Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-03-11 01:56:23 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-03-11 01:56:23 +0400
commita2ebfc82dbe954acc432ae017ac62a30a11b6a16 (patch)
tree8cf8bf458d14a26849dbee6af312ff9361029b90
parente9eed190e83eb351aeb435d21287eaf37fcffeb0 (diff)
parente09ab8883ce0e41add94058ecd4045ac5efa74c6 (diff)
Merged changes in the trunk up to revision 44797.
Conflicts resolved: doc/python_api/sphinx_doc_gen.py source/blender/makesdna/DNA_mesh_types.h source/blender/makesrna/intern/rna_action.c source/blender/makesrna/intern/rna_ID.c source/blender/makesrna/intern/rna_mesh.c
-rw-r--r--CMakeLists.txt49
-rw-r--r--SConstruct1
-rw-r--r--doc/python_api/rst/bge.types.rst14
-rw-r--r--doc/python_api/rst/info_best_practice.rst2
-rw-r--r--doc/python_api/rst/info_tips_and_tricks.rst2
-rw-r--r--doc/python_api/sphinx_doc_gen.py798
-rw-r--r--intern/cycles/blender/addon/enums.py31
-rw-r--r--intern/cycles/blender/addon/properties.py20
-rw-r--r--intern/cycles/blender/addon/ui.py14
-rw-r--r--intern/cycles/blender/blender_camera.cpp13
-rw-r--r--intern/cycles/blender/blender_shader.cpp4
-rw-r--r--intern/cycles/blender/blender_sync.cpp2
-rw-r--r--intern/cycles/kernel/kernel.cpp24
-rw-r--r--intern/cycles/kernel/kernel_montecarlo.h32
-rw-r--r--intern/cycles/kernel/kernel_textures.h12
-rw-r--r--intern/cycles/kernel/svm/svm_image.h21
-rw-r--r--intern/cycles/render/image.cpp347
-rw-r--r--intern/cycles/render/image.h9
-rw-r--r--intern/cycles/render/nodes.cpp178
-rw-r--r--intern/cycles/render/nodes.h4
-rw-r--r--intern/cycles/render/scene.h3
-rw-r--r--intern/cycles/render/svm.cpp24
-rw-r--r--intern/cycles/render/svm.h4
-rw-r--r--release/scripts/modules/bpy_extras/object_utils.py12
-rw-r--r--release/scripts/modules/bpy_types.py4
-rw-r--r--release/scripts/modules/sys_info.py72
-rw-r--r--release/scripts/startup/bl_operators/anim.py9
-rw-r--r--release/scripts/startup/bl_operators/image.py2
-rw-r--r--release/scripts/startup/bl_operators/uvcalc_follow_active.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_data_curve.py1
-rw-r--r--release/scripts/startup/bl_ui/properties_data_modifier.py3
-rw-r--r--release/scripts/startup/bl_ui/properties_object_constraint.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_fluid.py14
-rw-r--r--release/scripts/startup/bl_ui/properties_scene.py3
-rw-r--r--release/scripts/startup/bl_ui/properties_world.py5
-rw-r--r--release/scripts/startup/bl_ui/space_clip.py6
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py6
-rw-r--r--release/scripts/startup/keyingsets_builtins.py49
-rw-r--r--source/blender/avi/intern/avi.c13
-rw-r--r--source/blender/blenfont/BLF_api.h12
-rw-r--r--source/blender/blenkernel/BKE_DerivedMesh.h165
-rw-r--r--source/blender/blenkernel/BKE_animsys.h2
-rw-r--r--source/blender/blenkernel/BKE_bmfont_types.h9
-rw-r--r--source/blender/blenkernel/BKE_bvhutils.h4
-rw-r--r--source/blender/blenkernel/BKE_cdderivedmesh.h14
-rw-r--r--source/blender/blenkernel/BKE_cloth.h22
-rw-r--r--source/blender/blenkernel/BKE_context.h14
-rw-r--r--source/blender/blenkernel/BKE_customdata.h24
-rw-r--r--source/blender/blenkernel/BKE_depsgraph.h4
-rw-r--r--source/blender/blenkernel/BKE_dynamicpaint.h2
-rw-r--r--source/blender/blenkernel/BKE_icons.h4
-rw-r--r--source/blender/blenkernel/BKE_idprop.h134
-rw-r--r--source/blender/blenkernel/BKE_mesh.h14
-rw-r--r--source/blender/blenkernel/BKE_modifier.h2
-rw-r--r--source/blender/blenkernel/BKE_multires.h2
-rw-r--r--source/blender/blenkernel/BKE_particle.h4
-rw-r--r--source/blender/blenkernel/BKE_screen.h2
-rw-r--r--source/blender/blenkernel/BKE_sequencer.h66
-rw-r--r--source/blender/blenkernel/BKE_subsurf.h4
-rw-r--r--source/blender/blenkernel/BKE_suggestions.h26
-rw-r--r--source/blender/blenkernel/BKE_tessmesh.h29
-rw-r--r--source/blender/blenkernel/CMakeLists.txt8
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.c18
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.h6
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c88
-rw-r--r--source/blender/blenkernel/intern/action.c59
-rw-r--r--source/blender/blenkernel/intern/anim.c18
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c55
-rw-r--r--source/blender/blenkernel/intern/armature.c12
-rw-r--r--source/blender/blenkernel/intern/boids.c3
-rw-r--r--source/blender/blenkernel/intern/brush.c20
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c239
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c213
-rw-r--r--source/blender/blenkernel/intern/cloth.c12
-rw-r--r--source/blender/blenkernel/intern/collision.c177
-rw-r--r--source/blender/blenkernel/intern/colortools.c4
-rw-r--r--source/blender/blenkernel/intern/constraint.c11
-rw-r--r--source/blender/blenkernel/intern/curve.c48
-rw-r--r--source/blender/blenkernel/intern/customdata.c31
-rw-r--r--source/blender/blenkernel/intern/customdata_file.c6
-rw-r--r--source/blender/blenkernel/intern/deform.c10
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c68
-rw-r--r--source/blender/blenkernel/intern/displist.c30
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c72
-rw-r--r--source/blender/blenkernel/intern/editderivedmesh.c169
-rw-r--r--source/blender/blenkernel/intern/effect.c65
-rw-r--r--source/blender/blenkernel/intern/fcurve.c75
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c20
-rw-r--r--source/blender/blenkernel/intern/font.c22
-rw-r--r--source/blender/blenkernel/intern/group.c2
-rw-r--r--source/blender/blenkernel/intern/icons.c11
-rw-r--r--source/blender/blenkernel/intern/idprop.c56
-rw-r--r--source/blender/blenkernel/intern/image.c74
-rw-r--r--source/blender/blenkernel/intern/image_gen.c20
-rw-r--r--source/blender/blenkernel/intern/implicit.c126
-rw-r--r--source/blender/blenkernel/intern/ipo.c34
-rw-r--r--source/blender/blenkernel/intern/key.c12
-rw-r--r--source/blender/blenkernel/intern/lamp.c6
-rw-r--r--source/blender/blenkernel/intern/lattice.c2
-rw-r--r--source/blender/blenkernel/intern/library.c34
-rw-r--r--source/blender/blenkernel/intern/material.c10
-rw-r--r--source/blender/blenkernel/intern/mball.c12
-rw-r--r--source/blender/blenkernel/intern/mesh.c118
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c2
-rw-r--r--source/blender/blenkernel/intern/modifier.c30
-rw-r--r--source/blender/blenkernel/intern/modifiers_bmesh.c11
-rw-r--r--source/blender/blenkernel/intern/movieclip.c12
-rw-r--r--source/blender/blenkernel/intern/multires.c31
-rw-r--r--source/blender/blenkernel/intern/navmesh_conversion.c3
-rw-r--r--source/blender/blenkernel/intern/nla.c9
-rw-r--r--source/blender/blenkernel/intern/node.c74
-rw-r--r--source/blender/blenkernel/intern/object.c20
-rw-r--r--source/blender/blenkernel/intern/ocean.c26
-rw-r--r--source/blender/blenkernel/intern/packedFile.c31
-rw-r--r--source/blender/blenkernel/intern/particle.c24
-rw-r--r--source/blender/blenkernel/intern/particle_system.c66
-rw-r--r--source/blender/blenkernel/intern/pointcache.c14
-rw-r--r--source/blender/blenkernel/intern/property.c2
-rw-r--r--source/blender/blenkernel/intern/sca.c3
-rw-r--r--source/blender/blenkernel/intern/scene.c30
-rw-r--r--source/blender/blenkernel/intern/screen.c2
-rw-r--r--source/blender/blenkernel/intern/script.c5
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c102
-rw-r--r--source/blender/blenkernel/intern/sequencer.c198
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c29
-rw-r--r--source/blender/blenkernel/intern/sketch.c11
-rw-r--r--source/blender/blenkernel/intern/smoke.c30
-rw-r--r--source/blender/blenkernel/intern/softbody.c63
-rw-r--r--source/blender/blenkernel/intern/sound.c15
-rw-r--r--source/blender/blenkernel/intern/speaker.c6
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c291
-rw-r--r--source/blender/blenkernel/intern/text.c219
-rw-r--r--source/blender/blenkernel/intern/texture.c10
-rw-r--r--source/blender/blenkernel/intern/tracking.c114
-rw-r--r--source/blender/blenkernel/intern/unit.c330
-rw-r--r--source/blender/blenkernel/intern/world.c6
-rw-r--r--source/blender/blenkernel/intern/writeavi.c2
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c6
-rw-r--r--source/blender/blenlib/BLI_bitmap.h4
-rw-r--r--source/blender/blenlib/BLI_blenlib.h2
-rw-r--r--source/blender/blenlib/BLI_bpath.h2
-rw-r--r--source/blender/blenlib/BLI_dlrbTree.h2
-rw-r--r--source/blender/blenlib/BLI_dynstr.h2
-rw-r--r--source/blender/blenlib/BLI_editVert.h4
-rw-r--r--source/blender/blenlib/BLI_fnmatch.h42
-rw-r--r--source/blender/blenlib/BLI_heap.h4
-rw-r--r--source/blender/blenlib/BLI_listbase.h3
-rw-r--r--source/blender/blenlib/BLI_math_geom.h10
-rw-r--r--source/blender/blenlib/BLI_math_matrix.h7
-rw-r--r--source/blender/blenlib/BLI_math_vector.h8
-rw-r--r--source/blender/blenlib/BLI_md5.h10
-rw-r--r--source/blender/blenlib/BLI_path_util.h48
-rw-r--r--source/blender/blenlib/BLI_pbvh.h28
-rw-r--r--source/blender/blenlib/BLI_scanfill.h2
-rw-r--r--source/blender/blenlib/BLI_string_cursor_utf8.h51
-rw-r--r--source/blender/blenlib/BLI_utildefines.h14
-rw-r--r--source/blender/blenlib/CMakeLists.txt4
-rw-r--r--source/blender/blenlib/intern/BLI_args.c9
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c78
-rw-r--r--source/blender/blenlib/intern/BLI_memarena.c3
-rw-r--r--source/blender/blenlib/intern/boxpack2d.c320
-rw-r--r--source/blender/blenlib/intern/bpath.c6
-rw-r--r--source/blender/blenlib/intern/dynamiclist.h58
-rw-r--r--source/blender/blenlib/intern/fileops.c10
-rw-r--r--source/blender/blenlib/intern/freetypefont.c56
-rw-r--r--source/blender/blenlib/intern/graph.c2
-rw-r--r--source/blender/blenlib/intern/listbase.c21
-rw-r--r--source/blender/blenlib/intern/math_base_inline.c2
-rw-r--r--source/blender/blenlib/intern/math_color.c14
-rw-r--r--source/blender/blenlib/intern/math_color_inline.c6
-rw-r--r--source/blender/blenlib/intern/math_geom.c210
-rw-r--r--source/blender/blenlib/intern/math_matrix.c23
-rw-r--r--source/blender/blenlib/intern/math_rotation.c80
-rw-r--r--source/blender/blenlib/intern/math_vector.c8
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c49
-rw-r--r--source/blender/blenlib/intern/noise.c17
-rw-r--r--source/blender/blenlib/intern/path_util.c174
-rw-r--r--source/blender/blenlib/intern/pbvh.c323
-rw-r--r--source/blender/blenlib/intern/scanfill.c79
-rw-r--r--source/blender/blenlib/intern/storage.c6
-rw-r--r--source/blender/blenlib/intern/string.c8
-rw-r--r--source/blender/blenlib/intern/string_cursor_utf8.c191
-rw-r--r--source/blender/blenlib/intern/string_utf8.c12
-rw-r--r--source/blender/blenlib/intern/threads.c115
-rw-r--r--source/blender/blenlib/intern/winstuff.c12
-rw-r--r--source/blender/blenloader/BLO_sys_types.h2
-rw-r--r--source/blender/blenloader/intern/readfile.c54
-rw-r--r--source/blender/blenloader/intern/writefile.c2
-rw-r--r--source/blender/blenpluginapi/iff.h6
-rw-r--r--source/blender/blenpluginapi/intern/pluginapi.c2
-rw-r--r--source/blender/bmesh/CMakeLists.txt47
-rw-r--r--source/blender/bmesh/SConscript38
-rw-r--r--source/blender/bmesh/bmesh.h1
-rw-r--r--source/blender/bmesh/bmesh_class.h2
-rw-r--r--source/blender/bmesh/bmesh_operator_api.h31
-rw-r--r--source/blender/bmesh/intern/bmesh_construct.c4
-rw-r--r--source/blender/bmesh/intern/bmesh_core.c136
-rw-r--r--source/blender/bmesh/intern/bmesh_core.h23
-rw-r--r--source/blender/bmesh/intern/bmesh_interp.c4
-rw-r--r--source/blender/bmesh/intern/bmesh_iterators.c2
-rw-r--r--source/blender/bmesh/intern/bmesh_iterators.h2
-rw-r--r--source/blender/bmesh/intern/bmesh_marking.c34
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.c23
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh_conv.c901
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh_conv.h40
-rw-r--r--source/blender/bmesh/intern/bmesh_mods.c427
-rw-r--r--source/blender/bmesh/intern/bmesh_mods.h29
-rw-r--r--source/blender/bmesh/intern/bmesh_opdefines.c8
-rw-r--r--source/blender/bmesh/intern/bmesh_operators.c10
-rw-r--r--source/blender/bmesh/intern/bmesh_polygon.c371
-rw-r--r--source/blender/bmesh/intern/bmesh_polygon.h3
-rw-r--r--source/blender/bmesh/intern/bmesh_private.h5
-rw-r--r--source/blender/bmesh/intern/bmesh_queries.c132
-rw-r--r--source/blender/bmesh/intern/bmesh_queries.h5
-rw-r--r--source/blender/bmesh/intern/bmesh_structure.c11
-rw-r--r--source/blender/bmesh/intern/bmesh_structure.h1
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers.h32
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers_impl.c39
-rw-r--r--source/blender/bmesh/operators/bmo_bevel.c11
-rw-r--r--source/blender/bmesh/operators/bmo_connect.c2
-rw-r--r--source/blender/bmesh/operators/bmo_create.c61
-rw-r--r--source/blender/bmesh/operators/bmo_dissolve.c22
-rw-r--r--source/blender/bmesh/operators/bmo_edgesplit.c433
-rw-r--r--source/blender/bmesh/operators/bmo_extrude.c4
-rw-r--r--source/blender/bmesh/operators/bmo_join_triangles.c10
-rw-r--r--source/blender/bmesh/operators/bmo_mesh_conv.c857
-rw-r--r--source/blender/bmesh/operators/bmo_mirror.c7
-rw-r--r--source/blender/bmesh/operators/bmo_primitive.c4
-rw-r--r--source/blender/bmesh/operators/bmo_removedoubles.c6
-rw-r--r--source/blender/bmesh/operators/bmo_subdivide.c8
-rw-r--r--source/blender/bmesh/operators/bmo_triangulate.c19
-rw-r--r--source/blender/bmesh/operators/bmo_utils.c111
-rw-r--r--source/blender/bmesh/tools/BME_bevel.c18
-rw-r--r--source/blender/collada/ArmatureImporter.cpp22
-rw-r--r--source/blender/collada/MeshImporter.cpp1
-rw-r--r--source/blender/collada/collada_internal.cpp16
-rw-r--r--source/blender/editors/animation/CMakeLists.txt1
-rw-r--r--source/blender/editors/animation/SConscript2
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c17
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c5
-rw-r--r--source/blender/editors/animation/anim_deps.c6
-rw-r--r--source/blender/editors/animation/anim_draw.c9
-rw-r--r--source/blender/editors/animation/anim_filter.c7
-rw-r--r--source/blender/editors/animation/anim_markers.c120
-rw-r--r--source/blender/editors/animation/drivers.c2
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c93
-rw-r--r--source/blender/editors/animation/keyframes_edit.c6
-rw-r--r--source/blender/editors/animation/keyframes_general.c4
-rw-r--r--source/blender/editors/animation/keyframing.c25
-rw-r--r--source/blender/editors/animation/keyingsets.c110
-rw-r--r--source/blender/editors/armature/armature_ops.c2
-rw-r--r--source/blender/editors/armature/editarmature.c145
-rw-r--r--source/blender/editors/armature/editarmature_generate.c34
-rw-r--r--source/blender/editors/armature/editarmature_retarget.c8
-rw-r--r--source/blender/editors/armature/meshlaplacian.c30
-rw-r--r--source/blender/editors/armature/poseSlide.c10
-rw-r--r--source/blender/editors/armature/poselib.c2
-rw-r--r--source/blender/editors/armature/poseobject.c2
-rw-r--r--source/blender/editors/armature/reeb.c29
-rw-r--r--source/blender/editors/curve/editcurve.c171
-rw-r--r--source/blender/editors/gpencil/CMakeLists.txt1
-rw-r--r--source/blender/editors/gpencil/SConscript2
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c18
-rw-r--r--source/blender/editors/gpencil/gpencil_buttons.c159
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c24
-rw-r--r--source/blender/editors/include/BIF_gl.h2
-rw-r--r--source/blender/editors/include/BIF_glutil.h6
-rw-r--r--source/blender/editors/include/ED_armature.h38
-rw-r--r--source/blender/editors/include/ED_datafiles.h2
-rw-r--r--source/blender/editors/include/ED_keyframing.h9
-rw-r--r--source/blender/editors/include/ED_mesh.h54
-rw-r--r--source/blender/editors/include/ED_render.h12
-rw-r--r--source/blender/editors/include/ED_screen.h2
-rw-r--r--source/blender/editors/include/ED_space_api.h2
-rw-r--r--source/blender/editors/include/ED_view3d.h11
-rw-r--r--source/blender/editors/include/UI_interface.h10
-rw-r--r--source/blender/editors/include/UI_interface_icons.h4
-rw-r--r--source/blender/editors/interface/interface.c29
-rw-r--r--source/blender/editors/interface/interface_draw.c51
-rw-r--r--source/blender/editors/interface/interface_handlers.c280
-rw-r--r--source/blender/editors/interface/interface_icons.c15
-rw-r--r--source/blender/editors/interface/interface_intern.h4
-rw-r--r--source/blender/editors/interface/interface_layout.c12
-rw-r--r--source/blender/editors/interface/interface_ops.c2
-rw-r--r--source/blender/editors/interface/interface_panel.c37
-rw-r--r--source/blender/editors/interface/interface_regions.c22
-rw-r--r--source/blender/editors/interface/interface_style.c27
-rw-r--r--source/blender/editors/interface/interface_templates.c25
-rw-r--r--source/blender/editors/interface/interface_utils.c2
-rw-r--r--source/blender/editors/interface/interface_widgets.c68
-rw-r--r--source/blender/editors/interface/resources.c2
-rw-r--r--source/blender/editors/interface/view2d.c6
-rw-r--r--source/blender/editors/interface/view2d_ops.c13
-rw-r--r--source/blender/editors/mesh/bmesh_select.c54
-rw-r--r--source/blender/editors/mesh/bmesh_selecthistory.c4
-rw-r--r--source/blender/editors/mesh/bmesh_tools.c318
-rw-r--r--source/blender/editors/mesh/bmesh_utils.c7
-rw-r--r--source/blender/editors/mesh/editface.c9
-rw-r--r--source/blender/editors/mesh/editmesh_bvh.c12
-rw-r--r--source/blender/editors/mesh/knifetool.c834
-rw-r--r--source/blender/editors/mesh/loopcut.c27
-rw-r--r--source/blender/editors/mesh/mesh_data.c72
-rw-r--r--source/blender/editors/mesh/mesh_intern.h20
-rw-r--r--source/blender/editors/mesh/mesh_ops.c3
-rw-r--r--source/blender/editors/mesh/meshtools.c18
-rw-r--r--source/blender/editors/metaball/mball_edit.c2
-rw-r--r--source/blender/editors/object/object_add.c18
-rw-r--r--source/blender/editors/object/object_bake.c39
-rw-r--r--source/blender/editors/object/object_constraint.c5
-rw-r--r--source/blender/editors/object/object_edit.c4
-rw-r--r--source/blender/editors/object/object_group.c4
-rw-r--r--source/blender/editors/object/object_hook.c4
-rw-r--r--source/blender/editors/object/object_intern.h1
-rw-r--r--source/blender/editors/object/object_modifier.c84
-rw-r--r--source/blender/editors/object/object_ops.c2
-rw-r--r--source/blender/editors/object/object_relations.c14
-rw-r--r--source/blender/editors/object/object_select.c4
-rw-r--r--source/blender/editors/object/object_transform.c8
-rw-r--r--source/blender/editors/object/object_vgroup.c117
-rw-r--r--source/blender/editors/physics/dynamicpaint_ops.c18
-rw-r--r--source/blender/editors/physics/particle_edit.c20
-rw-r--r--source/blender/editors/physics/physics_fluid.c3
-rw-r--r--source/blender/editors/render/render_internal.c18
-rw-r--r--source/blender/editors/render/render_opengl.c11
-rw-r--r--source/blender/editors/render/render_preview.c8
-rw-r--r--source/blender/editors/render/render_update.c2
-rw-r--r--source/blender/editors/render/render_view.c2
-rw-r--r--source/blender/editors/screen/area.c20
-rw-r--r--source/blender/editors/screen/glutil.c31
-rw-r--r--source/blender/editors/screen/screen_edit.c51
-rw-r--r--source/blender/editors/screen/screen_ops.c292
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c34
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c173
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h8
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c16
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c17
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c65
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c109
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c6
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_uv.c3
-rw-r--r--source/blender/editors/sound/sound_ops.c13
-rw-r--r--source/blender/editors/space_action/space_action.c2
-rw-r--r--source/blender/editors/space_api/spacetypes.c2
-rw-r--r--source/blender/editors/space_buttons/buttons_texture.c8
-rw-r--r--source/blender/editors/space_clip/clip_draw.c16
-rw-r--r--source/blender/editors/space_clip/clip_graph_ops.c222
-rw-r--r--source/blender/editors/space_clip/clip_intern.h5
-rw-r--r--source/blender/editors/space_clip/clip_ops.c36
-rw-r--r--source/blender/editors/space_clip/space_clip.c73
-rw-r--r--source/blender/editors/space_clip/tracking_ops.c90
-rw-r--r--source/blender/editors/space_console/console_ops.c111
-rw-r--r--source/blender/editors/space_console/space_console.c6
-rw-r--r--source/blender/editors/space_file/file_draw.c8
-rw-r--r--source/blender/editors/space_file/file_ops.c18
-rw-r--r--source/blender/editors/space_file/file_panels.c8
-rw-r--r--source/blender/editors/space_file/filelist.c2
-rw-r--r--source/blender/editors/space_file/filesel.c4
-rw-r--r--source/blender/editors/space_file/fsmenu.c12
-rw-r--r--source/blender/editors/space_file/space_file.c6
-rw-r--r--source/blender/editors/space_graph/graph_buttons.c101
-rw-r--r--source/blender/editors/space_graph/graph_draw.c12
-rw-r--r--source/blender/editors/space_graph/graph_edit.c7
-rw-r--r--source/blender/editors/space_graph/graph_select.c8
-rw-r--r--source/blender/editors/space_graph/graph_utils.c4
-rw-r--r--source/blender/editors/space_graph/space_graph.c2
-rw-r--r--source/blender/editors/space_image/image_buttons.c14
-rw-r--r--source/blender/editors/space_image/image_draw.c18
-rw-r--r--source/blender/editors/space_image/image_ops.c4
-rw-r--r--source/blender/editors/space_image/space_image.c6
-rw-r--r--source/blender/editors/space_info/info_report.c4
-rw-r--r--source/blender/editors/space_logic/logic_ops.c6
-rw-r--r--source/blender/editors/space_logic/logic_window.c134
-rw-r--r--source/blender/editors/space_nla/nla_draw.c3
-rw-r--r--source/blender/editors/space_nla/nla_edit.c3
-rw-r--r--source/blender/editors/space_nla/space_nla.c6
-rw-r--r--source/blender/editors/space_node/drawnode.c10
-rw-r--r--source/blender/editors/space_node/node_draw.c19
-rw-r--r--source/blender/editors/space_node/node_edit.c345
-rw-r--r--source/blender/editors/space_node/node_intern.h3
-rw-r--r--source/blender/editors/space_node/node_ops.c1
-rw-r--r--source/blender/editors/space_node/node_select.c270
-rw-r--r--source/blender/editors/space_node/node_templates.c8
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c10
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c6
-rw-r--r--source/blender/editors/space_outliner/outliner_intern.h28
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c8
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c14
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c6
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c4
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c25
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c20
-rw-r--r--source/blender/editors/space_sequencer/sequencer_ops.c26
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c6
-rw-r--r--source/blender/editors/space_text/space_text.c4
-rw-r--r--source/blender/editors/space_text/text_draw.c102
-rw-r--r--source/blender/editors/space_text/text_ops.c39
-rw-r--r--source/blender/editors/space_text/text_python.c12
-rw-r--r--source/blender/editors/space_view3d/drawanimviz.c4
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c6
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c95
-rw-r--r--source/blender/editors/space_view3d/drawobject.c241
-rw-r--r--source/blender/editors/space_view3d/drawvolume.c26
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c12
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c767
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c173
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c101
-rw-r--r--source/blender/editors/space_view3d/view3d_fly.c642
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c13
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c42
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c73
-rw-r--r--source/blender/editors/transform/transform.c104
-rw-r--r--source/blender/editors/transform/transform.h26
-rw-r--r--source/blender/editors/transform/transform_constraints.c70
-rw-r--r--source/blender/editors/transform/transform_conversions.c137
-rw-r--r--source/blender/editors/transform/transform_generics.c100
-rw-r--r--source/blender/editors/transform/transform_input.c45
-rw-r--r--source/blender/editors/transform/transform_manipulator.c54
-rw-r--r--source/blender/editors/transform/transform_ops.c6
-rw-r--r--source/blender/editors/transform/transform_orientations.c151
-rw-r--r--source/blender/editors/transform/transform_snap.c173
-rw-r--r--source/blender/editors/util/crazyspace.c12
-rw-r--r--source/blender/editors/util/ed_util.c4
-rw-r--r--source/blender/editors/util/editmode_undo.c38
-rw-r--r--source/blender/editors/util/numinput.c6
-rw-r--r--source/blender/editors/uvedit/uvedit_draw.c12
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c10
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.c38
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.h36
-rw-r--r--source/blender/editors/uvedit/uvedit_smart_stitch.c11
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c11
-rw-r--r--source/blender/gpu/GPU_buffers.h40
-rw-r--r--source/blender/gpu/GPU_extensions.h42
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c160
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c7
-rw-r--r--source/blender/gpu/intern/gpu_codegen.h8
-rw-r--r--source/blender/gpu/intern/gpu_draw.c43
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c30
-rw-r--r--source/blender/gpu/intern/gpu_material.c29
-rw-r--r--source/blender/ikplugin/intern/iksolver_plugin.c8
-rw-r--r--source/blender/ikplugin/intern/itasc_plugin.cpp53
-rw-r--r--source/blender/imbuf/IMB_imbuf.h29
-rw-r--r--source/blender/imbuf/IMB_imbuf_types.h4
-rw-r--r--source/blender/imbuf/IMB_moviecache.h4
-rw-r--r--source/blender/imbuf/intern/IMB_indexer.h36
-rw-r--r--source/blender/imbuf/intern/IMB_metadata.h16
-rw-r--r--source/blender/imbuf/intern/anim_movie.c12
-rw-r--r--source/blender/imbuf/intern/bmp.c17
-rw-r--r--source/blender/imbuf/intern/cache.c22
-rw-r--r--source/blender/imbuf/intern/cineon/cineonlib.c9
-rw-r--r--source/blender/imbuf/intern/cineon/logmemfile.c4
-rw-r--r--source/blender/imbuf/intern/dds/Image.h4
-rw-r--r--source/blender/imbuf/intern/filter.c7
-rw-r--r--source/blender/imbuf/intern/imageprocess.c75
-rw-r--r--source/blender/imbuf/intern/jp2.c37
-rw-r--r--source/blender/imbuf/intern/jpeg.c17
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp53
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.h2
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_multi.h2
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_stub.cpp7
-rw-r--r--source/blender/imbuf/intern/png.c16
-rw-r--r--source/blender/imbuf/intern/radiance_hdr.c15
-rw-r--r--source/blender/imbuf/intern/rectop.c12
-rw-r--r--source/blender/imbuf/intern/scaling.c44
-rw-r--r--source/blender/imbuf/intern/thumbs.c4
-rw-r--r--source/blender/imbuf/intern/tiff.c2
-rw-r--r--source/blender/imbuf/intern/util.c6
-rw-r--r--source/blender/makesdna/DNA_ID.h7
-rw-r--r--source/blender/makesdna/DNA_action_types.h2
-rw-r--r--source/blender/makesdna/DNA_actuator_types.h9
-rw-r--r--source/blender/makesdna/DNA_anim_types.h6
-rw-r--r--source/blender/makesdna/DNA_armature_types.h14
-rw-r--r--source/blender/makesdna/DNA_brush_types.h2
-rw-r--r--source/blender/makesdna/DNA_camera_types.h2
-rw-r--r--source/blender/makesdna/DNA_cloth_types.h20
-rw-r--r--source/blender/makesdna/DNA_curve_types.h20
-rw-r--r--source/blender/makesdna/DNA_customdata_types.h2
-rw-r--r--source/blender/makesdna/DNA_documentation.h6
-rw-r--r--source/blender/makesdna/DNA_dynamicpaint_types.h2
-rw-r--r--source/blender/makesdna/DNA_fileglobal_types.h2
-rw-r--r--source/blender/makesdna/DNA_material_types.h2
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h29
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h8
-rw-r--r--source/blender/makesdna/DNA_meta_types.h4
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h32
-rw-r--r--source/blender/makesdna/DNA_movieclip_types.h6
-rw-r--r--source/blender/makesdna/DNA_node_types.h12
-rw-r--r--source/blender/makesdna/DNA_object_force.h21
-rw-r--r--source/blender/makesdna/DNA_scene_types.h15
-rw-r--r--source/blender/makesdna/DNA_sdna_types.h12
-rw-r--r--source/blender/makesdna/DNA_smoke_types.h12
-rw-r--r--source/blender/makesdna/DNA_sound_types.h15
-rw-r--r--source/blender/makesdna/DNA_space_types.h14
-rw-r--r--source/blender/makesdna/DNA_tracking_types.h3
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h12
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h52
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h2
-rw-r--r--source/blender/makesdna/intern/dna_genfile.c178
-rw-r--r--source/blender/makesdna/intern/makesdna.c48
-rw-r--r--source/blender/makesrna/RNA_define.h8
-rw-r--r--source/blender/makesrna/RNA_types.h6
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt1
-rw-r--r--source/blender/makesrna/intern/makesrna.c1320
-rw-r--r--source/blender/makesrna/intern/rna_ID.c208
-rw-r--r--source/blender/makesrna/intern/rna_access.c2496
-rw-r--r--source/blender/makesrna/intern/rna_action.c172
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c650
-rw-r--r--source/blender/makesrna/intern/rna_actuator_api.c8
-rw-r--r--source/blender/makesrna/intern/rna_animation.c266
-rw-r--r--source/blender/makesrna/intern/rna_animation_api.c6
-rw-r--r--source/blender/makesrna/intern/rna_animviz.c94
-rw-r--r--source/blender/makesrna/intern/rna_armature.c412
-rw-r--r--source/blender/makesrna/intern/rna_armature_api.c12
-rw-r--r--source/blender/makesrna/intern/rna_boid.c216
-rw-r--r--source/blender/makesrna/intern/rna_brush.c200
-rw-r--r--source/blender/makesrna/intern/rna_camera.c78
-rw-r--r--source/blender/makesrna/intern/rna_camera_api.c10
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c138
-rw-r--r--source/blender/makesrna/intern/rna_color.c166
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c700
-rw-r--r--source/blender/makesrna/intern/rna_context.c54
-rw-r--r--source/blender/makesrna/intern/rna_controller.c113
-rw-r--r--source/blender/makesrna/intern/rna_controller_api.c20
-rw-r--r--source/blender/makesrna/intern/rna_curve.c572
-rw-r--r--source/blender/makesrna/intern/rna_define.c1730
-rw-r--r--source/blender/makesrna/intern/rna_dynamicpaint.c280
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c554
-rw-r--r--source/blender/makesrna/intern/rna_fcurve_api.c4
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c180
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c116
-rw-r--r--source/blender/makesrna/intern/rna_group.c26
-rw-r--r--source/blender/makesrna/intern/rna_image.c240
-rw-r--r--source/blender/makesrna/intern/rna_image_api.c60
-rw-r--r--source/blender/makesrna/intern/rna_internal.h4
-rw-r--r--source/blender/makesrna/intern/rna_key.c228
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c200
-rw-r--r--source/blender/makesrna/intern/rna_lattice.c118
-rw-r--r--source/blender/makesrna/intern/rna_main.c92
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c586
-rw-r--r--source/blender/makesrna/intern/rna_material.c606
-rw-r--r--source/blender/makesrna/intern/rna_material_api.c4
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c1127
-rw-r--r--source/blender/makesrna/intern/rna_mesh_api.c18
-rw-r--r--source/blender/makesrna/intern/rna_mesh_utils.h156
-rw-r--r--source/blender/makesrna/intern/rna_meta.c90
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c863
-rw-r--r--source/blender/makesrna/intern/rna_movieclip.c70
-rw-r--r--source/blender/makesrna/intern/rna_nla.c158
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c331
-rw-r--r--source/blender/makesrna/intern/rna_object.c830
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c188
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c548
-rw-r--r--source/blender/makesrna/intern/rna_packedfile.c4
-rw-r--r--source/blender/makesrna/intern/rna_particle.c906
-rw-r--r--source/blender/makesrna/intern/rna_pose.c394
-rw-r--r--source/blender/makesrna/intern/rna_pose_api.c6
-rw-r--r--source/blender/makesrna/intern/rna_property.c52
-rw-r--r--source/blender/makesrna/intern/rna_render.c174
-rw-r--r--source/blender/makesrna/intern/rna_rna.c430
-rw-r--r--source/blender/makesrna/intern/rna_scene.c1435
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c26
-rw-r--r--source/blender/makesrna/intern/rna_screen.c86
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c182
-rw-r--r--source/blender/makesrna/intern/rna_sensor.c247
-rw-r--r--source/blender/makesrna/intern/rna_sensor_api.c8
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c564
-rw-r--r--source/blender/makesrna/intern/rna_sequencer_api.c10
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c66
-rw-r--r--source/blender/makesrna/intern/rna_sound.c14
-rw-r--r--source/blender/makesrna/intern/rna_space.c1002
-rw-r--r--source/blender/makesrna/intern/rna_speaker.c79
-rw-r--r--source/blender/makesrna/intern/rna_test.c34
-rw-r--r--source/blender/makesrna/intern/rna_text.c82
-rw-r--r--source/blender/makesrna/intern/rna_text_api.c6
-rw-r--r--source/blender/makesrna/intern/rna_texture.c544
-rw-r--r--source/blender/makesrna/intern/rna_texture_api.c16
-rw-r--r--source/blender/makesrna/intern/rna_timeline.c10
-rw-r--r--source/blender/makesrna/intern/rna_tracking.c452
-rw-r--r--source/blender/makesrna/intern/rna_ui.c250
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c206
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c1006
-rw-r--r--source/blender/makesrna/intern/rna_vfont.c6
-rw-r--r--source/blender/makesrna/intern/rna_wm.c570
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c208
-rw-r--r--source/blender/makesrna/intern/rna_world.c154
-rw-r--r--source/blender/modifiers/intern/MOD_array.c22
-rw-r--r--source/blender/modifiers/intern/MOD_bevel.c6
-rw-r--r--source/blender/modifiers/intern/MOD_boolean.c6
-rw-r--r--source/blender/modifiers/intern/MOD_boolean_util.c10
-rw-r--r--source/blender/modifiers/intern/MOD_boolean_util.h10
-rw-r--r--source/blender/modifiers/intern/MOD_build.c7
-rw-r--r--source/blender/modifiers/intern/MOD_cast.c40
-rw-r--r--source/blender/modifiers/intern/MOD_cloth.c22
-rw-r--r--source/blender/modifiers/intern/MOD_collision.c30
-rw-r--r--source/blender/modifiers/intern/MOD_displace.c6
-rw-r--r--source/blender/modifiers/intern/MOD_dynamicpaint.c8
-rw-r--r--source/blender/modifiers/intern/MOD_edgesplit.c12
-rw-r--r--source/blender/modifiers/intern/MOD_explode.c15
-rw-r--r--source/blender/modifiers/intern/MOD_fluidsim.c21
-rw-r--r--source/blender/modifiers/intern/MOD_fluidsim_util.c24
-rw-r--r--source/blender/modifiers/intern/MOD_mask.c25
-rw-r--r--source/blender/modifiers/intern/MOD_mirror.c2
-rw-r--r--source/blender/modifiers/intern/MOD_multires.c2
-rw-r--r--source/blender/modifiers/intern/MOD_particlesystem.c2
-rw-r--r--source/blender/modifiers/intern/MOD_remesh.c2
-rw-r--r--source/blender/modifiers/intern/MOD_screw.c13
-rw-r--r--source/blender/modifiers/intern/MOD_simpledeform.c42
-rw-r--r--source/blender/modifiers/intern/MOD_smoke.c20
-rw-r--r--source/blender/modifiers/intern/MOD_smooth.c2
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c6
-rw-r--r--source/blender/modifiers/intern/MOD_surface.c13
-rw-r--r--source/blender/modifiers/intern/MOD_util.c6
-rw-r--r--source/blender/modifiers/intern/MOD_uvproject.c8
-rw-r--r--source/blender/modifiers/intern/MOD_weightvg_util.c2
-rw-r--r--source/blender/modifiers/intern/MOD_weightvg_util.h2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_brightness.c6
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_movieclip.c11
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_normal.c2
-rw-r--r--source/blender/nodes/shader/node_shader_tree.c8
-rw-r--r--source/blender/nodes/shader/node_shader_util.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_dynamic.c8
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_normal.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_output.c6
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_environment.c3
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_image.c2
-rw-r--r--source/blender/nodes/texture/node_texture_util.c8
-rw-r--r--source/blender/python/bmesh/bmesh_py_api.c98
-rw-r--r--source/blender/python/bmesh/bmesh_py_select.c58
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.c55
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.h6
-rw-r--r--source/blender/python/bmesh/bmesh_py_utils.c174
-rw-r--r--source/blender/python/generic/bgl.h4
-rw-r--r--source/blender/python/generic/bpy_internal_import.c2
-rw-r--r--source/blender/python/generic/idprop_py_api.c24
-rw-r--r--source/blender/python/generic/py_capi_utils.c40
-rw-r--r--source/blender/python/intern/bpy.c6
-rw-r--r--source/blender/python/intern/bpy_app.c42
-rw-r--r--source/blender/python/intern/bpy_app_handlers.c8
-rw-r--r--source/blender/python/intern/bpy_interface.c6
-rw-r--r--source/blender/python/intern/bpy_interface_atexit.c2
-rw-r--r--source/blender/python/intern/bpy_operator.c5
-rw-r--r--source/blender/python/intern/bpy_props.c4
-rw-r--r--source/blender/python/intern/bpy_rna.c81
-rw-r--r--source/blender/python/intern/bpy_rna_array.c74
-rw-r--r--source/blender/python/intern/bpy_traceback.c9
-rw-r--r--source/blender/python/intern/gpu.c2
-rw-r--r--source/blender/python/mathutils/mathutils.c4
-rw-r--r--source/blender/python/mathutils/mathutils_Color.c10
-rw-r--r--source/blender/python/mathutils/mathutils_Color.h8
-rw-r--r--source/blender/python/mathutils/mathutils_Euler.c8
-rw-r--r--source/blender/python/mathutils/mathutils_Euler.h8
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.c22
-rw-r--r--source/blender/python/mathutils/mathutils_Quaternion.c8
-rw-r--r--source/blender/python/mathutils/mathutils_Quaternion.h8
-rw-r--r--source/blender/python/mathutils/mathutils_Vector.c46
-rw-r--r--source/blender/python/mathutils/mathutils_geometry.c2
-rw-r--r--source/blender/python/mathutils/mathutils_noise.c94
-rw-r--r--source/blender/render/CMakeLists.txt1
-rw-r--r--source/blender/render/SConscript2
-rw-r--r--source/blender/render/extern/include/RE_pipeline.h12
-rw-r--r--source/blender/render/intern/include/pixelblending.h2
-rw-r--r--source/blender/render/intern/include/pixelshading.h9
-rw-r--r--source/blender/render/intern/include/rayintersection.h2
-rw-r--r--source/blender/render/intern/include/rayobject.h21
-rw-r--r--source/blender/render/intern/include/render_types.h10
-rw-r--r--source/blender/render/intern/include/sunsky.h80
-rw-r--r--source/blender/render/intern/raytrace/bvh.h8
-rw-r--r--source/blender/render/intern/raytrace/rayobject.cpp16
-rw-r--r--source/blender/render/intern/raytrace/rayobject_hint.h5
-rw-r--r--source/blender/render/intern/raytrace/rayobject_internal.h68
-rw-r--r--source/blender/render/intern/raytrace/rayobject_octree.cpp12
-rw-r--r--source/blender/render/intern/raytrace/rayobject_rtbuild.cpp18
-rw-r--r--source/blender/render/intern/raytrace/vbvh.h17
-rw-r--r--source/blender/render/intern/source/convertblender.c96
-rw-r--r--source/blender/render/intern/source/envmap.c16
-rw-r--r--source/blender/render/intern/source/external_engine.c6
-rw-r--r--source/blender/render/intern/source/imagetexture.c2
-rw-r--r--source/blender/render/intern/source/occlusion.c16
-rw-r--r--source/blender/render/intern/source/pipeline.c62
-rw-r--r--source/blender/render/intern/source/pixelblending.c23
-rw-r--r--source/blender/render/intern/source/pixelshading.c13
-rw-r--r--source/blender/render/intern/source/pointdensity.c10
-rw-r--r--source/blender/render/intern/source/rayshade.c46
-rw-r--r--source/blender/render/intern/source/render_result.c7
-rw-r--r--source/blender/render/intern/source/render_texture.c34
-rw-r--r--source/blender/render/intern/source/rendercore.c12
-rw-r--r--source/blender/render/intern/source/renderdatabase.c52
-rw-r--r--source/blender/render/intern/source/shadbuf.c37
-rw-r--r--source/blender/render/intern/source/shadeinput.c75
-rw-r--r--source/blender/render/intern/source/shadeoutput.c14
-rw-r--r--source/blender/render/intern/source/sss.c64
-rw-r--r--source/blender/render/intern/source/strand.c2
-rw-r--r--source/blender/render/intern/source/sunsky.c8
-rw-r--r--source/blender/render/intern/source/volume_precache.c7
-rw-r--r--source/blender/render/intern/source/volumetric.c48
-rw-r--r--source/blender/render/intern/source/voxeldata.c3
-rw-r--r--source/blender/render/intern/source/zbuf.c9
-rw-r--r--source/blender/windowmanager/WM_api.h2
-rw-r--r--source/blender/windowmanager/WM_types.h16
-rw-r--r--source/blender/windowmanager/intern/wm.c8
-rw-r--r--source/blender/windowmanager/intern/wm_apple.c14
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c72
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c9
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c59
-rw-r--r--source/blender/windowmanager/intern/wm_files.c35
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c12
-rw-r--r--source/blender/windowmanager/intern/wm_jobs.c48
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c8
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c52
-rw-r--r--source/blender/windowmanager/intern/wm_subwindow.c34
-rw-r--r--source/blender/windowmanager/intern/wm_window.c46
-rw-r--r--source/blender/windowmanager/wm_event_types.h4
-rw-r--r--source/blender/windowmanager/wm_window.h2
-rw-r--r--source/blenderplayer/bad_level_call_stubs/stubs.c1
-rw-r--r--source/creator/creator.c79
-rw-r--r--source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp2
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderSystem.h2
-rw-r--r--source/gameengine/Converter/BL_ActionActuator.cpp6
-rw-r--r--source/gameengine/Converter/BL_ArmatureActuator.cpp9
-rw-r--r--source/gameengine/Converter/BL_ArmatureActuator.h4
-rw-r--r--source/gameengine/Converter/BL_ArmatureChannel.h4
-rw-r--r--source/gameengine/Converter/BL_ArmatureConstraint.h5
-rw-r--r--source/gameengine/Converter/BL_ArmatureObject.cpp17
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp15
-rw-r--r--source/gameengine/Converter/BL_MeshDeformer.h14
-rw-r--r--source/gameengine/Converter/BL_ModifierDeformer.cpp14
-rw-r--r--source/gameengine/Converter/KX_BlenderScalarInterpolator.h2
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.cpp7
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.h2
-rw-r--r--source/gameengine/Converter/KX_ConvertActuators.cpp44
-rw-r--r--source/gameengine/Converter/KX_ConvertSensors.cpp8
-rw-r--r--source/gameengine/Expressions/BoolValue.cpp6
-rw-r--r--source/gameengine/Expressions/BoolValue.h6
-rw-r--r--source/gameengine/Expressions/EmptyValue.h6
-rw-r--r--source/gameengine/Expressions/ErrorValue.h6
-rw-r--r--source/gameengine/Expressions/Expression.h6
-rw-r--r--source/gameengine/Expressions/FloatValue.h6
-rw-r--r--source/gameengine/Expressions/IfExpr.cpp28
-rw-r--r--source/gameengine/Expressions/InputParser.cpp12
-rw-r--r--source/gameengine/Expressions/IntValue.cpp9
-rw-r--r--source/gameengine/Expressions/IntValue.h6
-rw-r--r--source/gameengine/Expressions/ListValue.h6
-rw-r--r--source/gameengine/Expressions/Operator1Expr.h2
-rw-r--r--source/gameengine/Expressions/Operator2Expr.h8
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.cpp2
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.h10
-rw-r--r--source/gameengine/Expressions/StringValue.cpp36
-rw-r--r--source/gameengine/Expressions/Value.h2
-rw-r--r--source/gameengine/Expressions/VectorValue.cpp17
-rw-r--r--source/gameengine/Expressions/VectorValue.h12
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_Joystick.h4
-rw-r--r--source/gameengine/GameLogic/SCA_LogicManager.h4
-rw-r--r--source/gameengine/GameLogic/SCA_MouseManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_PythonController.cpp4
-rw-r--r--source/gameengine/GamePlayer/common/GPC_Canvas.cpp16
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Canvas.h6
-rw-r--r--source/gameengine/Ketsji/BL_Action.cpp1
-rw-r--r--source/gameengine/Ketsji/BL_Material.h10
-rw-r--r--source/gameengine/Ketsji/BL_Shader.h2
-rw-r--r--source/gameengine/Ketsji/KX_BulletPhysicsController.cpp10
-rw-r--r--source/gameengine/Ketsji/KX_Camera.cpp34
-rw-r--r--source/gameengine/Ketsji/KX_Camera.h9
-rw-r--r--source/gameengine/Ketsji/KX_CameraActuator.cpp14
-rw-r--r--source/gameengine/Ketsji/KX_CameraActuator.h2
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintActuator.cpp6
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintWrapper.h2
-rw-r--r--source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_Dome.cpp204
-rw-r--r--source/gameengine/Ketsji/KX_Dome.h9
-rw-r--r--source/gameengine/Ketsji/KX_FontObject.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_FontObject.h4
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp10
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.h2
-rw-r--r--source/gameengine/Ketsji/KX_IPhysicsController.h10
-rw-r--r--source/gameengine/Ketsji/KX_ISceneConverter.h10
-rw-r--r--source/gameengine/Ketsji/KX_IpoActuator.h6
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.cpp12
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.h20
-rw-r--r--source/gameengine/Ketsji/KX_MouseFocusSensor.cpp10
-rw-r--r--source/gameengine/Ketsji/KX_MouseFocusSensor.h4
-rw-r--r--source/gameengine/Ketsji/KX_NavMeshObject.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_NavMeshObject.h4
-rw-r--r--source/gameengine/Ketsji/KX_NearSensor.h6
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp8
-rw-r--r--source/gameengine/Ketsji/KX_PythonInitTypes.cpp6
-rw-r--r--source/gameengine/Ketsji/KX_PythonSeq.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_RadarSensor.h4
-rw-r--r--source/gameengine/Ketsji/KX_RaySensor.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp6
-rw-r--r--source/gameengine/Ketsji/KX_Scene.h24
-rw-r--r--source/gameengine/Ketsji/KX_SteeringActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_SteeringActuator.h4
-rw-r--r--source/gameengine/Ketsji/KX_TouchSensor.h2
-rw-r--r--source/gameengine/Network/NG_NetworkMessage.h6
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_2DFilterManager.cpp10
-rw-r--r--source/gameengine/Rasterizer/RAS_BucketManager.h4
-rw-r--r--source/gameengine/Rasterizer/RAS_ICanvas.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_IPolygonMaterial.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_IRasterizer.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp10
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp12
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h4
-rw-r--r--source/gameengine/Rasterizer/RAS_Polygon.cpp2
-rw-r--r--source/gameengine/SceneGraph/SG_IObject.h12
-rw-r--r--source/gameengine/SceneGraph/SG_Tree.h2
-rw-r--r--source/gameengine/VideoTexture/BlendType.h4
-rw-r--r--source/gameengine/VideoTexture/Common.h14
-rw-r--r--source/gameengine/VideoTexture/Exception.h4
-rw-r--r--source/gameengine/VideoTexture/FilterBase.h4
-rw-r--r--source/gameengine/VideoTexture/FilterBlueScreen.h4
-rw-r--r--source/gameengine/VideoTexture/FilterColor.h4
-rw-r--r--source/gameengine/VideoTexture/FilterNormal.h4
-rw-r--r--source/gameengine/VideoTexture/FilterSource.h4
-rw-r--r--source/gameengine/VideoTexture/ImageBase.h4
-rw-r--r--source/gameengine/VideoTexture/ImageBuff.cpp2
-rw-r--r--source/gameengine/VideoTexture/ImageBuff.h4
-rw-r--r--source/gameengine/VideoTexture/ImageMix.h4
-rw-r--r--source/gameengine/VideoTexture/ImageRender.cpp6
-rw-r--r--source/gameengine/VideoTexture/ImageRender.h4
-rw-r--r--source/gameengine/VideoTexture/ImageViewport.cpp2
-rw-r--r--source/gameengine/VideoTexture/ImageViewport.h4
-rw-r--r--source/gameengine/VideoTexture/PyTypeList.h4
-rw-r--r--source/gameengine/VideoTexture/Texture.h4
-rw-r--r--source/gameengine/VideoTexture/VideoBase.h4
-rw-r--r--source/gameengine/VideoTexture/VideoFFmpeg.cpp2
-rw-r--r--source/gameengine/VideoTexture/VideoFFmpeg.h4
-rw-r--r--source/tests/bl_load_addons.py2
-rw-r--r--source/tests/bl_run_operators.py5
828 files changed, 28177 insertions, 25671 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5cc04552086..25ed193b266 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -249,19 +249,46 @@ if(APPLE)
"Choose the architecture you want to build Blender for: i386, x86_64 or ppc"
FORCE)
endif()
- if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
- set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5 CACHE STRING
- "Choose the minimum OSX version required: 10.4 or 10.5"
- FORCE)
+
+ execute_process(COMMAND uname -r OUTPUT_VARIABLE MAC_SYS) # check for actual system-version
+ if (${MAC_SYS} MATCHES 11)
+ set(OSX_SYSTEM 10.7)
+ elseif(${MAC_SYS} MATCHES 10)
+ set(OSX_SYSTEM 10.6)
+ elseif(${MAC_SYS} MATCHES 9)
+ set(OSX_SYSTEM 10.5)
+ else()
+ set(OSX_SYSTEM unsupported)
endif()
+ message(STATUS "Detected system-version: " ${OSX_SYSTEM})
+
+ if(${OSX_SYSTEM} GREATER 10.6)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "" FORCE) # 10.7 does not have 10.5sdk !!!
+ else()
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING "" FORCE) # 10.5 is our minimum target
+ endif()
+
if(${CMAKE_GENERATOR} MATCHES "Xcode")
if(${XCODE_VERSION} VERSION_EQUAL 4 OR ${XCODE_VERSION} VERSION_GREATER 4)
# Xcode 4 defaults to the Apple LLVM Compiler.
# Override the default compiler selection because Blender only compiles with gcc
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
message(STATUS "Setting compiler to: " ${CMAKE_XCODE_ATTRIBUTE_GCC_VERSION})
+
+ ##### workaround for actual official cmake incompatibility with xcode 4.3 #####
+ if(${XCODE_VERSION} MATCHES '') # cmake fails due looking for xcode in the wrong path, thus will be empty var
+ message("Official cmake does not yet support Xcode 4.3, get a patched version here: http://www.jensverwiebe.de/Blender/CMake%202.8-7patched.zip")
+ endif()
+ ##### end workaround for actual official cmake incompatibility with xcode 4.3 #####
+
endif()
+ else() # unix makefile generator does not fill XCODE_VERSION var, so we get it with a command
+ execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE XCODE_VERS_BUILDNR )
+ STRING(SUBSTRING ${XCODE_VERS_BUILDNR} 6 3 XCODE_VERSION) # truncate away build-nr
endif()
+
+ message(STATUS "Detected Xcode-version: " ${XCODE_VERSION})
+
option(WITH_COCOA "Use Cocoa framework instead of deprecated Carbon" ON)
option(USE_QTKIT "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
option(WITH_LIBS10.5 "Use 10.5 libs (needed for 64bit builds)" OFF)
@@ -1065,10 +1092,20 @@ elseif(WIN32)
elseif(APPLE)
- if (${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.5")
- set(WITH_LIBS10.5 ON CACHE BOOL "Use 10.5 libs" FORCE)
+ if(${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.5" OR ${CMAKE_OSX_DEPLOYMENT_TARGET} STRGREATER "10.5")
+ set(WITH_LIBS10.5 ON CACHE BOOL "Use 10.5 libs" FORCE) # valid also for 10.6/10.7
endif()
+ if(${XCODE_VERSION} LESS 4.3)
+ SET(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}.sdk CACHE PATH "" FORCE )
+ else()
+ # note: i don't use xcode-select path on purpose, cause also /Applications/Xcode.app would be allowed
+ # absolute pathes are more foolproof here !
+ SET(OSX_SYSROOT_PREFIX /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform)
+ SET(OSX_DEVELOPER_PREFIX /Developer/SDKs/MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}.sdk)
+ SET(CMAKE_OSX_SYSROOT ${OSX_SYSROOT_PREFIX}/${OSX_DEVELOPER_PREFIX} CACHE PATH "" FORCE)
+ endif()
+
if(WITH_LIBS10.5)
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal)
else()
diff --git a/SConstruct b/SConstruct
index 9a1f9234d06..ff668a97483 100644
--- a/SConstruct
+++ b/SConstruct
@@ -266,6 +266,7 @@ if 'blenderlite' in B.targets:
target_env_defs['WITH_BF_REMESH'] = False
target_env_defs['WITH_BF_PYTHON'] = False
target_env_defs['WITH_BF_3DMOUSE'] = False
+ target_env_defs['WITH_BF_LIBMV'] = False
# Merge blenderlite, let command line to override
for k,v in target_env_defs.iteritems():
diff --git a/doc/python_api/rst/bge.types.rst b/doc/python_api/rst/bge.types.rst
index 735ad037175..3c15362a4ec 100644
--- a/doc/python_api/rst/bge.types.rst
+++ b/doc/python_api/rst/bge.types.rst
@@ -4518,10 +4518,16 @@ Game Types (bge.types)
.. data:: KX_ACT_ARMATURE_SETWEIGHT
- Change weight of (only for IK constraint).
+ Change weight of constraint (IK only).
:value: 4
+ .. data:: KX_ACT_ARMATURE_SETINFLUENCE
+
+ Change influence of constraint.
+
+ :value: 5
+
.. attribute:: type
The type of action that the actuator executes when it is active.
@@ -4566,6 +4572,12 @@ Game Types (bge.types)
A weight of 0 disables a constraint while still updating constraint runtime values (see :class:`BL_ArmatureConstraint`)
+ .. attribute:: influence
+
+ The influence this actuator will set on the constraint it controls.
+
+ :type: float.
+
.. class:: KX_ArmatureSensor(SCA_ISensor)
Armature sensor detect conditions on armatures.
diff --git a/doc/python_api/rst/info_best_practice.rst b/doc/python_api/rst/info_best_practice.rst
index d191bb608e8..1f0f81f7d14 100644
--- a/doc/python_api/rst/info_best_practice.rst
+++ b/doc/python_api/rst/info_best_practice.rst
@@ -264,7 +264,7 @@ if your unsure whether the text is upper or lower case use lower or upper string
Use try/except Sparingly
------------------------
-The **try** statement useful to save time writing error checking code.
+The **try** statement is useful to save time writing error checking code.
However **try** is significantly slower then an **if** since an exception has to be set each time, so avoid using **try** in areas of your code that execute in a loop and runs many times.
diff --git a/doc/python_api/rst/info_tips_and_tricks.rst b/doc/python_api/rst/info_tips_and_tricks.rst
index 0b9404906e2..521031f5e61 100644
--- a/doc/python_api/rst/info_tips_and_tricks.rst
+++ b/doc/python_api/rst/info_tips_and_tricks.rst
@@ -82,7 +82,7 @@ You might want to reference a script relative to the blend file.
import bpy
import os
- filename = os.path.join(os.path.basename(bpy.data.filepath), "myscript.py")
+ filename = os.path.join(os.path.dirname(bpy.data.filepath), "myscript.py")
exec(compile(open(filename).read(), filename, 'exec'))
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 2b07b0c3611..b9444f35e12 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -14,30 +14,33 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
- # Contributor(s): Campbell Barton
+ # Contributor(s): Campbell Barton, Luca Bonavita
#
# #**** END GPL LICENSE BLOCK #****
# <pep8 compliant>
-script_help_msg = """
+SCRIPT_HELP_MSG = """
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
+ ./blender.bin -b -noaudio -P 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
- 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
+ To choose sphinx-in directory:
+ ./blender.bin -b -P doc/python_api/sphinx_doc_gen.py -- -o ../python_api
+
+ For quick builds:
+ ./blender.bin -b -P doc/python_api/sphinx_doc_gen.py -- -q
Sphinx: HTML generation
-----------------------
- Generate html docs by running...
+ After you have built doc/python_api/sphinx-in (see above),
+ generate html docs by running:
cd doc/python_api
sphinx-build sphinx-in sphinx-out
@@ -46,19 +49,20 @@ Sphinx: HTML generation
Sphinx: PDF generation
----------------------
- After you have built doc/python_api/sphinx-in (see above), run:
+ After you have built doc/python_api/sphinx-in (see above),
+ generate the pdf doc by running:
sphinx-build -b latex doc/python_api/sphinx-in doc/python_api/sphinx-out
cd doc/python_api/sphinx-out
make
-
+
"""
try:
import bpy # blender module
except:
- print("\nError, this script must run from inside blender")
- print(script_help_msg)
+ print("\nERROR: this script must run from inside Blender")
+ print(SCRIPT_HELP_MSG)
import sys
sys.exit()
@@ -73,64 +77,160 @@ import shutil
from platform import platform
PLATFORM = platform().split('-')[0].lower() # 'linux', 'darwin', 'windows'
-# this script dir
-SCRIPT_DIR = os.path.dirname(__file__)
+SCRIPT_DIR = os.path.abspath(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"))
+def handle_args():
+ '''
+ Parse the args passed to Blender after "--", ignored by Blender
+ '''
+ import argparse
+
+ # When --help is given, print the usage text
+ parser = argparse.ArgumentParser(
+ formatter_class=argparse.RawTextHelpFormatter,
+ usage=SCRIPT_HELP_MSG
+ )
+
+ # optional arguments
+ parser.add_argument("-o", "--output",
+ dest="output_dir",
+ type=str,
+ default=SCRIPT_DIR,
+ help="Path of the API docs (default=<script dir>)",
+ required=False)
+
+ parser.add_argument("-B", "--sphinx-build",
+ dest="sphinx_build",
+ default=False,
+ action='store_true',
+ help="Run sphinx-build SPHINX_IN SPHINX_OUT (default=False)",
+ required=False)
+
+ parser.add_argument("-N", "--sphinx-named-output",
+ dest="sphinx_named_output",
+ default=False,
+ action='store_true',
+ help="Add the theme name to the html dir name (default=False)",
+ required=False)
+
+ parser.add_argument("-T", "--sphinx-theme",
+ dest="sphinx_theme",
+ type=str,
+ default='default',
+ help=
+ # see SPHINX_THEMES below
+ "Sphinx theme (default='default')\n"
+ "Available themes\n"
+ "----------------\n"
+ "(Blender Foundation) blender-org\n" # naiad
+ "(Sphinx) agogo, basic, epub, haiku, nature, "
+ "scrolls, sphinxdoc, traditional\n",
+# choices=['naiad', 'blender-org'] + # bf
+# ['agogo', 'basic', 'epub',
+# 'haiku', 'nature', 'scrolls',
+# 'sphinxdoc', 'traditional'], # sphinx
+ required=False)
+
+ parser.add_argument("-f", "--fullrebuild",
+ dest="full_rebuild",
+ default=False,
+ action='store_true',
+ help="Rewrite all rst files in sphinx-in/ (default=False)",
+ required=False)
+
+ parser.add_argument("-t", "--testdump",
+ dest="test_dump",
+ default=False,
+ action='store_true',
+ help="Dumps a small part of the API (default=False)",
+ required=False)
+
+ parser.add_argument("-b", "--bpy",
+ dest="bpy",
+ default=False,
+ action='store_true',
+ help="Write the rst file of the bpy module (default=False)",
+ required=False)
+
+ # parse only the args passed after '--'
+ argv = []
+ if "--" in sys.argv:
+ argv = sys.argv[sys.argv.index("--") + 1:] # get all args after "--"
+
+ return parser.parse_args(argv)
+
+
+ARGS = handle_args()
+
+# ----------------------------------BPY-----------------------------------------
-# Switch for quick testing
-if 1:
+"""
+# for quick rebuilds
+rm -rf /b/doc/python_api/sphinx-* && \
+./blender.bin --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py && \
+sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out
+"""
+
+# Switch for quick testing so doc-builds don't take so long
+if not ARGS.test_dump:
# full build
+ FILTER_BPY_OPS = None
+ FILTER_BPY_TYPES = None
EXCLUDE_INFO_DOCS = False
EXCLUDE_MODULES = ()
- FILTER_BPY_TYPES = None
- FILTER_BPY_OPS = None
else:
+ FILTER_BPY_OPS = ("import.scene", ) # allow
+ FILTER_BPY_TYPES = ("bpy_struct", "Operator", "ID") # allow
EXCLUDE_INFO_DOCS = True
- # for testing so doc-builds dont take so long.
EXCLUDE_MODULES = (
- "bpy.context",
+ "aud",
+ "bge",
+ "bge.constraints",
+ "bge.events",
+ "bge.logic",
+ "bge.render",
+ "bge.texture",
+ "bge.types",
+ "bgl",
+ "blf",
+ #"bmesh",
+ #"bmesh.types",
+ #"bmesh.utils",
"bpy.app",
"bpy.app.handlers",
- "bpy.path",
+ "bpy.context",
"bpy.data",
+ "bpy.ops", # supports filtering
+ "bpy.path",
"bpy.props",
- "bpy.utils",
- "bpy.context",
"bpy.types", # supports filtering
- "bpy.ops", # supports filtering
+ "bpy.utils",
"bpy_extras",
- "bge",
- "aud",
- "bgl",
- "blf",
"gpu",
"mathutils",
"mathutils.geometry",
"mathutils.noise",
- #"bmesh",
- #"bmesh.types",
- #"bmesh.utils",
"Freestyle",
)
- FILTER_BPY_TYPES = ("bpy_struct", "Operator", "ID") # allow
- FILTER_BPY_OPS = ("import.scene", ) # allow
+try:
+ __import__("aud")
+except ImportError:
+ print("Warning: Built without 'aud' module, docs incomplete...")
+ EXCLUDE_MODULES = EXCLUDE_MODULES + ("aud", )
- # for quick rebuilds
- """
-rm -rf /b/doc/python_api/sphinx-* && \
-./blender.bin --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py && \
-sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out
+# examples
+EXAMPLES_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "examples"))
+EXAMPLE_SET = set()
+for f in os.listdir(EXAMPLES_DIR):
+ if f.endswith(".py"):
+ EXAMPLE_SET.add(os.path.splitext(f)[0])
+EXAMPLE_SET_USED = set()
- """
+#rst files dir
+RST_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "rst"))
# extra info, not api reference docs
# stored in ./rst/info_*
@@ -138,26 +238,68 @@ 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"),
("info_best_practice.rst", "Best Practice: Conventions to follow for writing good scripts"),
- ("info_tips_and_tricks.rst", "Tips and Tricks: Hints to help you while writeing scripts for blender"),
+ ("info_tips_and_tricks.rst", "Tips and Tricks: Hints to help you while writing scripts for blender"),
("info_gotcha.rst", "Gotcha's: some of the problems you may come up against when writing scripts"),
)
# only support for properties atm.
RNA_BLACKLIST = {
- # messes up PDF!, really a bug but for now just workaround.
- "UserPreferencesSystem": {"language", },
+ # XXX messes up PDF!, really a bug but for now just workaround.
+ "UserPreferencesSystem": {"language", }
}
-# -----------------------------------------------------------------------------
+# -------------------------------SPHINX-----------------------------------------
+
+SPHINX_THEMES = {'bf': ['blender-org'], # , 'naiad',
+ 'sphinx': ['agogo',
+ 'basic',
+ 'default',
+ 'epub',
+ 'haiku',
+ 'nature',
+ 'scrolls',
+ 'sphinxdoc',
+ 'traditional']}
+
+available_themes = SPHINX_THEMES['bf'] + SPHINX_THEMES['sphinx']
+if ARGS.sphinx_theme not in available_themes:
+ print ("Please choose a theme among: %s" % ', '.join(available_themes))
+ sys.exit()
+
+SPHINX_IN = os.path.join(ARGS.output_dir, "sphinx-in")
+SPHINX_IN_TMP = SPHINX_IN + "-tmp"
+SPHINX_OUT = os.path.join(ARGS.output_dir, "sphinx-out")
+if ARGS.sphinx_named_output:
+ SPHINX_OUT += "_%s" % ARGS.sphinx_theme
+
+if ARGS.sphinx_theme in SPHINX_THEMES['bf']:
+ SPHINX_THEME_DIR = os.path.join(ARGS.output_dir, ARGS.sphinx_theme)
+ SPHINX_THEME_SVN_DIR = os.path.join(SCRIPT_DIR, ARGS.sphinx_theme)
+
+# ------------------------------------------------------------------------------
+
# configure compile time options
-try:
- __import__("aud")
-except ImportError:
- print("Warning: Built without 'aud' module, docs incomplete...")
- EXCLUDE_MODULES = EXCLUDE_MODULES + ("aud", )
+# -------------------------------BLENDER----------------------------------------
+
+'''
+blender version
+'''
+version_strings = [str(v) for v in bpy.app.version]
+
+BLENDER_VERSION_DOTS = ".".join(version_strings) # '2.62.1'
+if bpy.app.build_revision != b"Unknown":
+ # converting bytes to strings, due to #30154
+ BLENDER_VERSION_DOTS += " r" + str(bpy.app.build_revision, 'utf_8') # '2.62.1 r44584'
+BLENDER_VERSION_PDF = "_".join(version_strings) # '2_62_1'
+if bpy.app.version_cycle == "release":
+ BLENDER_VERSION_PDF = "%s%s_release" % ("_".join(version_strings[:2]),
+ bpy.app.version_char) # '2_62_release'
+
+
+# --------------------------------API DUMP--------------------------------------
# lame, python wont give some access
ClassMethodDescriptorType = type(dict.__dict__['fromkeys'])
@@ -168,7 +310,6 @@ from types import MemberDescriptorType
_BPY_STRUCT_FAKE = "bpy_struct"
_BPY_PROP_COLLECTION_FAKE = "bpy_prop_collection"
-_BPY_FULL_REBUILD = False
if _BPY_PROP_COLLECTION_FAKE:
_BPY_PROP_COLLECTION_ID = ":class:`%s`" % _BPY_PROP_COLLECTION_FAKE
@@ -185,10 +326,13 @@ def undocumented_message(module_name, type_name, identifier):
preloadtitle = '%s.%s' % (module_name, identifier)
else:
preloadtitle = '%s.%s.%s' % (module_name, type_name, identifier)
- message = "Undocumented (`contribute "\
- "<http://wiki.blender.org/index.php/Dev:2.5/Py/API/Documentation/Contribute"\
- "?action=edit&section=new&preload=Dev:2.5/Py/API/Documentation/Contribute/Howto-message"\
- "&preloadtitle=%s>`_)\n\n" % preloadtitle
+ message = "Undocumented (`contribute "\
+ "<http://wiki.blender.org/index.php/"\
+ "Dev:2.5/Py/API/Generating_API_Reference/Contribute/Howto-message"\
+ "?action=edit"\
+ "&section=new"\
+ "&preload=Dev:2.5/Py/API/Documentation/Contribute/Howto-message"\
+ "&preloadtitle=%s>`_)\n\n" % preloadtitle
return message
@@ -402,10 +546,10 @@ def pyprop2sphinx(ident, fw, identifier, py_prop):
fw(ident + " (readonly)\n\n")
-def pymodule2sphinx(BASEPATH, module_name, module, title):
+def pymodule2sphinx(basepath, module_name, module, title):
import types
attribute_set = set()
- filepath = os.path.join(BASEPATH, module_name + ".rst")
+ filepath = os.path.join(basepath, module_name + ".rst")
module_all = getattr(module, "__all__", None)
module_dir = sorted(dir(module))
@@ -453,7 +597,7 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
submod_name_full = "%s.%s" % (module_name, submod_name)
fw(" %s.rst\n\n" % submod_name_full)
- pymodule2sphinx(BASEPATH, submod_name_full, submod, "%s submodule" % module_name)
+ pymodule2sphinx(basepath, submod_name_full, submod, "%s submodule" % module_name)
del submod_ls
# done writing submodules!
@@ -596,10 +740,10 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
file.close()
-def pycontext2sphinx(BASEPATH):
+def pycontext2sphinx(basepath):
# Only use once. very irregular
- filepath = os.path.join(BASEPATH, "bpy.context.rst")
+ filepath = os.path.join(basepath, "bpy.context.rst")
file = open(filepath, "w", encoding="utf-8")
fw = file.write
fw("Context Access (bpy.context)\n")
@@ -738,7 +882,7 @@ def pyrna_enum2sphinx(prop, use_empty_descriptions=False):
return ""
-def pyrna2sphinx(BASEPATH):
+def pyrna2sphinx(basepath):
""" bpy.types and bpy.ops
"""
structs, funcs, ops, props = rna_info.BuildRNAInfo()
@@ -790,7 +934,7 @@ def pyrna2sphinx(BASEPATH):
#if not struct.identifier == "Object":
# return
- filepath = os.path.join(BASEPATH, "bpy.types.%s.rst" % struct.identifier)
+ filepath = os.path.join(basepath, "bpy.types.%s.rst" % struct.identifier)
file = open(filepath, "w", encoding="utf-8")
fw = file.write
@@ -1013,7 +1157,7 @@ def pyrna2sphinx(BASEPATH):
write_struct(struct)
def fake_bpy_type(class_value, class_name, descr_str, use_subclasses=True):
- filepath = os.path.join(BASEPATH, "bpy.types.%s.rst" % class_name)
+ filepath = os.path.join(basepath, "bpy.types.%s.rst" % class_name)
file = open(filepath, "w", encoding="utf-8")
fw = file.write
@@ -1064,7 +1208,7 @@ def pyrna2sphinx(BASEPATH):
del op
for op_module_name, ops_mod in op_modules.items():
- filepath = os.path.join(BASEPATH, "bpy.ops.%s.rst" % op_module_name)
+ filepath = os.path.join(basepath, "bpy.ops.%s.rst" % op_module_name)
file = open(filepath, "w", encoding="utf-8")
fw = file.write
@@ -1102,7 +1246,10 @@ def pyrna2sphinx(BASEPATH):
else:
url_base = API_BASEURL
- fw(" :file: `%s <%s/%s>`_:%d\n\n" % (location[0], url_base, location[0], location[1]))
+ fw(" :file: `%s <%s/%s>`_:%d\n\n" % (location[0],
+ url_base,
+ location[0],
+ location[1]))
file.close()
@@ -1110,53 +1257,43 @@ def pyrna2sphinx(BASEPATH):
write_ops()
-def rna2sphinx(BASEPATH):
-
- try:
- os.mkdir(BASEPATH)
- except:
- pass
-
- # conf.py - empty for now
- filepath = os.path.join(BASEPATH, "conf.py")
+def write_sphinx_conf_py(basepath):
+ '''
+ Write sphinx's conf.py
+ '''
+ filepath = os.path.join(basepath, "conf.py")
file = open(filepath, "w", encoding="utf-8")
fw = file.write
- version_string = ".".join(str(v) for v in bpy.app.version)
- if bpy.app.build_revision != "Unknown":
- version_string = version_string + " r" + bpy.app.build_revision
-
- version_string_fp = "_".join(str(v) for v in bpy.app.version)
-
- if bpy.app.version_cycle == "release":
- version_string_pdf = "%s%s_release" % ("_".join(str(v) for v in bpy.app.version[:2]), bpy.app.version_char)
- else:
- version_string_pdf = version_string_fp
-
fw("project = 'Blender'\n")
# fw("master_doc = 'index'\n")
fw("copyright = u'Blender Foundation'\n")
- fw("version = '%s - API'\n" % version_string)
- fw("release = '%s - API'\n" % version_string)
+ fw("version = '%s - API'\n" % BLENDER_VERSION_DOTS)
+ fw("release = '%s - API'\n" % BLENDER_VERSION_DOTS)
- # until we get a theme for 'Naiad'
- if 0:
- fw("html_theme = 'blender-org'\n")
- fw("html_theme_path = ['../']\n")
+ if ARGS.sphinx_theme != 'default':
+ fw("html_theme = '%s'\n" % ARGS.sphinx_theme)
+ if ARGS.sphinx_theme in SPHINX_THEMES['bf']:
+ fw("html_theme_path = ['../']\n")
# copied with the theme, exclude else we get an error [#28873]
- fw("html_favicon = 'favicon.ico'\n")
+ fw("html_favicon = 'favicon.ico'\n") # in <theme>/static/
- # not helpful since the source us generated, adds to upload size.
+ # not helpful since the source is generated, adds to upload size.
fw("html_copy_source = False\n")
fw("\n")
+
# needed for latex, pdf gen
fw("latex_documents = [ ('contents', 'contents.tex', 'Blender Index', 'Blender Foundation', 'manual'), ]\n")
fw("latex_paper_size = 'a4paper'\n")
file.close()
- # main page needed for sphinx (index.html)
- filepath = os.path.join(BASEPATH, "contents.rst")
+
+def write_rst_contents(basepath):
+ '''
+ Write the rst file of the main page, needed for sphinx (index.html)
+ '''
+ filepath = os.path.join(basepath, "contents.rst")
file = open(filepath, "w", encoding="utf-8")
fw = file.write
@@ -1164,11 +1301,11 @@ def rna2sphinx(BASEPATH):
fw(" Blender Documentation contents\n")
fw("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n")
fw("\n")
- fw("Welcome, this document is an API reference for Blender %s. built %s.\n" % (version_string, bpy.app.build_date))
+ fw("Welcome, this document is an API reference for Blender %s. built %s.\n" % (BLENDER_VERSION_DOTS, str(bpy.app.build_date, 'utf_8')))
fw("\n")
- # fw("`A PDF version of this document is also available <blender_python_reference_%s.pdf>`_\n" % version_string_pdf)
- fw("`A compressed ZIP file of this site is available <blender_python_reference_%s.zip>`_\n" % version_string_pdf)
+ # fw("`A PDF version of this document is also available <blender_python_reference_%s.pdf>`_\n" % BLENDER_VERSION_PDF)
+ fw("`A compressed ZIP file of this site is available <blender_python_reference_%s.zip>`_\n" % BLENDER_VERSION_PDF)
fw("\n")
@@ -1190,28 +1327,25 @@ def rna2sphinx(BASEPATH):
fw("\n")
fw(".. toctree::\n")
fw(" :maxdepth: 1\n\n")
- if "bpy.context" not in EXCLUDE_MODULES:
- fw(" bpy.context.rst\n\n") # note: not actually a module
- if "bpy.data" not in EXCLUDE_MODULES:
- fw(" bpy.data.rst\n\n") # note: not actually a module
- if "bpy.ops" not in EXCLUDE_MODULES:
- fw(" bpy.ops.rst\n\n")
- if "bpy.types" not in EXCLUDE_MODULES:
- fw(" bpy.types.rst\n\n")
-
- # py modules
- if "bpy.utils" not in EXCLUDE_MODULES:
- fw(" bpy.utils.rst\n\n")
- if "bpy.path" not in EXCLUDE_MODULES:
- fw(" bpy.path.rst\n\n")
- if "bpy.app" not in EXCLUDE_MODULES:
- fw(" bpy.app.rst\n\n")
- if "bpy.app.handlers" not in EXCLUDE_MODULES:
- fw(" bpy.app.handlers.rst\n\n")
-
- # C modules
- if "bpy.props" not in EXCLUDE_MODULES:
- fw(" bpy.props.rst\n\n")
+
+ app_modules = [
+ "bpy.context", # note: not actually a module
+ "bpy.data", # note: not actually a module
+ "bpy.ops",
+ "bpy.types",
+
+ # py modules
+ "bpy.utils",
+ "bpy.path",
+ "bpy.app",
+ "bpy.app.handlers",
+
+ # C modules
+ "bpy.props"
+ ]
+ for mod in app_modules:
+ if mod not in EXCLUDE_MODULES:
+ fw(" %s\n\n" % mod)
fw("==================\n")
fw("Standalone Modules\n")
@@ -1220,33 +1354,17 @@ def rna2sphinx(BASEPATH):
fw(".. toctree::\n")
fw(" :maxdepth: 1\n\n")
- # mathutils
- if "mathutils" not in EXCLUDE_MODULES:
- fw(" mathutils.rst\n\n")
- if "mathutils.geometry" not in EXCLUDE_MODULES:
- fw(" mathutils.geometry.rst\n\n")
- if "mathutils.noise" not in EXCLUDE_MODULES:
- fw(" mathutils.noise.rst\n\n")
- # misc
- if "Freestyle" not in EXCLUDE_MODULES:
- fw(" Freestyle.rst\n\n")
- if "bgl" not in EXCLUDE_MODULES:
- fw(" bgl.rst\n\n")
- if "blf" not in EXCLUDE_MODULES:
- fw(" blf.rst\n\n")
- if "gpu" not in EXCLUDE_MODULES:
- fw(" gpu.rst\n\n")
- if "aud" not in EXCLUDE_MODULES:
- fw(" aud.rst\n\n")
- if "bpy_extras" not in EXCLUDE_MODULES:
- fw(" bpy_extras.rst\n\n")
- # bmesh
- if "bmesh" not in EXCLUDE_MODULES:
- fw(" bmesh.rst\n\n")
- if "bmesh.types" not in EXCLUDE_MODULES:
- fw(" bmesh.types.rst\n\n")
- if "bmesh.utils" not in EXCLUDE_MODULES:
- fw(" bmesh.utils.rst\n\n")
+ standalone_modules = [
+ # mathutils
+ "mathutils", "mathutils.geometry", "mathutils.noise",
+ # misc
+ "Freestyle", "bgl", "blf", "gpu", "aud", "bpy_extras",
+ # bmesh
+ "bmesh", "bmesh.types", "bmesh.utils"
+ ]
+ for mod in standalone_modules:
+ if mod not in EXCLUDE_MODULES:
+ fw(" %s\n\n" % mod)
# game engine
if "bge" not in EXCLUDE_MODULES:
@@ -1289,21 +1407,32 @@ def rna2sphinx(BASEPATH):
file.close()
- # internal modules
- if "bpy.ops" not in EXCLUDE_MODULES:
- filepath = os.path.join(BASEPATH, "bpy.ops.rst")
+
+def write_rst_bpy(basepath):
+ '''
+ Write rst file of bpy module (disabled by default)
+ '''
+ if ARGS.bpy:
+ filepath = os.path.join(basepath, "bpy.rst")
file = open(filepath, "w", encoding="utf-8")
fw = file.write
- fw("Operators (bpy.ops)\n")
- fw("===================\n\n")
- write_example_ref("", fw, "bpy.ops")
- fw(".. toctree::\n")
- fw(" :glob:\n\n")
- fw(" bpy.ops.*\n\n")
+
+ fw("\n")
+
+ title = ":mod:`bpy` --- Blender Python Module"
+
+ write_title(fw, title, "=")
+
+ fw(".. module:: bpy.types\n\n")
file.close()
+
+def write_rst_types_index(basepath):
+ '''
+ Write the rst file of bpy.types module (index)
+ '''
if "bpy.types" not in EXCLUDE_MODULES:
- filepath = os.path.join(BASEPATH, "bpy.types.rst")
+ filepath = os.path.join(basepath, "bpy.types.rst")
file = open(filepath, "w", encoding="utf-8")
fw = file.write
fw("Types (bpy.types)\n")
@@ -1313,10 +1442,32 @@ def rna2sphinx(BASEPATH):
fw(" bpy.types.*\n\n")
file.close()
+
+def write_rst_ops_index(basepath):
+ '''
+ Write the rst file of bpy.ops module (index)
+ '''
+ if "bpy.ops" not in EXCLUDE_MODULES:
+ filepath = os.path.join(basepath, "bpy.ops.rst")
+ file = open(filepath, "w", encoding="utf-8")
+ fw = file.write
+ fw("Operators (bpy.ops)\n")
+ fw("===================\n\n")
+ write_example_ref("", fw, "bpy.ops")
+ fw(".. toctree::\n")
+ fw(" :glob:\n\n")
+ fw(" bpy.ops.*\n\n")
+ file.close()
+
+
+def write_rst_data(basepath):
+ '''
+ Write the rst file of bpy.data module
+ '''
if "bpy.data" not in EXCLUDE_MODULES:
# not actually a module, only write this file so we
# can reference in the TOC
- filepath = os.path.join(BASEPATH, "bpy.data.rst")
+ filepath = os.path.join(basepath, "bpy.data.rst")
file = open(filepath, "w", encoding="utf-8")
fw = file.write
fw("Data Access (bpy.data)\n")
@@ -1334,220 +1485,152 @@ def rna2sphinx(BASEPATH):
fw(".. literalinclude:: ../examples/bpy.data.py\n")
file.close()
- EXAMPLE_SET_USED.add("bpy.data")
+ EXAMPLE_SET_USED.add("bpy.data")
- module = None
- if "bpy.context" not in EXCLUDE_MODULES:
- # one of a kind, context doc (uses ctypes to extract info!)
- # doesn't work on mac
- if PLATFORM != "darwin":
- pycontext2sphinx(BASEPATH)
-
- # python modules
- if "bpy.utils" not in EXCLUDE_MODULES:
- from bpy import utils as module
- pymodule2sphinx(BASEPATH, "bpy.utils", module, "Utilities")
-
- if "bpy.path" not in EXCLUDE_MODULES:
- from bpy import path as module
- pymodule2sphinx(BASEPATH, "bpy.path", module, "Path Utilities")
-
- if "bpy_extras" not in EXCLUDE_MODULES:
- import bpy_extras as module
- pymodule2sphinx(BASEPATH, "bpy_extras", module, "Extra Utilities")
-
- # C modules
- if "bpy.app" not in EXCLUDE_MODULES:
- from bpy import app as module
- pymodule2sphinx(BASEPATH, "bpy.app", module, "Application Data")
-
- if "bpy.app.handlers" not in EXCLUDE_MODULES:
- from bpy.app import handlers as module
- pymodule2sphinx(BASEPATH, "bpy.app.handlers", module, "Application Handlers")
-
- if "bpy.props" not in EXCLUDE_MODULES:
- from bpy import props as module
- pymodule2sphinx(BASEPATH, "bpy.props", module, "Property Definitions")
-
- if "mathutils" not in EXCLUDE_MODULES:
- import mathutils as module
- pymodule2sphinx(BASEPATH, "mathutils", module, "Math Types & Utilities")
-
- if "mathutils.geometry" not in EXCLUDE_MODULES:
- import mathutils.geometry as module
- pymodule2sphinx(BASEPATH, "mathutils.geometry", module, "Geometry Utilities")
-
- if "mathutils.noise" not in EXCLUDE_MODULES:
- import mathutils.noise as module
- pymodule2sphinx(BASEPATH, "mathutils.noise", module, "Noise Utilities")
-
- if "bmesh" not in EXCLUDE_MODULES:
- import bmesh as module
- pymodule2sphinx(BASEPATH, "bmesh", module, "BMesh Module")
-
- if "bmesh.types" not in EXCLUDE_MODULES:
- import bmesh.types as module
- pymodule2sphinx(BASEPATH, "bmesh.types", module, "BMesh Types")
-
- if "bmesh.utils" not in EXCLUDE_MODULES:
- import bmesh.utils as module
- pymodule2sphinx(BASEPATH, "bmesh.utils", module, "BMesh Utilities")
-
- if "Freestyle" not in EXCLUDE_MODULES:
- import Freestyle as module
- pymodule2sphinx(BASEPATH, "Freestyle", module, "Freestyle Data Types & Operators")
-
- if "blf" not in EXCLUDE_MODULES:
- import blf as module
- pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing")
-
- if "bgl" not in EXCLUDE_MODULES:
- #import bgl as module
- #pymodule2sphinx(BASEPATH, "bgl", module, "Blender OpenGl wrapper")
- #del module
- 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
- shutil.copy2(os.path.join(RST_DIR, "gpu.rst"), BASEPATH)
-
- if "aud" not in EXCLUDE_MODULES:
- import aud as module
- pymodule2sphinx(BASEPATH, "aud", module, "Audio System")
- del module
-
- ## game engine
-
- # copy2 keeps time/date stamps
- if "bge" not in EXCLUDE_MODULES:
- 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)
+def write_rst_importable_modules(basepath):
+ '''
+ Write the rst files of importable modules
+ '''
+ importable_modules = {
+ # python_modules
+ "bpy.path" : "Path Utilities",
+ "bpy.utils" : "Utilities",
+ "bpy_extras" : "Extra Utilities",
+
+ # C_modules
+ "aud" : "Audio System",
+ "blf" : "Font Drawing",
+ "bmesh" : "BMesh Module",
+ "bmesh.types" : "BMesh Types",
+ "bmesh.utils" : "BMesh Utilities",
+ "bpy.app" : "Application Data",
+ "bpy.app.handlers" : "Application Handlers",
+ "bpy.props" : "Property Definitions",
+ "mathutils" : "Math Types & Utilities",
+ "mathutils.geometry": "Geometry Utilities",
+ "mathutils.noise" : "Noise Utilities",
+ "Freestyle" : "Freestyle Data Types & Operators",
+ }
+ for mod_name, mod_descr in importable_modules.items():
+ if mod_name not in EXCLUDE_MODULES:
+ module = __import__(mod_name,
+ fromlist=[mod_name.rsplit(".", 1)[-1]])
+ pymodule2sphinx(basepath, mod_name, module, mod_descr)
- shutil.copy2(os.path.join(RST_DIR, "change_log.rst"), BASEPATH)
+def copy_handwritten_rsts(basepath):
+
+ # info docs
if not EXCLUDE_INFO_DOCS:
for info, info_desc in INFO_DOCS:
- shutil.copy2(os.path.join(RST_DIR, info), BASEPATH)
+ shutil.copy2(os.path.join(RST_DIR, info), basepath)
+
+ # TODO put this docs in blender's code and use import as per modules above
+ handwritten_modules = [
+ "bge.types",
+ "bge.logic",
+ "bge.render",
+ "bge.texture",
+ "bge.events",
+ "bge.constraints",
+ "bgl", # "Blender OpenGl wrapper"
+ "gpu", # "GPU Shader Module"
+ ]
+ for mod_name in handwritten_modules:
+ if mod_name not in EXCLUDE_MODULES:
+ # copy2 keeps time/date stamps
+ shutil.copy2(os.path.join(RST_DIR, "%s.rst" % mod_name), basepath)
+
+ # changelog
+ shutil.copy2(os.path.join(RST_DIR, "change_log.rst"), basepath)
+
+
+def rna2sphinx(basepath):
- if 0:
- filepath = os.path.join(BASEPATH, "bpy.rst")
- file = open(filepath, "w", encoding="utf-8")
- fw = file.write
-
- fw("\n")
+ try:
+ os.mkdir(basepath)
+ except:
+ pass
- title = ":mod:`bpy` --- Blender Python Module"
+ # sphinx setup
+ write_sphinx_conf_py(basepath)
- write_title(fw, title, "=")
+ # main page
+ write_rst_contents(basepath)
- fw(".. module:: bpy.types\n\n")
- file.close()
+ # context
+ if "bpy.context" not in EXCLUDE_MODULES:
+ # one of a kind, context doc (uses ctypes to extract info!)
+ # doesn't work on mac
+ if PLATFORM != "darwin":
+ pycontext2sphinx(basepath)
- # bpy.types and bpy.ops
- pyrna2sphinx(BASEPATH)
+ # internal modules
+ write_rst_bpy(basepath) # bpy, disabled by default
+ write_rst_types_index(basepath) # bpy.types
+ write_rst_ops_index(basepath) # bpy.ops
+ pyrna2sphinx(basepath) # bpy.types.* and bpy.ops.*
+ write_rst_data(basepath) # bpy.data
+ write_rst_importable_modules(basepath)
- file.close()
+ # copy the other rsts
+ copy_handwritten_rsts(basepath)
-def handle_args():
+def align_sphinx_in_to_sphinx_in_tmp():
'''
- 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
+ Move changed files from SPHINX_IN_TMP to SPHINX_IN
'''
-
- 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():
-
- 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
-
- sphinx_in_dir = os.path.join(output_dir, "sphinx-in")
- sphinx_out_dir = os.path.join(output_dir, "sphinx-out")
-
- # 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)
+ import filecmp
- 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(sphinx_in_dir, True)
- shutil.rmtree(sphinx_out_dir, True)
- else:
- # write here, then move
- shutil.rmtree(sphinx_in_tmp_dir, True)
+ sphinx_in_files = set(os.listdir(SPHINX_IN))
+ sphinx_in_tmp_files = set(os.listdir(SPHINX_IN_TMP))
- rna2sphinx(sphinx_in_tmp_dir)
+ # remove deprecated files that have been removed
+ for f in sorted(sphinx_in_files):
+ if f not in sphinx_in_tmp_files:
+ print("\tdeprecated: %s" % f)
+ os.remove(os.path.join(SPHINX_IN, f))
- if not _BPY_FULL_REBUILD:
- import filecmp
+ # freshen with new files.
+ for f in sorted(sphinx_in_tmp_files):
+ f_from = os.path.join(SPHINX_IN_TMP, f)
+ f_to = os.path.join(SPHINX_IN, f)
- # 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))
+ do_copy = True
+ if f in sphinx_in_files:
+ if filecmp.cmp(f_from, f_to):
+ do_copy = False
- # remove deprecated files that have been removed.
- 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(sphinx_in_dir, f))
+ if do_copy:
+ print("\tupdating: %s" % f)
+ shutil.copy(f_from, f_to)
- # freshen with new files.
- 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_sphinx_in_dir:
- if filecmp.cmp(f_from, f_to):
- do_copy = False
+def main():
- if do_copy:
- print("\tupdating: %s" % f)
- shutil.copy(f_from, f_to)
- '''else:
- print("\tkeeping: %s" % f) # eh, not that useful'''
+ # dirs preparation
+ for dir_path in [ARGS.output_dir, SPHINX_IN]:
+ if not os.path.exists(dir_path):
+ os.mkdir(dir_path)
+
+ # dump the api in rst files
+ if ARGS.full_rebuild:
+ # only for full updates
+ shutil.rmtree(SPHINX_IN, True)
+ shutil.rmtree(SPHINX_OUT, True)
+ rna2sphinx(SPHINX_IN_TMP)
+ shutil.copytree(SPHINX_IN_TMP,
+ SPHINX_IN,
+ copy_function=shutil.copy)
+ else:
+ # write here, then move
+ shutil.rmtree(SPHINX_IN_TMP, True)
+ rna2sphinx(SPHINX_IN_TMP)
+ align_sphinx_in_to_sphinx_in_tmp()
+ # report which example files weren't used
EXAMPLE_SET_UNUSED = EXAMPLE_SET - EXAMPLE_SET_USED
if EXAMPLE_SET_UNUSED:
print("\nUnused examples found in '%s'..." % EXAMPLES_DIR)
@@ -1555,7 +1638,22 @@ def main():
print(" %s.py" % f)
print(" %d total\n" % len(EXAMPLE_SET_UNUSED))
+ # eventually, copy the theme in the output directory
+ if ARGS.sphinx_theme in SPHINX_THEMES['bf']:
+ if not os.path.exists(SPHINX_THEME_DIR):
+ shutil.copytree(SPHINX_THEME_SVN_DIR,
+ SPHINX_THEME_DIR,
+ copy_function=shutil.copy)
+
+ # eventually, build the docs
+ if ARGS.sphinx_build:
+ import subprocess
+ sphinx_build_command = "sphinx-build %s %s" % (SPHINX_IN, SPHINX_OUT)
+ print ('\n%s\n' % sphinx_build_command)
+ subprocess.call(sphinx_build_command, shell=True)
+
sys.exit()
+
if __name__ == '__main__':
main()
diff --git a/intern/cycles/blender/addon/enums.py b/intern/cycles/blender/addon/enums.py
index e1b138def3c..b4b1646c10d 100644
--- a/intern/cycles/blender/addon/enums.py
+++ b/intern/cycles/blender/addon/enums.py
@@ -21,31 +21,36 @@
from . import engine
devices = (
- ("CPU", "CPU", "Use CPU for rendering"),
- ("GPU", "GPU Compute", "Use GPU compute device for rendering, configured in user preferences"))
+ ('CPU', "CPU", "Use CPU for rendering"),
+ ('GPU', "GPU Compute", "Use GPU compute device for rendering, configured in user preferences"))
feature_set = (
- ("SUPPORTED", "Supported", "Only use finished and supported features"),
- ("EXPERIMENTAL", "Experimental", "Use experimental and incomplete features that might be broken or change in the future"),
+ ('SUPPORTED', "Supported", "Only use finished and supported features"),
+ ('EXPERIMENTAL', "Experimental", "Use experimental and incomplete features that might be broken or change in the future"),
)
shading_systems = (
- ("GPU_COMPATIBLE", "GPU Compatible", "Restricted shading system compatible with GPU rendering"),
- ("OSL", "Open Shading Language", "Open Shading Language shading system that only runs on the CPU"),
+ ('GPU_COMPATIBLE', "GPU Compatible", "Restricted shading system compatible with GPU rendering"),
+ ('OSL', "Open Shading Language", "Open Shading Language shading system that only runs on the CPU"),
)
displacement_methods = (
- ("BUMP", "Bump", "Bump mapping to simulate the appearance of displacement"),
- ("TRUE", "True", "Use true displacement only, requires fine subdivision"),
- ("BOTH", "Both", "Combination of displacement and bump mapping"),
+ ('BUMP', "Bump", "Bump mapping to simulate the appearance of displacement"),
+ ('TRUE', "True", "Use true displacement only, requires fine subdivision"),
+ ('BOTH', "Both", "Combination of displacement and bump mapping"),
)
bvh_types = (
- ("DYNAMIC_BVH", "Dynamic BVH", "Objects can be individually updated, at the cost of slower render time"),
- ("STATIC_BVH", "Static BVH", "Any object modification requires a complete BVH rebuild, but renders faster"),
+ ('DYNAMIC_BVH', "Dynamic BVH", "Objects can be individually updated, at the cost of slower render time"),
+ ('STATIC_BVH', "Static BVH", "Any object modification requires a complete BVH rebuild, but renders faster"),
)
filter_types = (
- ("BOX", "Box", "Box filter"),
- ("GAUSSIAN", "Gaussian", "Gaussian filter"),
+ ('BOX', "Box", "Box filter"),
+ ('GAUSSIAN', "Gaussian", "Gaussian filter"),
+ )
+
+aperture_types = (
+ ('RADIUS', "Radius", "Directly change the size of the aperture"),
+ ('FSTOP', "F/stop", "Change the size of the aperture by f/stops"),
)
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 7e7e83b4f69..86f726f7828 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -231,11 +231,27 @@ class CyclesCameraSettings(bpy.types.PropertyGroup):
type=cls,
)
+ cls.aperture_type = EnumProperty(
+ name="Aperture Type",
+ description="Use F/stop number or aperture radius",
+ items=enums.aperture_types,
+ default='RADIUS',
+ )
+ cls.aperture_fstop = FloatProperty(
+ name="Aperture F/stop",
+ description="F/stop ratio (lower numbers give more defocus, higher numbers give a sharper image)",
+ min=0.0, soft_min=0.1, soft_max=64.0,
+ default=5.6,
+ step=10,
+ precision=1,
+ )
cls.aperture_size = FloatProperty(
name="Aperture Size",
- description="Radius of the aperture for depth of field",
- min=0.0, max=10.0,
+ description="Radius of the aperture for depth of field (higher values give more defocus)",
+ min=0.0, soft_max=10.0,
default=0.0,
+ step=1,
+ precision=4,
)
cls.aperture_blades = IntProperty(
name="Aperture Blades",
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 9eb8f251ebb..745fb8366da 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -179,7 +179,6 @@ class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
col.prop(scene, "layers", text="Scene")
col.label(text="Material:")
col.prop(rl, "material_override", text="")
- col.prop(rl, "use_zmask");
col = split.column()
col.prop(rl, "layers", text="Layer")
@@ -264,7 +263,12 @@ class CyclesCamera_PT_dof(CyclesButtonsPanel, Panel):
col = split.column()
col.label("Aperture:")
- col.prop(ccam, "aperture_size", text="Size")
+ sub = col.column(align=True)
+ sub.prop(ccam, "aperture_type", text="")
+ if ccam.aperture_type == 'RADIUS':
+ sub.prop(ccam, "aperture_size", text="Size")
+ elif ccam.aperture_type == 'FSTOP':
+ sub.prop(ccam, "aperture_fstop", text="Number")
sub = col.column(align=True)
sub.prop(ccam, "aperture_blades", text="Blades")
@@ -397,7 +401,7 @@ def find_node_input(node, name):
def panel_node_draw(layout, id_data, output_type, input_name):
- if not id_data.node_tree:
+ if not id_data.use_nodes:
layout.prop(id_data, "use_nodes", icon='NODETREE')
return False
@@ -485,6 +489,7 @@ class CyclesWorld_PT_surface(CyclesButtonsPanel, Panel):
if not panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Surface'):
layout.prop(world, "horizon_color", text="Color")
+
class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel):
bl_label = "Volume"
bl_context = "world"
@@ -503,6 +508,7 @@ class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel):
world = context.world
panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Volume')
+
class CyclesWorld_PT_ambient_occlusion(CyclesButtonsPanel, Panel):
bl_label = "Ambient Occlusion"
bl_context = "world"
@@ -525,6 +531,7 @@ class CyclesWorld_PT_ambient_occlusion(CyclesButtonsPanel, Panel):
split.prop(light, "ao_factor", text="Factor")
split.prop(light, "distance", text="Distance")
+
class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
bl_label = "Settings"
bl_context = "world"
@@ -547,6 +554,7 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
row.active = cworld.sample_as_light
row.prop(cworld, "sample_map_resolution")
+
class CyclesMaterial_PT_surface(CyclesButtonsPanel, Panel):
bl_label = "Surface"
bl_context = "material"
diff --git a/intern/cycles/blender/blender_camera.cpp b/intern/cycles/blender/blender_camera.cpp
index 7c9c162f8b1..e7704c5f885 100644
--- a/intern/cycles/blender/blender_camera.cpp
+++ b/intern/cycles/blender/blender_camera.cpp
@@ -98,7 +98,18 @@ static void blender_camera_from_object(BlenderCamera *bcam, BL::Object b_ob)
bcam->ortho_scale = b_camera.ortho_scale();
bcam->lens = b_camera.lens();
- bcam->aperturesize = RNA_float_get(&ccamera, "aperture_size");
+
+ /* allow f/stop number to change aperture_size but still
+ give manual control over aperture radius */
+ int aperture_type = RNA_enum_get(&ccamera, "aperture_type");
+
+ if(aperture_type == 1) {
+ float fstop = RNA_float_get(&ccamera, "aperture_fstop");
+ bcam->aperturesize = (bcam->lens*1e-3f)/(2.0f*max(fstop, 1e-5f));
+ }
+ else
+ bcam->aperturesize = RNA_float_get(&ccamera, "aperture_size");
+
bcam->apertureblades = RNA_int_get(&ccamera, "aperture_blades");
bcam->aperturerotation = RNA_float_get(&ccamera, "aperture_rotation");
bcam->focaldistance = blender_camera_focal_distance(b_ob, b_camera);
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp
index 415a043cf78..5c26a4d2163 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -332,6 +332,7 @@ static ShaderNode *add_node(BL::BlendData b_data, ShaderGraph *graph, BL::Shader
if(b_image)
env->filename = blender_absolute_path(b_data, b_image, b_image.filepath());
env->color_space = EnvironmentTextureNode::color_space_enum[(int)b_env_node.color_space()];
+ env->projection = EnvironmentTextureNode::projection_enum[(int)b_env_node.projection()];
get_tex_mapping(&env->tex_mapping, b_env_node.texture_mapping());
node = env;
break;
@@ -517,6 +518,9 @@ static void add_nodes(BL::BlendData b_data, ShaderGraph *graph, BL::ShaderNodeTr
/* add proxy converter nodes for inputs and outputs */
BL::NodeGroup b_gnode(*b_node);
BL::ShaderNodeTree b_group_ntree(b_gnode.node_tree());
+ if (!b_group_ntree)
+ continue;
+
BL::Node::inputs_iterator b_input;
BL::Node::outputs_iterator b_output;
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp
index 45ed7adcfdc..defdb7b447d 100644
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@ -204,7 +204,7 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d, const char *layer)
render_layer.name = b_rlay->name();
render_layer.scene_layer = get_layer(b_scene.layers());
render_layer.layer = get_layer(b_rlay->layers());
- render_layer.holdout_layer = (b_rlay->use_zmask())? ~get_layer(b_rlay->layers_zmask()): 0;
+ render_layer.holdout_layer = get_layer(b_rlay->layers_zmask());
render_layer.layer |= render_layer.holdout_layer;
render_layer.material_override = b_rlay->material_override();
}
diff --git a/intern/cycles/kernel/kernel.cpp b/intern/cycles/kernel/kernel.cpp
index a93f6172d28..667db1e5f03 100644
--- a/intern/cycles/kernel/kernel.cpp
+++ b/intern/cycles/kernel/kernel.cpp
@@ -84,6 +84,25 @@ void kernel_tex_copy(KernelGlobals *kg, const char *name, device_ptr mem, size_t
#define KERNEL_IMAGE_TEX(type, ttype, tname)
#include "kernel_textures.h"
+ else if(strstr(name, "__tex_image_float")) {
+ texture_image_float4 *tex = NULL;
+ int id = atoi(name + strlen("__tex_image_float_"));
+
+ switch(id) {
+ case 95: tex = &kg->__tex_image_float_095; break;
+ case 96: tex = &kg->__tex_image_float_096; break;
+ case 97: tex = &kg->__tex_image_float_097; break;
+ case 98: tex = &kg->__tex_image_float_098; break;
+ case 99: tex = &kg->__tex_image_float_099; break;
+ default: break;
+ }
+
+ if(tex) {
+ tex->data = (float4*)mem;
+ tex->width = width;
+ tex->height = height;
+ }
+ }
else if(strstr(name, "__tex_image")) {
texture_image_uchar4 *tex = NULL;
int id = atoi(name + strlen("__tex_image_"));
@@ -184,11 +203,6 @@ void kernel_tex_copy(KernelGlobals *kg, const char *name, device_ptr mem, size_t
case 92: tex = &kg->__tex_image_092; break;
case 93: tex = &kg->__tex_image_093; break;
case 94: tex = &kg->__tex_image_094; break;
- case 95: tex = &kg->__tex_image_095; break;
- case 96: tex = &kg->__tex_image_096; break;
- case 97: tex = &kg->__tex_image_097; break;
- case 98: tex = &kg->__tex_image_098; break;
- case 99: tex = &kg->__tex_image_099; break;
default: break;
}
diff --git a/intern/cycles/kernel/kernel_montecarlo.h b/intern/cycles/kernel/kernel_montecarlo.h
index 66bd0ee9998..68f007cfd97 100644
--- a/intern/cycles/kernel/kernel_montecarlo.h
+++ b/intern/cycles/kernel/kernel_montecarlo.h
@@ -224,6 +224,38 @@ __device float3 equirectangular_to_direction(float u, float v)
cos(theta));
}
+/* Mirror Ball <-> Cartesion direction */
+
+__device float3 mirrorball_to_direction(float u, float v)
+{
+ /* point on sphere */
+ float3 dir;
+
+ dir.x = 2.0f*u - 1.0f;
+ dir.z = 2.0f*v - 1.0f;
+ dir.y = -sqrt(max(1.0f - dir.x*dir.x - dir.z*dir.z, 0.0f));
+
+ /* reflection */
+ float3 I = make_float3(0.0f, -1.0f, 0.0f);
+
+ return 2.0f*dot(dir, I)*dir - I;
+}
+
+__device float2 direction_to_mirrorball(float3 dir)
+{
+ /* inverse of mirrorball_to_direction */
+ dir.y -= 1.0f;
+
+ float div = 2.0f*sqrt(max(-0.5f*dir.y, 0.0f));
+ if(div > 0.0f)
+ dir /= div;
+
+ float u = 0.5f*(dir.x + 1.0f);
+ float v = 0.5f*(dir.z + 1.0f);
+
+ return make_float2(u, v);
+}
+
CCL_NAMESPACE_END
#endif /* __KERNEL_MONTECARLO_CL__ */
diff --git a/intern/cycles/kernel/kernel_textures.h b/intern/cycles/kernel/kernel_textures.h
index ca7ae432efa..8bab735d0d1 100644
--- a/intern/cycles/kernel/kernel_textures.h
+++ b/intern/cycles/kernel/kernel_textures.h
@@ -142,11 +142,13 @@ KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_091)
KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_092)
KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_093)
KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_094)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_095)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_096)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_097)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_098)
-KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_099)
+
+/* full-float image */
+KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float_095)
+KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float_096)
+KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float_097)
+KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float_098)
+KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float_099)
#undef KERNEL_TEX
#undef KERNEL_IMAGE_TEX
diff --git a/intern/cycles/kernel/svm/svm_image.h b/intern/cycles/kernel/svm/svm_image.h
index 073021bdd54..eddd0f7034a 100644
--- a/intern/cycles/kernel/svm/svm_image.h
+++ b/intern/cycles/kernel/svm/svm_image.h
@@ -130,11 +130,11 @@ __device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y)
case 92: r = kernel_tex_image_interp(__tex_image_092, x, y); break;
case 93: r = kernel_tex_image_interp(__tex_image_093, x, y); break;
case 94: r = kernel_tex_image_interp(__tex_image_094, x, y); break;
- case 95: r = kernel_tex_image_interp(__tex_image_095, x, y); break;
- case 96: r = kernel_tex_image_interp(__tex_image_096, x, y); break;
- case 97: r = kernel_tex_image_interp(__tex_image_097, x, y); break;
- case 98: r = kernel_tex_image_interp(__tex_image_098, x, y); break;
- case 99: r = kernel_tex_image_interp(__tex_image_099, x, y); break;
+ case 95: r = kernel_tex_image_interp(__tex_image_float_095, x, y); break;
+ case 96: r = kernel_tex_image_interp(__tex_image_float_096, x, y); break;
+ case 97: r = kernel_tex_image_interp(__tex_image_float_097, x, y); break;
+ case 98: r = kernel_tex_image_interp(__tex_image_float_098, x, y); break;
+ case 99: r = kernel_tex_image_interp(__tex_image_float_099, x, y); break;
default:
kernel_assert(0);
return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
@@ -171,11 +171,20 @@ __device void svm_node_tex_environment(KernelGlobals *kg, ShaderData *sd, float
{
uint id = node.y;
uint co_offset, out_offset, alpha_offset, srgb;
+ uint projection = node.w;
decode_node_uchar4(node.z, &co_offset, &out_offset, &alpha_offset, &srgb);
float3 co = stack_load_float3(stack, co_offset);
- float2 uv = direction_to_equirectangular(co);
+ float2 uv;
+
+ co = normalize(co);
+
+ if(projection == 0)
+ uv = direction_to_equirectangular(co);
+ else
+ uv = direction_to_mirrorball(co);
+
float4 f = svm_image_texture(kg, id, uv.x, uv.y);
float3 r = make_float3(f.x, f.y, f.z);
diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp
index de3ab8edf48..78b8f06c7b4 100644
--- a/intern/cycles/render/image.cpp
+++ b/intern/cycles/render/image.cpp
@@ -39,9 +39,10 @@ ImageManager::ImageManager()
ImageManager::~ImageManager()
{
- for(size_t slot = 0; slot < images.size(); slot++) {
+ for(size_t slot = 0; slot < images.size(); slot++)
assert(!images[slot]);
- }
+ for(size_t slot = 0; slot < float_images.size(); slot++)
+ assert(!float_images[slot]);
}
void ImageManager::set_osl_texture_system(void *texture_system)
@@ -49,39 +50,111 @@ void ImageManager::set_osl_texture_system(void *texture_system)
osl_texture_system = texture_system;
}
-int ImageManager::add_image(const string& filename)
+static bool is_float_image(const string& filename)
+{
+ ImageInput *in = ImageInput::create(filename);
+ bool is_float = false;
+
+ if(in) {
+ ImageSpec spec;
+
+ if(in->open(filename, spec)) {
+ /* check the main format, and channel formats;
+ if any are non-integer, we'll need a float texture slot */
+ if(spec.format == TypeDesc::HALF ||
+ spec.format == TypeDesc::FLOAT ||
+ spec.format == TypeDesc::DOUBLE) {
+ is_float = true;
+ }
+
+ for(size_t channel = 0; channel < spec.channelformats.size(); channel++) {
+ if(spec.channelformats[channel] == TypeDesc::HALF ||
+ spec.channelformats[channel] == TypeDesc::FLOAT ||
+ spec.channelformats[channel] == TypeDesc::DOUBLE) {
+ is_float = true;
+ }
+ }
+
+ in->close();
+ }
+
+ delete in;
+ }
+
+ return is_float;
+}
+
+int ImageManager::add_image(const string& filename, bool& is_float)
{
Image *img;
size_t slot;
- /* find existing image */
- for(slot = 0; slot < images.size(); slot++) {
- if(images[slot] && images[slot]->filename == filename) {
- images[slot]->users++;
- return slot;
+ /* load image info and find out if we need a float texture */
+ is_float = is_float_image(filename);
+
+ if(is_float) {
+ /* find existing image */
+ for(slot = 0; slot < float_images.size(); slot++) {
+ if(float_images[slot] && float_images[slot]->filename == filename) {
+ float_images[slot]->users++;
+ return slot+TEX_IMAGE_FLOAT_START;
+ }
}
+
+ /* find free slot */
+ for(slot = 0; slot < float_images.size(); slot++) {
+ if(!float_images[slot])
+ break;
+ }
+
+ if(slot == float_images.size()) {
+ /* max images limit reached */
+ if(float_images.size() == TEX_NUM_FLOAT_IMAGES)
+ return -1;
+
+ float_images.resize(float_images.size() + 1);
+ }
+
+ /* add new image */
+ img = new Image();
+ img->filename = filename;
+ img->need_load = true;
+ img->users = 1;
+
+ float_images[slot] = img;
+ /* report slot out of total set of textures */
+ slot += TEX_IMAGE_FLOAT_START;
}
+ else {
+ for(slot = 0; slot < images.size(); slot++) {
+ if(images[slot] && images[slot]->filename == filename) {
+ images[slot]->users++;
+ return slot;
+ }
+ }
- /* find free slot */
- for(slot = 0; slot < images.size(); slot++)
- if(!images[slot])
- break;
-
- if(slot == images.size()) {
- /* max images limit reached */
- if(images.size() == TEX_IMAGE_MAX)
- return -1;
+ /* find free slot */
+ for(slot = 0; slot < images.size(); slot++) {
+ if(!images[slot])
+ break;
+ }
+
+ if(slot == images.size()) {
+ /* max images limit reached */
+ if(images.size() == TEX_NUM_IMAGES)
+ return -1;
+
+ images.resize(images.size() + 1);
+ }
- images.resize(images.size() + 1);
+ /* add new image */
+ img = new Image();
+ img->filename = filename;
+ img->need_load = true;
+ img->users = 1;
+
+ images[slot] = img;
}
-
- /* add new image */
- img = new Image();
- img->filename = filename;
- img->need_load = true;
- img->users = 1;
-
- images[slot] = img;
need_update = true;
return slot;
@@ -91,24 +164,40 @@ void ImageManager::remove_image(const string& filename)
{
size_t slot;
- for(slot = 0; slot < images.size(); slot++)
- if(images[slot] && images[slot]->filename == filename)
+ for(slot = 0; slot < images.size(); slot++) {
+ if(images[slot] && images[slot]->filename == filename) {
+ /* decrement user count */
+ images[slot]->users--;
+ assert(images[slot]->users >= 0);
+
+ /* don't remove immediately, rather do it all together later on. one of
+ the reasons for this is that on shader changes we add and remove nodes
+ that use them, but we do not want to reload the image all the time. */
+ if(images[slot]->users == 0)
+ need_update = true;
+
break;
-
- if(slot == images.size())
- return;
+ }
+ }
- assert(images[slot]);
-
- /* decrement user count */
- images[slot]->users--;
- assert(images[slot]->users >= 0);
-
- /* don't remove immediately, rather do it all together later on. one of
- the reasons for this is that on shader changes we add and remove nodes
- that use them, but we do not want to reload the image all the time. */
- if(images[slot]->users == 0)
- need_update = true;
+ if(slot == images.size()) {
+ /* see if it's in a float texture slot */
+ for(slot = 0; slot < float_images.size(); slot++) {
+ if(float_images[slot] && float_images[slot]->filename == filename) {
+ /* decrement user count */
+ float_images[slot]->users--;
+ assert(float_images[slot]->users >= 0);
+
+ /* don't remove immediately, rather do it all together later on. one of
+ the reasons for this is that on shader changes we add and remove nodes
+ that use them, but we do not want to reload the image all the time. */
+ if(float_images[slot]->users == 0)
+ need_update = true;
+
+ break;
+ }
+ }
+ }
}
bool ImageManager::file_load_image(Image *img, device_vector<uchar4>& tex_img)
@@ -173,51 +262,168 @@ bool ImageManager::file_load_image(Image *img, device_vector<uchar4>& tex_img)
return true;
}
+bool ImageManager::file_load_float_image(Image *img, device_vector<float4>& tex_img)
+{
+ if(img->filename == "")
+ return false;
+
+ /* load image from file through OIIO */
+ ImageInput *in = ImageInput::create(img->filename);
+
+ if(!in)
+ return false;
+
+ ImageSpec spec;
+
+ if(!in->open(img->filename, spec)) {
+ delete in;
+ return false;
+ }
+
+ /* we only handle certain number of components */
+ int width = spec.width;
+ int height = spec.height;
+ int components = spec.nchannels;
+
+ if(!(components == 1 || components == 3 || components == 4)) {
+ in->close();
+ delete in;
+ return false;
+ }
+
+ /* read RGBA pixels */
+ float *pixels = (float*)tex_img.resize(width, height);
+ int scanlinesize = width*components*sizeof(float);
+
+ in->read_image(TypeDesc::FLOAT,
+ (uchar*)pixels + (height-1)*scanlinesize,
+ AutoStride,
+ -scanlinesize,
+ AutoStride);
+
+ in->close();
+ delete in;
+
+ if(components == 3) {
+ for(int i = width*height-1; i >= 0; i--) {
+ pixels[i*4+3] = 1.0f;
+ pixels[i*4+2] = pixels[i*3+2];
+ pixels[i*4+1] = pixels[i*3+1];
+ pixels[i*4+0] = pixels[i*3+0];
+ }
+ }
+ else if(components == 1) {
+ for(int i = width*height-1; i >= 0; i--) {
+ pixels[i*4+3] = 1.0f;
+ pixels[i*4+2] = pixels[i];
+ pixels[i*4+1] = pixels[i];
+ pixels[i*4+0] = pixels[i];
+ }
+ }
+
+ return true;
+}
+
void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int slot)
{
if(osl_texture_system)
return;
- Image *img = images[slot];
- device_vector<uchar4>& tex_img = dscene->tex_image[slot];
+ Image *img;
+ bool is_float;
- if(tex_img.device_pointer)
- device->tex_free(tex_img);
+ if(slot < TEX_IMAGE_FLOAT_START) {
+ img = images[slot];
+ is_float = false;
+ }
+ else {
+ img = float_images[slot - TEX_IMAGE_FLOAT_START];
+ is_float = true;
+ }
- if(!file_load_image(img, tex_img)) {
- /* on failure to load, we set a 1x1 pixels black image */
- uchar *pixels = (uchar*)tex_img.resize(1, 1);
+ if(is_float) {
+ device_vector<float4>& tex_img = dscene->tex_float_image[slot - TEX_IMAGE_FLOAT_START];
+
+ if(tex_img.device_pointer)
+ device->tex_free(tex_img);
+
+ if(!file_load_float_image(img, tex_img)) {
+ /* on failure to load, we set a 1x1 pixels black image */
+ float *pixels = (float*)tex_img.resize(1, 1);
+
+ pixels[0] = 0.0f;
+ pixels[1] = 0.0f;
+ pixels[2] = 0.0f;
+ pixels[3] = 0.0f;
+ }
- pixels[0] = 0;
- pixels[1] = 0;
- pixels[2] = 0;
- pixels[3] = 0;
+ string name;
+
+ if(slot >= 10) name = string_printf("__tex_image_float_0%d", slot);
+ else name = string_printf("__tex_image_float_00%d", slot);
+
+ device->tex_alloc(name.c_str(), tex_img, true, true);
}
+ else {
+ device_vector<uchar4>& tex_img = dscene->tex_image[slot];
+
+ if(tex_img.device_pointer)
+ device->tex_free(tex_img);
+
+ if(!file_load_image(img, tex_img)) {
+ /* on failure to load, we set a 1x1 pixels black image */
+ uchar *pixels = (uchar*)tex_img.resize(1, 1);
- string name;
+ pixels[0] = 0;
+ pixels[1] = 0;
+ pixels[2] = 0;
+ pixels[3] = 0;
+ }
+
+ string name;
- if(slot >= 10) name = string_printf("__tex_image_0%d", slot);
- else name = string_printf("__tex_image_00%d", slot);
+ if(slot >= 10) name = string_printf("__tex_image_0%d", slot);
+ else name = string_printf("__tex_image_00%d", slot);
- device->tex_alloc(name.c_str(), tex_img, true, true);
+ device->tex_alloc(name.c_str(), tex_img, true, true);
+ }
}
void ImageManager::device_free_image(Device *device, DeviceScene *dscene, int slot)
{
- if(images[slot]) {
+ Image *img;
+ bool is_float;
+
+ if(slot < TEX_IMAGE_FLOAT_START) {
+ img = images[slot];
+ is_float = false;
+ }
+ else {
+ img = float_images[slot - TEX_IMAGE_FLOAT_START];
+ is_float = true;
+ }
+
+ if(img) {
if(osl_texture_system) {
#ifdef WITH_OSL
ustring filename(images[slot]->filename);
((OSL::TextureSystem*)osl_texture_system)->invalidate(filename);
#endif
}
+ else if(is_float) {
+ device->tex_free(dscene->tex_float_image[slot - TEX_IMAGE_FLOAT_START]);
+ dscene->tex_float_image[slot - TEX_IMAGE_FLOAT_START].clear();
+
+ delete float_images[slot - TEX_IMAGE_FLOAT_START];
+ float_images[slot - TEX_IMAGE_FLOAT_START] = NULL;
+ }
else {
device->tex_free(dscene->tex_image[slot]);
dscene->tex_image[slot].clear();
- }
- delete images[slot];
- images[slot] = NULL;
+ delete images[slot];
+ images[slot] = NULL;
+ }
}
}
@@ -242,6 +448,22 @@ void ImageManager::device_update(Device *device, DeviceScene *dscene, Progress&
}
}
+ for(size_t slot = 0; slot < float_images.size(); slot++) {
+ if(float_images[slot]) {
+ if(float_images[slot]->users == 0) {
+ device_free_image(device, dscene, slot + TEX_IMAGE_FLOAT_START);
+ }
+ else if(float_images[slot]->need_load) {
+ string name = path_filename(float_images[slot]->filename);
+ progress.set_status("Updating Images", "Loading " + name);
+ device_load_image(device, dscene, slot + TEX_IMAGE_FLOAT_START);
+ float_images[slot]->need_load = false;
+ }
+
+ if(progress.get_cancel()) return;
+ }
+ }
+
need_update = false;
}
@@ -249,8 +471,11 @@ void ImageManager::device_free(Device *device, DeviceScene *dscene)
{
for(size_t slot = 0; slot < images.size(); slot++)
device_free_image(device, dscene, slot);
+ for(size_t slot = 0; slot < float_images.size(); slot++)
+ device_free_image(device, dscene, slot + TEX_IMAGE_FLOAT_START);
images.clear();
+ float_images.clear();
}
CCL_NAMESPACE_END
diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h
index 0d49a1e6b67..d789e6885e3 100644
--- a/intern/cycles/render/image.h
+++ b/intern/cycles/render/image.h
@@ -26,7 +26,10 @@
CCL_NAMESPACE_BEGIN
-#define TEX_IMAGE_MAX 100
+#define TEX_NUM_FLOAT_IMAGES 5
+#define TEX_NUM_IMAGES 95
+#define TEX_IMAGE_MAX (TEX_NUM_IMAGES + TEX_NUM_FLOAT_IMAGES)
+#define TEX_IMAGE_FLOAT_START TEX_NUM_IMAGES
class Device;
class DeviceScene;
@@ -37,7 +40,7 @@ public:
ImageManager();
~ImageManager();
- int add_image(const string& filename);
+ int add_image(const string& filename, bool& is_float);
void remove_image(const string& filename);
void device_update(Device *device, DeviceScene *dscene, Progress& progress);
@@ -56,9 +59,11 @@ private:
};
vector<Image*> images;
+ vector<Image*> float_images;
void *osl_texture_system;
bool file_load_image(Image *img, device_vector<uchar4>& tex_img);
+ bool file_load_float_image(Image *img, device_vector<float4>& tex_img);
void device_load_image(Device *device, DeviceScene *dscene, int slot);
void device_free_image(Device *device, DeviceScene *dscene, int slot);
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 982521b31f2..a98352aa85a 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -93,8 +93,8 @@ static ShaderEnum color_space_init()
{
ShaderEnum enm;
- enm.insert("Linear", 0);
- enm.insert("sRGB", 1);
+ enm.insert("None", 0);
+ enm.insert("Color", 1);
return enm;
}
@@ -106,8 +106,9 @@ ImageTextureNode::ImageTextureNode()
{
image_manager = NULL;
slot = -1;
+ is_float = false;
filename = "";
- color_space = ustring("sRGB");
+ color_space = ustring("Color");
add_input("Vector", SHADER_SOCKET_POINT, ShaderInput::TEXTURE_UV);
add_output("Color", SHADER_SOCKET_COLOR);
@@ -125,6 +126,7 @@ ShaderNode *ImageTextureNode::clone() const
ImageTextureNode *node = new ImageTextureNode(*this);
node->image_manager = NULL;
node->slot = -1;
+ node->is_float = false;
return node;
}
@@ -136,7 +138,7 @@ void ImageTextureNode::compile(SVMCompiler& compiler)
image_manager = compiler.image_manager;
if(slot == -1)
- slot = image_manager->add_image(filename);
+ slot = image_manager->add_image(filename, is_float);
if(!color_out->links.empty())
compiler.stack_assign(color_out);
@@ -146,16 +148,24 @@ void ImageTextureNode::compile(SVMCompiler& compiler)
if(slot != -1) {
compiler.stack_assign(vector_in);
- if(!tex_mapping.skip())
- tex_mapping.compile(compiler, vector_in->stack_offset, vector_in->stack_offset);
+ int srgb = (is_float || color_space != "Color")? 0: 1;
+ int vector_offset = vector_in->stack_offset;
+
+ if(!tex_mapping.skip()) {
+ vector_offset = compiler.stack_find_offset(SHADER_SOCKET_VECTOR);
+ tex_mapping.compile(compiler, vector_in->stack_offset, vector_offset);
+ }
compiler.add_node(NODE_TEX_IMAGE,
slot,
compiler.encode_uchar4(
- vector_in->stack_offset,
+ vector_offset,
color_out->stack_offset,
alpha_out->stack_offset,
- color_space_enum[color_space]));
+ srgb));
+
+ if(vector_offset != vector_in->stack_offset)
+ compiler.stack_clear_offset(vector_in->type, vector_offset);
}
else {
/* image not found */
@@ -171,21 +181,37 @@ void ImageTextureNode::compile(SVMCompiler& compiler)
void ImageTextureNode::compile(OSLCompiler& compiler)
{
compiler.parameter("filename", filename.c_str());
- compiler.parameter("color_space", color_space.c_str());
+ if(is_float || color_space != "Color")
+ compiler.parameter("color_space", "Linear");
+ else
+ compiler.parameter("color_space", "sRGB");
compiler.add(this, "node_image_texture");
}
/* Environment Texture */
+static ShaderEnum projection_init()
+{
+ ShaderEnum enm;
+
+ enm.insert("Equirectangular", 0);
+ enm.insert("Mirror Ball", 1);
+
+ return enm;
+}
+
ShaderEnum EnvironmentTextureNode::color_space_enum = color_space_init();
+ShaderEnum EnvironmentTextureNode::projection_enum = projection_init();
EnvironmentTextureNode::EnvironmentTextureNode()
: TextureNode("environment_texture")
{
image_manager = NULL;
slot = -1;
+ is_float = false;
filename = "";
- color_space = ustring("sRGB");
+ color_space = ustring("Color");
+ projection = ustring("Equirectangular");
add_input("Vector", SHADER_SOCKET_VECTOR, ShaderInput::POSITION);
add_output("Color", SHADER_SOCKET_COLOR);
@@ -203,6 +229,7 @@ ShaderNode *EnvironmentTextureNode::clone() const
EnvironmentTextureNode *node = new EnvironmentTextureNode(*this);
node->image_manager = NULL;
node->slot = -1;
+ node->is_float = false;
return node;
}
@@ -214,26 +241,35 @@ void EnvironmentTextureNode::compile(SVMCompiler& compiler)
image_manager = compiler.image_manager;
if(slot == -1)
- slot = image_manager->add_image(filename);
+ slot = image_manager->add_image(filename, is_float);
if(!color_out->links.empty())
compiler.stack_assign(color_out);
if(!alpha_out->links.empty())
compiler.stack_assign(alpha_out);
-
+
if(slot != -1) {
compiler.stack_assign(vector_in);
- if(!tex_mapping.skip())
- tex_mapping.compile(compiler, vector_in->stack_offset, vector_in->stack_offset);
+ int srgb = (is_float || color_space != "Color")? 0: 1;
+ int vector_offset = vector_in->stack_offset;
+
+ if(!tex_mapping.skip()) {
+ vector_offset = compiler.stack_find_offset(SHADER_SOCKET_VECTOR);
+ tex_mapping.compile(compiler, vector_in->stack_offset, vector_offset);
+ }
compiler.add_node(NODE_TEX_ENVIRONMENT,
slot,
compiler.encode_uchar4(
- vector_in->stack_offset,
+ vector_offset,
color_out->stack_offset,
alpha_out->stack_offset,
- color_space_enum[color_space]));
+ srgb),
+ projection_enum[projection]);
+
+ if(vector_offset != vector_in->stack_offset)
+ compiler.stack_clear_offset(vector_in->type, vector_offset);
}
else {
/* image not found */
@@ -249,7 +285,10 @@ void EnvironmentTextureNode::compile(SVMCompiler& compiler)
void EnvironmentTextureNode::compile(OSLCompiler& compiler)
{
compiler.parameter("filename", filename.c_str());
- compiler.parameter("color_space", color_space.c_str());
+ if(is_float || color_space != "Color")
+ compiler.parameter("color_space", "Linear");
+ else
+ compiler.parameter("color_space", "sRGB");
compiler.add(this, "node_environment_texture");
}
@@ -338,11 +377,19 @@ void SkyTextureNode::compile(SVMCompiler& compiler)
if(vector_in->link)
compiler.stack_assign(vector_in);
- if(!tex_mapping.skip())
- tex_mapping.compile(compiler, vector_in->stack_offset, vector_in->stack_offset);
+
+ int vector_offset = vector_in->stack_offset;
+
+ if(!tex_mapping.skip()) {
+ vector_offset = compiler.stack_find_offset(SHADER_SOCKET_VECTOR);
+ tex_mapping.compile(compiler, vector_in->stack_offset, vector_offset);
+ }
compiler.stack_assign(color_out);
- compiler.add_node(NODE_TEX_SKY, vector_in->stack_offset, color_out->stack_offset);
+ compiler.add_node(NODE_TEX_SKY, vector_offset, color_out->stack_offset);
+
+ if(vector_offset != vector_in->stack_offset)
+ compiler.stack_clear_offset(vector_in->type, vector_offset);
}
void SkyTextureNode::compile(OSLCompiler& compiler)
@@ -389,8 +436,12 @@ void GradientTextureNode::compile(SVMCompiler& compiler)
if(vector_in->link) compiler.stack_assign(vector_in);
- if(!tex_mapping.skip())
- tex_mapping.compile(compiler, vector_in->stack_offset, vector_in->stack_offset);
+ int vector_offset = vector_in->stack_offset;
+
+ if(!tex_mapping.skip()) {
+ vector_offset = compiler.stack_find_offset(SHADER_SOCKET_VECTOR);
+ tex_mapping.compile(compiler, vector_in->stack_offset, vector_offset);
+ }
if(!fac_out->links.empty())
compiler.stack_assign(fac_out);
@@ -398,7 +449,10 @@ void GradientTextureNode::compile(SVMCompiler& compiler)
compiler.stack_assign(color_out);
compiler.add_node(NODE_TEX_GRADIENT,
- compiler.encode_uchar4(type_enum[type], vector_in->stack_offset, fac_out->stack_offset, color_out->stack_offset));
+ compiler.encode_uchar4(type_enum[type], vector_offset, fac_out->stack_offset, color_out->stack_offset));
+
+ if(vector_offset != vector_in->stack_offset)
+ compiler.stack_clear_offset(vector_in->type, vector_offset);
}
void GradientTextureNode::compile(OSLCompiler& compiler)
@@ -435,8 +489,12 @@ void NoiseTextureNode::compile(SVMCompiler& compiler)
if(detail_in->link) compiler.stack_assign(detail_in);
if(distortion_in->link) compiler.stack_assign(distortion_in);
- if(!tex_mapping.skip())
- tex_mapping.compile(compiler, vector_in->stack_offset, vector_in->stack_offset);
+ int vector_offset = vector_in->stack_offset;
+
+ if(!tex_mapping.skip()) {
+ vector_offset = compiler.stack_find_offset(SHADER_SOCKET_VECTOR);
+ tex_mapping.compile(compiler, vector_in->stack_offset, vector_offset);
+ }
if(!fac_out->links.empty())
compiler.stack_assign(fac_out);
@@ -444,12 +502,15 @@ void NoiseTextureNode::compile(SVMCompiler& compiler)
compiler.stack_assign(color_out);
compiler.add_node(NODE_TEX_NOISE,
- compiler.encode_uchar4(vector_in->stack_offset, scale_in->stack_offset, detail_in->stack_offset, distortion_in->stack_offset),
+ compiler.encode_uchar4(vector_offset, scale_in->stack_offset, detail_in->stack_offset, distortion_in->stack_offset),
compiler.encode_uchar4(color_out->stack_offset, fac_out->stack_offset));
compiler.add_node(
__float_as_int(scale_in->value.x),
__float_as_int(detail_in->value.x),
__float_as_int(distortion_in->value.x));
+
+ if(vector_offset != vector_in->stack_offset)
+ compiler.stack_clear_offset(vector_in->type, vector_offset);
}
void NoiseTextureNode::compile(OSLCompiler& compiler)
@@ -493,16 +554,23 @@ void VoronoiTextureNode::compile(SVMCompiler& compiler)
if(vector_in->link) compiler.stack_assign(vector_in);
if(scale_in->link) compiler.stack_assign(scale_in);
- if(!tex_mapping.skip())
- tex_mapping.compile(compiler, vector_in->stack_offset, vector_in->stack_offset);
+ int vector_offset = vector_in->stack_offset;
+
+ if(!tex_mapping.skip()) {
+ vector_offset = compiler.stack_find_offset(SHADER_SOCKET_VECTOR);
+ tex_mapping.compile(compiler, vector_in->stack_offset, vector_offset);
+ }
compiler.stack_assign(color_out);
compiler.stack_assign(fac_out);
compiler.add_node(NODE_TEX_VORONOI,
coloring_enum[coloring],
- compiler.encode_uchar4(scale_in->stack_offset, vector_in->stack_offset, fac_out->stack_offset, color_out->stack_offset),
+ compiler.encode_uchar4(scale_in->stack_offset, vector_offset, fac_out->stack_offset, color_out->stack_offset),
__float_as_int(scale_in->value.x));
+
+ if(vector_offset != vector_in->stack_offset)
+ compiler.stack_clear_offset(vector_in->type, vector_offset);
}
void VoronoiTextureNode::compile(OSLCompiler& compiler)
@@ -565,8 +633,12 @@ void MusgraveTextureNode::compile(SVMCompiler& compiler)
if(gain_in->link) compiler.stack_assign(gain_in);
if(scale_in->link) compiler.stack_assign(scale_in);
- if(!tex_mapping.skip())
- tex_mapping.compile(compiler, vector_in->stack_offset, vector_in->stack_offset);
+ int vector_offset = vector_in->stack_offset;
+
+ if(!tex_mapping.skip()) {
+ vector_offset = compiler.stack_find_offset(SHADER_SOCKET_VECTOR);
+ tex_mapping.compile(compiler, vector_in->stack_offset, vector_offset);
+ }
if(!fac_out->links.empty())
compiler.stack_assign(fac_out);
@@ -574,7 +646,7 @@ void MusgraveTextureNode::compile(SVMCompiler& compiler)
compiler.stack_assign(color_out);
compiler.add_node(NODE_TEX_MUSGRAVE,
- compiler.encode_uchar4(type_enum[type], vector_in->stack_offset, color_out->stack_offset, fac_out->stack_offset),
+ compiler.encode_uchar4(type_enum[type], vector_offset, color_out->stack_offset, fac_out->stack_offset),
compiler.encode_uchar4(dimension_in->stack_offset, lacunarity_in->stack_offset, detail_in->stack_offset, offset_in->stack_offset),
compiler.encode_uchar4(gain_in->stack_offset, scale_in->stack_offset));
compiler.add_node(__float_as_int(dimension_in->value.x),
@@ -583,6 +655,9 @@ void MusgraveTextureNode::compile(SVMCompiler& compiler)
__float_as_int(offset_in->value.x));
compiler.add_node(__float_as_int(gain_in->value.x),
__float_as_int(scale_in->value.x));
+
+ if(vector_offset != vector_in->stack_offset)
+ compiler.stack_clear_offset(vector_in->type, vector_offset);
}
void MusgraveTextureNode::compile(OSLCompiler& compiler)
@@ -637,8 +712,12 @@ void WaveTextureNode::compile(SVMCompiler& compiler)
if(dscale_in->link) compiler.stack_assign(dscale_in);
if(vector_in->link) compiler.stack_assign(vector_in);
- if(!tex_mapping.skip())
- tex_mapping.compile(compiler, vector_in->stack_offset, vector_in->stack_offset);
+ int vector_offset = vector_in->stack_offset;
+
+ if(!tex_mapping.skip()) {
+ vector_offset = compiler.stack_find_offset(SHADER_SOCKET_VECTOR);
+ tex_mapping.compile(compiler, vector_in->stack_offset, vector_offset);
+ }
if(!fac_out->links.empty())
compiler.stack_assign(fac_out);
@@ -647,13 +726,16 @@ void WaveTextureNode::compile(SVMCompiler& compiler)
compiler.add_node(NODE_TEX_WAVE,
compiler.encode_uchar4(type_enum[type], color_out->stack_offset, fac_out->stack_offset, dscale_in->stack_offset),
- compiler.encode_uchar4(vector_in->stack_offset, scale_in->stack_offset, detail_in->stack_offset, distortion_in->stack_offset));
+ compiler.encode_uchar4(vector_offset, scale_in->stack_offset, detail_in->stack_offset, distortion_in->stack_offset));
compiler.add_node(
__float_as_int(scale_in->value.x),
__float_as_int(detail_in->value.x),
__float_as_int(distortion_in->value.x),
__float_as_int(dscale_in->value.x));
+
+ if(vector_offset != vector_in->stack_offset)
+ compiler.stack_clear_offset(vector_in->type, vector_offset);
}
void WaveTextureNode::compile(OSLCompiler& compiler)
@@ -690,8 +772,12 @@ void MagicTextureNode::compile(SVMCompiler& compiler)
if(distortion_in->link) compiler.stack_assign(distortion_in);
if(scale_in->link) compiler.stack_assign(scale_in);
- if(!tex_mapping.skip())
- tex_mapping.compile(compiler, vector_in->stack_offset, vector_in->stack_offset);
+ int vector_offset = vector_in->stack_offset;
+
+ if(!tex_mapping.skip()) {
+ vector_offset = compiler.stack_find_offset(SHADER_SOCKET_VECTOR);
+ tex_mapping.compile(compiler, vector_in->stack_offset, vector_offset);
+ }
if(!fac_out->links.empty())
compiler.stack_assign(fac_out);
@@ -700,10 +786,13 @@ void MagicTextureNode::compile(SVMCompiler& compiler)
compiler.add_node(NODE_TEX_MAGIC,
compiler.encode_uchar4(depth, color_out->stack_offset, fac_out->stack_offset),
- compiler.encode_uchar4(vector_in->stack_offset, scale_in->stack_offset, distortion_in->stack_offset));
+ compiler.encode_uchar4(vector_offset, scale_in->stack_offset, distortion_in->stack_offset));
compiler.add_node(
__float_as_int(scale_in->value.x),
__float_as_int(distortion_in->value.x));
+
+ if(vector_offset != vector_in->stack_offset)
+ compiler.stack_clear_offset(vector_in->type, vector_offset);
}
void MagicTextureNode::compile(OSLCompiler& compiler)
@@ -741,8 +830,12 @@ void CheckerTextureNode::compile(SVMCompiler& compiler)
compiler.stack_assign(color2_in);
if(scale_in->link) compiler.stack_assign(scale_in);
- if(!tex_mapping.skip())
- tex_mapping.compile(compiler, vector_in->stack_offset, vector_in->stack_offset);
+ int vector_offset = vector_in->stack_offset;
+
+ if(!tex_mapping.skip()) {
+ vector_offset = compiler.stack_find_offset(SHADER_SOCKET_VECTOR);
+ tex_mapping.compile(compiler, vector_in->stack_offset, vector_offset);
+ }
if(!color_out->links.empty())
compiler.stack_assign(color_out);
@@ -750,9 +843,12 @@ void CheckerTextureNode::compile(SVMCompiler& compiler)
compiler.stack_assign(fac_out);
compiler.add_node(NODE_TEX_CHECKER,
- compiler.encode_uchar4(vector_in->stack_offset, color1_in->stack_offset, color2_in->stack_offset, scale_in->stack_offset),
+ compiler.encode_uchar4(vector_offset, color1_in->stack_offset, color2_in->stack_offset, scale_in->stack_offset),
compiler.encode_uchar4(color_out->stack_offset, fac_out->stack_offset),
__float_as_int(scale_in->value.x));
+
+ if(vector_offset != vector_in->stack_offset)
+ compiler.stack_clear_offset(vector_in->type, vector_offset);
}
void CheckerTextureNode::compile(OSLCompiler& compiler)
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index 338af4ef48a..e0329cb9b1d 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -64,6 +64,7 @@ public:
ImageManager *image_manager;
int slot;
+ bool is_float;
string filename;
ustring color_space;
@@ -78,10 +79,13 @@ public:
ImageManager *image_manager;
int slot;
+ bool is_float;
string filename;
ustring color_space;
+ ustring projection;
static ShaderEnum color_space_enum;
+ static ShaderEnum projection_enum;
};
class SkyTextureNode : public TextureNode {
diff --git a/intern/cycles/render/scene.h b/intern/cycles/render/scene.h
index c251174b607..0a4f0ef5d95 100644
--- a/intern/cycles/render/scene.h
+++ b/intern/cycles/render/scene.h
@@ -92,7 +92,8 @@ public:
device_vector<uint> sobol_directions;
/* images */
- device_vector<uchar4> tex_image[TEX_IMAGE_MAX];
+ device_vector<uchar4> tex_image[TEX_NUM_IMAGES];
+ device_vector<float4> tex_float_image[TEX_NUM_FLOAT_IMAGES];
KernelData data;
};
diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp
index ae666ddfe68..46c6149ab32 100644
--- a/intern/cycles/render/svm.cpp
+++ b/intern/cycles/render/svm.cpp
@@ -161,6 +161,14 @@ int SVMCompiler::stack_find_offset(ShaderSocketType type)
return offset;
}
+void SVMCompiler::stack_clear_offset(ShaderSocketType type, int offset)
+{
+ int size = stack_size(type);
+
+ for(int i = 0; i < size; i++)
+ active_stack.users[offset + i]--;
+}
+
void SVMCompiler::stack_backup(StackBackup& backup, set<ShaderNode*>& done)
{
backup.done = done;
@@ -261,11 +269,7 @@ void SVMCompiler::stack_clear_users(ShaderNode *node, set<ShaderNode*>& done)
all_done = false;
if(all_done) {
- int size = stack_size(output->type);
-
- for(int i = 0; i < size; i++)
- active_stack.users[output->stack_offset + i]--;
-
+ stack_clear_offset(output->type, output->stack_offset);
output->stack_offset = SVM_STACK_INVALID;
foreach(ShaderInput *in, output->links)
@@ -279,11 +283,7 @@ void SVMCompiler::stack_clear_temporary(ShaderNode *node)
{
foreach(ShaderInput *input, node->inputs) {
if(!input->link && input->stack_offset != SVM_STACK_INVALID) {
- int size = stack_size(input->type);
-
- for(int i = 0; i < size; i++)
- active_stack.users[input->stack_offset + i]--;
-
+ stack_clear_offset(input->type, input->stack_offset);
input->stack_offset = SVM_STACK_INVALID;
}
}
@@ -514,14 +514,14 @@ void SVMCompiler::generate_multi_closure(ShaderNode *node, set<ShaderNode*>& don
generate_multi_closure(cl1in->link->parent, done, out1_offset);
if(fin)
- active_stack.users[out1_offset]--;
+ stack_clear_offset(SHADER_SOCKET_FLOAT, out1_offset);
}
if(cl2in->link) {
generate_multi_closure(cl2in->link->parent, done, out2_offset);
if(fin)
- active_stack.users[out2_offset]--;
+ stack_clear_offset(SHADER_SOCKET_FLOAT, out2_offset);
}
}
else {
diff --git a/intern/cycles/render/svm.h b/intern/cycles/render/svm.h
index d66d3816068..d8a1b14d637 100644
--- a/intern/cycles/render/svm.h
+++ b/intern/cycles/render/svm.h
@@ -59,7 +59,10 @@ public:
void stack_assign(ShaderOutput *output);
void stack_assign(ShaderInput *input);
+ int stack_find_offset(ShaderSocketType type);
+ void stack_clear_offset(ShaderSocketType type, int offset);
void stack_link(ShaderInput *input, ShaderOutput *output);
+
void add_node(NodeType type, int a = 0, int b = 0, int c = 0);
void add_node(int a = 0, int b = 0, int c = 0, int d = 0);
void add_node(NodeType type, const float3& f);
@@ -115,7 +118,6 @@ protected:
void stack_clear_temporary(ShaderNode *node);
int stack_size(ShaderSocketType type);
- int stack_find_offset(ShaderSocketType type);
void stack_clear_users(ShaderNode *node, set<ShaderNode*>& done);
bool node_skip_input(ShaderNode *node, ShaderInput *input);
diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py
index 66b774e6301..9175d1f9792 100644
--- a/release/scripts/modules/bpy_extras/object_utils.py
+++ b/release/scripts/modules/bpy_extras/object_utils.py
@@ -86,7 +86,7 @@ def add_object_align_init(context, operator):
return location * rotation
-def object_data_add(context, obdata, operator=None):
+def object_data_add(context, obdata, operator=None, use_active_layer=True):
"""
Add an object using the view context and preference to to initialize the
location, rotation and layer.
@@ -111,7 +111,17 @@ def object_data_add(context, obdata, operator=None):
base = scene.objects.link(obj_new)
base.select = True
+ v3d = None
if context.space_data and context.space_data.type == 'VIEW_3D':
+ v3d = context.space_data
+
+ if use_active_layer:
+ if v3d.local_view:
+ base.layers_from_view(context.space_data)
+ base.layers[scene.active_layer] = True
+ else:
+ base.layers = [True if i == scene.active_layer else False for i in range(len(scene.layers))]
+ if v3d:
base.layers_from_view(context.space_data)
obj_new.matrix_world = add_object_align_init(context, operator)
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index a43d26b2c89..8c02e845071 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -446,6 +446,7 @@ class MeshFace(StructRNA):
ord_ind(verts[3], verts[0]),
)
+
class MeshPolygon(StructRNA):
__slots__ = ()
@@ -453,7 +454,7 @@ class MeshPolygon(StructRNA):
def edge_keys(self):
verts = self.vertices[:]
vlen = len(self.vertices)
- return [ord_ind(verts[i], verts[(i+1) % vlen]) for i in range(vlen)]
+ return [ord_ind(verts[i], verts[(i + 1) % vlen]) for i in range(vlen)]
@property
def loops(self):
@@ -461,6 +462,7 @@ class MeshPolygon(StructRNA):
end = start + self.loop_total
return range(start, end)
+
class Text(bpy_types.ID):
__slots__ = ()
diff --git a/release/scripts/modules/sys_info.py b/release/scripts/modules/sys_info.py
index 10aba96afd0..0fa80a8f855 100644
--- a/release/scripts/modules/sys_info.py
+++ b/release/scripts/modules/sys_info.py
@@ -57,66 +57,66 @@ def write_sysinfo(op):
else:
output = bpy.data.texts.new(name=output_filename)
- header = '= Blender {} System Information =\n'.format(bpy.app.version_string)
- lilies = '{}\n\n'.format(len(header) * '=')
- firstlilies = '{}\n'.format(len(header) * '=')
+ header = "= Blender %s System Information =\n" % bpy.app.version_string
+ lilies = "%s\n\n" % (len(header) * "=")
+ firstlilies = "%s\n" % (len(header) * "=")
output.write(firstlilies)
output.write(header)
output.write(lilies)
# build info
- output.write('\nBlender:\n')
+ output.write("\nBlender:\n")
output.write(lilies)
- output.write('version {}, revision {}. {}\n'.format(bpy.app.version_string, bpy.app.build_revision, bpy.app.build_type))
- output.write('build date: {}, {}\n'.format(bpy.app.build_date, bpy.app.build_time))
- output.write('platform: {}\n'.format(bpy.app.build_platform))
- output.write('binary path: {}\n'.format(bpy.app.binary_path))
- output.write('build cflags: {}\n'.format(bpy.app.build_cflags))
- output.write('build cxxflags: {}\n'.format(bpy.app.build_cxxflags))
- output.write('build linkflags: {}\n'.format(bpy.app.build_linkflags))
- output.write('build system: {}\n'.format(bpy.app.build_system))
+ output.write("version %s, revision %r. %r\n" % (bpy.app.version_string, bpy.app.build_revision, bpy.app.build_type))
+ output.write("build date: %r, %r\n" % (bpy.app.build_date, bpy.app.build_time))
+ output.write("platform: %r\n" % (bpy.app.build_platform))
+ output.write("binary path: %r\n" % (bpy.app.binary_path))
+ output.write("build cflags: %r\n" % (bpy.app.build_cflags))
+ output.write("build cxxflags: %r\n" % (bpy.app.build_cxxflags))
+ output.write("build linkflags: %r\n" % (bpy.app.build_linkflags))
+ output.write("build system: %r\n" % (bpy.app.build_system))
# python info
- output.write('\nPython:\n')
+ output.write("\nPython:\n")
output.write(lilies)
- output.write('version: {}\n'.format(sys.version))
- output.write('paths:\n')
+ output.write("version: %s\n" % (sys.version))
+ output.write("paths:\n")
for p in sys.path:
- output.write('\t{}\n'.format(p))
+ output.write("\t%r\n" % (p))
- output.write('\nDirectories:\n')
+ output.write("\nDirectories:\n")
output.write(lilies)
- output.write('scripts: {}\n'.format(bpy.utils.script_paths()))
- output.write('user scripts: {}\n'.format(bpy.utils.user_script_path()))
- output.write('datafiles: {}\n'.format(bpy.utils.user_resource('DATAFILES')))
- output.write('config: {}\n'.format(bpy.utils.user_resource('CONFIG')))
- output.write('scripts : {}\n'.format(bpy.utils.user_resource('SCRIPTS')))
- output.write('autosave: {}\n'.format(bpy.utils.user_resource('AUTOSAVE')))
- output.write('tempdir: {}\n'.format(bpy.app.tempdir))
-
- output.write('\nFFmpeg:\n')
+ output.write("scripts: %r\n" % (bpy.utils.script_paths()))
+ output.write("user scripts: %r\n" % (bpy.utils.user_script_path()))
+ output.write("datafiles: %r\n" % (bpy.utils.user_resource('DATAFILES')))
+ output.write("config: %r\n" % (bpy.utils.user_resource('CONFIG')))
+ output.write("scripts : %r\n" % (bpy.utils.user_resource('SCRIPTS')))
+ output.write("autosave: %r\n" % (bpy.utils.user_resource('AUTOSAVE')))
+ output.write("tempdir: %r\n" % (bpy.app.tempdir))
+
+ output.write("\nFFmpeg:\n")
output.write(lilies)
ffmpeg = bpy.app.ffmpeg
if ffmpeg.supported:
for lib in ['avcodec', 'avdevice', 'avformat', 'avutil', 'swscale']:
- output.write('{}:{}{}\n'.format(lib, " " * (10 - len(lib)),
- getattr(ffmpeg, lib + '_version_string')))
+ output.write("%r:%r%r\n" % (lib, " " * (10 - len(lib)),
+ getattr(ffmpeg, lib + "_version_string")))
else:
- output.write('Blender was built without FFmpeg support\n')
+ output.write("Blender was built without FFmpeg support\n")
if bpy.app.background:
- output.write('\nOpenGL: missing, background mode\n')
+ output.write("\nOpenGL: missing, background mode\n")
else:
- output.write('\nOpenGL\n')
+ output.write("\nOpenGL\n")
output.write(lilies)
- output.write('renderer:\t{}\n'.format(bgl.glGetString(bgl.GL_RENDERER)))
- output.write('vendor:\t\t{}\n'.format(bgl.glGetString(bgl.GL_VENDOR)))
- output.write('version:\t{}\n'.format(bgl.glGetString(bgl.GL_VERSION)))
- output.write('extensions:\n')
+ output.write("renderer:\t%r\n" % (bgl.glGetString(bgl.GL_RENDERER)))
+ output.write("vendor:\t\t%r\n" % (bgl.glGetString(bgl.GL_VENDOR)))
+ output.write("version:\t%r\n" % (bgl.glGetString(bgl.GL_VERSION)))
+ output.write("extensions:\n")
glext = bgl.glGetString(bgl.GL_EXTENSIONS)
glext = textWrap(glext, 70)
for l in glext:
- output.write('\t\t{}\n'.format(l))
+ output.write("\t\t%r\n" % (l))
op.report({'INFO'}, "System information generated in 'system-info.txt'")
diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py
index d26a7728af1..2689cfda8eb 100644
--- a/release/scripts/startup/bl_operators/anim.py
+++ b/release/scripts/startup/bl_operators/anim.py
@@ -67,15 +67,16 @@ class ANIM_OT_keying_set_export(Operator):
scene = context.scene
ks = scene.keying_sets.active
- f.write("# Keying Set: %s\n" % ks.name)
+ f.write("# Keying Set: %s\n" % ks.bl_idname)
f.write("import bpy\n\n")
- # XXX, why not current scene?
- f.write("scene= bpy.data.scenes[0]\n\n")
+ f.write("scene = bpy.context.scene\n\n")
# Add KeyingSet and set general settings
f.write("# Keying Set Level declarations\n")
- f.write("ks= scene.keying_sets.new(name=\"%s\")\n" % ks.name)
+ f.write("ks = scene.keying_sets.new(idname=\"%s\", name=\"%s\")\n"
+ "" % (ks.bl_idname, ks.bl_label))
+ f.write("ks.bl_description = \"%s\"\n" % ks.bl_description)
if not ks.is_path_absolute:
f.write("ks.is_path_absolute = False\n")
diff --git a/release/scripts/startup/bl_operators/image.py b/release/scripts/startup/bl_operators/image.py
index 4c04aa3b7f3..754e993dacb 100644
--- a/release/scripts/startup/bl_operators/image.py
+++ b/release/scripts/startup/bl_operators/image.py
@@ -67,7 +67,7 @@ class EditExternally(Operator):
self.report({'ERROR'}, "Image path not set")
return {'CANCELLED'}
- if not os.path.exists(filepath):
+ if not os.path.exists(filepath) or not os.path.isfile(filepath):
self.report({'ERROR'},
"Image path %r not found, image may be packed or "
"unsaved" % filepath)
diff --git a/release/scripts/startup/bl_operators/uvcalc_follow_active.py b/release/scripts/startup/bl_operators/uvcalc_follow_active.py
index 0df86a3869e..d2a5d83c188 100644
--- a/release/scripts/startup/bl_operators/uvcalc_follow_active.py
+++ b/release/scripts/startup/bl_operators/uvcalc_follow_active.py
@@ -54,7 +54,7 @@ def extend(obj, operator, EXTEND_MODE):
def face_edge_vs(vi):
vlen = len(vi)
- return [(vi[i], vi[(i+1) % vlen]) for i in range(vlen)]
+ return [(vi[i], vi[(i + 1) % vlen]) for i in range(vlen)]
vidx_source = face_source.vertices
vidx_target = face_target.vertices
diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py
index fb365ea1fa4..b8e531dd729 100644
--- a/release/scripts/startup/bl_ui/properties_data_curve.py
+++ b/release/scripts/startup/bl_ui/properties_data_curve.py
@@ -197,7 +197,6 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
layout.prop(curve, "path_duration", text="Frames")
layout.prop(curve, "eval_time")
-
# these are for paths only
row = layout.row()
row.prop(curve, "use_path_follow")
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index f3e4942f732..e3d62250609 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -25,6 +25,7 @@ class ModifierButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "modifier"
+ bl_options = {'HIDE_HEADER'}
class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
@@ -126,7 +127,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
split = layout.split()
split.prop(md, "use_even_offset")
split.prop(md, "use_distance_offset")
- # -- end
+ # -- end
layout.label(text="Limit Method:")
layout.row().prop(md, "limit_method", expand=True)
diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py
index 68c00691122..c1b49d087ca 100644
--- a/release/scripts/startup/bl_ui/properties_object_constraint.py
+++ b/release/scripts/startup/bl_ui/properties_object_constraint.py
@@ -822,6 +822,7 @@ class ConstraintButtonsPanel():
class OBJECT_PT_constraints(ConstraintButtonsPanel, Panel):
bl_label = "Object Constraints"
bl_context = "constraint"
+ bl_options = {'HIDE_HEADER'}
@classmethod
def poll(cls, context):
@@ -846,6 +847,7 @@ class OBJECT_PT_constraints(ConstraintButtonsPanel, Panel):
class BONE_PT_constraints(ConstraintButtonsPanel, Panel):
bl_label = "Bone Constraints"
bl_context = "bone_constraint"
+ bl_options = {'HIDE_HEADER'}
@classmethod
def poll(cls, context):
diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py
index 363b0f20428..d334671292a 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fluid.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py
@@ -42,14 +42,14 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
md = context.fluid
fluid = md.settings
- row = layout.row()
+ col = layout.column()
if fluid is None:
- row.label("Built without fluids")
+ col.label("Built without fluids")
return
- row.prop(fluid, "type")
+ col.prop(fluid, "type")
if fluid.type not in {'NONE', 'DOMAIN', 'PARTICLE', 'FLUID'}:
- row.prop(fluid, "use", text="")
+ col.prop(fluid, "use")
layout = layout.column()
if fluid.type not in {'NONE', 'DOMAIN', 'PARTICLE', 'FLUID'}:
@@ -134,15 +134,11 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
col.prop(fluid, "inflow_velocity", text="")
elif fluid.type == 'OUTFLOW':
- split = layout.split()
-
- col = split.column()
+ col = layout.column()
col.label(text="Volume Initialization:")
col.prop(fluid, "volume_initialization", text="")
col.prop(fluid, "use_animated_mesh")
- split.column()
-
elif fluid.type == 'PARTICLE':
split = layout.split()
diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py
index 7879f15270a..1c78549c086 100644
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@ -115,7 +115,8 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, Panel):
row = layout.row()
col = row.column()
- col.prop(ks, "name")
+ col.prop(ks, "bl_label")
+ col.prop(ks, "bl_description")
subcol = col.column()
subcol.operator_context = 'INVOKE_DEFAULT'
diff --git a/release/scripts/startup/bl_ui/properties_world.py b/release/scripts/startup/bl_ui/properties_world.py
index 23f35d6d1e9..76d70aafc2e 100644
--- a/release/scripts/startup/bl_ui/properties_world.py
+++ b/release/scripts/startup/bl_ui/properties_world.py
@@ -49,16 +49,17 @@ class WORLD_PT_context_world(WorldButtonsPanel, Panel):
scene = context.scene
world = context.world
space = context.space_data
+ rd = context.scene.render
texture_count = world and len(world.texture_slots.keys())
- split = layout.split(percentage=0.65)
+ split = layout.split(percentage=0.85)
if scene:
split.template_ID(scene, "world", new="world.new")
elif world:
split.template_ID(space, "pin_id")
- if texture_count:
+ if texture_count and rd.engine != 'CYCLES':
split.label(text=str(texture_count), icon='TEXTURE')
diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py
index b8a205dc662..72fee8d4c2e 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -298,7 +298,11 @@ class CLIP_PT_tools_orientation(Panel):
settings = sc.clip.tracking.settings
col = layout.column(align=True)
- col.operator("clip.set_floor")
+ row = col.row()
+ props = row.operator("clip.set_plane", text="Floor")
+ props.plane = 'FLOOR'
+ props = row.operator("clip.set_plane", text="Wall")
+ props.plane = 'WALL'
col.operator("clip.set_origin")
row = col.row()
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 809e78050c2..fc176578944 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -527,10 +527,10 @@ class VIEW3D_MT_select_edit_mesh(Menu):
layout.separator()
- layout.operator("mesh.select_by_number_vertices", text = "By Number of Verts")
+ layout.operator("mesh.select_by_number_vertices", text="By Number of Verts")
if context.scene.tool_settings.mesh_select_mode[2] == False:
layout.operator("mesh.select_non_manifold", text="Non Manifold")
- layout.operator("mesh.select_loose_verts", text = "Loose Verts/Edges")
+ layout.operator("mesh.select_loose_verts", text="Loose Verts/Edges")
layout.operator("mesh.select_similar", text="Similar")
layout.separator()
@@ -1032,7 +1032,7 @@ class VIEW3D_MT_object_game(Menu):
layout.operator("object.game_property_clear")
-
+
# ********** Brush menu **********
class VIEW3D_MT_brush(Menu):
bl_label = "Brush"
diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py
index 1caf7c43983..3527ece2bd3 100644
--- a/release/scripts/startup/keyingsets_builtins.py
+++ b/release/scripts/startup/keyingsets_builtins.py
@@ -38,8 +38,20 @@ from bpy.types import KeyingSetInfo
# Built-In KeyingSets
+# "Defines"
+# Keep these in sync with those in ED_keyframing.h!
+ANIM_KS_LOCATION_ID = "Location"
+ANIM_KS_ROTATION_ID = "Rotation"
+ANIM_KS_SCALING_ID = "Scaling"
+ANIM_KS_LOC_ROT_SCALE_ID = "LocRotScale"
+ANIM_KS_AVAILABLE_ID = "Available"
+ANIM_KS_WHOLE_CHARACTER_ID = "Whole Character"
+
+
# Location
class BUILTIN_KSI_Location(KeyingSetInfo):
+ """Insert a keyframe on each of the location channels"""
+ bl_idname = ANIM_KS_LOCATION_ID
bl_label = "Location"
# poll - use predefined callback for selected bones/objects
@@ -54,6 +66,8 @@ class BUILTIN_KSI_Location(KeyingSetInfo):
# Rotation
class BUILTIN_KSI_Rotation(KeyingSetInfo):
+ """Insert a keyframe on each of the rotation channels"""
+ bl_idname = ANIM_KS_ROTATION_ID
bl_label = "Rotation"
# poll - use predefined callback for selected bones/objects
@@ -62,12 +76,14 @@ class BUILTIN_KSI_Rotation(KeyingSetInfo):
# iterator - use callback for selected bones/objects
iterator = keyingsets_utils.RKS_ITER_selected_item
- # generator - use callback for location
+ # generator - use callback for rotation
generate = keyingsets_utils.RKS_GEN_rotation
# Scale
class BUILTIN_KSI_Scaling(KeyingSetInfo):
+ """Insert a keyframe on each of the scale channels"""
+ bl_idname = ANIM_KS_SCALING_ID
bl_label = "Scaling"
# poll - use predefined callback for selected bones/objects
@@ -76,7 +92,7 @@ class BUILTIN_KSI_Scaling(KeyingSetInfo):
# iterator - use callback for selected bones/objects
iterator = keyingsets_utils.RKS_ITER_selected_item
- # generator - use callback for location
+ # generator - use callback for scaling
generate = keyingsets_utils.RKS_GEN_scaling
# ------------
@@ -84,6 +100,7 @@ class BUILTIN_KSI_Scaling(KeyingSetInfo):
# LocRot
class BUILTIN_KSI_LocRot(KeyingSetInfo):
+ """Insert a keyframe on each of the location and rotation channels"""
bl_label = "LocRot"
# poll - use predefined callback for selected bones/objects
@@ -102,6 +119,7 @@ class BUILTIN_KSI_LocRot(KeyingSetInfo):
# LocScale
class BUILTIN_KSI_LocScale(KeyingSetInfo):
+ """Insert a keyframe on each of the location and scale channels"""
bl_label = "LocScale"
# poll - use predefined callback for selected bones/objects
@@ -120,6 +138,10 @@ class BUILTIN_KSI_LocScale(KeyingSetInfo):
# LocRotScale
class BUILTIN_KSI_LocRotScale(KeyingSetInfo):
+ """
+ Insert a keyframe on each of the location, rotation, and scale channels
+ """
+ bl_idname = ANIM_KS_LOC_ROT_SCALE_ID
bl_label = "LocRotScale"
# poll - use predefined callback for selected bones/objects
@@ -140,6 +162,7 @@ class BUILTIN_KSI_LocRotScale(KeyingSetInfo):
# RotScale
class BUILTIN_KSI_RotScale(KeyingSetInfo):
+ """Insert a keyframe on each of the rotation and scale channels"""
bl_label = "RotScale"
# poll - use predefined callback for selected bones/objects
@@ -160,6 +183,10 @@ class BUILTIN_KSI_RotScale(KeyingSetInfo):
# Location
class BUILTIN_KSI_VisualLoc(KeyingSetInfo):
+ """
+ Insert a keyframe on each of the location channels, taking into account
+ effects of constraints and relationships
+ """
bl_label = "Visual Location"
bl_options = {'INSERTKEY_VISUAL'}
@@ -176,6 +203,10 @@ class BUILTIN_KSI_VisualLoc(KeyingSetInfo):
# Rotation
class BUILTIN_KSI_VisualRot(KeyingSetInfo):
+ """
+ Insert a keyframe on each of the rotation channels, taking into account
+ effects of constraints and relationships
+ """
bl_label = "Visual Rotation"
bl_options = {'INSERTKEY_VISUAL'}
@@ -192,6 +223,10 @@ class BUILTIN_KSI_VisualRot(KeyingSetInfo):
# VisualLocRot
class BUILTIN_KSI_VisualLocRot(KeyingSetInfo):
+ """
+ Insert a keyframe on each of the location and rotation channels,
+ taking into account effects of constraints and relationships
+ """
bl_label = "Visual LocRot"
bl_options = {'INSERTKEY_VISUAL'}
@@ -214,6 +249,8 @@ class BUILTIN_KSI_VisualLocRot(KeyingSetInfo):
# Available
class BUILTIN_KSI_Available(KeyingSetInfo):
+ """Insert a keyframe on each of the already existing F-Curves"""
+ bl_idname = ANIM_KS_AVAILABLE_ID
bl_label = "Available"
# poll - selected objects or selected object with animation data
@@ -236,6 +273,11 @@ class BUILTIN_KSI_Available(KeyingSetInfo):
# All properties that are likely to get animated in a character rig
class BUILTIN_KSI_WholeCharacter(KeyingSetInfo):
+ """
+ Insert a keyframe for all properties that are likely to get animated in a
+ character rig (useful when blocking out a shot)
+ """
+ bl_idname = ANIM_KS_WHOLE_CHARACTER_ID
bl_label = "Whole Character"
# these prefixes should be avoided, as they are not really bones
@@ -379,6 +421,7 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo):
# Delta Location
class BUILTIN_KSI_DeltaLocation(KeyingSetInfo):
+ """Insert keyframes for additional location offset"""
bl_label = "Delta Location"
# poll - selected objects only (and only if active object in object mode)
@@ -404,6 +447,7 @@ class BUILTIN_KSI_DeltaLocation(KeyingSetInfo):
# Delta Rotation
class BUILTIN_KSI_DeltaRotation(KeyingSetInfo):
+ """Insert keyframes for additional rotation offset"""
bl_label = "Delta Rotation"
# poll - selected objects only (and only if active object in object mode)
@@ -437,6 +481,7 @@ class BUILTIN_KSI_DeltaRotation(KeyingSetInfo):
# Delta Scale
class BUILTIN_KSI_DeltaScale(KeyingSetInfo):
+ """Insert keyframes for additional scaling factor"""
bl_label = "Delta Scale"
# poll - selected objects only (and only if active object in object mode)
diff --git a/source/blender/avi/intern/avi.c b/source/blender/avi/intern/avi.c
index 1da93d5ed50..cc4d6b41f98 100644
--- a/source/blender/avi/intern/avi.c
+++ b/source/blender/avi/intern/avi.c
@@ -197,13 +197,12 @@ AviError AVI_print_error (AviError in_error)
return in_error;
}
-/*
+#if 0
void AVI_set_debug (int mode)
{
AVI_DEBUG= mode;
}
-*/
-/*
+
int AVI_is_avi (char *name)
{
FILE *fp;
@@ -224,7 +223,7 @@ int AVI_is_avi (char *name)
fclose(fp);
return ret;
}
-*/
+#endif
int AVI_is_avi (const char *name)
{
@@ -659,7 +658,7 @@ void *AVI_read_frame (AviMovie *movie, AviFormat format, int frame, int stream)
void *buffer;
/* Retrieve the record number of the desired frame in the index
- If a chunk has Size 0 we need to rewind to previous frame */
+ * If a chunk has Size 0 we need to rewind to previous frame */
while(rewind && frame > -1) {
i=0;
cur_frame=-1;
@@ -798,13 +797,13 @@ AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...)
movie->streams[i].sh.bottom = 0;
if (movie->streams[i].sh.Type == FCC("vids")) {
-/*
+#if 0
if (movie->streams[i].format == AVI_FORMAT_MJPEG) {
movie->streams[i].sf = MEM_mallocN (sizeof(AviBitmapInfoHeader)
+ sizeof(AviMJPEGUnknown),"moviestreamformatL");
movie->streams[i].sf_size = sizeof(AviBitmapInfoHeader) + sizeof(AviMJPEGUnknown);
} else {
-*/
+#endif
movie->streams[i].sf = MEM_mallocN (sizeof(AviBitmapInfoHeader), "moviestreamformatS");
movie->streams[i].sf_size = sizeof(AviBitmapInfoHeader);
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index d7b441e70e1..1e242deece4 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -59,12 +59,12 @@ void BLF_size(int fontid, int size, int dpi);
* to enable this.
*
* The order of the matrix is like GL:
-
- | m[0] m[4] m[8] m[12] |
- | m[1] m[5] m[9] m[13] |
- | m[2] m[6] m[10] m[14] |
- | m[3] m[7] m[11] m[15] |
-
+ *
+ * | m[0] m[4] m[8] m[12] |
+ * | m[1] m[5] m[9] m[13] |
+ * | m[2] m[6] m[10] m[14] |
+ * | m[3] m[7] m[11] m[15] |
+ *
*/
void BLF_matrix(int fontid, const double m[16]);
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index dff783c1b9b..87ba2092437 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -29,38 +29,38 @@
#define __BKE_DERIVEDMESH_H__
/*
- Basic design of the DerivedMesh system:
-
- DerivedMesh is a common set of interfaces for mesh systems.
-
- There are three main mesh data structures in Blender: Mesh, CDDM, and BMesh.
- These, and a few others, all implement DerivedMesh interfaces,
- which contains unified drawing interfaces, a few utility interfaces,
- and a bunch of read-only interfaces intended mostly for conversion from
- one format to another.
-
- All Mesh structures in blender make use of CustomData, which is used to store
- per-element attributes and interpolate them (e.g. uvs, vcols, vgroups, etc).
-
- Mesh is the "serialized" structure, used for storing object-mode mesh data
- and also for saving stuff to disk. It's interfaces are also what DerivedMesh
- uses to communicate with.
-
- CDDM is a little mesh library, that uses Mesh data structures in the backend.
- It's mostly used for modifiers, and has the advantages of not taking much
- resources.
-
- BMesh is a full-on brep, used for editmode, some modifiers, etc. It's much
- more capable (if memory-intensive) then CDDM.
-
- DerivedMesh is somewhat hackish. Many places assumes that a DerivedMesh is
- a CDDM (most of the time by simply copying it and converting it to one).
- CDDM is the original structure for modifiers, but has since been superseded
- by BMesh, at least for the foreseeable future.
-*/
-
-/*
- * Note: This sturcture is read-only, for all practical purposes.
+ * Basic design of the DerivedMesh system:
+ *
+ * DerivedMesh is a common set of interfaces for mesh systems.
+ *
+ * There are three main mesh data structures in Blender: Mesh, CDDM, and BMesh.
+ * These, and a few others, all implement DerivedMesh interfaces,
+ * which contains unified drawing interfaces, a few utility interfaces,
+ * and a bunch of read-only interfaces intended mostly for conversion from
+ * one format to another.
+ *
+ * All Mesh structures in blender make use of CustomData, which is used to store
+ * per-element attributes and interpolate them (e.g. uvs, vcols, vgroups, etc).
+ *
+ * Mesh is the "serialized" structure, used for storing object-mode mesh data
+ * and also for saving stuff to disk. It's interfaces are also what DerivedMesh
+ * uses to communicate with.
+ *
+ * CDDM is a little mesh library, that uses Mesh data structures in the backend.
+ * It's mostly used for modifiers, and has the advantages of not taking much
+ * resources.
+ *
+ * BMesh is a full-on brep, used for editmode, some modifiers, etc. It's much
+ * more capable (if memory-intensive) then CDDM.
+ *
+ * DerivedMesh is somewhat hackish. Many places assumes that a DerivedMesh is
+ * a CDDM (most of the time by simply copying it and converting it to one).
+ * CDDM is the original structure for modifiers, but has since been superseded
+ * by BMesh, at least for the foreseeable future.
+ */
+
+/*
+ * Note: This structure is read-only, for all practical purposes.
* At some point in the future, we may want to consider
* creating a replacement structure that implements a proper
* abstract mesh kernel interface. Or, we can leave this
@@ -98,9 +98,9 @@ struct PBVH;
#define SUB_ELEMS_FACE 50
/*
-Note: all mface interfaces now officially operate on tesselated data.
- Also, the mface origindex layer indexes mpolys, not mfaces.
-*/
+ * Note: all mface interfaces now officially operate on tesselated data.
+ * Also, the mface origindex layer indexes mpolys, not mfaces.
+ */
typedef struct DMGridData {
float co[3];
@@ -112,12 +112,41 @@ typedef struct DMGridAdjacency {
int rotation[4];
} DMGridAdjacency;
+/* keep in sync with MFace/MPoly types */
+typedef struct DMFlagMat {
+ short mat_nr;
+ char flag;
+} DMFlagMat;
+
typedef enum DerivedMeshType {
DM_TYPE_CDDM,
DM_TYPE_EDITBMESH,
DM_TYPE_CCGDM
} DerivedMeshType;
+typedef enum DMDrawOption {
+ /* the element is hidden or otherwise non-drawable */
+ DM_DRAW_OPTION_SKIP = 0,
+ /* normal drawing */
+ DM_DRAW_OPTION_NORMAL = 1,
+ /* draw, but don't set the color from mcol */
+ DM_DRAW_OPTION_NO_MCOL = 2,
+ /* used in drawMappedFaces, use GL stipple for the face */
+ DM_DRAW_OPTION_STIPPLE = 3,
+} DMDrawOption;
+
+/* Drawing callback types */
+typedef int (*DMSetMaterial)(int mat_nr, void *attribs);
+typedef int (*DMCompareDrawOptions)(void *userData, int cur_index, int next_index);
+typedef void (*DMSetDrawInterpOptions)(void *userData, int index, float t);
+typedef DMDrawOption (*DMSetDrawOptions)(void *userData, int index);
+typedef DMDrawOption (*DMSetDrawOptionsTex)(struct MTFace *tface, int has_vcol, int matnr);
+
+typedef enum DMDrawFlag {
+ DM_DRAW_USE_COLORS = 1,
+ DM_DRAW_ALWAYS_SMOOTH = 2
+} DMDrawFlag;
+
typedef struct DerivedMesh DerivedMesh;
struct DerivedMesh {
/* Private DerivedMesh data, only for internal DerivedMesh use */
@@ -199,8 +228,8 @@ struct DerivedMesh {
void *(*getEdgeDataArray)(DerivedMesh *dm, int type);
void *(*getTessFaceDataArray)(DerivedMesh *dm, int type);
- /*retrieves the base CustomData structures for
- verts/edges/tessfaces/loops/facdes*/
+ /* retrieves the base CustomData structures for
+ * verts/edges/tessfaces/loops/facdes*/
CustomData *(*getVertDataLayout)(DerivedMesh *dm);
CustomData *(*getEdgeDataLayout)(DerivedMesh *dm);
CustomData *(*getTessFaceDataLayout)(DerivedMesh *dm);
@@ -218,6 +247,8 @@ struct DerivedMesh {
DMGridData **(*getGridData)(DerivedMesh *dm);
DMGridAdjacency *(*getGridAdjacency)(DerivedMesh *dm);
int *(*getGridOffset)(DerivedMesh *dm);
+ DMFlagMat *(*getGridFlagMats)(DerivedMesh *dm);
+
/* Iterate over each mapped vertex in the derived mesh, calling the
* given function with the original vert and the mapped vert's new
@@ -300,33 +331,21 @@ struct DerivedMesh {
* Also called for *final* editmode DerivedMeshes
*/
void (*drawFacesSolid)(DerivedMesh *dm, float (*partial_redraw_planes)[4],
- int fast, int (*setMaterial)(int, void *attribs));
-
- /* Draw all faces
- * o If useTwoSided, draw front and back using col arrays
- * o col1,col2 are arrays of length numFace*4 of 4 component colors
- * in ABGR format, and should be passed as per-face vertex color.
- */
- void (*drawFacesColored)(DerivedMesh *dm, int useTwoSided,
- unsigned char *col1, unsigned char *col2);
+ int fast, DMSetMaterial setMaterial);
/* Draw all faces using MTFace
* o Drawing options too complicated to enumerate, look at code.
*/
void (*drawFacesTex)(DerivedMesh *dm,
- int (*setDrawOptions)(struct MTFace *tface,
- int has_vcol, int matnr),
- int (*compareDrawOptions)(void *userData,
- int cur_index,
- int next_index),
- void *userData);
+ DMSetDrawOptionsTex setDrawOptions,
+ DMCompareDrawOptions compareDrawOptions,
+ void *userData);
/* Draw all faces with GLSL materials
* o setMaterial is called for every different material nr
* o Only if setMaterial returns true
*/
- void (*drawFacesGLSL)(DerivedMesh *dm,
- int (*setMaterial)(int, void *attribs));
+ void (*drawFacesGLSL)(DerivedMesh *dm, DMSetMaterial setMaterial);
/* Draw mapped faces (no color, or texture)
* o Only if !setDrawOptions or
@@ -342,23 +361,18 @@ struct DerivedMesh {
* smooth shaded.
*/
void (*drawMappedFaces)(DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index,
- int *drawSmooth_r),
- int (*setMaterial)(int, void *attribs),
- int (*compareDrawOptions)(void *userData,
- int cur_index,
- int next_index),
- void *userData, int useColors);
+ DMSetDrawOptions setDrawOptions,
+ DMSetMaterial setMaterial,
+ DMCompareDrawOptions compareDrawOptions,
+ void *userData,
+ DMDrawFlag flag);
/* Draw mapped faces using MTFace
* o Drawing options too complicated to enumerate, look at code.
*/
void (*drawMappedFacesTex)(DerivedMesh *dm,
- int (*setDrawOptions)(void *userData,
- int index),
- int (*compareDrawOptions)(void *userData,
- int cur_index,
- int next_index),
+ DMSetDrawOptions setDrawOptions,
+ DMCompareDrawOptions compareDrawOptions,
void *userData);
/* Draw mapped faces with GLSL materials
@@ -367,8 +381,8 @@ struct DerivedMesh {
* o Only if setMaterial and setDrawOptions return true
*/
void (*drawMappedFacesGLSL)(DerivedMesh *dm,
- int (*setMaterial)(int, void *attribs),
- int (*setDrawOptions)(void *userData, int index),
+ DMSetMaterial setMaterial,
+ DMSetDrawOptions setDrawOptions,
void *userData);
/* Draw mapped edges as lines
@@ -376,7 +390,7 @@ struct DerivedMesh {
* returns true
*/
void (*drawMappedEdges)(DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index),
+ DMSetDrawOptions setDrawOptions,
void *userData);
/* Draw mapped edges as lines with interpolation values
@@ -387,11 +401,8 @@ struct DerivedMesh {
* NOTE: This routine is optional!
*/
void (*drawMappedEdgesInterp)(DerivedMesh *dm,
- int (*setDrawOptions)(void *userData,
- int index),
- void (*setDrawInterpOptions)(void *userData,
- int index,
- float t),
+ DMSetDrawOptions setDrawOptions,
+ DMSetDrawInterpOptions setDrawInterpOptions,
void *userData);
/* Draw all faces with materials
@@ -576,8 +587,8 @@ void DM_interp_poly_data(struct DerivedMesh *source, struct DerivedMesh *dest,
void vDM_ColorBand_store(struct ColorBand *coba);
/* Simple function to get me->totvert amount of vertices/normals,
- correctly deformed and subsurfered. Needed especially when vertexgroups are involved.
- In use now by vertex/weigt paint and particles */
+ * correctly deformed and subsurfered. Needed especially when vertexgroups are involved.
+ * In use now by vertex/weight paint and particles */
float *mesh_get_mapped_verts_nors(struct Scene *scene, struct Object *ob);
/* */
@@ -625,7 +636,7 @@ void makeDerivedMesh(struct Scene *scene, struct Object *ob, struct BMEditMesh *
CustomDataMask dataMask, int build_shapekey_layers);
/* returns an array of deform matrices for crazyspace correction, and the
- number of modifiers left */
+ * number of modifiers left */
int editbmesh_get_first_deform_matrices(struct Scene *, struct Object *, struct BMEditMesh *em,
float (**deformmats)[3][3], float (**deformcos)[3]);
diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h
index fb4a44b2c80..59dc2f2fc70 100644
--- a/source/blender/blenkernel/BKE_animsys.h
+++ b/source/blender/blenkernel/BKE_animsys.h
@@ -81,7 +81,7 @@ void BKE_relink_animdata(struct AnimData *adt);
/* KeyingSets API */
/* Used to create a new 'custom' KeyingSet for the user, that will be automatically added to the stack */
-struct KeyingSet *BKE_keyingset_add(struct ListBase *list, const char name[], short flag, short keyingflag);
+struct KeyingSet *BKE_keyingset_add(struct ListBase *list, const char idname[], const char name[], short flag, short keyingflag);
/* Add a path to a KeyingSet */
struct KS_Path *BKE_keyingset_add_path(struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, short flag, short groupmode);
diff --git a/source/blender/blenkernel/BKE_bmfont_types.h b/source/blender/blenkernel/BKE_bmfont_types.h
index 73ef0c3a2c3..a5be0be6997 100644
--- a/source/blender/blenkernel/BKE_bmfont_types.h
+++ b/source/blender/blenkernel/BKE_bmfont_types.h
@@ -34,10 +34,11 @@
*/
#define is_power_of_two(N) ((N ^ (N - 1)) == (2 * N - 1))
/*
-Moved to IMB_imbuf_types.h where it will live close to the ImBuf type.
-It is used as a userflag bit mask.
-#define IB_BITMAPFONT 1
-*/
+ * Moved to IMB_imbuf_types.h where it will live close to the ImBuf type.
+ * It is used as a userflag bit mask.
+ */
+// #define IB_BITMAPFONT 1
+
typedef struct bmGlyph {
unsigned short unicode;
short locx, locy;
diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h
index 15c93bd58fa..ab3d751cc8e 100644
--- a/source/blender/blenkernel/BKE_bvhutils.h
+++ b/source/blender/blenkernel/BKE_bvhutils.h
@@ -106,8 +106,8 @@ BVHTree* bvhtree_from_mesh_edges(struct BVHTreeFromMesh *data, struct DerivedMes
void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data);
/*
-* Math functions used by callbacks
-*/
+ * Math functions used by callbacks
+ */
float bvhtree_ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float v0[3], const float v1[3], const float v2[3]);
float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const float v2[3], const float p[3], int *v, int *e, float nearest[3]);
diff --git a/source/blender/blenkernel/BKE_cdderivedmesh.h b/source/blender/blenkernel/BKE_cdderivedmesh.h
index 8ece5f14a96..9e2dd778b03 100644
--- a/source/blender/blenkernel/BKE_cdderivedmesh.h
+++ b/source/blender/blenkernel/BKE_cdderivedmesh.h
@@ -50,9 +50,9 @@ struct DerivedMesh *CDDM_new(int numVerts, int numEdges, int numFaces,
int CDDM_Check(struct DerivedMesh *dm);
/* creates a CDDerivedMesh from the given Mesh, this will reference the
- original data in Mesh, but it is safe to apply vertex coordinates or
- calculate normals as those functions will automtically create new
- data to not overwrite the original */
+ * original data in Mesh, but it is safe to apply vertex coordinates or
+ * calculate normals as those functions will automatically create new
+ * data to not overwrite the original */
struct DerivedMesh *CDDM_from_mesh(struct Mesh *mesh, struct Object *ob);
/* creates a CDDerivedMesh from the given BMEditMesh */
@@ -107,7 +107,7 @@ 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 tessellation
- faces*/
+ * faces*/
void CDDM_calc_edges(struct DerivedMesh *dm);
/* reconstitute face triangulation */
@@ -143,9 +143,9 @@ struct MFace *CDDM_get_tessfaces(struct DerivedMesh *dm);
struct MLoop *CDDM_get_loops(struct DerivedMesh *dm);
struct MPoly *CDDM_get_polys(struct DerivedMesh *dm);
-/*Assigns news m*** layers to the cddm. Note that you must handle
- freeing the old ones yourself. Also you must ensure dm->num****Data
- is correct.*/
+/* Assigns news m*** layers to the cddm. Note that you must handle
+ * freeing the old ones yourself. Also you must ensure dm->num****Data
+ * is correct.*/
void CDDM_set_mvert(struct DerivedMesh *dm, struct MVert *mvert);
void CDDM_set_medge(struct DerivedMesh *dm, struct MEdge *medge);
void CDDM_set_mface(struct DerivedMesh *dm, struct MFace *mface);
diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h
index c453a9b0497..98e273f59b2 100644
--- a/source/blender/blenkernel/BKE_cloth.h
+++ b/source/blender/blenkernel/BKE_cloth.h
@@ -51,7 +51,7 @@ struct CollisionTree;
#define SOFTGOALSNAP 0.999f
/* This is approximately the smallest number that can be
-* represented by a float, given its precision. */
+ * represented by a float, given its precision. */
#define ALMOST_ZERO FLT_EPSILON
/* Bits to or into the ClothVertex.flags. */
@@ -60,15 +60,15 @@ struct CollisionTree;
#define CLOTH_VERT_FLAG_PINNED_EM 3
/**
-* This structure describes a cloth object against which the
-* simulation can run.
-*
-* The m and n members of this structure represent the assumed
-* rectangular ordered grid for which the original paper is written.
-* At some point they need to disappear and we need to determine out
-* own connectivity of the mesh based on the actual edges in the mesh.
-*
-**/
+ * This structure describes a cloth object against which the
+ * simulation can run.
+ *
+ * The m and n members of this structure represent the assumed
+ * rectangular ordered grid for which the original paper is written.
+ * At some point they need to disappear and we need to determine out
+ * own connectivity of the mesh based on the actual edges in the mesh.
+ *
+ */
typedef struct Cloth
{
struct ClothVertex *verts; /* The vertices that represent this cloth. */
@@ -237,7 +237,7 @@ typedef enum
/* This structure defines how to call the solver.
-*/
+ */
typedef struct
{
const char *name;
diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h
index c4f860e820f..5966f8e0ff0 100644
--- a/source/blender/blenkernel/BKE_context.h
+++ b/source/blender/blenkernel/BKE_context.h
@@ -170,10 +170,10 @@ const char *CTX_wm_operator_poll_msg_get(struct bContext *C);
void CTX_wm_operator_poll_msg_set(struct bContext *C, const char *msg);
/* Data Context
-
- - listbases consist of CollectionPointerLink items and must be
- freed with BLI_freelistN!
- - the dir listbase consits of LinkData items */
+ *
+ * - listbases consist of CollectionPointerLink items and must be
+ * freed with BLI_freelistN!
+ * - the dir listbase consits of LinkData items */
/* data type, needed so we can tell between a NULL pointer and an empty list */
enum {
@@ -201,8 +201,10 @@ short CTX_data_type_get(struct bContextDataResult *result);
int CTX_data_equals(const char *member, const char *str);
int CTX_data_dir(const char *member);
-/*void CTX_data_pointer_set(bContextDataResult *result, void *data);
-void CTX_data_list_add(bContextDataResult *result, void *data);*/
+#if 0
+void CTX_data_pointer_set(bContextDataResult *result, void *data);
+void CTX_data_list_add(bContextDataResult *result, void *data);
+#endif
#define CTX_DATA_BEGIN(C, Type, instance, member) \
{ \
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index b414f36b8c8..27b27ce5b42 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -59,7 +59,7 @@ extern const CustomDataMask CD_MASK_FACECORNERS;
/* for ORIGINDEX layer type, indicates no original index for this element */
#define ORIGINDEX_NONE -1
-/* initialises a CustomData object with the same layer setup as source and
+/* initializes a CustomData object with the same layer setup as source and
* memory space for totelem elements. mask must be an array of length
* CD_NUMTYPES elements, that indicate if a layer can be copied. */
@@ -69,7 +69,7 @@ extern const CustomDataMask CD_MASK_FACECORNERS;
#define CD_DEFAULT 2 /* allocate and set to default */
#define CD_REFERENCE 3 /* use data pointers, set layer flag NOFREE */
#define CD_DUPLICATE 4 /* do a full copy of all layers, only allowed if source
- has same number of elements */
+ * has same number of elements */
#define CD_TYPE_AS_MASK(_type) (CustomDataMask)((CustomDataMask)1 << (CustomDataMask)(_type))
@@ -78,9 +78,9 @@ extern const CustomDataMask CD_MASK_FACECORNERS;
*/
int CustomData_layer_has_math(struct CustomData *data, int layern);
-/*copies the "value" (e.g. mloopuv uv or mloopcol colors) from one block to
- another, while not overwriting anything else (e.g. flags). probably only
- implemented for mloopuv/mloopcol, for now.*/
+/* copies the "value" (e.g. mloopuv uv or mloopcol colors) from one block to
+ * another, while not overwriting anything else (e.g. flags). probably only
+ * implemented for mloopuv/mloopcol, for now.*/
void CustomData_data_copy_value(int type, void *source, void *dest);
/* compares if data1 is equal to data2. type is a valid CustomData type
@@ -92,7 +92,7 @@ void CustomData_data_dominmax(int type, void *data, void *min, void *max);
void CustomData_data_multiply(int type, void *data, float fac);
void CustomData_data_add(int type, void *data1, void *data2);
-/* initialises a CustomData object with the same layer setup as source.
+/* initializes a CustomData object with the same layer setup as source.
* mask is a bitfield where (mask & (1 << (layer type))) indicates
* if a layer should be copied or not. alloctype must be one of the above. */
void CustomData_copy(const struct CustomData *source, struct CustomData *dest,
@@ -106,9 +106,9 @@ void CustomData_update_typemap(struct CustomData *data);
void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
CustomDataMask mask, int alloctype, int totelem);
-/*bmesh version of CustomData_merge; merges the layouts of source and dest,
- then goes through the mesh and makes sure all the customdata blocks are
- consistent with the new layout.*/
+/* bmesh version of CustomData_merge; merges the layouts of source and 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, const char htype);
@@ -210,8 +210,8 @@ void CustomData_bmesh_interp(struct CustomData *data, void **src_blocks,
/* swaps the data in the element corners, to new corners with indices as
- specified in corner_indices. for edges this is an array of length 2, for
- faces an array of length 4 */
+ * specified in corner_indices. for edges this is an array of length 2, for
+ * faces an array of length 4 */
void CustomData_swap(struct CustomData *data, int index, const int *corner_indices);
/* gets a pointer to the data element at index from the first layer of type
@@ -311,7 +311,7 @@ void CustomData_set_layer_unique_name(struct CustomData *data, int index);
void CustomData_validate_layer_name(const struct CustomData *data, int type, char *name, char *outname);
/* for file reading compatibility, returns false if the layer was freed,
- only after this test passes, layer->data should be assigned */
+ * only after this test passes, layer->data should be assigned */
int CustomData_verify_versions(struct CustomData *data, int index);
/*BMesh specific customdata stuff*/
diff --git a/source/blender/blenkernel/BKE_depsgraph.h b/source/blender/blenkernel/BKE_depsgraph.h
index fcc9f860471..b7edf04724d 100644
--- a/source/blender/blenkernel/BKE_depsgraph.h
+++ b/source/blender/blenkernel/BKE_depsgraph.h
@@ -34,9 +34,7 @@
extern "C" {
#endif
-/*
-#define DEPS_DEBUG
-*/
+// #define DEPS_DEBUG
struct ID;
struct Main;
diff --git a/source/blender/blenkernel/BKE_dynamicpaint.h b/source/blender/blenkernel/BKE_dynamicpaint.h
index b6de8188536..a71522773fe 100644
--- a/source/blender/blenkernel/BKE_dynamicpaint.h
+++ b/source/blender/blenkernel/BKE_dynamicpaint.h
@@ -32,7 +32,7 @@ typedef struct PaintSurfaceData {
typedef struct PaintPoint {
/* Wet paint is handled at effect layer only
- * and mixed to surface when drying */
+ * and mixed to surface when drying */
float e_color[3];
float e_alpha;
float wetness;
diff --git a/source/blender/blenkernel/BKE_icons.h b/source/blender/blenkernel/BKE_icons.h
index 3be11913f9e..e1f8df941cb 100644
--- a/source/blender/blenkernel/BKE_icons.h
+++ b/source/blender/blenkernel/BKE_icons.h
@@ -33,8 +33,8 @@
*/
/*
- Resizable Icons for Blender
-*/
+ * Resizable Icons for Blender
+ */
typedef void (*DrawInfoFreeFP) (void *drawinfo);
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index c4321d25271..173adcc295b 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -58,8 +58,8 @@ typedef union IDPropertyTemplate {
/* ----------- Property Array Type ---------- */
-/*note: as a start to move away from the stupid IDP_New function, this type
- has it's own allocation function.*/
+/* note: as a start to move away from the stupid IDP_New function, this type
+ * has it's own allocation function.*/
IDProperty *IDP_NewIDPArray(const char *name);
IDProperty *IDP_CopyIDPArray(IDProperty *array);
@@ -93,104 +93,108 @@ void IDP_UnlinkID(struct IDProperty *prop);
void IDP_SyncGroupValues(struct IDProperty *dest, struct IDProperty *src);
/**
- replaces all properties with the same name in a destination group from a source group.
-*/
+ * replaces all properties with the same name in a destination group from a source group.
+ */
void IDP_ReplaceGroupInGroup(struct IDProperty *dest, struct IDProperty *src);
-/** checks if a property with the same name as prop exists, and if so replaces it.
- Use this to preserve order!*/
+/**
+ * Checks if a property with the same name as prop exists, and if so replaces it.
+ * Use this to preserve order!*/
void IDP_ReplaceInGroup(struct IDProperty *group, struct IDProperty *prop);
/**
-This function has a sanity check to make sure ID properties with the same name don't
-get added to the group.
-
-The sanity check just means the property is not added to the group if another property
-exists with the same name; the client code using ID properties then needs to detect this
-(the function that adds new properties to groups, IDP_AddToGroup, returns 0 if a property can't
-be added to the group, and 1 if it can) and free the property.
-
-Currently the code to free ID properties is designesd to leave the actual struct
-you pass it un-freed, this is needed for how the system works. This means
-to free an ID property, you first call IDP_FreeProperty then MEM_freeN the
-struct. In the future this will just be IDP_FreeProperty and the code will
-be reorganized to work properly.
-*/
+ * This function has a sanity check to make sure ID properties with the same name don't
+ * get added to the group.
+ *
+ * The sanity check just means the property is not added to the group if another property
+ * exists with the same name; the client code using ID properties then needs to detect this
+ * (the function that adds new properties to groups, IDP_AddToGroup, returns 0 if a property can't
+ * be added to the group, and 1 if it can) and free the property.
+ *
+ * Currently the code to free ID properties is designed to leave the actual struct
+ * you pass it un-freed, this is needed for how the system works. This means
+ * to free an ID property, you first call IDP_FreeProperty then MEM_freeN the
+ * struct. In the future this will just be IDP_FreeProperty and the code will
+ * be reorganized to work properly.
+ */
int IDP_AddToGroup(struct IDProperty *group, struct IDProperty *prop);
/** this is the same as IDP_AddToGroup, only you pass an item
- in the group list to be inserted after.*/
+ * in the group list to be inserted after. */
int IDP_InsertToGroup(struct IDProperty *group, struct IDProperty *previous,
struct IDProperty *pnew);
/** \note this does not free the property!!
-
- To free the property, you have to do:
- IDP_FreeProperty(prop); //free all subdata
- MEM_freeN(prop); //free property struct itself
-
-*/
+ *
+ * To free the property, you have to do:
+ * IDP_FreeProperty(prop); //free all subdata
+ * MEM_freeN(prop); //free property struct itself
+ */
void IDP_RemFromGroup(struct IDProperty *group, struct IDProperty *prop);
IDProperty *IDP_GetPropertyFromGroup(struct IDProperty *prop, const char *name);
/** same as above but ensure type match */
IDProperty *IDP_GetPropertyTypeFromGroup(struct IDProperty *prop, const char *name, const char type);
-/** Get an iterator to iterate over the members of an id property group.
- Note that this will automatically free the iterator once iteration is complete;
- if you stop the iteration before hitting the end, make sure to call
- IDP_FreeIterBeforeEnd().*/
+/**
+ * Get an iterator to iterate over the members of an id property group.
+ * Note that this will automatically free the iterator once iteration is complete;
+ * if you stop the iteration before hitting the end, make sure to call
+ * IDP_FreeIterBeforeEnd(). */
void *IDP_GetGroupIterator(struct IDProperty *prop);
-/** Returns the next item in the iteration. To use, simple for a loop like the following:
- while (IDP_GroupIterNext(iter) != NULL) {
- . . .
- }*/
+/**
+ * Returns the next item in the iteration. To use, simple for a loop like the following:
+ * while (IDP_GroupIterNext(iter) != NULL) {
+ * ...
+ * }
+ */
IDProperty *IDP_GroupIterNext(void *vself);
-/** Frees the iterator pointed to at vself, only use this if iteration is stopped early;
- when the iterator hits the end of the list it'll automatially free itself.*/
+/**
+ * Frees the iterator pointed to at vself, only use this if iteration is stopped early;
+ * when the iterator hits the end of the list it'll automatically free itself.*/
void IDP_FreeIterBeforeEnd(void *vself);
/*-------- Main Functions --------*/
/** Get the Group property that contains the id properties for ID id. Set create_if_needed
- to create the Group property and attach it to id if it doesn't exist; otherwise
- the function will return NULL if there's no Group property attached to the ID.*/
+ * to create the Group property and attach it to id if it doesn't exist; otherwise
+ * the function will return NULL if there's no Group property attached to the ID.*/
struct IDProperty *IDP_GetProperties(struct ID *id, int create_if_needed);
struct IDProperty *IDP_CopyProperty(struct IDProperty *prop);
int IDP_EqualsProperties(struct IDProperty *prop1, struct IDProperty *prop2);
/**
-Allocate a new ID.
-
-This function takes three arguments: the ID property type, a union which defines
-it's initial value, and a name.
-
-The union is simple to use; see the top of this header file for its definition.
-An example of using this function:
-
- IDPropertyTemplate val;
- IDProperty *group, *idgroup, *color;
- group = IDP_New(IDP_GROUP, val, "group1"); //groups don't need a template.
-
- val.array.len = 4
- val.array.type = IDP_FLOAT;
- color = IDP_New(IDP_ARRAY, val, "color1");
-
- idgroup = IDP_GetProperties(some_id, 1);
- IDP_AddToGroup(idgroup, color);
- IDP_AddToGroup(idgroup, group);
-
-Note that you MUST either attach the id property to an id property group with
-IDP_AddToGroup or MEM_freeN the property, doing anything else might result in
-a memory leak.
-*/
+ * Allocate a new ID.
+ *
+ * This function takes three arguments: the ID property type, a union which defines
+ * it's initial value, and a name.
+ *
+ * The union is simple to use; see the top of this header file for its definition.
+ * An example of using this function:
+ *
+ * IDPropertyTemplate val;
+ * IDProperty *group, *idgroup, *color;
+ * group = IDP_New(IDP_GROUP, val, "group1"); //groups don't need a template.
+ *
+ * val.array.len = 4
+ * val.array.type = IDP_FLOAT;
+ * color = IDP_New(IDP_ARRAY, val, "color1");
+ *
+ * idgroup = IDP_GetProperties(some_id, 1);
+ * IDP_AddToGroup(idgroup, color);
+ * IDP_AddToGroup(idgroup, group);
+ *
+ * Note that you MUST either attach the id property to an id property group with
+ * IDP_AddToGroup or MEM_freeN the property, doing anything else might result in
+ * a memory leak.
+ */
struct IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *name);
/** \note this will free all child properties of list arrays and groups!
- Also, note that this does NOT unlink anything! Plus it doesn't free
- the actual struct IDProperty struct either.*/
+ * Also, note that this does NOT unlink anything! Plus it doesn't free
+ * the actual struct IDProperty struct either.*/
void IDP_FreeProperty(struct IDProperty *prop);
/** Unlinks any struct IDProperty<->ID linkage that might be going on.*/
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 4a37252e3fb..65ebd23d742 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -100,14 +100,14 @@ float mesh_calc_poly_area(struct MPoly *mpoly, struct MLoop *loopstart,
struct MVert *mvarray, float polynormal[3]);
/* Find the index of the loop in 'poly' which references vertex,
- returns -1 if not found */
+ * returns -1 if not found */
int poly_find_loop_from_vert(const struct MPoly *poly,
const struct MLoop *loopstart,
unsigned vert);
/* Fill 'adj_r' with the loop indices in 'poly' adjacent to the
- vertex. Returns the index of the loop matching vertex, or -1 if the
- vertex is not in 'poly' */
+ * vertex. Returns the index of the loop matching vertex, or -1 if the
+ * vertex is not in 'poly' */
int poly_get_adj_loops_from_vert(unsigned adj_r[3], const struct MPoly *poly,
const struct MLoop *mloop, unsigned vert);
@@ -141,10 +141,10 @@ void mesh_set_smooth_flag(struct Object *meshOb, int enableSmooth);
void convert_mfaces_to_mpolys(struct Mesh *mesh);
void mesh_calc_normals_tessface(struct MVert *mverts, int numVerts,struct MFace *mfaces, int numFaces, float (*faceNors_r)[3]);
-/*used for unit testing; compares two meshes, checking only
- differences we care about. should be usable with leaf's
- testing framework I get RNA work done, will use hackish
- testing code for now.*/
+/* used for unit testing; compares two meshes, checking only
+ * differences we care about. should be usable with leaf's
+ * testing framework I get RNA work done, will use hackish
+ * testing code for now.*/
const char *mesh_cmp(struct Mesh *me1, struct Mesh *me2, float thresh);
struct BoundBox *mesh_get_bb(struct Object *ob);
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index de4f0a7eac6..937eb02743f 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -92,7 +92,7 @@ typedef enum {
eModifierTypeFlag_RequiresOriginalData = (1<<5),
/* For modifiers that support pointcache, so we can check to see if it has files we need to deal with
- */
+ */
eModifierTypeFlag_UsesPointCache = (1<<6),
/* For physics modifiers, max one per type */
diff --git a/source/blender/blenkernel/BKE_multires.h b/source/blender/blenkernel/BKE_multires.h
index b1fa375388a..34123229863 100644
--- a/source/blender/blenkernel/BKE_multires.h
+++ b/source/blender/blenkernel/BKE_multires.h
@@ -75,7 +75,7 @@ void multires_stitch_grids(struct Object *);
enum {
MULTIRES_SPACE_TANGENT,
MULTIRES_SPACE_OBJECT,
- MULTIRES_SPACE_ABSOLUTE,
+ MULTIRES_SPACE_ABSOLUTE
};
void multires_set_space(struct DerivedMesh *dm, struct Object *ob, int from, int to);
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index 4407be4c8be..08f9dfb05f3 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -80,8 +80,8 @@ typedef struct ParticleSimulationData {
struct ParticleSystemModifierData *psmd;
struct ListBase *colliders;
/* Courant number. This is used to implement an adaptive time step. Only the
- maximum value per time step is important. Only sph_integrate makes use of
- this at the moment. Other solvers could, too. */
+ * maximum value per time step is important. Only sph_integrate makes use of
+ * this at the moment. Other solvers could, too. */
float courant_num;
} ParticleSimulationData;
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index c254144b812..fbb93c761c2 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -55,7 +55,7 @@ struct wmWindowManager;
#include "RNA_types.h"
/* spacetype has everything stored to get an editor working, it gets initialized via
- ED_spacetypes_init() in editors/area/spacetypes.c */
+ * ED_spacetypes_init() in editors/area/spacetypes.c */
/* an editor in Blender is a combined ScrArea + SpaceType + SpaceData */
#define BKE_ST_MAXNAME 64
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h
index d54874f1fb8..4b3a15181c1 100644
--- a/source/blender/blenkernel/BKE_sequencer.h
+++ b/source/blender/blenkernel/BKE_sequencer.h
@@ -101,8 +101,14 @@ int seq_cmp_render_data(const SeqRenderData * a, const SeqRenderData * b);
unsigned int seq_hash_render_data(const SeqRenderData * a);
/* Wipe effect */
-enum {DO_SINGLE_WIPE, DO_DOUBLE_WIPE, DO_BOX_WIPE, DO_CROSS_WIPE,
- DO_IRIS_WIPE,DO_CLOCK_WIPE};
+enum {
+ DO_SINGLE_WIPE,
+ DO_DOUBLE_WIPE,
+ DO_BOX_WIPE,
+ DO_CROSS_WIPE,
+ DO_IRIS_WIPE,
+ DO_CLOCK_WIPE
+};
struct SeqEffectHandle {
@@ -112,11 +118,11 @@ struct SeqEffectHandle {
void (*init_plugin)(struct Sequence *seq, const char *fname);
/* number of input strips needed
- (called directly after construction) */
+ * (called directly after construction) */
int (*num_inputs)(void);
/* load is called first time after readblenfile in
- get_sequence_effect automatically */
+ * get_sequence_effect automatically */
void (*load)(struct Sequence *seq);
/* duplicate */
@@ -126,9 +132,9 @@ struct SeqEffectHandle {
void (*free)(struct Sequence *seq);
/* returns: -1: no input needed,
- 0: no early out,
- 1: out = ibuf1,
- 2: out = ibuf2 */
+ * 0: no early out,
+ * 1: out = ibuf1,
+ * 2: out = ibuf2 */
int (*early_out)(struct Sequence *seq, float facf0, float facf1);
/* stores the y-range of the effect IPO */
@@ -140,9 +146,9 @@ struct SeqEffectHandle {
float * facf0, float * facf1);
/* execute the effect
- sequence effects are only required to either support
- float-rects or byte-rects
- (mixed cases are handled one layer up...) */
+ * sequence effects are only required to either support
+ * float-rects or byte-rects
+ * (mixed cases are handled one layer up...) */
struct ImBuf* (*execute)(
SeqRenderData context,
@@ -155,10 +161,10 @@ struct SeqEffectHandle {
/* ********************* prototypes *************** */
/* **********************************************************************
- * sequence.c
-
- * sequencer render functions
- ********************************************************************** */
+ * sequence.c
+ *
+ * sequencer render functions
+ * ********************************************************************** */
struct ImBuf *give_ibuf_seq(SeqRenderData context, float cfra, int chanshown);
struct ImBuf *give_ibuf_seq_threaded(SeqRenderData context, float cfra, int chanshown);
@@ -203,10 +209,10 @@ void seq_proxy_rebuild_finish(struct SeqIndexBuildContext *context, short stop);
/* **********************************************************************
- seqcache.c
-
- Sequencer memory cache management functions
- ********************************************************************** */
+ * seqcache.c
+ *
+ * Sequencer memory cache management functions
+ * ********************************************************************** */
typedef enum {
SEQ_STRIPELEM_IBUF,
@@ -224,20 +230,20 @@ struct ImBuf * seq_stripelem_cache_get(
float cfra, seq_stripelem_ibuf_t type);
/* passed ImBuf is properly refed, so ownership is *not*
- transfered to the cache.
- you can pass the same ImBuf multiple times to the cache without problems.
-*/
+ * transfered to the cache.
+ * you can pass the same ImBuf multiple times to the cache without problems.
+ */
void seq_stripelem_cache_put(
SeqRenderData context, struct Sequence * seq,
float cfra, seq_stripelem_ibuf_t type, struct ImBuf * nval);
/* **********************************************************************
- seqeffects.c
-
- Sequencer effect strip managment functions
- **********************************************************************
-*/
+ * seqeffects.c
+ *
+ * Sequencer effect strip managment functions
+ * **********************************************************************
+ */
/* intern */
struct SeqEffectHandle get_sequence_blend(struct Sequence *seq);
@@ -249,9 +255,9 @@ int get_sequence_effect_num_inputs(int seq_type);
/* **********************************************************************
- Sequencer editing functions
- **********************************************************************
-*/
+ * Sequencer editing functions
+ * **********************************************************************
+ */
/* for transform but also could use elsewhere */
int seq_tx_get_start(struct Sequence *seq);
@@ -336,7 +342,7 @@ struct Sequence *sequencer_add_sound_strip(struct bContext *C, ListBase *seqbase
struct Sequence *sequencer_add_movie_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load);
/* view3d draw callback, run when not in background view */
-typedef struct ImBuf *(*SequencerDrawView)(struct Scene *, struct Object *, int, int, unsigned int, int, char[256]);
+typedef struct ImBuf *(*SequencerDrawView)(struct Scene *, struct Object *, int, int, unsigned int, int, int, char[256]);
extern SequencerDrawView sequencer_view3d_cb;
/* copy/paste */
diff --git a/source/blender/blenkernel/BKE_subsurf.h b/source/blender/blenkernel/BKE_subsurf.h
index 8f32063c243..f3cdd858e7d 100644
--- a/source/blender/blenkernel/BKE_subsurf.h
+++ b/source/blender/blenkernel/BKE_subsurf.h
@@ -31,6 +31,7 @@
* \ingroup bke
*/
+struct DMFlagMat;
struct DMGridAdjacency;
struct DMGridData;
struct DerivedMesh;
@@ -75,7 +76,7 @@ typedef struct CCGDerivedMesh {
int startFace; struct CCGFace *face;} *faceMap;
short *edgeFlags;
- char *faceFlags;
+ struct DMFlagMat *faceFlags;
int *reverseFaceMap;
@@ -90,6 +91,7 @@ typedef struct CCGDerivedMesh {
struct DMGridAdjacency *gridAdjacency;
int *gridOffset;
struct CCGFace **gridFaces;
+ struct DMFlagMat *gridFlagMats;
struct {
struct MultiresModifierData *mmd;
diff --git a/source/blender/blenkernel/BKE_suggestions.h b/source/blender/blenkernel/BKE_suggestions.h
index 6168b98ac4c..9b61d9141fb 100644
--- a/source/blender/blenkernel/BKE_suggestions.h
+++ b/source/blender/blenkernel/BKE_suggestions.h
@@ -36,19 +36,19 @@ extern "C" {
#endif
/* ****************************************************************************
-Suggestions should be added in sorted order although a linear sorting method is
-implemented. The list is then divided up based on the prefix provided by
-update_suggestions:
-
-Example:
- Prefix: ab
- aaa <-- first
- aab
- aba <-- firstmatch
- abb <-- lastmatch
- baa
- bab <-- last
-**************************************************************************** */
+ * Suggestions should be added in sorted order although a linear sorting method is
+ * implemented. The list is then divided up based on the prefix provided by
+ * update_suggestions:
+ *
+ * Example:
+ * Prefix: ab
+ * aaa <-- first
+ * aab
+ * aba <-- firstmatch
+ * abb <-- lastmatch
+ * baa
+ * bab <-- last
+ **************************************************************************** */
struct Text;
diff --git a/source/blender/blenkernel/BKE_tessmesh.h b/source/blender/blenkernel/BKE_tessmesh.h
index d935c932387..451fbcdfd28 100644
--- a/source/blender/blenkernel/BKE_tessmesh.h
+++ b/source/blender/blenkernel/BKE_tessmesh.h
@@ -31,20 +31,19 @@ struct BMFace;
struct Mesh;
struct DerivedMesh;
-/*
-ok: the EDBM module is for editmode bmesh stuff. in contrast, the
- BMEdit module is for code shared with blenkernel that concerns
- the BMEditMesh structure.
-*/
+/* ok: the EDBM module is for editmode bmesh stuff. in contrast, the
+ * BMEdit module is for code shared with blenkernel that concerns
+ * the BMEditMesh structure.
+ */
-/*this structure replaces EditMesh.
-
- through this, you get access to both the edit 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,
- and not BMesh. Mesh->edit_bmesh stores a pointer to this structure.*/
+/* this structure replaces EditMesh.
+ *
+ * through this, you get access to both the edit 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,
+ * and not BMesh. Mesh->edit_bmesh stores a pointer to this structure. */
typedef struct BMEditMesh {
struct BMesh *bm;
@@ -52,8 +51,8 @@ typedef struct BMEditMesh {
struct BMEditMesh *emcopy;
int emcopyusers;
- /*we store tessellations as triplets of three loops,
- which each define a triangle.*/
+ /* we store tessellations as triplets of three loops,
+ * which each define a triangle.*/
struct BMLoop *(*looptris)[3];
int tottri;
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 76df916ff44..86035e218c5 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -86,8 +86,8 @@ set(SRC
intern/depsgraph.c
intern/displist.c
intern/dynamicpaint.c
- intern/effect.c
intern/editderivedmesh.c
+ intern/effect.c
intern/fcurve.c
intern/fluidsim.c
intern/fmodifier.c
@@ -116,8 +116,8 @@ set(SRC
intern/multires.c
intern/nla.c
intern/node.c
- intern/ocean.c
intern/object.c
+ intern/ocean.c
intern/packedFile.c
intern/paint.c
intern/particle.c
@@ -203,8 +203,8 @@ set(SRC
BKE_multires.h
BKE_nla.h
BKE_node.h
- BKE_ocean.h
BKE_object.h
+ BKE_ocean.h
BKE_packedFile.h
BKE_paint.h
BKE_particle.h
@@ -236,8 +236,8 @@ set(SRC
BKE_writeffmpeg.h
BKE_writeframeserver.h
depsgraph_private.h
- intern/CCGSubSurf.h
nla_private.h
+ intern/CCGSubSurf.h
)
add_definitions(-DGLEW_STATIC)
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c
index f843d21a975..7cee0272e4b 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@ -732,7 +732,7 @@ static void _face_calcIFNo(CCGFace *f, int lvl, int S, int x, int y, float *no,
no[1] = b_dZ * a_cX - b_dX * a_cZ;
no[2] = b_dX * a_cY - b_dY * a_cX;
- length = sqrt(no[0] * no[0] + no[1] * no[1] + no[2] * no[2]);
+ length = sqrtf(no[0] * no[0] + no[1] * no[1] + no[2] * no[2]);
if (length > EPSILON) {
float invLength = 1.f/length;
@@ -1419,7 +1419,7 @@ static void ccgSubSurf__calcVertNormals(CCGSubSurf *ss,
NormAdd(no, FACE_getIFNo(f, lvl, _face_getVertIndex(f,v), gridSize - 1, gridSize - 1));
}
- length = sqrt(no[0] * no[0] + no[1] * no[1] + no[2] * no[2]);
+ length = sqrtf(no[0] * no[0] + no[1] * no[1] + no[2] * no[2]);
if (length > EPSILON) {
float invLength = 1.0f/length;
@@ -1477,7 +1477,7 @@ static void ccgSubSurf__calcVertNormals(CCGSubSurf *ss,
for (y = 0; y < gridSize; y++) {
for (x = 0; x < gridSize; x++) {
float *no = FACE_getIFNo(f, lvl, S, x, y);
- float length = sqrt(no[0] * no[0] + no[1] * no[1] + no[2] * no[2]);
+ float length = sqrtf(no[0] * no[0] + no[1] * no[1] + no[2] * no[2]);
if (length > EPSILON) {
float invLength = 1.0f/length;
@@ -2468,7 +2468,7 @@ CCGError ccgSubSurf_updateToFaces(CCGSubSurf *ss, int lvl, CCGFace **effectedF,
}
/* stitch together face grids, averaging coordinates at edges
- and vertices, for multires displacements */
+ * and vertices, for multires displacements */
CCGError ccgSubSurf_stitchFaces(CCGSubSurf *ss, int lvl, CCGFace **effectedF, int numEffectedF)
{
CCGVert **effectedV;
@@ -2634,8 +2634,8 @@ CCGError ccgSubSurf_updateNormals(CCGSubSurf *ss, CCGFace **effectedF, int numEf
}
/* compute subdivision levels from a given starting point, used by
- multires subdivide/propagate, by filling in coordinates at a
- certain level, and then subdividing that up to the highest level */
+ * multires subdivide/propagate, by filling in coordinates at a
+ * certain level, and then subdividing that up to the highest level */
CCGError ccgSubSurf_updateLevels(CCGSubSurf *ss, int lvl, CCGFace **effectedF, int numEffectedF)
{
CCGVert **effectedV;
@@ -2857,7 +2857,7 @@ float ccgSubSurf_getEdgeCrease(CCGEdge *e)
/* Face accessors */
-CCGFaceHDL ccgSubSurf_getFaceFaceHandle(CCGSubSurf *UNUSED(ss), CCGFace *f)
+CCGFaceHDL ccgSubSurf_getFaceFaceHandle(CCGFace *f)
{
return f->fHDL;
}
@@ -2880,7 +2880,7 @@ int ccgSubSurf_getFaceNumVerts(CCGFace *f)
{
return f->numVerts;
}
-CCGVert *ccgSubSurf_getFaceVert(CCGSubSurf *UNUSED(ss), CCGFace *f, int index)
+CCGVert *ccgSubSurf_getFaceVert(CCGFace *f, int index)
{
if (index<0 || index>=f->numVerts) {
return NULL;
@@ -2889,7 +2889,7 @@ CCGVert *ccgSubSurf_getFaceVert(CCGSubSurf *UNUSED(ss), CCGFace *f, int index)
return FACE_getVerts(f)[index];
}
}
-CCGEdge *ccgSubSurf_getFaceEdge(CCGSubSurf *UNUSED(ss), CCGFace *f, int index)
+CCGEdge *ccgSubSurf_getFaceEdge(CCGFace *f, int index)
{
if (index<0 || index>=f->numVerts) {
return NULL;
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.h b/source/blender/blenkernel/intern/CCGSubSurf.h
index a1cbd98d7e8..e73ef6b543e 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.h
+++ b/source/blender/blenkernel/intern/CCGSubSurf.h
@@ -116,10 +116,10 @@ void* ccgSubSurf_getEdgeData (CCGSubSurf *ss, CCGEdge *e, int x);
void* ccgSubSurf_getEdgeLevelData (CCGSubSurf *ss, CCGEdge *e, int x, int level);
CCGFace* ccgSubSurf_getFace (CCGSubSurf *ss, CCGFaceHDL f);
-CCGFaceHDL ccgSubSurf_getFaceFaceHandle (CCGSubSurf *ss, CCGFace *f);
+CCGFaceHDL ccgSubSurf_getFaceFaceHandle (CCGFace *f);
int ccgSubSurf_getFaceNumVerts (CCGFace *f);
-CCGVert* ccgSubSurf_getFaceVert (CCGSubSurf *ss, CCGFace *f, int index);
-CCGEdge* ccgSubSurf_getFaceEdge (CCGSubSurf *ss, CCGFace *f, int index);
+CCGVert* ccgSubSurf_getFaceVert (CCGFace *f, int index);
+CCGEdge* ccgSubSurf_getFaceEdge (CCGFace *f, int index);
int ccgSubSurf_getFaceEdgeIndex (CCGFace *f, CCGEdge *e);
int ccgSubSurf_getFaceAge (CCGSubSurf *ss, CCGFace *f);
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 0d12785872c..4c683b2b2c8 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -421,7 +421,7 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
}
/* not all DerivedMeshes store their verts/edges/faces in CustomData, so
- we set them here in case they are missing */
+ * we set them here in case they are missing */
if(!CustomData_has_layer(&tmp.vdata, CD_MVERT))
CustomData_add_layer(&tmp.vdata, CD_MVERT, CD_ASSIGN, dm->dupVertArray(dm), totvert);
if(!CustomData_has_layer(&tmp.edata, CD_MEDGE))
@@ -454,9 +454,9 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
CustomData_free(&me->ldata, me->totloop);
CustomData_free(&me->pdata, me->totpoly);
- /* ok, this should now use new CD shapekey data,
- which shouuld be fed through the modifier
- stack*/
+ /* ok, this should now use new CD shapekey data,
+ * which shouuld be fed through the modifier
+ * stack*/
if(tmp.totvert != me->totvert && !did_shapekeys && me->key) {
printf("YEEK! this should be recoded! Shape key loss!!!\n");
if(tmp.key) tmp.key->id.us--;
@@ -787,7 +787,7 @@ static void *get_orco_coords_dm(Object *ob, BMEditMesh *em, int layer, int *free
}
else if(layer == CD_CLOTH_ORCO) {
/* apply shape key for cloth, this should really be solved
- by a more flexible customdata system, but not simple */
+ * by a more flexible customdata system, but not simple */
if(!em) {
ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
KeyBlock *kb= key_get_keyblock(ob_get_key(ob), clmd->sim_parms->shapekey_rest);
@@ -2460,14 +2460,12 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
MFace * mface = dm->getTessFaceArray(dm);
MTFace * mtface = dm->getTessFaceDataArray(dm, CD_MTFACE);
- if(mtface)
- {
+ if(mtface) {
double dsum = 0.0;
int nr_accumulated = 0;
int f;
- for ( f=0; f<totface; f++ )
- {
+ for ( f=0; f < totface; f++ ) {
{
float * verts[4], * tex_coords[4];
const int nr_verts = mface[f].v4!=0 ? 4 : 3;
@@ -2475,8 +2473,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
verts[0]=mvert[mface[f].v1].co; verts[1]=mvert[mface[f].v2].co; verts[2]=mvert[mface[f].v3].co;
tex_coords[0]=mtface[f].uv[0]; tex_coords[1]=mtface[f].uv[1]; tex_coords[2]=mtface[f].uv[2];
- if(nr_verts==4)
- {
+ if (nr_verts==4) {
verts[3]=mvert[mface[f].v4].co;
tex_coords[3]=mtface[f].uv[3];
}
@@ -2490,32 +2487,33 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
}
// verify last vertex as well if this is a quad
- if ( is_degenerate==0 && nr_verts==4 )
- {
- if( equals_v3v3(verts[3], verts[0]) || equals_v3v3(verts[3], verts[1]) || equals_v3v3(verts[3], verts[2]) ||
- equals_v2v2(tex_coords[3], tex_coords[0]) || equals_v2v2(tex_coords[3], tex_coords[1]) || equals_v2v2(tex_coords[3], tex_coords[2]) )
+ if (is_degenerate == 0 && nr_verts == 4) {
+ if (equals_v3v3(verts[3], verts[0]) || equals_v3v3(verts[3], verts[1]) || equals_v3v3(verts[3], verts[2]) ||
+ equals_v2v2(tex_coords[3], tex_coords[0]) || equals_v2v2(tex_coords[3], tex_coords[1]) || equals_v2v2(tex_coords[3], tex_coords[2]) )
{
is_degenerate = 1;
}
// verify the winding is consistent
- if ( is_degenerate==0 )
- {
+ if (is_degenerate == 0) {
float prev_edge[2];
int is_signed = 0;
sub_v2_v2v2(prev_edge, tex_coords[0], tex_coords[3]);
i = 0;
- while ( is_degenerate==0 && i<4 )
- {
+ while (is_degenerate == 0 && i < 4) {
float cur_edge[2], signed_area;
sub_v2_v2v2(cur_edge, tex_coords[(i+1)&0x3], tex_coords[i]);
signed_area = prev_edge[0]*cur_edge[1] - prev_edge[1]*cur_edge[0];
- if ( i==0 ) is_signed = signed_area<0.0f ? 1 : 0;
- else if((is_signed!=0)!=(signed_area<0.0f)) is_degenerate=1;
- if ( is_degenerate==0 )
- {
+ if (i == 0 ) {
+ is_signed = (signed_area < 0.0f) ? 1 : 0;
+ }
+ else if((is_signed != 0) != (signed_area < 0.0f)) {
+ is_degenerate = 1;
+ }
+
+ if (is_degenerate == 0) {
copy_v2_v2(prev_edge, cur_edge);
++i;
}
@@ -2524,13 +2522,11 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
}
// proceed if not a degenerate face
- if ( is_degenerate==0 )
- {
+ if (is_degenerate == 0) {
int nr_tris_to_pile=0;
// quads split at shortest diagonal
int offs = 0; // initial triangulation is 0,1,2 and 0, 2, 3
- if ( nr_verts==4 )
- {
+ if (nr_verts == 4) {
float pos_len_diag0, pos_len_diag1;
float vtmp[3];
sub_v3_v3v3(vtmp, verts[2], verts[0]);
@@ -2538,10 +2534,10 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
sub_v3_v3v3(vtmp, verts[3], verts[1]);
pos_len_diag1 = dot_v3v3(vtmp, vtmp);
- if(pos_len_diag1<pos_len_diag0)
+ if(pos_len_diag1<pos_len_diag0) {
offs=1; // alter split
- else if(pos_len_diag0==pos_len_diag1) // do UV check instead
- {
+ }
+ else if(pos_len_diag0==pos_len_diag1) { /* do UV check instead */
float tex_len_diag0, tex_len_diag1;
sub_v2_v2v2(vtmp, tex_coords[2], tex_coords[0]);
@@ -2549,15 +2545,13 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
sub_v2_v2v2(vtmp, tex_coords[3], tex_coords[1]);
tex_len_diag1 = dot_v2v2(vtmp, vtmp);
- if(tex_len_diag1<tex_len_diag0)
- {
- offs=1; // alter split
+ if (tex_len_diag1<tex_len_diag0) {
+ offs=1; /* alter split */
}
}
}
nr_tris_to_pile = nr_verts - 2;
- if ( nr_tris_to_pile==1 || nr_tris_to_pile==2 )
- {
+ if (nr_tris_to_pile==1 || nr_tris_to_pile==2) {
const int indices[] = {offs+0, offs+1, offs+2, offs+0, offs+2, (offs+3)&0x3 };
int t;
for ( t=0; t<nr_tris_to_pile; t++ )
@@ -2572,8 +2566,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
sub_v2_v2v2(edge_t1, tex_coords[indices[t*3+2]], tex_coords[indices[t*3+0]]);
f2x_area_uv = fabsf(edge_t0[0]*edge_t1[1] - edge_t0[1]*edge_t1[0]);
- if ( f2x_area_uv>FLT_EPSILON )
- {
+ if (f2x_area_uv>FLT_EPSILON) {
float norm[3], v0[3], v1[3], f2x_surf_area, fsurf_ratio;
sub_v3_v3v3(v0, p1, p0);
sub_v3_v3v3(v1, p2, p0);
@@ -2598,8 +2591,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
dm->auto_bump_scale = use_as_render_bump_scale;
}
}
- else
- {
+ else {
dm->auto_bump_scale = 1.0f;
}
}
@@ -2644,8 +2636,9 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
attribs->tface[a].glIndex = gattribs->layer[b].glindex;
attribs->tface[a].glTexco = gattribs->layer[b].gltexco;
}
- /* BMESH ONLY, may need to get this working?, otherwise remove */
- /* else {
+ /* BMESH_TODO - BMESH ONLY, may need to get this working?, otherwise remove */
+#if 0
+ else {
int player;
CustomData *pdata = dm->getPolyDataLayout(dm);
@@ -2665,7 +2658,7 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
}
}
- */
+#endif
}
else if(gattribs->layer[b].type == CD_MCOL) {
/* vertex colors */
@@ -2764,13 +2757,14 @@ static void navmesh_drawColored(DerivedMesh *dm)
if (!polygonIdx)
return;
- /*
+#if 0
//UI_ThemeColor(TH_WIRE);
glDisable(GL_LIGHTING);
glLineWidth(2.0);
dm->drawEdges(dm, 0, 1);
glLineWidth(1.0);
- glEnable(GL_LIGHTING);*/
+ glEnable(GL_LIGHTING);
+#endif
glDisable(GL_LIGHTING);
/* if(GPU_buffer_legacy(dm) ) */ { /* TODO - VBO draw code, not high priority - campbell */
@@ -2805,8 +2799,8 @@ static void navmesh_drawColored(DerivedMesh *dm)
}
static void navmesh_DM_drawFacesTex(DerivedMesh *dm,
- int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ DMSetDrawOptionsTex setDrawOptions,
+ DMCompareDrawOptions compareDrawOptions,
void *userData)
{
(void) setDrawOptions;
@@ -2818,7 +2812,7 @@ static void navmesh_DM_drawFacesTex(DerivedMesh *dm,
static void navmesh_DM_drawFacesSolid(DerivedMesh *dm,
float (*partial_redraw_planes)[4],
- int UNUSED(fast), int (*setMaterial)(int, void *attribs))
+ int UNUSED(fast), DMSetMaterial setMaterial)
{
(void) partial_redraw_planes;
(void) setMaterial;
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index c181548eb19..b1b98c030eb 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -65,17 +65,17 @@
#include "RNA_access.h"
/* *********************** NOTE ON POSE AND ACTION **********************
-
- - Pose is the local (object level) component of armature. The current
- object pose is saved in files, and (will be) is presorted for dependency
- - Actions have fewer (or other) channels, and write data to a Pose
- - Currently ob->pose data is controlled in where_is_pose only. The (recalc)
- event system takes care of calling that
- - The NLA system (here too) uses Poses as interpolation format for Actions
- - Therefore we assume poses to be static, and duplicates of poses have channels in
- same order, for quick interpolation reasons
-
- ****************************** (ton) ************************************ */
+ *
+ * - Pose is the local (object level) component of armature. The current
+ * object pose is saved in files, and (will be) is presorted for dependency
+ * - Actions have fewer (or other) channels, and write data to a Pose
+ * - Currently ob->pose data is controlled in where_is_pose only. The (recalc)
+ * event system takes care of calling that
+ * - The NLA system (here too) uses Poses as interpolation format for Actions
+ * - Therefore we assume poses to be static, and duplicates of poses have channels in
+ * same order, for quick interpolation reasons
+ *
+ * ****************************** (ton) ************************************ */
/* ***************** Library data level operations on action ************** */
@@ -1214,23 +1214,22 @@ static void blend_pose_strides(bPose *dst, bPose *src, float srcweight, short mo
}
-/*
-
-bone matching diagram, strips A and B
-
- .------------------------.
- | A |
- '------------------------'
- . . b2
- . .-------------v----------.
- . | B . |
- . '------------------------'
- . . .
- . . .
-offset: . 0 . A-B . A-b2+B
- . . .
-
-*/
+/*
+ * bone matching diagram, strips A and B
+ *
+ * .------------------------.
+ * | A |
+ * '------------------------'
+ * . . b2
+ * . .-------------v----------.
+ * . | B . |
+ * . '------------------------'
+ * . . .
+ * . . .
+ * offset: . 0 . A-B . A-b2+B
+ * . . .
+ *
+ * */
static void blend_pose_offset_bone(bActionStrip *strip, bPose *dst, bPose *src, float srcweight, short mode)
@@ -1294,8 +1293,8 @@ static void blend_pose_offset_bone(bActionStrip *strip, bPose *dst, bPose *src,
}
/* added "sizecorr" here, to allow armatures to be scaled and still have striding.
- Only works for uniform scaling. In general I'd advise against scaling armatures ever though! (ton)
-*/
+ * Only works for uniform scaling. In general I'd advise against scaling armatures ever though! (ton)
+ */
static float stridechannel_frame(Object *ob, float sizecorr, bActionStrip *strip, Path *path, float pathdist, float *stride_offset)
{
bAction *act= strip->act;
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 6f3facb6d9d..743cfba0185 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -453,7 +453,7 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets)
/* free curve path data
* NOTE: frees the path itself!
- * NOTE: this is increasingly innacurate with non-uniform BevPoint subdivisions [#24633]
+ * NOTE: this is increasingly inaccurate with non-uniform BevPoint subdivisions [#24633]
*/
void free_path(Path *path)
{
@@ -955,8 +955,8 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
/* par_space_mat - only used for groups so we can modify the space dupli's are in
- when par_space_mat is NULL ob->obmat can be used instead of ob__obmat
- */
+ * when par_space_mat is NULL ob->obmat can be used instead of ob__obmat
+ */
if(par_space_mat)
mult_m4_m4m4(vdd.obmat, par_space_mat, ob->obmat);
else
@@ -1085,8 +1085,8 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
/* End Scene/Group object loop, below is generic */
/* par_space_mat - only used for groups so we can modify the space dupli's are in
- when par_space_mat is NULL ob->obmat can be used instead of ob__obmat
- */
+ * when par_space_mat is NULL ob->obmat can be used instead of ob__obmat
+ */
if(par_space_mat)
mult_m4_m4m4(ob__obmat, par_space_mat, ob->obmat);
else
@@ -1117,11 +1117,11 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
v1= mvert[(mv1= loopstart[0].v)].co;
v2= mvert[(mv2= loopstart[1].v)].co;
v3= mvert[(mv3= loopstart[2].v)].co;
- /*
+#if 0
if (mp->totloop > 3) {
v4= mvert[(mv4= loopstart[3].v)].co;
}
- */
+#endif
}
/* translation */
@@ -1626,8 +1626,8 @@ void free_object_duplilist(ListBase *lb)
DupliObject *dob;
/* loop in reverse order, if object is instanced multiple times
- the original layer may not really be original otherwise, proper
- solution is more complicated */
+ * the original layer may not really be original otherwise, proper
+ * solution is more complicated */
for(dob= lb->last; dob; dob= dob->prev) {
dob->ob->lay= dob->origlay;
copy_m4_m4(dob->ob->obmat, dob->omat);
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index ec5bfbb2cdc..aa01aecf98d 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -948,14 +948,16 @@ KS_Path *BKE_keyingset_find_path (KeyingSet *ks, ID *id, const char group_name[]
/* Defining Tools --------------------------- */
/* Used to create a new 'custom' KeyingSet for the user, that will be automatically added to the stack */
-KeyingSet *BKE_keyingset_add (ListBase *list, const char name[], short flag, short keyingflag)
+KeyingSet *BKE_keyingset_add (ListBase *list, const char idname[], const char name[], short flag, short keyingflag)
{
KeyingSet *ks;
/* allocate new KeyingSet */
ks= MEM_callocN(sizeof(KeyingSet), "KeyingSet");
- BLI_strncpy(ks->name, name ? name : "KeyingSet", sizeof(ks->name));
+ BLI_strncpy(ks->idname, idname ? idname : name ? name : "KeyingSet", sizeof(ks->idname));
+
+ BLI_strncpy(ks->name, name ? name : idname ? idname : "Keying Set", sizeof(ks->name));
ks->flag= flag;
ks->keyingflag= keyingflag;
@@ -963,8 +965,11 @@ KeyingSet *BKE_keyingset_add (ListBase *list, const char name[], short flag, sho
/* add KeyingSet to list */
BLI_addtail(list, ks);
- /* make sure KeyingSet has a unique name (this helps with identification) */
- BLI_uniquename(list, ks, "KeyingSet", '.', offsetof(KeyingSet, name), sizeof(ks->name));
+ /* Make sure KeyingSet has a unique idname. */
+ BLI_uniquename(list, ks, "KeyingSet", '.', offsetof(KeyingSet, idname), sizeof(ks->idname));
+
+ /* Make sure KeyingSet has a unique label (this helps with identification). */
+ BLI_uniquename(list, ks, "Keying Set", '.', offsetof(KeyingSet, name), sizeof(ks->name));
/* return new KeyingSet for further editing */
return ks;
@@ -1131,15 +1136,12 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
//printf("%p %s %i %f\n", ptr, path, array_index, value);
/* get property to write to */
- if (RNA_path_resolve(ptr, path, &new_ptr, &prop))
- {
+ if (RNA_path_resolve(ptr, path, &new_ptr, &prop)) {
/* set value - only for animatable numerical values */
- if (RNA_property_animateable(&new_ptr, prop))
- {
+ if (RNA_property_animateable(&new_ptr, prop)) {
int array_len= RNA_property_array_length(&new_ptr, prop);
- if (array_len && array_index >= array_len)
- {
+ if (array_len && array_index >= array_len) {
if (G.f & G_DEBUG) {
printf("Animato: Invalid array index. ID = '%s', '%s[%d]', array length is %d \n",
(ptr && ptr->id.data) ? (((ID *)ptr->id.data)->name+2) : "<No ID>",
@@ -1149,8 +1151,7 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
return 0;
}
- switch (RNA_property_type(prop))
- {
+ switch (RNA_property_type(prop)) {
case PROP_BOOLEAN:
if (array_len)
RNA_property_boolean_set_index(&new_ptr, prop, array_index, ANIMSYS_FLOAT_AS_BOOL(value));
@@ -1198,8 +1199,8 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
#endif
/* as long as we don't do property update, we still tag datablock
- as having been updated. this flag does not cause any updates to
- be run, it's for e.g. render engines to synchronize data */
+ * as having been updated. this flag does not cause any updates to
+ * be run, it's for e.g. render engines to synchronize data */
if(new_ptr.id.data) {
ID *id= new_ptr.id.data;
id->flag |= LIB_ID_RECALC;
@@ -1258,8 +1259,7 @@ static void animsys_evaluate_fcurves (PointerRNA *ptr, ListBase *list, AnimMappe
/* check if this F-Curve doesn't belong to a muted group */
if ((fcu->grp == NULL) || (fcu->grp->flag & AGRP_MUTED)==0) {
/* check if this curve should be skipped */
- if ((fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) == 0)
- {
+ if ((fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) == 0) {
calculate_fcurve(fcu, ctime);
animsys_execute_fcurve(ptr, remap, fcu);
}
@@ -1284,8 +1284,7 @@ static void animsys_evaluate_drivers (PointerRNA *ptr, AnimData *adt, float ctim
short ok= 0;
/* check if this driver's curve should be skipped */
- if ((fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) == 0)
- {
+ if ((fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) == 0) {
/* check if driver itself is tagged for recalculation */
if ((driver) && !(driver->flag & DRIVER_FLAG_INVALID)/*&& (driver->flag & DRIVER_FLAG_RECALC)*/) { // XXX driver recalc flag is not set yet by depsgraph!
/* evaluate this using values set already in other places */
@@ -1359,8 +1358,7 @@ void animsys_evaluate_action_group (PointerRNA *ptr, bAction *act, bActionGroup
for (fcu= agrp->channels.first; (fcu) && (fcu->grp == agrp); fcu= fcu->next)
{
/* check if this curve should be skipped */
- if ((fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) == 0)
- {
+ if ((fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) == 0) {
calculate_fcurve(fcu, ctime);
animsys_execute_fcurve(ptr, remap, fcu);
}
@@ -1386,7 +1384,7 @@ void animsys_evaluate_action (PointerRNA *ptr, bAction *act, AnimMapper *remap,
/* calculate influence of strip based for given frame based on blendin/out values */
static float nlastrip_get_influence (NlaStrip *strip, float cframe)
{
- /* sanity checks - normalise the blendin/out values? */
+ /* sanity checks - normalize the blendin/out values? */
strip->blendin= fabsf(strip->blendin);
strip->blendout= fabsf(strip->blendout);
@@ -1596,14 +1594,14 @@ static NlaEvalChannel *nlaevalchan_verify (PointerRNA *ptr, ListBase *channels,
/* get path, remapped as appropriate to work in its new environment */
/* free_path= */ /* UNUSED */ animsys_remap_path(strip->remap, fcu->rna_path, &path);
- /* a valid property must be available, and it must be animateable */
+ /* a valid property must be available, and it must be animatable */
if (RNA_path_resolve(ptr, path, &new_ptr, &prop) == 0) {
if (G.f & G_DEBUG) printf("NLA Strip Eval: Cannot resolve path \n");
return NULL;
}
- /* only ok if animateable */
+ /* only ok if animatable */
else if (RNA_property_animateable(&new_ptr, prop) == 0) {
- if (G.f & G_DEBUG) printf("NLA Strip Eval: Property not animateable \n");
+ if (G.f & G_DEBUG) printf("NLA Strip Eval: Property not animatable \n");
return NULL;
}
@@ -2202,11 +2200,9 @@ void BKE_animsys_evaluate_animdata (Scene *scene, ID *id, AnimData *adt, float c
* that overrides 'rough' work in NLA
*/
// TODO: need to double check that this all works correctly
- if ((recalc & ADT_RECALC_ANIM) || (adt->recalc & ADT_RECALC_ANIM))
- {
+ if ((recalc & ADT_RECALC_ANIM) || (adt->recalc & ADT_RECALC_ANIM)) {
/* evaluate NLA data */
- if ((adt->nla_tracks.first) && !(adt->flag & ADT_NLA_EVAL_OFF))
- {
+ if ((adt->nla_tracks.first) && !(adt->flag & ADT_NLA_EVAL_OFF)) {
/* evaluate NLA-stack
* - active action is evaluated as part of the NLA stack as the last item
*/
@@ -2239,8 +2235,7 @@ void BKE_animsys_evaluate_animdata (Scene *scene, ID *id, AnimData *adt, float c
animsys_evaluate_overrides(&id_ptr, adt);
/* execute and clear all cached property update functions */
- if (scene)
- {
+ if (scene) {
Main *bmain = G.main; // xxx - to get passed in!
RNA_property_update_cache_flush(bmain, scene);
RNA_property_update_cache_free();
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index bc18332844b..9bf8de4a2e1 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1114,7 +1114,7 @@ void armature_mat_world_to_pose(Object *ob, float inmat[][4], float outmat[][4])
mult_m4_m4m4(outmat, inmat, obmat);
}
-/* Convert Wolrd-Space Location to Pose-Space Location
+/* Convert World-Space Location to Pose-Space Location
* NOTE: this cannot be used to convert to pose-space location of the supplied
* pose-channel into its local space (i.e. 'visual'-keyframing) */
void armature_loc_world_to_pose(Object *ob, const float inloc[3], float outloc[3])
@@ -1584,7 +1584,7 @@ void where_is_armature_bone(Bone *bone, Bone *prevbone)
}
/* updates vectors and matrices on rest-position level, only needed
- after editing armature itself, now only on reading file */
+ * after editing armature itself, now only on reading file */
void where_is_armature(bArmature *arm)
{
Bone *bone;
@@ -1901,7 +1901,7 @@ static void splineik_init_tree_from_pchan(Scene *scene, Object *UNUSED(ob), bPos
* proportion of the total length that each bone occupies
*/
for (i = 0; i < segcount; i++) {
- /* 'head' joints, travelling towards the root of the chain
+ /* 'head' joints, traveling towards the root of the chain
* - 2 methods; the one chosen depends on whether we've got usable lengths
*/
if ((ikData->flag & CONSTRAINT_SPLINEIK_EVENSPLITS) || (totLength == 0.0f)) {
@@ -2078,14 +2078,14 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
float raxis[3], rangle;
/* compute the raw rotation matrix from the bone's current matrix by extracting only the
- * orientation-relevant axes, and normalising them
+ * orientation-relevant axes, and normalizing them
*/
copy_v3_v3(rmat[0], pchan->pose_mat[0]);
copy_v3_v3(rmat[1], pchan->pose_mat[1]);
copy_v3_v3(rmat[2], pchan->pose_mat[2]);
normalize_m3(rmat);
- /* also, normalise the orientation imposed by the bone, now that we've extracted the scale factor */
+ /* also, normalize the orientation imposed by the bone, now that we've extracted the scale factor */
normalize_v3(splineVec);
/* calculate smallest axis-angle rotation necessary for getting from the
@@ -2255,7 +2255,7 @@ void pchan_to_mat4(bPoseChannel *pchan, float chan_mat[4][4])
/* quats are normalised before use to eliminate scaling issues */
float quat[4];
- /* NOTE: we now don't normalise the stored values anymore, since this was kindof evil in some cases
+ /* NOTE: we now don't normalize the stored values anymore, since this was kindof evil in some cases
* but if this proves to be too problematic, switch back to the old system of operating directly on
* the stored copy
*/
diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c
index f3f4d7c9598..8fa0a46f6da 100644
--- a/source/blender/blenkernel/intern/boids.c
+++ b/source/blender/blenkernel/intern/boids.c
@@ -250,8 +250,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
}
//check boids in own system
- if(acbr->options & BRULE_ACOLL_WITH_BOIDS)
- {
+ if (acbr->options & BRULE_ACOLL_WITH_BOIDS) {
neighbors = BLI_kdtree_range_search(bbd->sim->psys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn);
if(neighbors > 1) for(n=1; n<neighbors; n++) {
copy_v3_v3(co1, pa->prev_state.co);
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 9e706c48430..c178bf6f0a7 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -201,7 +201,7 @@ void make_local_brush(Brush *brush)
if(brush->clone.image) {
/* special case: ima always local immediately. Clone image should only
- have one user anyway. */
+ * have one user anyway. */
id_clear_lib_data(bmain, &brush->clone.image->id);
extern_local_brush(brush);
}
@@ -331,10 +331,8 @@ void brush_debug_print_state(Brush *br)
void brush_reset_sculpt(Brush *br)
{
/* enable this to see any non-default
- settings used by a brush:
-
- brush_debug_print_state(br);
- */
+ * settings used by a brush: */
+ // brush_debug_print_state(br);
brush_set_defaults(br);
brush_curve_preset(br, CURVE_PRESET_SMOOTH);
@@ -857,8 +855,8 @@ static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf,
dotexold = (oldtexibuf != NULL);
/* not sure if it's actually needed or it's a mistake in coords/sizes
- calculation in brush_painter_fixed_tex_partial_update(), but without this
- limitation memory gets corrupted at fast strokes with quite big spacing (sergey) */
+ * calculation in brush_painter_fixed_tex_partial_update(), but without this
+ * limitation memory gets corrupted at fast strokes with quite big spacing (sergey) */
w = MIN2(w, ibuf->x);
h = MIN2(h, ibuf->y);
@@ -1049,7 +1047,7 @@ void brush_jitter_pos(const Scene *scene, Brush *brush, const float pos[2], floa
int use_jitter= brush->jitter != 0;
/* jitter-ed brush gives weird and unpredictable result for this
- kinds of stroke, so manyally disable jitter usage (sergey) */
+ * kinds of stroke, so manyally disable jitter usage (sergey) */
use_jitter &= (brush->flag & (BRUSH_RESTORE_MESH|BRUSH_ANCHORED)) == 0;
if (use_jitter) {
@@ -1139,7 +1137,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2
const int radius= brush_size(scene, brush);
/* compute brush spacing adapted to brush radius, spacing may depend
- on pressure, so update it */
+ * on pressure, so update it */
brush_apply_pressure(painter, brush, painter->lastpressure);
spacing= MAX2(1.0f, radius)*brush->spacing*0.01f;
@@ -1188,8 +1186,8 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2
}
/* do airbrush paint ops, based on the number of paint ops left over
- from regular painting. this is a temporary solution until we have
- accurate time stamps for mouse move events */
+ * from regular painting. this is a temporary solution until we have
+ * accurate time stamps for mouse move events */
if (brush->flag & BRUSH_AIRBRUSH) {
double curtime= time;
double painttime= brush->rate*totpaintops;
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index 0af3c9c9f02..4cade876d09 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -67,8 +67,7 @@ static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, con
normal_tri_v3(plane_normal, v0, v1, v2);
madd_v3_v3v3fl(p1, ray->origin, ray->direction, m_dist);
- if(isect_sweeping_sphere_tri_v3(ray->origin, p1, radius, v0, v1, v2, &idist, hit_point))
- {
+ if (isect_sweeping_sphere_tri_v3(ray->origin, p1, radius, v0, v1, v2, &idist, hit_point)) {
return idist * m_dist;
}
@@ -111,23 +110,17 @@ float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const f
S = A01 * B1 - A11 * B0;
T = A01 * B0 - A00 * B1;
- if ( S + T <= Det )
- {
- if ( S < 0.0f )
- {
- if ( T < 0.0f ) // Region 4
- {
- if ( B0 < 0.0f )
- {
+ if (S + T <= Det) {
+ if (S < 0.0f) {
+ if (T < 0.0f) { /* Region 4 */
+ if (B0 < 0.0f) {
T = 0.0f;
- if ( -B0 >= A00 )
- {
+ if (-B0 >= A00) {
S = 1.0f;
sqrDist = A00 + 2.0f * B0 + C;
lv = 1;
}
- else
- {
+ else {
if(fabsf(A00) > FLT_EPSILON)
S = -B0/A00;
else
@@ -136,23 +129,19 @@ float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const f
le = 0;
}
}
- else
- {
+ else {
S = 0.0f;
- if ( B1 >= 0.0f )
- {
+ if (B1 >= 0.0f) {
T = 0.0f;
sqrDist = C;
lv = 0;
}
- else if ( -B1 >= A11 )
- {
+ else if (-B1 >= A11) {
T = 1.0f;
sqrDist = A11 + 2.0f * B1 + C;
lv = 2;
}
- else
- {
+ else {
if(fabsf(A11) > FLT_EPSILON)
T = -B1 / A11;
else
@@ -162,23 +151,19 @@ float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const f
}
}
}
- else // Region 3
- {
+ else { /* Region 3 */
S = 0.0f;
- if ( B1 >= 0.0f )
- {
+ if (B1 >= 0.0f) {
T = 0.0f;
sqrDist = C;
lv = 0;
}
- else if ( -B1 >= A11 )
- {
+ else if (-B1 >= A11) {
T = 1.0f;
sqrDist = A11 + 2.0f * B1 + C;
lv = 2;
}
- else
- {
+ else {
if(fabsf(A11) > FLT_EPSILON)
T = -B1 / A11;
else
@@ -188,24 +173,20 @@ float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const f
}
}
}
- else if ( T < 0.0f ) // Region 5
- {
+ else if (T < 0.0f) { /* Region 5 */
T = 0.0f;
- if ( B0 >= 0.0f )
- {
+ if (B0 >= 0.0f) {
S = 0.0f;
sqrDist = C;
lv = 0;
}
- else if ( -B0 >= A00 )
- {
+ else if (-B0 >= A00) {
S = 1.0f;
sqrDist = A00 + 2.0f * B0 + C;
lv = 1;
}
- else
- {
- if(fabsf(A00) > FLT_EPSILON)
+ else {
+ if (fabsf(A00) > FLT_EPSILON)
S = -B0 / A00;
else
S = 0.0f;
@@ -213,8 +194,7 @@ float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const f
le = 0;
}
}
- else // Region 0
- {
+ else { /* Region 0 */
// Minimum at interior lv
float invDet;
if(fabsf(Det) > FLT_EPSILON)
@@ -224,57 +204,48 @@ float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const f
S *= invDet;
T *= invDet;
sqrDist = S * ( A00 * S + A01 * T + 2.0f * B0) +
- T * ( A01 * S + A11 * T + 2.0f * B1 ) + C;
+ T * ( A01 * S + A11 * T + 2.0f * B1 ) + C;
}
}
- else
- {
+ else {
float tmp0, tmp1, numer, denom;
- if ( S < 0.0f ) // Region 2
- {
+ if (S < 0.0f) { /* Region 2 */
tmp0 = A01 + B0;
tmp1 = A11 + B1;
- if ( tmp1 > tmp0 )
- {
+ if ( tmp1 > tmp0 ) {
numer = tmp1 - tmp0;
denom = A00 - 2.0f * A01 + A11;
- if ( numer >= denom )
- {
+ if ( numer >= denom ) {
S = 1.0f;
T = 0.0f;
sqrDist = A00 + 2.0f * B0 + C;
lv = 1;
}
- else
- {
+ else {
if(fabsf(denom) > FLT_EPSILON)
S = numer / denom;
else
S = 0.0f;
T = 1.0f - S;
sqrDist = S * ( A00 * S + A01 * T + 2.0f * B0 ) +
- T * ( A01 * S + A11 * T + 2.0f * B1 ) + C;
+ T * ( A01 * S + A11 * T + 2.0f * B1 ) + C;
le = 2;
}
}
- else
- {
+ else {
S = 0.0f;
- if ( tmp1 <= 0.0f )
- {
+ if ( tmp1 <= 0.0f ) {
T = 1.0f;
sqrDist = A11 + 2.0f * B1 + C;
lv = 2;
}
- else if ( B1 >= 0.0f )
- {
+ else if (B1 >= 0.0f) {
T = 0.0f;
sqrDist = C;
lv = 0;
}
- else
- {
+ else {
if(fabsf(A11) > FLT_EPSILON)
T = -B1 / A11;
else
@@ -284,50 +255,42 @@ float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const f
}
}
}
- else if ( T < 0.0f ) // Region 6
- {
+ else if (T < 0.0f) { /* Region 6 */
tmp0 = A01 + B1;
tmp1 = A00 + B0;
- if ( tmp1 > tmp0 )
- {
+ if ( tmp1 > tmp0 ) {
numer = tmp1 - tmp0;
denom = A00 - 2.0f * A01 + A11;
- if ( numer >= denom )
- {
+ if ( numer >= denom ) {
T = 1.0f;
S = 0.0f;
sqrDist = A11 + 2.0f * B1 + C;
lv = 2;
}
- else
- {
+ else {
if(fabsf(denom) > FLT_EPSILON)
T = numer / denom;
else
T = 0.0f;
S = 1.0f - T;
sqrDist = S * ( A00 * S + A01 * T + 2.0f * B0 ) +
- T * ( A01 * S + A11 * T + 2.0f * B1 ) + C;
+ T * ( A01 * S + A11 * T + 2.0f * B1 ) + C;
le = 2;
}
}
- else
- {
+ else {
T = 0.0f;
- if ( tmp1 <= 0.0f )
- {
+ if (tmp1 <= 0.0f) {
S = 1.0f;
sqrDist = A00 + 2.0f * B0 + C;
lv = 1;
}
- else if ( B0 >= 0.0f )
- {
+ else if (B0 >= 0.0f) {
S = 0.0f;
sqrDist = C;
lv = 0;
}
- else
- {
+ else {
if(fabsf(A00) > FLT_EPSILON)
S = -B0 / A00;
else
@@ -337,35 +300,30 @@ float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const f
}
}
}
- else // Region 1
- {
+ else { /* Region 1 */
numer = A11 + B1 - A01 - B0;
- if ( numer <= 0.0f )
- {
+ if ( numer <= 0.0f ) {
S = 0.0f;
T = 1.0f;
sqrDist = A11 + 2.0f * B1 + C;
lv = 2;
}
- else
- {
+ else {
denom = A00 - 2.0f * A01 + A11;
- if ( numer >= denom )
- {
+ if ( numer >= denom ) {
S = 1.0f;
T = 0.0f;
sqrDist = A00 + 2.0f * B0 + C;
lv = 1;
}
- else
- {
+ else {
if(fabsf(denom) > FLT_EPSILON)
S = numer / denom;
else
S = 0.0f;
T = 1.0f - S;
sqrDist = S * ( A00 * S + A01 * T + 2.0f * B0 ) +
- T * ( A01 * S + A11 * T + 2.0f * B1 ) + C;
+ T * ( A01 * S + A11 * T + 2.0f * B1 ) + C;
le = 2;
}
}
@@ -421,8 +379,7 @@ static void mesh_faces_nearest_point(void *userdata, int index, const float co[3
int vertex, edge;
dist = nearest_point_in_tri_surface(t0, t1, t2, co, &vertex, &edge, nearest_tmp);
- if(dist < nearest->dist)
- {
+ if (dist < nearest->dist) {
nearest->index = index;
nearest->dist = dist;
copy_v3_v3(nearest->co, nearest_tmp);
@@ -459,8 +416,7 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r
else
dist = sphereray_tri_intersection(ray, data->sphere_radius, hit->dist, t0, t1, t2);
- if(dist >= 0 && dist < hit->dist)
- {
+ if (dist >= 0 && dist < hit->dist) {
hit->index = index;
hit->dist = dist;
madd_v3_v3v3fl(hit->co, ray->origin, ray->direction, dist);
@@ -491,8 +447,7 @@ static void mesh_edges_nearest_point(void *userdata, int index, const float co[3
closest_to_line_segment_v3(nearest_tmp, co, t0, t1);
dist = len_squared_v3v3(nearest_tmp, co);
- if(dist < nearest->dist)
- {
+ if (dist < nearest->dist) {
nearest->index = index;
nearest->dist = dist;
copy_v3_v3(nearest->co, nearest_tmp);
@@ -510,20 +465,18 @@ BVHTree* bvhtree_from_mesh_verts(BVHTreeFromMesh *data, DerivedMesh *mesh, float
BVHTree *tree = bvhcache_find(&mesh->bvhCache, BVHTREE_FROM_VERTICES);
//Not in cache
- if(tree == NULL)
- {
+ if(tree == NULL) {
int i;
int numVerts= mesh->getNumVerts(mesh);
MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT);
- if(vert != NULL)
- {
+ if (vert != NULL) {
tree = BLI_bvhtree_new(numVerts, epsilon, tree_type, axis);
- if(tree != NULL)
- {
- for(i = 0; i < numVerts; i++)
+ if (tree != NULL) {
+ for (i = 0; i < numVerts; i++) {
BLI_bvhtree_insert(tree, i, vert[i].co, 1);
+ }
BLI_bvhtree_balance(tree);
@@ -533,8 +486,7 @@ BVHTree* bvhtree_from_mesh_verts(BVHTreeFromMesh *data, DerivedMesh *mesh, float
}
}
}
- else
- {
+ else {
// printf("BVHTree is already build, using cached tree\n");
}
@@ -543,8 +495,7 @@ BVHTree* bvhtree_from_mesh_verts(BVHTreeFromMesh *data, DerivedMesh *mesh, float
memset(data, 0, sizeof(*data));
data->tree = tree;
- if(data->tree)
- {
+ if (data->tree) {
data->cached = TRUE;
//a NULL nearest callback works fine
@@ -568,8 +519,7 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float
BVHTree *tree = bvhcache_find(&mesh->bvhCache, BVHTREE_FROM_FACES);
//Not in cache
- if(tree == NULL)
- {
+ if (tree == NULL) {
int i;
int numFaces= mesh->getNumTessFaces(mesh);
@@ -580,25 +530,23 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float
* if not caller should use DM_ensure_tessface() */
BLI_assert(!(numFaces == 0 && mesh->getNumPolys(mesh) != 0));
- if(numFaces != 0)
- {
+ if(numFaces != 0) {
/* Create a bvh-tree of the given target */
tree = BLI_bvhtree_new(numFaces, epsilon, tree_type, axis);
- if(tree != NULL)
- {
+ if (tree != NULL) {
BMEditMesh *em= data->em_evil;
if(em) {
- /*data->em_evil is only set for snapping, and only for the mesh of the object
- which is currently open in edit mode. When set, the bvhtree should not contain
- faces that will interfere with snapping (e.g. faces that are hidden/selected
- or faces that have selected verts).*/
+ /* data->em_evil is only set for snapping, and only for the mesh of the object
+ * which is currently open in edit mode. When set, the bvhtree should not contain
+ * faces that will interfere with snapping (e.g. faces that are hidden/selected
+ * or faces that have selected verts).*/
/* XXX, for snap only, em & dm are assumed to be aligned, since dm is the em's cage */
- /*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.*/
+ /* 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.*/
for (i = 0; i < em->tottri; i++) {
BMLoop **tri = em->looptris[i];
BMFace *f;
@@ -606,37 +554,36 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float
BMIter iter;
int insert;
- /*Each loop of the triangle points back to the BMFace it was tesselated from.
- All three should point to the same face, so just use the face from the first
- loop.*/
+ /* Each loop of the triangle points back to the BMFace it was tesselated from.
+ * All three should point to the same face, so just use the face from the first
+ * loop.*/
f = tri[0]->f;
- /*If the looptris is ordered such that all triangles tesselated from a single
- faces are consecutive elements in the array, then we could speed up the tests
- below by using the insert value from the previous iteration.*/
+ /* If the looptris is ordered such that all triangles tesselated from a single
+ * faces are consecutive elements in the array, then we could speed up the tests
+ * below by using the insert value from the previous iteration.*/
/*Start with the assumption the triangle should be included for snapping.*/
insert = 1;
if (BM_elem_flag_test(f, BM_ELEM_SELECT) || BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
- /*Don't insert triangles tesselated from faces that are hidden
- or selected*/
+ /* Don't insert triangles tesselated from faces that are hidden
+ * or selected*/
insert = 0;
}
else {
BM_ITER(v, &iter, em->bm, BM_VERTS_OF_FACE, f) {
if (BM_elem_flag_test(v, BM_ELEM_SELECT)) {
- /*Don't insert triangles tesselated from faces that have
- any selected verts.*/
+ /* Don't insert triangles tesselated from faces that have
+ * any selected verts.*/
insert = 0;
}
}
}
- if (insert)
- {
- /*No reason found to block hit-testing the triangle for snap,
- so insert it now.*/
+ if (insert) {
+ /* No reason found to block hit-testing the triangle for snap,
+ * so insert it now.*/
float co[4][3];
copy_v3_v3(co[0], tri[0]->v->co);
copy_v3_v3(co[1], tri[1]->v->co);
@@ -671,8 +618,7 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float
}
}
}
- else
- {
+ else {
// printf("BVHTree is already build, using cached tree\n");
}
@@ -681,8 +627,7 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float
memset(data, 0, sizeof(*data));
data->tree = tree;
- if(data->tree)
- {
+ if(data->tree) {
data->cached = TRUE;
data->nearest_callback = mesh_faces_nearest_point;
@@ -711,14 +656,11 @@ BVHTree* bvhtree_from_mesh_edges(BVHTreeFromMesh *data, DerivedMesh *mesh, float
MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT);
MEdge *edge = mesh->getEdgeDataArray(mesh, CD_MEDGE);
- if(vert != NULL && edge != NULL)
- {
+ if (vert != NULL && edge != NULL) {
/* Create a bvh-tree of the given target */
tree = BLI_bvhtree_new(numEdges, epsilon, tree_type, axis);
- if(tree != NULL)
- {
- for(i = 0; i < numEdges; i++)
- {
+ if (tree != NULL) {
+ for (i = 0; i < numEdges; i++) {
float co[4][3];
copy_v3_v3(co[0], vert[ edge[i].v1 ].co);
copy_v3_v3(co[1], vert[ edge[i].v2 ].co);
@@ -743,8 +685,7 @@ BVHTree* bvhtree_from_mesh_edges(BVHTreeFromMesh *data, DerivedMesh *mesh, float
memset(data, 0, sizeof(*data));
data->tree = tree;
- if(data->tree)
- {
+ if(data->tree) {
data->cached = TRUE;
data->nearest_callback = mesh_edges_nearest_point;
@@ -763,8 +704,7 @@ BVHTree* bvhtree_from_mesh_edges(BVHTreeFromMesh *data, DerivedMesh *mesh, float
// Frees data allocated by a call to bvhtree_from_mesh_*.
void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data)
{
- if(data->tree)
- {
+ if(data->tree) {
if(!data->cached)
BLI_bvhtree_free(data->tree);
@@ -786,8 +726,7 @@ static void bvhcacheitem_set_if_match(void *_cached, void *_search)
BVHCacheItem * cached = (BVHCacheItem *)_cached;
BVHCacheItem * search = (BVHCacheItem *)_search;
- if(search->type == cached->type)
- {
+ if(search->type == cached->type) {
search->tree = cached->tree;
}
}
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 50d0f2daab9..cf435e96332 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -79,7 +79,7 @@ typedef struct {
DerivedMesh dm;
/* these point to data in the DerivedMesh custom data layers,
- they are only here for efficiency and convenience **/
+ * they are only here for efficiency and convenience **/
MVert *mvert;
MEdge *medge;
MFace *mface;
@@ -237,13 +237,13 @@ static int can_pbvh_draw(Object *ob, DerivedMesh *dm)
int deformed= 0;
/* active modifiers means extra deformation, which can't be handled correct
- on bith of PBVH and sculpt "layer" levels, so use PBVH only for internal brush
- stuff and show final DerivedMesh so user would see actual object shape */
+ * on bith of PBVH and sculpt "layer" levels, so use PBVH only for internal brush
+ * stuff and show final DerivedMesh so user would see actual object shape */
deformed|= ob->sculpt->modifiers_active;
/* as in case with modifiers, we can't synchronize deformation made against
- PBVH and non-locked keyblock, so also use PBVH only for brushes and
- final DM to give final result to user */
+ * PBVH and non-locked keyblock, so also use PBVH only for brushes and
+ * final DM to give final result to user */
deformed|= ob->sculpt->kb && (ob->shapeflag&OB_SHAPE_LOCK) == 0;
if(deformed)
@@ -269,8 +269,8 @@ static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
}
/* always build pbvh from original mesh, and only use it for drawing if
- this derivedmesh is just original mesh. it's the multires subsurf dm
- that this is actually for, to support a pbvh on a modified mesh */
+ * this derivedmesh is just original mesh. it's the multires subsurf dm
+ * that this is actually for, to support a pbvh on a modified mesh */
if(!cddm->pbvh && ob->type == OB_MESH) {
SculptSession *ss= ob->sculpt;
Mesh *me= ob->data;
@@ -297,7 +297,7 @@ static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
}
/* update vertex normals so that drawing smooth faces works during sculpt
- TODO: proper fix is to support the pbvh in all drawing modes */
+ * TODO: proper fix is to support the pbvh in all drawing modes */
static void cdDM_update_normals_from_pbvh(DerivedMesh *dm)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
@@ -505,7 +505,7 @@ static void cdDM_drawLooseEdges(DerivedMesh *dm)
static void cdDM_drawFacesSolid(DerivedMesh *dm,
float (*partial_redraw_planes)[4],
- int UNUSED(fast), int (*setMaterial)(int, void *attribs))
+ int UNUSED(fast), DMSetMaterial setMaterial)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
MVert *mvert = cddm->mvert;
@@ -525,12 +525,7 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm,
if(dm->numTessFaceData) {
float (*face_nors)[3] = CustomData_get_layer(&dm->faceData, CD_NORMAL);
- /* should be per face */
- if(!setMaterial(mface->mat_nr+1, NULL))
- return;
-
- glShadeModel((mface->flag & ME_SMOOTH)? GL_SMOOTH: GL_FLAT);
- BLI_pbvh_draw(cddm->pbvh, partial_redraw_planes, face_nors, (mface->flag & ME_SMOOTH));
+ BLI_pbvh_draw(cddm->pbvh, partial_redraw_planes, face_nors, setMaterial);
glShadeModel(GL_FLAT);
}
@@ -604,97 +599,10 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm,
glShadeModel(GL_FLAT);
}
-static void cdDM_drawFacesColored(DerivedMesh *dm, int useTwoSided, unsigned char *col1, unsigned char *col2)
-{
- CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
- int a, glmode;
- unsigned char *cp1, *cp2;
- MVert *mvert = cddm->mvert;
- MFace *mface = cddm->mface;
-
- cp1 = col1;
- if(col2) {
- cp2 = col2;
- } else {
- cp2 = NULL;
- useTwoSided = 0;
- }
-
- /* there's a conflict here... twosided colors versus culling...? */
- /* defined by history, only texture faces have culling option */
- /* we need that as mesh option builtin, next to double sided lighting */
- if(col2) {
- glEnable(GL_CULL_FACE);
- }
-
- cdDM_update_normals_from_pbvh(dm);
-
- if( GPU_buffer_legacy(dm) ) {
- DEBUG_VBO( "Using legacy code. cdDM_drawFacesColored\n" );
- glShadeModel(GL_SMOOTH);
- glBegin(glmode = GL_QUADS);
- for(a = 0; a < dm->numTessFaceData; a++, mface++, cp1 += 16) {
- int new_glmode = mface->v4?GL_QUADS:GL_TRIANGLES;
-
- if(new_glmode != glmode) {
- glEnd();
- glBegin(glmode = new_glmode);
- }
-
- glColor3ubv(cp1+0);
- glVertex3fv(mvert[mface->v1].co);
- glColor3ubv(cp1+4);
- glVertex3fv(mvert[mface->v2].co);
- glColor3ubv(cp1+8);
- glVertex3fv(mvert[mface->v3].co);
- if(mface->v4) {
- glColor3ubv(cp1+12);
- glVertex3fv(mvert[mface->v4].co);
- }
-
- if(useTwoSided) {
- glColor3ubv(cp2+8);
- glVertex3fv(mvert[mface->v3].co );
- glColor3ubv(cp2+4);
- glVertex3fv(mvert[mface->v2].co );
- glColor3ubv(cp2+0);
- glVertex3fv(mvert[mface->v1].co );
- if(mface->v4) {
- glColor3ubv(cp2+12);
- glVertex3fv(mvert[mface->v4].co );
- }
- }
- if(col2) cp2 += 16;
- }
- glEnd();
- }
- else { /* use OpenGL VBOs or Vertex Arrays instead for better, faster rendering */
- GPU_color4_upload(dm,cp1);
- GPU_vertex_setup(dm);
- GPU_color_setup(dm);
- if( !GPU_buffer_legacy(dm) ) {
- glShadeModel(GL_SMOOTH);
- glDrawArrays(GL_TRIANGLES, 0, dm->drawObject->tot_triangle_point);
-
- if( useTwoSided ) {
- GPU_color4_upload(dm,cp2);
- GPU_color_setup(dm);
- glCullFace(GL_FRONT);
- glDrawArrays(GL_TRIANGLES, 0, dm->drawObject->tot_triangle_point);
- glCullFace(GL_BACK);
- }
- }
- GPU_buffer_unbind();
- }
-
- glShadeModel(GL_FLAT);
- glDisable(GL_CULL_FACE);
-}
-
static void cdDM_drawFacesTex_common(DerivedMesh *dm,
- int (*drawParams)(MTFace *tface, int has_mcol, int matnr),
- int (*drawParamsMapped)(void *userData, int index),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ DMSetDrawOptionsTex drawParams,
+ DMSetDrawOptions drawParamsMapped,
+ DMCompareDrawOptions compareDrawOptions,
void *userData)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
@@ -715,26 +623,26 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
DEBUG_VBO( "Using legacy code. cdDM_drawFacesTex_common\n" );
for(i = 0; i < dm->numTessFaceData; i++, mf++) {
MVert *mvert;
- int flag;
+ DMDrawOption draw_option;
unsigned char *cp = NULL;
if(drawParams) {
- flag = drawParams(tf? &tf[i]: NULL, (mcol != NULL), mf->mat_nr);
+ draw_option = drawParams(tf? &tf[i]: NULL, (mcol != NULL), mf->mat_nr);
}
else {
if(index) {
orig = *index++;
if(orig == ORIGINDEX_NONE) { if(nors) nors += 3; continue; }
- if(drawParamsMapped) flag = drawParamsMapped(userData, orig);
+ if(drawParamsMapped) draw_option = drawParamsMapped(userData, orig);
else { if(nors) nors += 3; continue; }
}
else
- if(drawParamsMapped) flag = drawParamsMapped(userData, i);
+ if(drawParamsMapped) draw_option = drawParamsMapped(userData, i);
else { if(nors) nors += 3; continue; }
}
- if(flag != 0) {
- if (flag==1 && mcol)
+ if(draw_option != DM_DRAW_OPTION_SKIP) {
+ if (draw_option != DM_DRAW_OPTION_NO_MCOL && mcol)
cp= (unsigned char*) &mcol[i*4];
if(!(mf->flag&ME_SMOOTH)) {
@@ -826,39 +734,40 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
/* lastFlag = 0; */ /* UNUSED */
for(i = 0; i < tottri; i++) {
int actualFace = next_actualFace;
- int flag = 1;
+ DMDrawOption draw_option = DM_DRAW_OPTION_NORMAL;
int flush = 0;
if(i != tottri-1)
next_actualFace= dm->drawObject->triangle_to_mface[i+1];
if(drawParams) {
- flag = drawParams(tf? &tf[actualFace]: NULL, (mcol != NULL), mf[actualFace].mat_nr);
+ draw_option = drawParams(tf? &tf[actualFace]: NULL, (mcol != NULL), mf[actualFace].mat_nr);
}
else {
if(index) {
orig = index[actualFace];
if(orig == ORIGINDEX_NONE) continue;
if(drawParamsMapped)
- flag = drawParamsMapped(userData, orig);
+ draw_option = drawParamsMapped(userData, orig);
}
else
if(drawParamsMapped)
- flag = drawParamsMapped(userData, actualFace);
+ draw_option = drawParamsMapped(userData, actualFace);
}
/* flush buffer if current triangle isn't drawable or it's last triangle */
- flush= !flag || i == tottri - 1;
+ flush= (draw_option == DM_DRAW_OPTION_SKIP) || (i == tottri - 1);
if(!flush && compareDrawOptions) {
/* also compare draw options and flush buffer if they're different
- need for face selection highlight in edit mode */
+ * need for face selection highlight in edit mode */
flush|= compareDrawOptions(userData, actualFace, next_actualFace) == 0;
}
if(flush) {
int first= startFace*3;
- int count= (i-startFace+(flag ? 1 : 0))*3; /* Add one to the length if we're drawing at the end of the array */
+ /* Add one to the length if we're drawing at the end of the array */
+ int count= (i-startFace+(draw_option != DM_DRAW_OPTION_SKIP ? 1 : 0))*3;
if(count) {
if (col)
@@ -880,24 +789,25 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
}
static void cdDM_drawFacesTex(DerivedMesh *dm,
- int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ DMSetDrawOptionsTex setDrawOptions,
+ DMCompareDrawOptions compareDrawOptions,
void *userData)
{
cdDM_drawFacesTex_common(dm, setDrawOptions, NULL, compareDrawOptions, userData);
}
static void cdDM_drawMappedFaces(DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r),
- int (*setMaterial)(int, void *attribs),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
- void *userData, int useColors)
+ DMSetDrawOptions setDrawOptions,
+ DMSetMaterial setMaterial,
+ DMCompareDrawOptions compareDrawOptions,
+ void *userData, DMDrawFlag flag)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
MVert *mv = cddm->mvert;
MFace *mf = cddm->mface;
MCol *mc;
float *nors= DM_get_tessface_data_layer(dm, CD_NORMAL);
+ int useColors = flag & DM_DRAW_USE_COLORS;
int i, orig, *index = DM_get_tessface_data_layer(dm, CD_ORIGINDEX);
mc = DM_get_tessface_data_layer(dm, CD_ID_MCOL);
@@ -913,24 +823,24 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
if( GPU_buffer_legacy(dm) || G.f & G_BACKBUFSEL) {
DEBUG_VBO( "Using legacy code. cdDM_drawMappedFaces\n" );
for(i = 0; i < dm->numTessFaceData; i++, mf++) {
- int drawSmooth = (mf->flag & ME_SMOOTH);
- int draw= 1;
+ int drawSmooth = (flag & DM_DRAW_ALWAYS_SMOOTH) ? 1 : (mf->flag & ME_SMOOTH);
+ DMDrawOption draw_option= DM_DRAW_OPTION_NORMAL;
orig= (index==NULL) ? i : *index++;
if(orig == ORIGINDEX_NONE)
- draw= setMaterial(mf->mat_nr + 1, NULL);
+ draw_option= setMaterial(mf->mat_nr + 1, NULL);
else if (setDrawOptions != NULL)
- draw= setDrawOptions(userData, orig, &drawSmooth);
+ draw_option= setDrawOptions(userData, orig);
- if(draw) {
+ if(draw_option != DM_DRAW_OPTION_SKIP) {
unsigned char *cp = NULL;
if(useColors && mc)
cp = (unsigned char *)&mc[i * 4];
/* no need to set shading mode to flat because
- * normals are already used to change shading */
+ * normals are already used to change shading */
glShadeModel(GL_SMOOTH);
glBegin(mf->v4?GL_QUADS:GL_TRIANGLES);
@@ -1006,8 +916,8 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
//int actualFace = dm->drawObject->triangle_to_mface[i];
int actualFace = next_actualFace;
MFace *mface= mf + actualFace;
- int drawSmooth= (mface->flag & ME_SMOOTH);
- int draw = 1;
+ /*int drawSmooth= (flag & DM_DRAW_ALWAYS_SMOOTH) ? 1 : (mface->flag & ME_SMOOTH);*/ /* UNUSED */
+ DMDrawOption draw_option = DM_DRAW_OPTION_NORMAL;
int flush = 0;
if(i != tottri-1)
@@ -1016,16 +926,16 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
orig= (index==NULL) ? actualFace : index[actualFace];
if(orig == ORIGINDEX_NONE)
- draw= setMaterial(mface->mat_nr + 1, NULL);
+ draw_option= setMaterial(mface->mat_nr + 1, NULL);
else if (setDrawOptions != NULL)
- draw= setDrawOptions(userData, orig, &drawSmooth);
+ draw_option= setDrawOptions(userData, orig);
/* Goal is to draw as long of a contiguous triangle
- array as possible, so draw when we hit either an
- invisible triangle or at the end of the array */
+ * array as possible, so draw when we hit either an
+ * invisible triangle or at the end of the array */
/* flush buffer if current triangle isn't drawable or it's last triangle... */
- flush= !draw || i == tottri - 1;
+ flush= (draw_option == DM_DRAW_OPTION_SKIP) || (i == tottri - 1);
/* ... or when material setting is dissferent */
flush|= mf[actualFace].mat_nr != mf[next_actualFace].mat_nr;
@@ -1036,7 +946,8 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
if(flush) {
int first= prevstart*3;
- int count= (i-prevstart+(draw ? 1 : 0))*3; /* Add one to the length if we're drawing at the end of the array */
+ /* Add one to the length if we're drawing at the end of the array */
+ int count= (i-prevstart+(draw_option != DM_DRAW_OPTION_SKIP ? 1 : 0))*3;
if(count)
glDrawArrays(GL_TRIANGLES, first, count);
@@ -1053,8 +964,8 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
}
static void cdDM_drawMappedFacesTex(DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ DMSetDrawOptions setDrawOptions,
+ DMCompareDrawOptions compareDrawOptions,
void *userData)
{
cdDM_drawFacesTex_common(dm, NULL, setDrawOptions, compareDrawOptions, userData);
@@ -1105,8 +1016,8 @@ static void cddm_draw_attrib_vertex(DMVertexAttribs *attribs, MVert *mvert, int
}
static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
- int (*setMaterial)(int, void *attribs),
- int (*setDrawOptions)(void *userData, int index),
+ DMSetMaterial setMaterial,
+ DMSetDrawOptions setDrawOptions,
void *userData)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
@@ -1158,7 +1069,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
/* continue */
}
- else if(!setDrawOptions(userData, orig))
+ else if(setDrawOptions(userData, orig) == DM_DRAW_OPTION_SKIP)
continue;
}
@@ -1394,7 +1305,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
glShadeModel(GL_FLAT);
}
-static void cdDM_drawFacesGLSL(DerivedMesh *dm,int (*setMaterial)(int, void *attribs))
+static void cdDM_drawFacesGLSL(DerivedMesh *dm, DMSetMaterial setMaterial)
{
dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL);
}
@@ -1478,7 +1389,7 @@ static void cdDM_drawMappedFacesMat(DerivedMesh *dm,
glShadeModel(GL_FLAT);
}
-static void cdDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index), void *userData)
+static void cdDM_drawMappedEdges(DerivedMesh *dm, DMSetDrawOptions setDrawOptions, void *userData)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
MVert *vert = cddm->mvert;
@@ -1494,7 +1405,7 @@ static void cdDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *us
else
orig = i;
- if(!setDrawOptions || setDrawOptions(userData, orig)) {
+ if(!setDrawOptions || (setDrawOptions(userData, orig) != DM_DRAW_OPTION_SKIP)) {
glVertex3fv(vert[edge->v1].co);
glVertex3fv(vert[edge->v2].co);
}
@@ -1606,7 +1517,7 @@ void CDDM_recalc_tessellation_ex(DerivedMesh *dm, const int do_face_nor_cpy)
cddm->mface = CustomData_get_layer(&dm->faceData, CD_MFACE);
/* Tessellation recreated faceData, and the active layer indices need to get re-propagated
- from loops and polys to faces */
+ * from loops and polys to faces */
CustomData_bmesh_update_active_layers(&dm->faceData, &dm->polyData, &dm->loopData);
}
@@ -1691,7 +1602,6 @@ static CDDerivedMesh *cdDM_create(const char *desc)
dm->drawMappedEdges = cdDM_drawMappedEdges;
dm->drawFacesSolid = cdDM_drawFacesSolid;
- dm->drawFacesColored = cdDM_drawFacesColored;
dm->drawFacesTex = cdDM_drawFacesTex;
dm->drawFacesGLSL = cdDM_drawFacesGLSL;
dm->drawMappedFaces = cdDM_drawMappedFaces;
@@ -1916,8 +1826,8 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
mask = use_mdisps ? CD_MASK_DERIVEDMESH|CD_MASK_MDISPS : CD_MASK_DERIVEDMESH;
- /*don't process shapekeys, we only feed them through the modifier stack as needed,
- e.g. for applying modifiers or the like*/
+ /* don't process shapekeys, we only feed them through the modifier stack as needed,
+ * e.g. for applying modifiers or the like*/
mask &= ~CD_MASK_SHAPEKEY;
CustomData_merge(&bm->vdata, &dm->vertData, mask,
CD_CALLOC, dm->numVertData);
@@ -2082,7 +1992,7 @@ static DerivedMesh *cddm_copy_ex(DerivedMesh *source, int faces_from_tessfaces)
/* any callers that need tessface data can calculate it - campbell */
#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. */
+ * it). If it is necessary, add a comment explaining why. */
CDDM_recalc_tessellation((DerivedMesh *)cddm);
#endif
@@ -2316,7 +2226,6 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
/*find-replace merged vertices with target vertices*/
ml = cddm->mloop;
- c = 0;
for (i=0; i<totloop; i++, ml++) {
if (vtargetmap[ml->v] != -1) {
ml->v = vtargetmap[ml->v];
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index e2d12c04bf2..3aeeb265c01 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -288,8 +288,7 @@ void bvhtree_update_from_cloth(ClothModifierData *clmd, int moving)
ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, (mfaces->v4 ? 4 : 3));
}
- else
- {
+ else {
ret = BLI_bvhtree_update_node(bvhtree, i, co, NULL, (mfaces->v4 ? 4 : 3));
}
@@ -332,8 +331,7 @@ void bvhselftree_update_from_cloth(ClothModifierData *clmd, int moving)
ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, 1);
}
- else
- {
+ else {
ret = BLI_bvhtree_update_node(bvhtree, i, co, NULL, 1);
}
@@ -828,8 +826,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
cloth = clmd->clothObject;
clmd->clothObject->edgehash = NULL;
}
- else if ( !clmd->clothObject )
- {
+ else if (!clmd->clothObject) {
modifier_setError ( & ( clmd->modifier ), "Out of memory on allocating clmd->clothObject." );
return 0;
}
@@ -1096,8 +1093,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
BLI_linklist_prepend ( &cloth->springs, spring );
}
- else
- {
+ else {
cloth_free_errorsprings(cloth, edgehash, edgelist);
return 0;
}
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index 5e65d104a03..f19226cedf0 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -82,10 +82,10 @@ void collision_move_object ( CollisionModifierData *collmd, float step, float pr
for ( i = 0; i < collmd->numverts; i++ )
{
- VECSUB ( tv, collmd->xnew[i].co, collmd->x[i].co );
+ sub_v3_v3v3 ( tv, collmd->xnew[i].co, collmd->x[i].co );
VECADDS ( collmd->current_x[i].co, collmd->x[i].co, tv, prevstep );
VECADDS ( collmd->current_xnew[i].co, collmd->x[i].co, tv, step );
- VECSUB ( collmd->current_v[i].co, collmd->current_xnew[i].co, collmd->current_x[i].co );
+ sub_v3_v3v3 ( collmd->current_v[i].co, collmd->current_xnew[i].co, collmd->current_x[i].co );
}
bvhtree_update_from_mvert ( collmd->bvhtree, collmd->mfaces, collmd->numfaces, collmd->current_x, collmd->current_xnew, collmd->numverts, 1 );
@@ -529,10 +529,10 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM
collision_interpolateOnTriangle ( v2, collmd->current_v[collpair->bp1].co, collmd->current_v[collpair->bp2].co, collmd->current_v[collpair->bp3].co, u1, u2, u3 );
- VECSUB ( relativeVelocity, v2, v1 );
+ sub_v3_v3v3 ( relativeVelocity, v2, v1 );
// Calculate the normal component of the relative velocity (actually only the magnitude - the direction is stored in 'normal').
- magrelVel = INPR ( relativeVelocity, collpair->normal );
+ magrelVel = dot_v3v3( relativeVelocity, collpair->normal );
// printf("magrelVel: %f\n", magrelVel);
@@ -551,11 +551,11 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM
// calculate tangential velocity
copy_v3_v3 ( temp, collpair->normal );
mul_v3_fl( temp, magrelVel );
- VECSUB ( vrel_t_pre, relativeVelocity, temp );
+ sub_v3_v3v3 ( vrel_t_pre, relativeVelocity, temp );
// Decrease in magnitude of relative tangential velocity due to coulomb friction
// in original formula "magrelVel" should be the "change of relative velocity in normal direction"
- magtangent = MIN2 ( clmd->coll_parms->friction * 0.01f * magrelVel, sqrtf( INPR ( vrel_t_pre,vrel_t_pre ) ) );
+ magtangent = MIN2 ( clmd->coll_parms->friction * 0.01f * magrelVel, sqrtf( dot_v3v3( vrel_t_pre,vrel_t_pre ) ) );
// Apply friction impulse.
if ( magtangent > ALMOST_ZERO )
@@ -859,10 +859,10 @@ static int cloth_edge_collision_response_moving ( ClothModifierData *clmd, Colli
VECADDFAC(v1, cloth1->verts[collpair->ap1].tv, cloth1->verts[collpair->ap2].tv, w1);
VECADDFAC(v2, collmd->current_v[collpair->bp1].co, collmd->current_v[collpair->bp2].co, w2);
- VECSUB ( relativeVelocity, v2, v1);
+ sub_v3_v3v3 ( relativeVelocity, v2, v1);
// Calculate the normal component of the relative velocity (actually only the magnitude - the direction is stored in 'normal').
- magrelVel = INPR ( relativeVelocity, collpair->normal );
+ magrelVel = dot_v3v3 ( relativeVelocity, collpair->normal );
// If v_n_mag < 0 the edges are approaching each other.
if ( magrelVel > ALMOST_ZERO )
@@ -876,13 +876,13 @@ static int cloth_edge_collision_response_moving ( ClothModifierData *clmd, Colli
zero_v3(pimpulse);
// calculate tangential velocity
- VECCOPY ( temp, collpair->normal );
+ copy_v3_v3 ( temp, collpair->normal );
mul_v3_fl( temp, magrelVel );
- VECSUB ( vrel_t_pre, relativeVelocity, temp );
+ sub_v3_v3v3 ( vrel_t_pre, relativeVelocity, temp );
// Decrease in magnitude of relative tangential velocity due to coulomb friction
// in original formula "magrelVel" should be the "change of relative velocity in normal direction"
- magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( INPR ( vrel_t_pre,vrel_t_pre ) ) );
+ magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
// Apply friction impulse.
if ( magtangent > ALMOST_ZERO )
@@ -961,10 +961,10 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
// Calculate relative "velocity".
collision_interpolateOnTriangle ( v1, collmd->current_v[collpair->bp1].co, collmd->current_v[collpair->bp2].co, collmd->current_v[collpair->bp3].co, w1, w2, w3);
- VECSUB ( relativeVelocity, v1, cloth1->verts[collpair->collp].tv);
+ sub_v3_v3v3 ( relativeVelocity, v1, cloth1->verts[collpair->collp].tv);
// Calculate the normal component of the relative velocity (actually only the magnitude - the direction is stored in 'normal').
- magrelVel = INPR ( relativeVelocity, collpair->normal );
+ magrelVel = dot_v3v3 ( relativeVelocity, collpair->normal );
// If v_n_mag < 0 the edges are approaching each other.
if ( magrelVel > ALMOST_ZERO )
@@ -976,13 +976,13 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
float temp[3], spf;
// calculate tangential velocity
- VECCOPY ( temp, collpair->normal );
+ copy_v3_v3 ( temp, collpair->normal );
mul_v3_fl( temp, magrelVel );
- VECSUB ( vrel_t_pre, relativeVelocity, temp );
+ sub_v3_v3v3 ( vrel_t_pre, relativeVelocity, temp );
// Decrease in magnitude of relative tangential velocity due to coulomb friction
// in original formula "magrelVel" should be the "change of relative velocity in normal direction"
- magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( INPR ( vrel_t_pre,vrel_t_pre ) ) );
+ magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
// Apply friction impulse.
if ( magtangent > ALMOST_ZERO )
@@ -1027,10 +1027,10 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
// Calculate relative "velocity".
collision_interpolateOnTriangle ( v1, cloth1->verts[collpair->ap1].tv, cloth1->verts[collpair->ap2].tv, cloth1->verts[collpair->ap3].tv, w1, w2, w3 );
- VECSUB ( relativeVelocity, collmd->current_v[collpair->collp].co, v1);
+ sub_v3_v3v3 ( relativeVelocity, collmd->current_v[collpair->collp].co, v1);
// Calculate the normal component of the relative velocity (actually only the magnitude - the direction is stored in 'normal').
- magrelVel = INPR ( relativeVelocity, collpair->normal );
+ magrelVel = dot_v3v3 ( relativeVelocity, collpair->normal );
// If v_n_mag < 0 the edges are approaching each other.
if ( magrelVel > ALMOST_ZERO )
@@ -1042,13 +1042,13 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
float temp[3], spf;
// calculate tangential velocity
- VECCOPY ( temp, collpair->normal );
+ copy_v3_v3 ( temp, collpair->normal );
mul_v3_fl( temp, magrelVel );
- VECSUB ( vrel_t_pre, relativeVelocity, temp );
+ sub_v3_v3v3 ( vrel_t_pre, relativeVelocity, temp );
// Decrease in magnitude of relative tangential velocity due to coulomb friction
// in original formula "magrelVel" should be the "change of relative velocity in normal direction"
- magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( INPR ( vrel_t_pre,vrel_t_pre ) ) );
+ magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
// Apply friction impulse.
if ( magtangent > ALMOST_ZERO )
@@ -1545,9 +1545,9 @@ static CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2,
collision_interpolateOnTriangle ( v2, collmd->current_v[collpair->bp1].co, collmd->current_v[collpair->bp2].co, collmd->current_v[collpair->bp3].co, u1, u2, u3 );
- VECSUB ( relativeVelocity, v2, v1 );
+ sub_v3_v3v3 ( relativeVelocity, v2, v1 );
- if(sqrt(INPR(relativeVelocity, relativeVelocity)) >= distance)
+ if(sqrt(dot_v3v3(relativeVelocity, relativeVelocity)) >= distance)
{
// check for collision in the future
collpair->flag |= COLLISION_IN_FUTURE;
@@ -1592,10 +1592,10 @@ static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionMo
collision_interpolateOnTriangle ( v2, collmd->current_v[collpair->bp1].co, collmd->current_v[collpair->bp2].co, collmd->current_v[collpair->bp3].co, u1, u2, u3 );
- VECSUB ( relativeVelocity, v2, v1 );
+ sub_v3_v3v3 ( relativeVelocity, v2, v1 );
// Calculate the normal component of the relative velocity (actually only the magnitude - the direction is stored in 'normal').
- magrelVel = INPR ( relativeVelocity, collpair->normal );
+ magrelVel = dot_v3v3 ( relativeVelocity, collpair->normal );
// printf("magrelVel: %f\n", magrelVel);
@@ -1612,13 +1612,13 @@ static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionMo
float temp[3];
// calculate tangential velocity
- VECCOPY ( temp, collpair->normal );
+ copy_v3_v3 ( temp, collpair->normal );
mul_v3_fl( temp, magrelVel );
- VECSUB ( vrel_t_pre, relativeVelocity, temp );
+ sub_v3_v3v3 ( vrel_t_pre, relativeVelocity, temp );
// Decrease in magnitude of relative tangential velocity due to coulomb friction
// in original formula "magrelVel" should be the "change of relative velocity in normal direction"
- magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( INPR ( vrel_t_pre,vrel_t_pre ) ) );
+ magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
// Apply friction impulse.
if ( magtangent > ALMOST_ZERO )
@@ -1675,9 +1675,9 @@ static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionMo
static float projectPointOntoLine(float *p, float *a, float *b)
{
float ba[3], pa[3];
- VECSUB(ba, b, a);
- VECSUB(pa, p, a);
- return INPR(pa, ba) / INPR(ba, ba);
+ sub_v3_v3v3(ba, b, a);
+ sub_v3_v3v3(pa, p, a);
+ return dot_v3v3(pa, ba) / dot_v3v3(ba, ba);
}
static void calculateEENormal(float *np1, float *np2, float *np3, float *np4,float *out_normal)
@@ -1685,8 +1685,8 @@ static void calculateEENormal(float *np1, float *np2, float *np3, float *np4,flo
float line1[3], line2[3];
float length;
- VECSUB(line1, np2, np1);
- VECSUB(line2, np3, np1);
+ sub_v3_v3v3(line1, np2, np1);
+ sub_v3_v3v3(line2, np3, np1);
// printf("l1: %f, l1: %f, l2: %f, l2: %f\n", line1[0], line1[1], line2[0], line2[1]);
@@ -1697,7 +1697,7 @@ static void calculateEENormal(float *np1, float *np2, float *np3, float *np4,flo
length = normalize_v3(out_normal);
if (length <= FLT_EPSILON)
{ // lines are collinear
- VECSUB(out_normal, np2, np1);
+ sub_v3_v3v3(out_normal, np2, np1);
normalize_v3(out_normal);
}
}
@@ -1708,19 +1708,19 @@ static void findClosestPointsEE(float *x1, float *x2, float *x3, float *x4, floa
double a, b, c, e, f;
- VECSUB(temp, x2, x1);
- a = INPR(temp, temp);
+ sub_v3_v3v3(temp, x2, x1);
+ a = dot_v3v3(temp, temp);
- VECSUB(temp2, x4, x3);
- b = -INPR(temp, temp2);
+ sub_v3_v3v3(temp2, x4, x3);
+ b = -dot_v3v3(temp, temp2);
- c = INPR(temp2, temp2);
+ c = dot_v3v3(temp2, temp2);
- VECSUB(temp2, x3, x1);
- e = INPR(temp, temp2);
+ sub_v3_v3v3(temp2, x3, x1);
+ e = dot_v3v3(temp, temp2);
- VECSUB(temp, x4, x3);
- f = -INPR(temp, temp2);
+ sub_v3_v3v3(temp, x4, x3);
+ f = -dot_v3v3(temp, temp2);
*w1 = (e * c - b * f) / (a * c - b * b);
*w2 = (f - b * *w1) / c;
@@ -1735,11 +1735,11 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
float temp[3], temp2[3];
float dist_a1, dist_a2;
- VECSUB(line1, np12, np11);
- VECSUB(line2, np22, np21);
+ sub_v3_v3v3(line1, np12, np11);
+ sub_v3_v3v3(line2, np22, np21);
cross_v3_v3v3(cross, line1, line2);
- length = INPR(cross, cross);
+ length = dot_v3v3(cross, cross);
if (length < FLT_EPSILON)
{
@@ -1748,11 +1748,11 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
{
*out_a1 = 0;
calculateEENormal(np11, np12, np21, np22, out_normal);
- VECSUB(temp, np22, np21);
+ sub_v3_v3v3(temp, np22, np21);
mul_v3_fl(temp, *out_a2);
VECADD(temp2, temp, np21);
VECADD(temp2, temp2, np11);
- return INPR(temp2, temp2);
+ return dot_v3v3(temp2, temp2);
}
CLAMP(*out_a2, 0.0, 1.0);
@@ -1764,11 +1764,11 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
calculateEENormal(np11, np12, np21, np22, out_normal);
// return (np22 - (np11 + (np12 - np11) * out_a1)).lengthSquared();
- VECSUB(temp, np12, np11);
+ sub_v3_v3v3(temp, np12, np11);
mul_v3_fl(temp, *out_a1);
VECADD(temp2, temp, np11);
- VECSUB(temp2, np22, temp2);
- return INPR(temp2, temp2);
+ sub_v3_v3v3(temp2, np22, temp2);
+ return dot_v3v3(temp2, temp2);
}
}
else
@@ -1779,11 +1779,11 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
calculateEENormal(np11, np11, np21, np22, out_normal);
// return (np21 - (np11 + (np12 - np11) * out_a1)).lengthSquared();
- VECSUB(temp, np12, np11);
+ sub_v3_v3v3(temp, np12, np11);
mul_v3_fl(temp, *out_a1);
VECADD(temp2, temp, np11);
- VECSUB(temp2, np21, temp2);
- return INPR(temp2, temp2);
+ sub_v3_v3v3(temp2, np21, temp2);
+ return dot_v3v3(temp2, temp2);
}
}
@@ -1793,26 +1793,26 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
{
if(*out_a2 > .5)
{
- VECSUB(temp, np12, np22);
+ sub_v3_v3v3(temp, np12, np22);
}
else
{
- VECSUB(temp, np12, np21);
+ sub_v3_v3v3(temp, np12, np21);
}
}
else
{
if(*out_a2 > .5)
{
- VECSUB(temp, np11, np22);
+ sub_v3_v3v3(temp, np11, np22);
}
else
{
- VECSUB(temp, np11, np21);
+ sub_v3_v3v3(temp, np11, np21);
}
}
- return INPR(temp, temp);
+ return dot_v3v3(temp, temp);
}
else
{
@@ -1827,18 +1827,18 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
float p1[3], p2[3];
// p1= np11 + (np12 - np11) * out_a1;
- VECSUB(temp, np12, np11);
+ sub_v3_v3v3(temp, np12, np11);
mul_v3_fl(temp, *out_a1);
VECADD(p1, np11, temp);
// p2 = np21 + (np22 - np21) * out_a2;
- VECSUB(temp, np22, np21);
+ sub_v3_v3v3(temp, np22, np21);
mul_v3_fl(temp, *out_a2);
VECADD(p2, np21, temp);
calculateEENormal(np11, np12, np21, np22, out_normal);
- VECSUB(temp, p1, p2);
- return INPR(temp, temp);
+ sub_v3_v3v3(temp, p1, p2);
+ return dot_v3v3(temp, temp);
}
@@ -1858,7 +1858,7 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
float p1[3];
// p1 = np11 + (np12 - np11) * out_a1;
- VECSUB(temp, np12, np11);
+ sub_v3_v3v3(temp, np12, np11);
mul_v3_fl(temp, *out_a1);
VECADD(p1, np11, temp);
@@ -1868,11 +1868,11 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
calculateEENormal(np11, np12, np21, np22, out_normal);
// return (p1 - (np21 + (np22 - np21) * out_a2)).lengthSquared();
- VECSUB(temp, np22, np21);
+ sub_v3_v3v3(temp, np22, np21);
mul_v3_fl(temp, *out_a2);
VECADD(temp, temp, np21);
- VECSUB(temp, p1, temp);
- return INPR(temp, temp);
+ sub_v3_v3v3(temp, p1, temp);
+ return dot_v3v3(temp, temp);
}
else
{
@@ -1880,7 +1880,7 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
float p2[3];
// p2 = np21 + (np22 - np21) * out_a2;
- VECSUB(temp, np22, np21);
+ sub_v3_v3v3(temp, np22, np21);
mul_v3_fl(temp, *out_a2);
VECADD(p2, np21, temp);
@@ -1890,11 +1890,11 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
calculateEENormal(np11, np12, np21, np22, out_normal);
// return ((np11 + (np12 - np11) * out_a1) - p2).lengthSquared();
- VECSUB(temp, np12, np11);
+ sub_v3_v3v3(temp, np12, np11);
mul_v3_fl(temp, *out_a1);
VECADD(temp, temp, np11);
- VECSUB(temp, temp, p2);
- return INPR(temp, temp);
+ sub_v3_v3v3(temp, temp, p2);
+ return dot_v3v3(temp, temp);
}
}
@@ -2006,14 +2006,14 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
// if ( !cloth_are_edges_adjacent ( clmd, collmd, &edgecollpair ) )
{
// always put coll points in p21/p22
- VECSUB ( x1, verts1[edgecollpair.p12].txold, verts1[edgecollpair.p11].txold );
- VECSUB ( v1, verts1[edgecollpair.p12].tv, verts1[edgecollpair.p11].tv );
+ sub_v3_v3v3 ( x1, verts1[edgecollpair.p12].txold, verts1[edgecollpair.p11].txold );
+ sub_v3_v3v3 ( v1, verts1[edgecollpair.p12].tv, verts1[edgecollpair.p11].tv );
- VECSUB ( x2, verts2[edgecollpair.p21].co, verts1[edgecollpair.p11].txold );
- VECSUB ( v2, velocity2[edgecollpair.p21].co, verts1[edgecollpair.p11].tv );
+ sub_v3_v3v3 ( x2, verts2[edgecollpair.p21].co, verts1[edgecollpair.p11].txold );
+ sub_v3_v3v3 ( v2, velocity2[edgecollpair.p21].co, verts1[edgecollpair.p11].tv );
- VECSUB ( x3, verts2[edgecollpair.p22].co, verts1[edgecollpair.p11].txold );
- VECSUB ( v3, velocity2[edgecollpair.p22].co, verts1[edgecollpair.p11].tv );
+ sub_v3_v3v3 ( x3, verts2[edgecollpair.p22].co, verts1[edgecollpair.p11].txold );
+ sub_v3_v3v3 ( v3, velocity2[edgecollpair.p22].co, verts1[edgecollpair.p11].tv );
numsolutions = cloth_get_collision_time ( x1, v1, x2, v2, x3, v3, solution );
@@ -2048,27 +2048,27 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
// TODO: check for collisions
distance = edgedge_distance(triA[0], triA[1], triB[0], triB[1], &a, &b, out_normal);
- if ((distance <= clmd->coll_parms->epsilon + BLI_bvhtree_getepsilon ( collmd->bvhtree ) + ALMOST_ZERO) && (INPR(out_normal, out_normal) > 0))
+ if ((distance <= clmd->coll_parms->epsilon + BLI_bvhtree_getepsilon ( collmd->bvhtree ) + ALMOST_ZERO) && (dot_v3v3(out_normal, out_normal) > 0))
{
float vrel_1_to_2[3], temp[3], temp2[3], out_normalVelocity;
float desiredVn;
- VECCOPY(vrel_1_to_2, verts1[edgecollpair.p11].tv);
+ copy_v3_v3(vrel_1_to_2, verts1[edgecollpair.p11].tv);
mul_v3_fl(vrel_1_to_2, 1.0 - a);
- VECCOPY(temp, verts1[edgecollpair.p12].tv);
+ copy_v3_v3(temp, verts1[edgecollpair.p12].tv);
mul_v3_fl(temp, a);
VECADD(vrel_1_to_2, vrel_1_to_2, temp);
- VECCOPY(temp, verts1[edgecollpair.p21].tv);
+ copy_v3_v3(temp, verts1[edgecollpair.p21].tv);
mul_v3_fl(temp, 1.0 - b);
- VECCOPY(temp2, verts1[edgecollpair.p22].tv);
+ copy_v3_v3(temp2, verts1[edgecollpair.p22].tv);
mul_v3_fl(temp2, b);
VECADD(temp, temp, temp2);
- VECSUB(vrel_1_to_2, vrel_1_to_2, temp);
+ sub_v3_v3v3(vrel_1_to_2, vrel_1_to_2, temp);
- out_normalVelocity = INPR(vrel_1_to_2, out_normal);
+ out_normalVelocity = dot_v3v3(vrel_1_to_2, out_normal);
/*
// this correction results in wrong normals sometimes?
if(out_normalVelocity < 0.0)
@@ -2507,7 +2507,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
}
}
- VECSUB ( temp, verts[i].tx, verts[j].tx );
+ sub_v3_v3v3 ( temp, verts[i].tx, verts[j].tx );
if ( ( ABS ( temp[0] ) > mindistance ) || ( ABS ( temp[1] ) > mindistance ) || ( ABS ( temp[2] ) > mindistance ) ) continue;
@@ -2538,13 +2538,12 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
mul_v3_fl( temp, correction * -0.5 );
VECADD ( verts[j].tx, verts[j].tx, temp );
- VECSUB ( verts[i].tx, verts[i].tx, temp );
+ sub_v3_v3v3 ( verts[i].tx, verts[i].tx, temp );
}
ret = 1;
ret2 += ret;
}
- else
- {
+ else {
// check for approximated time collisions
}
}
@@ -2565,7 +2564,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
{
if ( ! ( verts [i].flags & CLOTH_VERT_FLAG_PINNED ) )
{
- VECSUB ( verts[i].tv, verts[i].tx, verts[i].txold );
+ sub_v3_v3v3 ( verts[i].tv, verts[i].tx, verts[i].txold );
}
}
}
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 108b4e48a95..4f288594dc9 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -386,7 +386,7 @@ static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *nex
}
/* in X, out Y.
- X is presumed to be outside first or last */
+ * X is presumed to be outside first or last */
static float curvemap_calc_extend(CurveMap *cuma, float x, const float first[2], const float last[2])
{
if(x <= first[0]) {
@@ -454,7 +454,7 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr)
}
/* first and last handle need correction, instead of pointing to center of next/prev,
- we let it point to the closest handle */
+ * we let it point to the closest handle */
if(cuma->totpoint>2) {
float hlen, nlen, vec[3];
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index c66b8da0dcd..e0125891e86 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -576,7 +576,7 @@ static void constraint_target_to_mat4 (Object *ob, const char *substring, float
/* Current method just takes the average location of all the points in the
* VertexGroup, and uses that as the location value of the targets. Where
* possible, the orientation will also be calculated, by calculating an
- * 'average' vertex normal, and deriving the rotaation from that.
+ * 'average' vertex normal, and deriving the rotation from that.
*
* NOTE: EditMode is not currently supported, and will most likely remain that
* way as constraints can only really affect things on object/bone level.
@@ -1910,7 +1910,7 @@ static void samevolume_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
mat4_to_size(obsize, cob->matrix);
- /* calculate normalising scale factor for non-essential values */
+ /* calculate normalizing scale factor for non-essential values */
if (obsize[data->flag] != 0)
fac = sqrtf(volume / obsize[data->flag]) / obsize[data->flag];
@@ -3507,8 +3507,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
if(scon->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS) no[1] = 1.0f;
if(scon->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS) no[2] = 1.0f;
- if(INPR(no,no) < FLT_EPSILON)
- {
+ if (dot_v3v3(no, no) < FLT_EPSILON) {
fail = TRUE;
break;
}
@@ -3637,7 +3636,7 @@ static void damptrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
/* find the (unit) direction that the axis we're interested in currently points
* - mul_mat3_m4_v3() only takes the 3x3 (rotation+scaling) components of the 4x4 matrix
- * - the normalisation step at the end should take care of any unwanted scaling
+ * - the normalization step at the end should take care of any unwanted scaling
* left over in the 3x3 matrix we used
*/
copy_v3_v3(obvec, track_dir_vecs[data->trackflag]);
@@ -4398,7 +4397,7 @@ void remove_constraints_type (ListBase *list, short type, short last_only)
/* ......... */
-/* Creates a new constraint, initialises its data, and returns it */
+/* Creates a new constraint, initializes its data, and returns it */
static bConstraint *add_new_constraint_internal (const char *name, short type)
{
bConstraint *con= MEM_callocN(sizeof(bConstraint), "Constraint");
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 931934f8052..5af72e6115c 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -1135,13 +1135,13 @@ float *make_orco_surf(Object *ob)
nu= cu->nurb.first;
while(nu) {
/* as we want to avoid the seam in a cyclic nurbs
- texture wrapping, reserve extra orco data space to save these extra needed
- vertex based UV coordinates for the meridian vertices.
- Vertices on the 0/2pi boundary are not duplicated inside the displist but later in
- the renderface/vert construction.
-
- See also convertblender.c: init_render_surf()
- */
+ * texture wrapping, reserve extra orco data space to save these extra needed
+ * vertex based UV coordinates for the meridian vertices.
+ * Vertices on the 0/2pi boundary are not duplicated inside the displist but later in
+ * the renderface/vert construction.
+ *
+ * See also convertblender.c: init_render_surf()
+ */
resolu= cu->resolu_ren ? cu->resolu_ren : nu->resolu;
resolv= cu->resolv_ren ? cu->resolv_ren : nu->resolv;
@@ -1505,11 +1505,11 @@ static int cu_isectLL(const float v1[3], const float v2[3], const float v3[3], c
float *labda, float *mu, float vec[3])
{
/* return:
- -1: colliniar
- 0: no intersection of segments
- 1: exact intersection of segments
- 2: cross-intersection of segments
- */
+ * -1: colliniar
+ * 0: no intersection of segments
+ * 1: exact intersection of segments
+ * 2: cross-intersection of segments
+ */
float deler;
deler= (v1[cox]-v2[cox])*(v3[coy]-v4[coy])-(v3[cox]-v4[cox])*(v1[coy]-v2[coy]);
@@ -1572,7 +1572,7 @@ static short bevelinside(BevList *bl1,BevList *bl2)
/* there's a transition, calc intersection point */
mode= cu_isectLL(prevbevp->vec, bevp->vec, hvec1, hvec2, 0, 1, &lab, &mu, vec);
/* if lab==0.0 or lab==1.0 then the edge intersects exactly a transition
- only allow for one situation: we choose lab= 1.0
+ * only allow for one situation: we choose lab= 1.0
*/
if(mode >= 0 && lab != 0.0f) {
if(vec[0]<hvec1[0]) links++;
@@ -2075,11 +2075,11 @@ static void make_bevel_list_segment_3D(BevList *bl)
void makeBevelList(Object *ob)
{
/*
- - convert all curves to polys, with indication of resol and flags for double-vertices
- - possibly; do a smart vertice removal (in case Nurb)
- - separate in individual blicks with BoundBox
- - AutoHole detection
- */
+ * - convert all curves to polys, with indication of resol and flags for double-vertices
+ * - possibly; do a smart vertice removal (in case Nurb)
+ * - separate in individual blicks with BoundBox
+ * - AutoHole detection
+ */
Curve *cu;
Nurb *nu;
BezTriple *bezt, *prevbezt;
@@ -2701,12 +2701,12 @@ void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */
void testhandlesNurb(Nurb *nu)
{
/* use when something has changed with handles.
- it treats all BezTriples with the following rules:
- PHASE 1: do types have to be altered?
- Auto handles: become aligned when selection status is NOT(000 || 111)
- Vector handles: become 'nothing' when (one half selected AND other not)
- PHASE 2: recalculate handles
- */
+ * it treats all BezTriples with the following rules:
+ * PHASE 1: do types have to be altered?
+ * Auto handles: become aligned when selection status is NOT(000 || 111)
+ * Vector handles: become 'nothing' when (one half selected AND other not)
+ * PHASE 2: recalculate handles
+ */
BezTriple *bezt;
short flag, a;
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index cd15c56cea1..233d0202540 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -102,10 +102,10 @@ typedef struct LayerTypeInfo {
void (*swap)(void *data, const int *corner_indices);
/* a function to set a layer's data to default values. if NULL, the
- default is assumed to be all zeros */
+ * default is assumed to be all zeros */
void (*set_default)(void *data, int count);
- /* functions necessary 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);
@@ -172,6 +172,13 @@ static void layerCopy_bmesh_elem_py_ptr(const void *UNUSED(source), void *dest,
}
}
+#ifndef WITH_PYTHON
+void bpy_bm_generic_invalidate(void *UNUSED(self))
+{
+ /* dummy */
+}
+#endif
+
static void layerFree_bmesh_elem_py_ptr(void *data, int count, int size)
{
extern void bpy_bm_generic_invalidate(void *self);
@@ -450,7 +457,7 @@ static void layerSwap_mdisps(void *data, const int *ci)
if(corners!=nverts) {
/* happens when face changed vertex count in edit mode
- if it happened, just forgot displacement */
+ * if it happened, just forgot displacement */
MEM_freeN(s->disps);
s->totdisp= (s->totdisp/corners)*nverts;
@@ -1481,7 +1488,7 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data,
void *newlayerdata = NULL;
/* Passing a layerdata to copy from with an alloctype that won't copy is
- most likely a bug */
+ * most likely a bug */
BLI_assert(!layerdata ||
(alloctype == CD_ASSIGN) ||
(alloctype == CD_DUPLICATE) ||
@@ -1810,9 +1817,11 @@ void CustomData_copy_data(const CustomData *source, CustomData *dest,
dest_offset = dest_index * typeInfo->size;
if (!src_data || !dest_data) {
- printf("%s: warning null data for %s type (%p --> %p), skipping\n",
- __func__, layerType_getName(source->layers[src_i].type),
- (void *)src_data, (void *)dest_data);
+ if (src_data != NULL && dest_data != NULL) {
+ printf("%s: warning null data for %s type (%p --> %p), skipping\n",
+ __func__, layerType_getName(source->layers[src_i].type),
+ (void *)src_data, (void *)dest_data);
+ }
continue;
}
@@ -2307,8 +2316,8 @@ int CustomData_layer_has_math(struct CustomData *data, int layern)
return 0;
}
-/*copies the "value" (e.g. mloopuv uv or mloopcol colors) from one block to
- another, while not overwriting anything else (e.g. flags)*/
+/* copies the "value" (e.g. mloopuv uv or mloopcol colors) from one block to
+ * another, while not overwriting anything else (e.g. flags)*/
void CustomData_data_copy_value(int type, void *source, void *dest)
{
const LayerTypeInfo *typeInfo = layerType_getInfo(type);
@@ -2626,8 +2635,8 @@ void CustomData_validate_layer_name(const CustomData *data, int type, char *name
if(index < 0) {
/* either no layer was specified, or the layer we want has been
- * deleted, so assign the active layer to name
- */
+ * deleted, so assign the active layer to name
+ */
index = CustomData_get_active_layer_index(data, type);
strcpy(outname, data->layers[index].name);
}
diff --git a/source/blender/blenkernel/intern/customdata_file.c b/source/blender/blenkernel/intern/customdata_file.c
index 75898018a2b..4386132fc18 100644
--- a/source/blender/blenkernel/intern/customdata_file.c
+++ b/source/blender/blenkernel/intern/customdata_file.c
@@ -109,13 +109,15 @@ static int cdf_endian(void)
return CDF_ENDIAN_BIG;
}
-/*static int cdf_data_type_size(int datatype)
+#if 0
+static int cdf_data_type_size(int datatype)
{
if(datatype == CDF_DATA_FLOAT)
return sizeof(float);
return 0;
-}*/
+}
+#endif
CDataFile *cdf_create(int type)
{
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index f2246da930c..6158d2f8608 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -169,7 +169,7 @@ void defvert_remap(MDeformVert *dvert, int *map, const int map_len)
if (dw->def_nr < map_len) {
dw->def_nr= map[dw->def_nr];
- /* just incase */
+ /* just in case */
BLI_assert(dw->def_nr >= 0);
}
}
@@ -197,7 +197,7 @@ void defvert_normalize(MDeformVert *dvert)
for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
dw->weight *= scalar;
- /* incase of division errors with very low weights */
+ /* in case of division errors with very low weights */
CLAMP(dw->weight, 0.0f, 1.0f);
}
}
@@ -231,14 +231,14 @@ void defvert_normalize_lock(MDeformVert *dvert, const int def_nr_lock)
}
if (tot_weight > 0.0f) {
- /* paranoid, should be 1.0 but incase of float error clamp anyway */
+ /* paranoid, should be 1.0 but in case of float error clamp anyway */
float scalar= (1.0f / tot_weight) * lock_iweight;
for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
if(dw != dw_lock) {
dw->weight *= scalar;
- /* incase of division errors with very low weights */
+ /* in case of division errors with very low weights */
CLAMP(dw->weight, 0.0f, 1.0f);
}
}
@@ -316,7 +316,7 @@ int *defgroup_flip_map(Object *ob, int *flip_map_len, int use_default)
for (dg=ob->defbase.first, i=0; dg; dg=dg->next, i++) {
if (map[i] == -1) { /* may be calculated previously */
- /* incase no valid value is found, use this */
+ /* in case no valid value is found, use this */
if (use_default)
map[i]= i;
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index c45687f0b93..c178a4ef6ea 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -75,7 +75,7 @@
/* Queue and stack operations for dag traversal
*
- * the queue store a list of freenodes to avoid successives alloc/dealloc
+ * the queue store a list of freenodes to avoid successive alloc/dealloc
*/
DagNodeQueue * queue_create (int slots)
@@ -595,8 +595,8 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
if(part->ren_as == PART_DRAW_OB && part->dup_ob) {
node2 = dag_get_node(dag, part->dup_ob);
/* note that this relation actually runs in the wrong direction, the problem
- is that dupli system all have this (due to parenting), and the render
- engine instancing assumes particular ordering of objects in list */
+ * is that dupli system all have this (due to parenting), and the render
+ * engine instancing assumes particular ordering of objects in list */
dag_add_relation(dag, node, node2, DAG_RL_OB_OB, "Particle Object Visualisation");
if(part->dup_ob->type == OB_MBALL)
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA, "Particle Object Visualisation");
@@ -756,8 +756,8 @@ struct DagForest *build_dag(Main *bmain, Scene *sce, short mask)
}
/* Now all relations were built, but we need to solve 1 exceptional case;
- When objects have multiple "parents" (for example parent + constraint working on same object)
- the relation type has to be synced. One of the parents can change, and should give same event to child */
+ * When objects have multiple "parents" (for example parent + constraint working on same object)
+ * the relation type has to be synced. One of the parents can change, and should give same event to child */
/* nodes were callocced, so we can use node->color for temporal storage */
for(node = sce->theDag->DagNode.first; node; node= node->next) {
@@ -1159,9 +1159,8 @@ void graph_bfs(void)
}
set_node_xy(node, node->BFS_dist*DEPSX*2, pos[node->BFS_dist]*DEPSY*2);
node->color = DAG_BLACK;
- /*
- fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
- */
+
+ // fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
}
}
queue_delete(nqueue);
@@ -1185,8 +1184,8 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a
/* fprintf(stderr,"starting BFS \n ------------\n"); */
/* Init
- * dagnode.first is always the root (scene)
- */
+ * dagnode.first is always the root (scene)
+ */
node = dag->DagNode.first;
nqueue = queue_create(DAGQUEUEALLOC);
while(node) {
@@ -1220,9 +1219,8 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a
}
post_func(node->ob,data);
node->color = DAG_BLACK;
- /*
- fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
- */
+
+ // fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
}
}
queue_delete(nqueue);
@@ -1303,7 +1301,7 @@ DagNodeQueue * graph_dfs(void)
;
/* already processed node but we may want later to change distance either to shorter to longer.
* DFS_dist is the first encounter
- */
+ */
/*if (node->DFS_dist >= itA->node->DFS_dist)
itA->node->DFS_dist = node->DFS_dist + 1;
@@ -1337,9 +1335,8 @@ DagNodeQueue * graph_dfs(void)
}
set_node_xy(node, node->DFS_dist*DEPSX*2, pos[node->DFS_dist]*DEPSY*2);
- /*
- fprintf(stderr,"DFS node : %20s %i %i %i %i\n",((ID *) node->ob)->name,node->BFS_dist, node->DFS_dist, node->DFS_dvtm, node->DFS_fntm );
- */
+ // fprintf(stderr,"DFS node : %20s %i %i %i %i\n",((ID *) node->ob)->name,node->BFS_dist, node->DFS_dist, node->DFS_dvtm, node->DFS_fntm );
+
push_stack(retqueue,node);
}
@@ -1376,8 +1373,8 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a
nqueue = queue_create(DAGQUEUEALLOC);
/* Init
- * dagnode.first is always the root (scene)
- */
+ * dagnode.first is always the root (scene)
+ */
node = dag->DagNode.first;
while(node) {
node->color = DAG_WHITE;
@@ -1652,7 +1649,7 @@ void graph_print_adj_list(void)
/* ************************ API *********************** */
/* mechanism to allow editors to be informed of depsgraph updates,
- to do their own updates based on changes... */
+ * to do their own updates based on changes... */
static void (*EditorsUpdateIDCb)(Main *bmain, ID *id)= NULL;
static void (*EditorsUpdateSceneCb)(Main *bmain, Scene *scene, int updated)= NULL;
@@ -2363,7 +2360,7 @@ static void dag_current_scene_layers(Main *bmain, Scene **sce, unsigned int *lay
wmWindow *win;
/* only one scene supported currently, making more scenes work
- correctly requires changes beyond just the dependency graph */
+ * correctly requires changes beyond just the dependency graph */
*sce= NULL;
*lay= 0;
@@ -2383,8 +2380,8 @@ static void dag_current_scene_layers(Main *bmain, Scene **sce, unsigned int *lay
if(*sce) *lay= (*sce)->lay;
/* XXX for background mode, we should get the scene
- from somewhere, for the -S option, but it's in
- the context, how to get it here? */
+ * from somewhere, for the -S option, but it's in
+ * the context, how to get it here? */
}
}
@@ -2414,9 +2411,9 @@ void DAG_on_visible_update(Main *bmain, const short do_time)
if(scene && scene->theDag) {
Scene *sce_iter;
/* derivedmeshes and displists are not saved to file so need to be
- remade, tag them so they get remade in the scene update loop,
- note armature poses or object matrices are preserved and do not
- require updates, so we skip those */
+ * remade, tag them so they get remade in the scene update loop,
+ * note armature poses or object matrices are preserved and do not
+ * require updates, so we skip those */
dag_scene_flush_layers(scene, lay);
for(SETLOOPER(scene, sce_iter, base)) {
@@ -2471,7 +2468,7 @@ static void dag_id_flush_update(Scene *sce, ID *id)
short idtype;
/* here we flush a few things before actual scene wide flush, mostly
- due to only objects and not other datablocks being in the depsgraph */
+ * due to only objects and not other datablocks being in the depsgraph */
/* set flags & pointcache for object */
if(GS(id->name) == ID_OB) {
@@ -2591,10 +2588,13 @@ static void dag_id_flush_update(Scene *sce, ID *id)
}
/* camera's matrix is used to orient reconstructed stuff,
- so it should happen tracking-related constraints recalculation
- when camera is changing (sergey) */
- if(sce->camera && &sce->camera->id == id && object_get_movieclip(sce, sce->camera, 1)) {
- dag_id_flush_update(sce, &sce->clip->id);
+ * so it should happen tracking-related constraints recalculation
+ * when camera is changing (sergey) */
+ if(sce->camera && &sce->camera->id == id) {
+ MovieClip *clip = object_get_movieclip(sce, sce->camera, 1);
+
+ if(clip)
+ dag_id_flush_update(sce, &clip->id);
}
/* update editors */
@@ -2622,7 +2622,7 @@ void DAG_ids_flush_tagged(Main *bmain)
ID *id = lb->first;
/* we tag based on first ID type character to avoid
- looping over all ID's in case there are no tags */
+ * looping over all ID's in case there are no tags */
if(id && bmain->id_tag_update[id->name[0]]) {
for(; id; id=id->next) {
if(id->flag & (LIB_ID_RECALC|LIB_ID_RECALC_DATA)) {
@@ -2651,7 +2651,7 @@ void DAG_ids_check_recalc(Main *bmain, Scene *scene, int time)
ID *id = lb->first;
/* we tag based on first ID type character to avoid
- looping over all ID's in case there are no tags */
+ * looping over all ID's in case there are no tags */
if(id && bmain->id_tag_update[id->name[0]]) {
updated= 1;
break;
@@ -2674,7 +2674,7 @@ void DAG_ids_clear_recalc(Main *bmain)
ID *id = lb->first;
/* we tag based on first ID type character to avoid
- looping over all ID's in case there are no tags */
+ * looping over all ID's in case there are no tags */
if(id && bmain->id_tag_update[id->name[0]]) {
for(; id; id=id->next)
if(id->flag & (LIB_ID_RECALC|LIB_ID_RECALC_DATA))
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 6383f7b9040..d10c060cc7f 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -613,10 +613,10 @@ static void curve_to_filledpoly(Curve *cu, ListBase *UNUSED(nurb), ListBase *dis
}
/* taper rules:
- - only 1 curve
- - first point left, last point right
- - based on subdivided points in original curve, not on points in taper curve (still)
-*/
+ * - only 1 curve
+ * - first point left, last point right
+ * - based on subdivided points in original curve, not on points in taper curve (still)
+ */
float calc_taper(Scene *scene, Object *taperobj, int cur, int tot)
{
DispList *dl;
@@ -710,8 +710,8 @@ static ModifierData *curve_get_tesselate_point(Scene *scene, Object *ob, int for
preTesselatePoint = md;
/* 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 */
+ * (some of them even can't be applied on tesselated curve), set flag
+ * for incformation button in modifier's header */
md->mode |= eModifierMode_ApplyOnSpline;
} else if(md->mode&eModifierMode_ApplyOnSpline) {
preTesselatePoint = md;
@@ -746,9 +746,9 @@ static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, fl
if(keyVerts) {
/* split coords from key data, the latter also includes
- tilts, which is passed through in the modifier stack.
- this is also the reason curves do not use a virtual
- shape key modifier yet. */
+ * tilts, which is passed through in the modifier stack.
+ * this is also the reason curves do not use a virtual
+ * shape key modifier yet. */
deformedVerts= curve_getKeyVertexCos(cu, nurb, keyVerts);
originalVerts= MEM_dupallocN(deformedVerts);
}
@@ -1168,8 +1168,8 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
}
/* make copy of 'undeformed" displist for texture space calculation
- actually, it's not totally undeformed -- pre-tessellation modifiers are
- already applied, thats how it worked for years, so keep for compatibility (sergey) */
+ * 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);
if (!forRender) {
@@ -1394,8 +1394,8 @@ 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-tessellation modifiers are
- already applied, thats how it worked for years, so keep for compatibility (sergey) */
+ * 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);
if (!forRender) {
@@ -1416,8 +1416,8 @@ void makeDispListCurveTypes(Scene *scene, Object *ob, int forOrco)
ListBase *dispbase;
/* The same check for duplis as in do_makeDispListCurveTypes.
- Happens when curve used for constraint/bevel was converted to mesh.
- check there is still needed for render displist and orco displists. */
+ * Happens when curve used for constraint/bevel was converted to mesh.
+ * check there is still needed for render displist and orco displists. */
if(!ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT)) return;
freedisplist(&(ob->disp));
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 83d64f693e2..2c7814a6a43 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -156,7 +156,7 @@ typedef struct PaintBakeData {
int *s_pos; /* index to start reading point sample realCoord */
int *s_num; /* num of realCoord samples */
Vec3f *realCoord; /* current pixel center world-space coordinates for each sample
- * ordered as (s_pos+s_num)*/
+ * ordered as (s_pos+s_num)*/
Bounds3D mesh_bounds;
/* adjacency info */
@@ -313,8 +313,8 @@ static int surface_duplicateOutputExists(void *arg, const char *name)
for(; surface; surface=surface->next) {
if (surface!=t_surface && surface->type==t_surface->type &&
surface->format==t_surface->format) {
- if (surface->output_name[0]!='\0' && !strcmp(name, surface->output_name)) return 1;
- if (surface->output_name2[0]!='\0' && !strcmp(name, surface->output_name2)) return 1;
+ if (surface->output_name[0]!='\0' && !BLI_path_cmp(name, surface->output_name)) return 1;
+ if (surface->output_name2[0]!='\0' && !BLI_path_cmp(name, surface->output_name2)) return 1;
}
}
return 0;
@@ -745,7 +745,7 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface)
grid->t_index = MEM_callocN(sizeof(int) * sData->total_points, "Surface Grid Target Ids");
temp_t_index = MEM_callocN(sizeof(int) * sData->total_points, "Temp Surface Grid Target Ids");
- /* in case of an allocation failture abort here */
+ /* in case of an allocation failure abort here */
if (!grid->bounds || !grid->s_pos || !grid->s_num || !grid->t_index || !temp_s_num || !temp_t_index)
error = 1;
@@ -1235,7 +1235,7 @@ static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, int for
if (!surface_usesAdjData(surface) && !force_init) return;
if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
- /* For vertex format, neighbours are connected by edges */
+ /* For vertex format, neighbors are connected by edges */
neigh_points = 2*dm->getNumEdges(dm);
}
else if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ)
@@ -3970,7 +3970,7 @@ void surface_determineForceTargetPoints(PaintSurfaceData *sData, int index, floa
madd_v3_v3v3fl(force_proj, force, tangent, (-1.0f)*force_intersect);
normalize_v3(force_proj);
- /* get drip factor based on force dir in relation to angle between those neighbours */
+ /* get drip factor based on force dir in relation to angle between those neighbors */
temp = dot_v3v3(bNeighs[closest_id[0]].dir, force_proj);
CLAMP(temp, -1.0f, 1.0f); /* float precision might cause values > 1.0f that return infinite */
closest_d[1] = acosf(temp)/neigh_diff;
@@ -4145,9 +4145,9 @@ static int dynamicPaint_prepareEffectStep(DynamicPaintSurface *surface, Scene *s
return steps;
}
-/*
-* Processes active effect step.
-*/
+/**
+ * Processes active effect step.
+ */
static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force, PaintPoint *prevPoint, float timescale, float steps)
{
PaintSurfaceData *sData = surface->data;
@@ -4159,8 +4159,8 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
if (!sData->adj_data) return;
/*
- * Spread Effect
- */
+ * Spread Effect
+ */
if (surface->effect & MOD_DPAINT_EFFECT_DO_SPREAD) {
float eff_scale = distance_scale*EFF_MOVEMENT_PER_FRAME*surface->spread_speed*timescale;
@@ -4175,7 +4175,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
PaintPoint *pPoint = &((PaintPoint*)sData->type_data)[index];
/* Only reads values from the surface copy (prevPoint[]),
- * so this one is thread safe */
+ * so this one is thread safe */
/* Loop through neighboring points */
for (i=0; i<numOfNeighs; i++) {
@@ -4202,8 +4202,8 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
}
/*
- * Shrink Effect
- */
+ * Shrink Effect
+ */
if (surface->effect & MOD_DPAINT_EFFECT_DO_SHRINK) {
float eff_scale = distance_scale*EFF_MOVEMENT_PER_FRAME*surface->shrink_speed*timescale;
@@ -4227,7 +4227,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
totalAlpha += ePoint->e_alpha;
/* Check if neighboring point has lower alpha,
- * if so, decrease this point's alpha as well*/
+ * if so, decrease this point's alpha as well*/
if (pPoint->alpha <= 0.0f && pPoint->e_alpha <= 0.0f && pPoint->wetness <= 0.0f) continue;
/* decrease factor for dry paint alpha */
@@ -4251,8 +4251,8 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
}
/*
- * Drip Effect
- */
+ * Drip Effect
+ */
if (surface->effect & MOD_DPAINT_EFFECT_DO_DRIP && force)
{
float eff_scale = distance_scale*EFF_MOVEMENT_PER_FRAME*timescale/2.0f;
@@ -4450,8 +4450,8 @@ static void dynamicPaint_surfacePreStep(DynamicPaintSurface *surface, float time
dry_ratio = pPoint->wetness/p_wetness;
/*
- * Slowly "shift" paint from wet layer to dry layer as it drys:
- */
+ * Slowly "shift" paint from wet layer to dry layer as it drys:
+ */
/* make sure alpha values are within proper range */
CLAMP(pPoint->alpha, 0.0f, 1.0f);
CLAMP(pPoint->e_alpha, 0.0f, 1.0f);
@@ -4464,7 +4464,7 @@ static void dynamicPaint_surfacePreStep(DynamicPaintSurface *surface, float time
/* now calculate new alpha for dry layer that keeps final blended color unchanged */
pPoint->alpha = (f_color[3] - pPoint->e_alpha)/(1.0f-pPoint->e_alpha);
/* for each rgb component, calculate a new dry layer color that keeps the final blend color
- * with these new alpha values. (wet layer color doesnt change)*/
+ * with these new alpha values. (wet layer color doesnt change)*/
if (pPoint->alpha) {
for (i=0; i<3; i++) {
pPoint->color[i] = (f_color[i]*f_color[3] - pPoint->e_color[i]*pPoint->e_alpha)/(pPoint->alpha*(1.0f-pPoint->e_alpha));
@@ -4635,8 +4635,8 @@ static int dynamicPaint_generateBakeData(DynamicPaintSurface *surface, Scene *sc
}
/*
- * Make a transformed copy of canvas derived mesh vertices to avoid recalculation.
- */
+ * Make a transformed copy of canvas derived mesh vertices to avoid recalculation.
+ */
bData->mesh_bounds.valid = 0;
for (index=0; index<canvasNumOfVerts; index++) {
copy_v3_v3(canvas_verts[index].v, mvert[index].co);
@@ -4645,8 +4645,8 @@ static int dynamicPaint_generateBakeData(DynamicPaintSurface *surface, Scene *sc
}
/*
- * Prepare each surface point for a new step
- */
+ * Prepare each surface point for a new step
+ */
#pragma omp parallel for schedule(static)
for (index=0; index<sData->total_points; index++)
{
@@ -4655,8 +4655,8 @@ static int dynamicPaint_generateBakeData(DynamicPaintSurface *surface, Scene *sc
copy_v3_v3(prev_point, bData->realCoord[bData->s_pos[index]].v);
}
/*
- * Calculate current 3D-position and normal of each surface point
- */
+ * Calculate current 3D-position and normal of each surface point
+ */
if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) {
float n1[3], n2[3], n3[3];
ImgSeqFormatData *f_data = (ImgSeqFormatData*)sData->format_data;
@@ -4716,7 +4716,7 @@ static int dynamicPaint_generateBakeData(DynamicPaintSurface *surface, Scene *sc
}
/* Prepare surface normal directional scale to easily convert
- * brush intersection amount between global and local space */
+ * brush intersection amount between global and local space */
if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE ||
surface->type == MOD_DPAINT_SURFACE_T_WAVE) {
float temp_nor[3];
@@ -4763,8 +4763,8 @@ static int dynamicPaint_generateBakeData(DynamicPaintSurface *surface, Scene *sc
}
/*
-* Do Dynamic Paint step. Paints scene brush objects of current state/frame to the surface.
-*/
+ * Do Dynamic Paint step. Paints scene brush objects of current state/frame to the surface.
+ */
static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *surface, float timescale, float subframe)
{
PaintSurfaceData *sData = surface->data;
@@ -4775,8 +4775,8 @@ static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *su
dynamicPaint_surfacePreStep(surface, timescale);
/*
- * Loop through surface's target paint objects and do painting
- */
+ * Loop through surface's target paint objects and do painting
+ */
{
Base *base = NULL;
GroupObject *go = NULL;
@@ -4889,16 +4889,14 @@ static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *su
}
/* surfaces operations that use adjacency data */
- if (sData->adj_data && bData->bNeighs)
- {
+ if (sData->adj_data && bData->bNeighs) {
/* wave type surface simulation step */
if (surface->type == MOD_DPAINT_SURFACE_T_WAVE) {
dynamicPaint_doWaveStep(surface, timescale);
}
/* paint surface effects */
- if (surface->effect && surface->type == MOD_DPAINT_SURFACE_T_PAINT)
- {
+ if (surface->effect && surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
int steps = 1, s;
PaintPoint *prevPoint;
float *force = NULL;
@@ -4924,8 +4922,8 @@ static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *su
}
/*
-* Calculate a single frame and included subframes for surface
-*/
+ * Calculate a single frame and included subframes for surface
+ */
int dynamicPaint_calculateFrame(DynamicPaintSurface *surface, Scene *scene, Object *cObject, int frame)
{
float timescale = 1.0f;
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index 139f7d55438..ff798f5f2a1 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -90,13 +90,13 @@ BMEditMesh *BMEdit_Copy(BMEditMesh *tm)
tm2->bm = BM_mesh_copy(tm->bm);
- /*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
- tessellation only when/if that copy ends up getting
- used.*/
+ /* 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
+ * tessellation only when/if that copy ends up getting
+ * used.*/
tm2->looptris = NULL;
tm2->vert_index = NULL;
@@ -136,7 +136,7 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
if ( (tm->looptris != NULL) &&
(tm->tottri != 0) &&
/* (totrti <= bm->totface * 2) would be fine for all quads,
- * but incase there are some ngons, still re-use the array */
+ * but in case there are some ngons, still re-use the array */
(tm->tottri <= bm->totface * 3))
{
looptris = tm->looptris;
@@ -191,7 +191,7 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
else {
ScanFillVert *v, *lastv=NULL, *firstv=NULL;
- ScanFillEdge *e;
+ /* ScanFillEdge *e; */ /* UNUSED */
ScanFillFace *efa;
int totfilltri;
@@ -206,7 +206,7 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
v->tmp.p = l;
if (lastv) {
- e = BLI_addfilledge(lastv, v);
+ /* e = */ BLI_addfilledge(lastv, v);
}
lastv = v;
@@ -311,18 +311,18 @@ 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 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 tessellations are exposed. looking up an edge by index in particular
-is likely to be a little slow.
-*/
+ * 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 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 tessellations are exposed. looking up an edge by index in particular
+ * is likely to be a little slow.
+ */
typedef struct EditDerivedBMesh {
DerivedMesh dm;
@@ -342,7 +342,7 @@ typedef struct EditDerivedBMesh {
static void emDM_calcNormals(DerivedMesh *UNUSED(dm))
{
/* Nothing to do: normals are already calculated and stored on the
- BMVerts and BMFaces */
+ * BMVerts and BMFaces */
}
static void emDM_recalcTessellation(DerivedMesh *UNUSED(dm))
@@ -399,7 +399,7 @@ static void emDM_foreachMappedEdge(
static void emDM_drawMappedEdges(
DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index),
+ DMSetDrawOptions setDrawOptions,
void *userData)
{
EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm;
@@ -414,7 +414,7 @@ static void emDM_drawMappedEdges(
glBegin(GL_LINES);
eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
for (i=0; eed; i++,eed=BM_iter_step(&iter)) {
- if (!setDrawOptions || setDrawOptions(userData, i)) {
+ if (!setDrawOptions || (setDrawOptions(userData, i) != DM_DRAW_OPTION_SKIP)) {
glVertex3fv(bmdm->vertexCos[BM_elem_index_get(eed->v1)]);
glVertex3fv(bmdm->vertexCos[BM_elem_index_get(eed->v2)]);
}
@@ -425,7 +425,7 @@ static void emDM_drawMappedEdges(
glBegin(GL_LINES);
eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
for (i=0; eed; i++,eed=BM_iter_step(&iter)) {
- if (!setDrawOptions || setDrawOptions(userData, i)) {
+ if (!setDrawOptions || (setDrawOptions(userData, i) != DM_DRAW_OPTION_SKIP)) {
glVertex3fv(eed->v1->co);
glVertex3fv(eed->v2->co);
}
@@ -443,8 +443,8 @@ static void emDM_drawEdges(
static void emDM_drawMappedEdgesInterp(
DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index),
- void (*setDrawInterpOptions)(void *userData, int index, float t),
+ DMSetDrawOptions setDrawOptions,
+ DMSetDrawInterpOptions setDrawInterpOptions,
void *userData)
{
EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm;
@@ -459,7 +459,7 @@ static void emDM_drawMappedEdgesInterp(
glBegin(GL_LINES);
eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
for (i=0; eed; i++,eed=BM_iter_step(&iter)) {
- if (!setDrawOptions || setDrawOptions(userData, i)) {
+ if (!setDrawOptions || (setDrawOptions(userData, i) != DM_DRAW_OPTION_SKIP)) {
setDrawInterpOptions(userData, i, 0.0);
glVertex3fv(bmdm->vertexCos[BM_elem_index_get(eed->v1)]);
setDrawInterpOptions(userData, i, 1.0);
@@ -472,7 +472,7 @@ static void emDM_drawMappedEdgesInterp(
glBegin(GL_LINES);
eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
for (i=0; eed; i++,eed=BM_iter_step(&iter)) {
- if (!setDrawOptions || setDrawOptions(userData, i)) {
+ if (!setDrawOptions || (setDrawOptions(userData, i) != DM_DRAW_OPTION_SKIP)) {
setDrawInterpOptions(userData, i, 0.0);
glVertex3fv(eed->v1->co);
setDrawInterpOptions(userData, i, 1.0);
@@ -579,17 +579,19 @@ static void emDM_foreachMappedFaceCenter(
static void emDM_drawMappedFaces(
DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r),
- int (*setMaterial)(int, void *attribs),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
- void *userData, int UNUSED(useColors))
+ DMSetDrawOptions setDrawOptions,
+ DMSetMaterial setMaterial,
+ DMCompareDrawOptions compareDrawOptions,
+ void *userData,
+ DMDrawFlag flag)
{
EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm;
BMFace *efa;
struct BMLoop *(*looptris)[3]= bmdm->tc->looptris;
const int tottri= bmdm->tc->tottri;
const int lasttri= tottri - 1; /* compare agasint this a lot */
- int i, draw, flush;
+ DMDrawOption draw_option;
+ int i, flush;
const int skip_normals= !glIsEnabled(GL_LIGHTING); /* could be passed as an arg */
/* GL_ZERO is used to detect if drawing has started or not */
@@ -615,12 +617,14 @@ static void emDM_drawMappedFaces(
int drawSmooth;
efa = l[0]->f;
- drawSmooth= BM_elem_flag_test(efa, BM_ELEM_SMOOTH);
+ drawSmooth= (flag & DM_DRAW_ALWAYS_SMOOTH) ? 1 : BM_elem_flag_test(efa, BM_ELEM_SMOOTH);
- draw = setDrawOptions==NULL ? 1 : setDrawOptions(userData, BM_elem_index_get(efa), &drawSmooth);
- if (draw) {
+ draw_option = (!setDrawOptions ?
+ DM_DRAW_OPTION_NORMAL :
+ setDrawOptions(userData, BM_elem_index_get(efa)));
+ if (draw_option != DM_DRAW_OPTION_SKIP) {
const GLenum poly_type= GL_TRIANGLES; /* BMESH NOTE, this is odd but keep it for now to match trunk */
- if (draw==2) { /* enabled with stipple */
+ if (draw_option == DM_DRAW_OPTION_STIPPLE) { /* enabled with stipple */
if (poly_prev != GL_ZERO) glEnd();
poly_prev= GL_ZERO; /* force glBegin */
@@ -666,7 +670,7 @@ static void emDM_drawMappedFaces(
}
}
- flush= (draw==2);
+ flush= (draw_option == DM_DRAW_OPTION_STIPPLE);
if (!skip_normals && !flush && (i != lasttri))
flush|= efa->mat_nr != looptris[i + 1][0]->f->mat_nr; /* TODO, make this neater */
@@ -687,12 +691,14 @@ static void emDM_drawMappedFaces(
int drawSmooth;
efa = l[0]->f;
- drawSmooth= BM_elem_flag_test(efa, BM_ELEM_SMOOTH);
+ drawSmooth= (flag & DM_DRAW_ALWAYS_SMOOTH) ? 1 : BM_elem_flag_test(efa, BM_ELEM_SMOOTH);
- draw = setDrawOptions==NULL ? 1 : setDrawOptions(userData, BM_elem_index_get(efa), &drawSmooth);
- if (draw) {
+ draw_option = (!setDrawOptions ?
+ DM_DRAW_OPTION_NORMAL :
+ setDrawOptions(userData, BM_elem_index_get(efa)));
+ if (draw_option != DM_DRAW_OPTION_SKIP) {
const GLenum poly_type= GL_TRIANGLES; /* BMESH NOTE, this is odd but keep it for now to match trunk */
- if (draw==2) { /* enabled with stipple */
+ if (draw_option == DM_DRAW_OPTION_STIPPLE) { /* enabled with stipple */
if (poly_prev != GL_ZERO) glEnd();
poly_prev= GL_ZERO; /* force glBegin */
@@ -738,7 +744,7 @@ static void emDM_drawMappedFaces(
}
}
- flush= (draw==2);
+ flush= (draw_option == DM_DRAW_OPTION_STIPPLE);
if (!skip_normals && !flush && (i != lasttri)) {
flush|= efa->mat_nr != looptris[i + 1][0]->f->mat_nr; /* TODO, make this neater */
}
@@ -777,9 +783,9 @@ static void bmdm_get_tri_tex(BMesh *bm, BMLoop **ls, MLoopUV *luv[3], MLoopCol *
static void emDM_drawFacesTex_common(
DerivedMesh *dm,
- int (*drawParams)(MTFace *tface, int has_vcol, int matnr),
- int (*drawParamsMapped)(void *userData, int index),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ DMSetDrawOptionsTex drawParams,
+ DMSetDrawOptions drawParamsMapped,
+ DMCompareDrawOptions compareDrawOptions,
void *userData)
{
EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm;
@@ -789,14 +795,13 @@ static void emDM_drawFacesTex_common(
float (*vertexNos)[3]= bmdm->vertexNos;
BMFace *efa;
MLoopUV *luv[3], dummyluv = {{0}};
- MLoopCol *lcol[3], dummylcol = {0};
+ MLoopCol *lcol[3] = {NULL}, dummylcol = {0};
int i, has_vcol = CustomData_has_layer(&bm->ldata, CD_MLOOPCOL);
int has_uv = CustomData_has_layer(&bm->pdata, CD_MTEXPOLY);
(void) compareDrawOptions;
luv[0] = luv[1] = luv[2] = &dummyluv;
- lcol[0] = lcol[1] = lcol[2] = &dummylcol;
dummylcol.a = dummylcol.r = dummylcol.g = dummylcol.b = 255;
@@ -815,7 +820,7 @@ static void emDM_drawFacesTex_common(
MTFace mtf = {{{0}}};
/*unsigned char *cp= NULL;*/ /*UNUSED*/
int drawSmooth= BM_elem_flag_test(ls[0]->f, BM_ELEM_SMOOTH);
- int flag;
+ DMDrawOption draw_option;
efa = ls[0]->f;
@@ -824,13 +829,13 @@ static void emDM_drawFacesTex_common(
}
if (drawParams)
- flag= drawParams(&mtf, has_vcol, efa->mat_nr);
+ draw_option= drawParams(&mtf, has_vcol, efa->mat_nr);
else if (drawParamsMapped)
- flag= drawParamsMapped(userData, BM_elem_index_get(efa));
+ draw_option= drawParamsMapped(userData, BM_elem_index_get(efa));
else
- flag= 1;
+ draw_option= DM_DRAW_OPTION_NORMAL;
- if (flag != 0) { /* flag 0 == the face is hidden or invisible */
+ if (draw_option != DM_DRAW_OPTION_SKIP) {
if (!drawSmooth) {
glNormal3fv(bmdm->polyNos[BM_elem_index_get(efa)]);
@@ -838,32 +843,38 @@ static void emDM_drawFacesTex_common(
bmdm_get_tri_tex(bm, ls, luv, lcol, has_uv, has_vcol);
glTexCoord2fv(luv[0]->uv);
- glColor3ub(lcol[0]->b, lcol[0]->g, lcol[0]->r);
+ if (lcol[0])
+ glColor3ub(lcol[0]->b, lcol[0]->g, lcol[0]->r);
glVertex3fv(vertexCos[BM_elem_index_get(ls[0]->v)]);
glTexCoord2fv(luv[1]->uv);
- glColor3ub(lcol[1]->b, lcol[1]->g, lcol[1]->r);
+ if (lcol[1])
+ glColor3ub(lcol[1]->b, lcol[1]->g, lcol[1]->r);
glVertex3fv(vertexCos[BM_elem_index_get(ls[1]->v)]);
glTexCoord2fv(luv[2]->uv);
- glColor3ub(lcol[2]->b, lcol[2]->g, lcol[2]->r);
+ if (lcol[2])
+ glColor3ub(lcol[2]->b, lcol[2]->g, lcol[2]->r);
glVertex3fv(vertexCos[BM_elem_index_get(ls[2]->v)]);
}
else {
bmdm_get_tri_tex(bm, ls, luv, lcol, has_uv, has_vcol);
glTexCoord2fv(luv[0]->uv);
- glColor3ub(lcol[0]->b, lcol[0]->g, lcol[0]->r);
+ if (lcol[0])
+ glColor3ub(lcol[0]->b, lcol[0]->g, lcol[0]->r);
glNormal3fv(vertexNos[BM_elem_index_get(ls[0]->v)]);
glVertex3fv(vertexCos[BM_elem_index_get(ls[0]->v)]);
glTexCoord2fv(luv[1]->uv);
- glColor3ub(lcol[1]->b, lcol[1]->g, lcol[1]->r);
+ if (lcol[1])
+ glColor3ub(lcol[1]->b, lcol[1]->g, lcol[1]->r);
glNormal3fv(vertexNos[BM_elem_index_get(ls[1]->v)]);
glVertex3fv(vertexCos[BM_elem_index_get(ls[1]->v)]);
glTexCoord2fv(luv[2]->uv);
- glColor3ub(lcol[2]->b, lcol[2]->g, lcol[2]->r);
+ if (lcol[2])
+ glColor3ub(lcol[2]->b, lcol[2]->g, lcol[2]->r);
glNormal3fv(vertexNos[BM_elem_index_get(ls[2]->v)]);
glVertex3fv(vertexCos[BM_elem_index_get(ls[2]->v)]);
}
@@ -880,7 +891,7 @@ static void emDM_drawFacesTex_common(
MTFace mtf = {{{0}}};
/*unsigned char *cp= NULL;*/ /*UNUSED*/
int drawSmooth= BM_elem_flag_test(ls[0]->f, BM_ELEM_SMOOTH);
- int flag;
+ DMDrawOption draw_option;
efa = ls[0]->f;
@@ -889,13 +900,13 @@ static void emDM_drawFacesTex_common(
}
if (drawParams)
- flag= drawParams(&mtf, has_vcol, efa->mat_nr);
+ draw_option= drawParams(&mtf, has_vcol, efa->mat_nr);
else if (drawParamsMapped)
- flag= drawParamsMapped(userData, BM_elem_index_get(efa));
+ draw_option= drawParamsMapped(userData, BM_elem_index_get(efa));
else
- flag= 1;
+ draw_option= DM_DRAW_OPTION_NORMAL;
- if (flag != 0) { /* flag 0 == the face is hidden or invisible */
+ if (draw_option != DM_DRAW_OPTION_SKIP) {
glBegin(GL_TRIANGLES);
if (!drawSmooth) {
@@ -907,21 +918,18 @@ static void emDM_drawFacesTex_common(
glTexCoord2fv(luv[0]->uv);
if (lcol[0])
glColor3ub(lcol[0]->b, lcol[0]->g, lcol[0]->r);
- else glColor3ub(0, 0, 0);
glVertex3fv(ls[0]->v->co);
if (luv[1])
glTexCoord2fv(luv[1]->uv);
if (lcol[1])
glColor3ub(lcol[1]->b, lcol[1]->g, lcol[1]->r);
- else glColor3ub(0, 0, 0);
glVertex3fv(ls[1]->v->co);
if (luv[2])
glTexCoord2fv(luv[2]->uv);
if (lcol[2])
glColor3ub(lcol[2]->b, lcol[2]->g, lcol[2]->r);
- else glColor3ub(0, 0, 0);
glVertex3fv(ls[2]->v->co);
}
else {
@@ -931,7 +939,6 @@ static void emDM_drawFacesTex_common(
glTexCoord2fv(luv[0]->uv);
if (lcol[0])
glColor3ub(lcol[0]->b, lcol[0]->g, lcol[0]->r);
- else glColor3ub(0, 0, 0);
glNormal3fv(ls[0]->v->no);
glVertex3fv(ls[0]->v->co);
@@ -939,7 +946,6 @@ static void emDM_drawFacesTex_common(
glTexCoord2fv(luv[1]->uv);
if (lcol[1])
glColor3ub(lcol[1]->b, lcol[1]->g, lcol[1]->r);
- else glColor3ub(0, 0, 0);
glNormal3fv(ls[1]->v->no);
glVertex3fv(ls[1]->v->co);
@@ -947,7 +953,6 @@ static void emDM_drawFacesTex_common(
glTexCoord2fv(luv[2]->uv);
if (lcol[2])
glColor3ub(lcol[2]->b, lcol[2]->g, lcol[2]->r);
- else glColor3ub(0, 0, 0);
glNormal3fv(ls[2]->v->no);
glVertex3fv(ls[2]->v->co);
}
@@ -961,8 +966,8 @@ static void emDM_drawFacesTex_common(
static void emDM_drawFacesTex(
DerivedMesh *dm,
- int (*setDrawOptions)(MTFace *tface, int has_vcol, int matnr),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ DMSetDrawOptionsTex setDrawOptions,
+ DMCompareDrawOptions compareDrawOptions,
void *userData)
{
emDM_drawFacesTex_common(dm, setDrawOptions, NULL, compareDrawOptions, userData);
@@ -970,8 +975,8 @@ static void emDM_drawFacesTex(
static void emDM_drawMappedFacesTex(
DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ DMSetDrawOptions setDrawOptions,
+ DMCompareDrawOptions compareDrawOptions,
void *userData)
{
emDM_drawFacesTex_common(dm, NULL, setDrawOptions, compareDrawOptions, userData);
@@ -979,8 +984,8 @@ static void emDM_drawMappedFacesTex(
static void emDM_drawMappedFacesGLSL(
DerivedMesh *dm,
- int (*setMaterial)(int, void *attribs),
- int (*setDrawOptions)(void *userData, int index),
+ DMSetMaterial setMaterial,
+ DMSetDrawOptions setDrawOptions,
void *userData)
{
EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm;
@@ -1032,7 +1037,7 @@ static void emDM_drawMappedFacesGLSL(
efa = ltri[0]->f;
drawSmooth= BM_elem_flag_test(efa, BM_ELEM_SMOOTH);
- if (setDrawOptions && !setDrawOptions(userData, BM_elem_index_get(efa)))
+ if (setDrawOptions && (setDrawOptions(userData, BM_elem_index_get(efa)) == DM_DRAW_OPTION_SKIP))
continue;
new_matnr = efa->mat_nr + 1;
@@ -1511,8 +1516,8 @@ static void *emDM_getTessFaceDataArray(DerivedMesh *dm, int type)
data = datalayer = DM_get_tessface_data_layer(dm, type);
for (i=0; i<bmdm->tc->tottri; i++, data+=size) {
efa = bmdm->tc->looptris[i][0]->f;
- /*BMESH_TODO: need to still add tface data,
- derived from the loops.*/
+ /* BMESH_TODO: need to still add tface data,
+ * derived from the loops.*/
bmdata = CustomData_bmesh_get(&bm->pdata, efa->head.data, type);
memcpy(data, bmdata, size);
}
@@ -1717,5 +1722,5 @@ DerivedMesh *getEditDerivedBMesh(
BMEditMesh *BMEdit_FromObject(Object *ob)
{
BLI_assert(ob->type == OB_MESH);
- return ((Mesh *) ob->data )->edit_btmesh;
+ return ((Mesh *)ob->data)->edit_btmesh;
}
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 82a5d9aba3a..117414060df 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -426,16 +426,14 @@ static float eff_calc_visibility(ListBase *colliders, EffectorCache *eff, Effect
if(col->ob == eff->ob)
continue;
- if(collmd->bvhtree)
- {
+ if (collmd->bvhtree) {
BVHTreeRayHit hit;
hit.index = -1;
hit.dist = len + FLT_EPSILON;
// check if the way is blocked
- if(BLI_bvhtree_ray_cast(collmd->bvhtree, point->loc, norm, 0.0f, &hit, eff_tri_ray_hit, NULL)>=0)
- {
+ if (BLI_bvhtree_ray_cast(collmd->bvhtree, point->loc, norm, 0.0f, &hit, eff_tri_ray_hit, NULL)>=0) {
absorption= col->ob->pd->absorption;
// visibility is only between 0 and 1, calculated from 1-absorption
@@ -717,11 +715,11 @@ static void get_effector_tot(EffectorCache *eff, EffectorData *efd, EffectedPoin
if(eff->pd->forcefield == PFIELD_CHARGE) {
/* Only the charge of the effected particle is used for
- interaction, not fall-offs. If the fall-offs aren't the
- same this will be unphysical, but for animation this
- could be the wanted behavior. If you want physical
- correctness the fall-off should be spherical 2.0 anyways.
- */
+ * interaction, not fall-offs. If the fall-offs aren't the
+ * same this will be unphysical, but for animation this
+ * could be the wanted behavior. If you want physical
+ * correctness the fall-off should be spherical 2.0 anyways.
+ */
efd->charge = eff->pd->f_strength;
}
else if(eff->pd->forcefield == PFIELD_HARMONIC && (eff->pd->flag & PFIELD_MULTIPLE_SPRINGS)==0) {
@@ -943,34 +941,33 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
}
/* -------- pdDoEffectors() --------
- generic force/speed system, now used for particles and softbodies
- scene = scene where it runs in, for time and stuff
- lb = listbase with objects that take part in effecting
- opco = global coord, as input
- force = force accumulator
- speed = actual current speed which can be altered
- cur_time = "external" time in frames, is constant for static particles
- loc_time = "local" time in frames, range <0-1> for the lifetime of particle
- par_layer = layer the caller is in
- flags = only used for softbody wind now
- guide = old speed of particle
-
-*/
+ * generic force/speed system, now used for particles and softbodies
+ * scene = scene where it runs in, for time and stuff
+ * lb = listbase with objects that take part in effecting
+ * opco = global coord, as input
+ * force = force accumulator
+ * speed = actual current speed which can be altered
+ * cur_time = "external" time in frames, is constant for static particles
+ * loc_time = "local" time in frames, range <0-1> for the lifetime of particle
+ * par_layer = layer the caller is in
+ * flags = only used for softbody wind now
+ * guide = old speed of particle
+ */
void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *weights, EffectedPoint *point, float *force, float *impulse)
{
/*
- Modifies the force on a particle according to its
- relation with the effector object
- Different kind of effectors include:
- Forcefields: Gravity-like attractor
- (force power is related to the inverse of distance to the power of a falloff value)
- Vortex fields: swirling effectors
- (particles rotate around Z-axis of the object. otherwise, same relation as)
- (Forcefields, but this is not done through a force/acceleration)
- Guide: particles on a path
- (particles are guided along a curve bezier or old nurbs)
- (is independent of other effectors)
-*/
+ * Modifies the force on a particle according to its
+ * relation with the effector object
+ * Different kind of effectors include:
+ * Forcefields: Gravity-like attractor
+ * (force power is related to the inverse of distance to the power of a falloff value)
+ * Vortex fields: swirling effectors
+ * (particles rotate around Z-axis of the object. otherwise, same relation as)
+ * (Forcefields, but this is not done through a force/acceleration)
+ * Guide: particles on a path
+ * (particles are guided along a curve bezier or old nurbs)
+ * (is independent of other effectors)
+ */
EffectorCache *eff;
EffectorData efd;
int p=0, tot = 1, step = 1;
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 1c6c229d8fc..59f62c43b73 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -827,7 +827,7 @@ void calchandles_fcurve (FCurve *fcu)
* -> Auto handles: become aligned when selection status is NOT(000 || 111)
* -> Vector handles: become 'nothing' when (one half selected AND other not)
* - PHASE 2: recalculate handles
-*/
+ */
void testhandles_fcurve (FCurve *fcu, const short use_handle)
{
BezTriple *bezt;
@@ -1686,7 +1686,7 @@ static float evaluate_driver (ChannelDriver *driver, const float evaltime)
/* The total length of the handles is not allowed to be more
* than the horizontal distance between (v1-v4).
* This is to prevent curve loops.
-*/
+ */
void correct_bezpart(float v1[2], float v2[2], float v3[2], float v4[2])
{
float h1[2], h2[2], len1, len2, len, fac;
@@ -1873,22 +1873,20 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
lastbezt= prevbezt + a;
/* evaluation time at or past endpoints? */
- if (prevbezt->vec[1][0] >= evaltime)
- {
+ if (prevbezt->vec[1][0] >= evaltime) {
/* before or on first keyframe */
if ( (fcu->extend == FCURVE_EXTRAPOLATE_LINEAR) && (prevbezt->ipo != BEZT_IPO_CONST) &&
- !(fcu->flag & FCURVE_DISCRETE_VALUES) )
+ !(fcu->flag & FCURVE_DISCRETE_VALUES) )
{
/* linear or bezier interpolation */
- if (prevbezt->ipo==BEZT_IPO_LIN)
- {
+ if (prevbezt->ipo==BEZT_IPO_LIN) {
/* Use the next center point instead of our own handle for
* linear interpolated extrapolate
*/
- if (fcu->totvert == 1)
+ if (fcu->totvert == 1) {
cvalue= prevbezt->vec[1][1];
- else
- {
+ }
+ else {
bezt = prevbezt+1;
dx= prevbezt->vec[1][0] - evaltime;
fac= bezt->vec[1][0] - prevbezt->vec[1][0];
@@ -1898,12 +1896,12 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
fac= (bezt->vec[1][1] - prevbezt->vec[1][1]) / fac;
cvalue= prevbezt->vec[1][1] - (fac * dx);
}
- else
+ else {
cvalue= prevbezt->vec[1][1];
+ }
}
}
- else
- {
+ else {
/* Use the first handle (earlier) of first BezTriple to calculate the
* gradient and thus the value of the curve at evaltime
*/
@@ -1915,34 +1913,32 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
fac= (prevbezt->vec[1][1] - prevbezt->vec[0][1]) / fac;
cvalue= prevbezt->vec[1][1] - (fac * dx);
}
- else
+ else {
cvalue= prevbezt->vec[1][1];
+ }
}
}
- else
- {
+ else {
/* constant (BEZT_IPO_HORIZ) extrapolation or constant interpolation,
* so just extend first keyframe's value
*/
cvalue= prevbezt->vec[1][1];
}
}
- else if (lastbezt->vec[1][0] <= evaltime)
- {
+ else if (lastbezt->vec[1][0] <= evaltime) {
/* after or on last keyframe */
if ( (fcu->extend == FCURVE_EXTRAPOLATE_LINEAR) && (lastbezt->ipo != BEZT_IPO_CONST) &&
!(fcu->flag & FCURVE_DISCRETE_VALUES) )
{
/* linear or bezier interpolation */
- if (lastbezt->ipo==BEZT_IPO_LIN)
- {
+ if (lastbezt->ipo==BEZT_IPO_LIN) {
/* Use the next center point instead of our own handle for
* linear interpolated extrapolate
*/
- if (fcu->totvert == 1)
+ if (fcu->totvert == 1) {
cvalue= lastbezt->vec[1][1];
- else
- {
+ }
+ else {
prevbezt = lastbezt - 1;
dx= evaltime - lastbezt->vec[1][0];
fac= lastbezt->vec[1][0] - prevbezt->vec[1][0];
@@ -1952,12 +1948,12 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
fac= (lastbezt->vec[1][1] - prevbezt->vec[1][1]) / fac;
cvalue= lastbezt->vec[1][1] + (fac * dx);
}
- else
+ else {
cvalue= lastbezt->vec[1][1];
+ }
}
}
- else
- {
+ else {
/* Use the gradient of the second handle (later) of last BezTriple to calculate the
* gradient and thus the value of the curve at evaltime
*/
@@ -1969,38 +1965,33 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
fac= (lastbezt->vec[2][1] - lastbezt->vec[1][1]) / fac;
cvalue= lastbezt->vec[1][1] + (fac * dx);
}
- else
+ else {
cvalue= lastbezt->vec[1][1];
+ }
}
}
- else
- {
+ else {
/* constant (BEZT_IPO_HORIZ) extrapolation or constant interpolation,
* so just extend last keyframe's value
*/
cvalue= lastbezt->vec[1][1];
}
}
- else
- {
+ else {
/* evaltime occurs somewhere in the middle of the curve */
- for (a=0; prevbezt && bezt && (a < fcu->totvert-1); a++, prevbezt=bezt, bezt++)
- {
+ for (a=0; prevbezt && bezt && (a < fcu->totvert-1); a++, prevbezt=bezt, bezt++) {
/* use if the key is directly on the frame, rare cases this is needed else we get 0.0 instead. */
if(fabsf(bezt->vec[1][0] - evaltime) < SMALL_NUMBER) {
cvalue= bezt->vec[1][1];
}
/* evaltime occurs within the interval defined by these two keyframes */
- else if ((prevbezt->vec[1][0] <= evaltime) && (bezt->vec[1][0] >= evaltime))
- {
+ else if ((prevbezt->vec[1][0] <= evaltime) && (bezt->vec[1][0] >= evaltime)) {
/* value depends on interpolation mode */
- if ((prevbezt->ipo == BEZT_IPO_CONST) || (fcu->flag & FCURVE_DISCRETE_VALUES))
- {
+ if ((prevbezt->ipo == BEZT_IPO_CONST) || (fcu->flag & FCURVE_DISCRETE_VALUES)) {
/* constant (evaltime not relevant, so no interpolation needed) */
cvalue= prevbezt->vec[1][1];
}
- else if (prevbezt->ipo == BEZT_IPO_LIN)
- {
+ else if (prevbezt->ipo == BEZT_IPO_LIN) {
/* linear - interpolate between values of the two keyframes */
fac= bezt->vec[1][0] - prevbezt->vec[1][0];
@@ -2009,11 +2000,11 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
fac= (evaltime - prevbezt->vec[1][0]) / fac;
cvalue= prevbezt->vec[1][1] + (fac * (bezt->vec[1][1] - prevbezt->vec[1][1]));
}
- else
+ else {
cvalue= prevbezt->vec[1][1];
+ }
}
- else
- {
+ else {
/* bezier interpolation */
/* v1,v2 are the first keyframe and its 2nd handle */
v1[0]= prevbezt->vec[1][0];
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index 19b036d9ccf..ae474f9d9c3 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -39,6 +39,8 @@
#include "DNA_anim_types.h"
+#include "BLF_translation.h"
+
#include "BLI_blenlib.h"
#include "BLI_math.h" /* windows needs for M_PI */
#include "BLI_utildefines.h"
@@ -264,7 +266,7 @@ static FModifierTypeInfo FMI_GENERATOR = {
sizeof(FMod_Generator), /* size */
FMI_TYPE_GENERATE_CURVE, /* action type */
FMI_REQUIRES_NOTHING, /* requirements */
- "Generator", /* name */
+ N_("Generator"), /* name */
"FMod_Generator", /* struct name */
fcm_generator_free, /* free data */
fcm_generator_copy, /* copy data */
@@ -386,7 +388,7 @@ static FModifierTypeInfo FMI_FN_GENERATOR = {
sizeof(FMod_FunctionGenerator), /* size */
FMI_TYPE_GENERATE_CURVE, /* action type */
FMI_REQUIRES_NOTHING, /* requirements */
- "Built-In Function", /* name */
+ N_("Built-In Function"), /* name */
"FMod_FunctionGenerator", /* struct name */
NULL, /* free data */
NULL, /* copy data */
@@ -493,7 +495,7 @@ static FModifierTypeInfo FMI_ENVELOPE = {
sizeof(FMod_Envelope), /* size */
FMI_TYPE_REPLACE_VALUES, /* action type */
0, /* requirements */
- "Envelope", /* name */
+ N_("Envelope"), /* name */
"FMod_Envelope", /* struct name */
fcm_envelope_free, /* free data */
fcm_envelope_copy, /* copy data */
@@ -690,7 +692,7 @@ static FModifierTypeInfo FMI_CYCLES = {
sizeof(FMod_Cycles), /* size */
FMI_TYPE_EXTRAPOLATION, /* action type */
FMI_REQUIRES_ORIGINAL_DATA, /* requirements */
- "Cycles", /* name */
+ N_("Cycles"), /* name */
"FMod_Cycles", /* struct name */
NULL, /* free data */
NULL, /* copy data */
@@ -748,7 +750,7 @@ static FModifierTypeInfo FMI_NOISE = {
sizeof(FMod_Noise), /* size */
FMI_TYPE_REPLACE_VALUES, /* action type */
0, /* requirements */
- "Noise", /* name */
+ N_("Noise"), /* name */
"FMod_Noise", /* struct name */
NULL, /* free data */
NULL, /* copy data */
@@ -766,7 +768,7 @@ static FModifierTypeInfo FMI_FILTER = {
sizeof(FMod_Filter), /* size */
FMI_TYPE_REPLACE_VALUES, /* action type */
0, /* requirements */
- "Filter", /* name */
+ N_("Filter"), /* name */
"FMod_Filter", /* struct name */
NULL, /* free data */
NULL, /* copy data */
@@ -822,7 +824,7 @@ static FModifierTypeInfo FMI_PYTHON = {
sizeof(FMod_Python), /* size */
FMI_TYPE_GENERATE_CURVE, /* action type */
FMI_REQUIRES_RUNTIME_CHECK, /* requirements */
- "Python", /* name */
+ N_("Python"), /* name */
"FMod_Python", /* struct name */
fcm_python_free, /* free data */
fcm_python_copy, /* copy data */
@@ -865,7 +867,7 @@ static FModifierTypeInfo FMI_LIMITS = {
sizeof(FMod_Limits), /* size */
FMI_TYPE_GENERATE_CURVE, /* action type */ /* XXX... err... */
FMI_REQUIRES_RUNTIME_CHECK, /* requirements */
- "Limits", /* name */
+ N_("Limits"), /* name */
"FMod_Limits", /* struct name */
NULL, /* free data */
NULL, /* copy data */
@@ -918,7 +920,7 @@ static FModifierTypeInfo FMI_STEPPED = {
sizeof(FMod_Limits), /* size */
FMI_TYPE_GENERATE_CURVE, /* action type */ /* XXX... err... */
FMI_REQUIRES_RUNTIME_CHECK, /* requirements */
- "Stepped", /* name */
+ N_("Stepped"), /* name */
"FMod_Stepped", /* struct name */
NULL, /* free data */
NULL, /* copy data */
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 5a37a65ddbf..4cf47906b64 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -165,8 +165,7 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
pf= vfont->packedfile;
// We need to copy a tmp font to memory unless it is already there
- if(!tmpfnt)
- {
+ if(!tmpfnt) {
tpf= MEM_callocN(sizeof(*tpf), "PackedFile");
tpf->data= MEM_mallocN(pf->size, "packFile");
tpf->size= pf->size;
@@ -178,11 +177,11 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
tmpfnt->vfont= vfont;
BLI_addtail(&ttfdata, tmpfnt);
}
- } else {
+ }
+ else {
pf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id));
-
- if(!tmpfnt)
- {
+
+ if (!tmpfnt) {
tpf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id));
// Add temporary packed file to globals
@@ -257,8 +256,7 @@ VFont *load_vfont(Main *bmain, const char *name)
}
// Do not add FO_BUILTIN_NAME to temporary listbase
- if(strcmp(filename, FO_BUILTIN_NAME))
- {
+ if (strcmp(filename, FO_BUILTIN_NAME)) {
tmpfnt= (struct TmpFont *) MEM_callocN(sizeof(struct TmpFont), "temp_font");
tmpfnt->pf= tpf;
tmpfnt->vfont= vfont;
@@ -372,7 +370,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
vfd= vfont_get_data(bmain, which_vfont(cu, info));
if (!vfd) return;
- /*
+#if 0
if (cu->selend < cu->selstart) {
if ((charidx >= (cu->selend)) && (charidx <= (cu->selstart-2)))
sel= 1;
@@ -381,7 +379,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
if ((charidx >= (cu->selstart-1)) && (charidx <= (cu->selend-1)))
sel= 1;
}
- */
+#endif
/* make a copy at distance ofsx,ofsy with shear*/
fsize= cu->fsize;
@@ -541,7 +539,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
wchar_t *mem, *tmp, ascii;
/* renark: do calculations including the trailing '\0' of a string
- because the cursor can be at that location */
+ * because the cursor can be at that location */
if(ob->type!=OB_FONT) return NULL;
@@ -941,7 +939,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
if(mode==FO_CURSUP || mode==FO_CURSDOWN || mode==FO_PAGEUP || mode==FO_PAGEDOWN) {
/* 2: curs up
- 3: curs down */
+ * 3: curs down */
ct= chartransdata+cu->pos;
if((mode==FO_CURSUP || mode==FO_PAGEUP) && ct->linenr==0);
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index 989ccf65a88..00ec9ba0345 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -343,7 +343,7 @@ static void group_replaces_nla(Object *parent, Object *target, char mode)
#endif
/* puts all group members in local timing system, after this call
-you can draw everything, leaves tags in objects to signal it needs further updating */
+ * you can draw everything, leaves tags in objects to signal it needs further updating */
/* note: does not work for derivedmesh and render... it recreates all again in convertblender.c */
void group_handle_recalc_and_update(Scene *scene, Object *UNUSED(parent), Group *group)
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c
index 58c88682d3f..72038955c55 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -66,8 +66,7 @@ static void icon_free(void *val)
{
Icon* icon = val;
- if (icon)
- {
+ if (icon) {
if (icon->drawinfo_free) {
icon->drawinfo_free(icon->drawinfo);
}
@@ -79,7 +78,7 @@ static void icon_free(void *val)
}
/* create an id for a new icon and make sure that ids from deleted icons get reused
- after the integer number range is used up */
+ * after the integer number range is used up */
static int get_next_free_id(void)
{
int startId = gFirstIconId;
@@ -236,8 +235,7 @@ void BKE_icon_changed(int id)
icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(id));
- if (icon)
- {
+ if (icon) {
PreviewImage *prv = BKE_previewimg_get((ID*)icon->obj);
/* all previews changed */
@@ -302,8 +300,7 @@ void BKE_icon_set(int icon_id, struct Icon* icon)
old_icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id));
- if (old_icon)
- {
+ if (old_icon) {
printf("BKE_icon_set: Internal error, icon already set: %d\n", icon_id);
return;
}
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 5cef30894ef..b06cc8414a6 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -60,8 +60,8 @@ static char idp_size_table[] = {
/* --------- property array type -------------*/
-/*note: as a start to move away from the stupid IDP_New function, this type
- has it's own allocation function.*/
+/* note: as a start to move away from the stupid IDP_New function, this type
+ * has it's own allocation function.*/
IDProperty *IDP_NewIDPArray(const char *name)
{
IDProperty *prop = MEM_callocN(sizeof(IDProperty), "IDProperty prop array");
@@ -82,12 +82,12 @@ IDProperty *IDP_CopyIDPArray(IDProperty *array)
narray->data.pointer = MEM_dupallocN(array->data.pointer);
for (i=0; i<narray->len; i++) {
- /*ok, the copy functions always allocate a new structure,
- which doesn't work here. instead, simply copy the
- contents of the new structure into the array cell,
- then free it. this makes for more maintainable
- code than simply reimplementing the copy functions
- in this loop.*/
+ /* ok, the copy functions always allocate a new structure,
+ * which doesn't work here. instead, simply copy the
+ * contents of the new structure into the array cell,
+ * then free it. this makes for more maintainable
+ * code than simply reimplementing the copy functions
+ * in this loop.*/
tmp = IDP_CopyProperty(GETPROP(narray, i));
memcpy(GETPROP(narray, i), tmp, sizeof(IDProperty));
MEM_freeN(tmp);
@@ -368,8 +368,8 @@ void IDP_ConcatStringC(IDProperty *prop, const char *st)
int newlen;
newlen = prop->len + strlen(st);
- /*we have to remember that prop->len includes the null byte for strings.
- so there's no need to add +1 to the resize function.*/
+ /* we have to remember that prop->len includes the null byte for strings.
+ * so there's no need to add +1 to the resize function.*/
IDP_ResizeArray(prop, newlen);
strcat(prop->data.pointer, st);
}
@@ -378,8 +378,8 @@ void IDP_ConcatString(IDProperty *str1, IDProperty *append)
{
int newlen;
- /*since ->len for strings includes the NULL byte, we have to subtract one or
- we'll get an extra null byte after each concatination operation.*/
+ /* since ->len for strings includes the NULL byte, we have to subtract one or
+ * we'll get an extra null byte after each concatenation operation.*/
newlen = str1->len + append->len - 1;
IDP_ResizeArray(str1, newlen);
strcat(str1->data.pointer, append->data.pointer);
@@ -455,8 +455,8 @@ void IDP_SyncGroupValues(IDProperty *dest, IDProperty *src)
}
/*
- replaces all properties with the same name in a destination group from a source group.
-*/
+ * replaces all properties with the same name in a destination group from a source group.
+ */
void IDP_ReplaceGroupInGroup(IDProperty *dest, IDProperty *src)
{
IDProperty *loop, *prop;
@@ -483,9 +483,9 @@ void IDP_ReplaceGroupInGroup(IDProperty *dest, IDProperty *src)
}
}
/*
- replaces a property with the same name in a group, or adds
- it if the propery doesn't exist.
-*/
+ * replaces a property with the same name in a group, or adds
+ * it if the propery doesn't exist.
+ */
void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop)
{
IDProperty *loop;
@@ -502,8 +502,8 @@ void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop)
}
}
-/*returns 0 if an id property with the same name exists and it failed,
- or 1 if it succeeded in adding to the group.*/
+/* returns 0 if an id property with the same name exists and it failed,
+ * or 1 if it succeeded in adding to the group.*/
int IDP_AddToGroup(IDProperty *group, IDProperty *prop)
{
if (IDP_GetPropertyFromGroup(group, prop->name) == NULL) {
@@ -574,10 +574,10 @@ void IDP_FreeIterBeforeEnd(void *vself)
MEM_freeN(vself);
}
-/*Ok, the way things work, Groups free the ID Property structs of their children.
- This is because all ID Property freeing functions free only direct data (not the ID Property
- struct itself), but for Groups the child properties *are* considered
- direct data.*/
+/* Ok, the way things work, Groups free the ID Property structs of their children.
+ * This is because all ID Property freeing functions free only direct data (not the ID Property
+ * struct itself), but for Groups the child properties *are* considered
+ * direct data. */
static void IDP_FreeGroup(IDProperty *prop)
{
IDProperty *loop;
@@ -761,9 +761,9 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n
return prop;
}
-/*NOTE: this will free all child properties including list arrays and groups!
- Also, note that this does NOT unlink anything! Plus it doesn't free
- the actual IDProperty struct either.*/
+/* NOTE: this will free all child properties including list arrays and groups!
+ * Also, note that this does NOT unlink anything! Plus it doesn't free
+ * the actual IDProperty struct either.*/
void IDP_FreeProperty(IDProperty *prop)
{
switch (prop->type) {
@@ -782,8 +782,8 @@ void IDP_FreeProperty(IDProperty *prop)
}
}
-/*Unlinks any IDProperty<->ID linkage that might be going on.
- note: currently unused.*/
+/* Unlinks any IDProperty<->ID linkage that might be going on.
+ * note: currently unused.*/
void IDP_UnlinkProperty(IDProperty *prop)
{
switch (prop->type) {
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 3cc73d7f7f1..3ac95b83e74 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -324,7 +324,7 @@ Image *copy_image(Image *ima)
static void extern_local_image(Image *UNUSED(ima))
{
/* Nothing to do: images don't link to other IDs. This function exists to
- match id_make_local pattern. */
+ * match id_make_local pattern. */
}
void make_local_image(struct Image *ima)
@@ -343,7 +343,7 @@ void make_local_image(struct Image *ima)
if(ima->id.lib==NULL) return;
/* Can't take short cut here: must check meshes at least because of bogus
- texface ID refs. - z0r */
+ * texface ID refs. - z0r */
#if 0
if(ima->id.us==1) {
id_clear_lib_data(bmain, &ima->id);
@@ -438,8 +438,8 @@ void make_local_image(struct Image *ima)
brush= brush->id.next;
}
/* Transfer references in texfaces. Texfaces don't add to image ID
- user count *unless* there are no other users. See
- readfile.c:lib_link_mtface. */
+ * user count *unless* there are no other users. See
+ * readfile.c:lib_link_mtface. */
me= bmain->mesh.first;
while(me) {
if(me->mtface) {
@@ -531,13 +531,13 @@ Image *BKE_add_image_file(const char *name)
BLI_strncpy(strtest, ima->name, sizeof(ima->name));
BLI_path_abs(strtest, G.main->name);
- if( strcmp(strtest, str)==0 ) {
+ if (BLI_path_cmp(strtest, str)==0) {
if(ima->anim==NULL || ima->id.us==0) {
BLI_strncpy(ima->name, name, sizeof(ima->name)); /* for stringcode */
ima->id.us++; /* officially should not, it doesn't link here! */
if(ima->ok==0)
ima->ok= IMA_OK;
- /* RETURN! */
+ /* RETURN! */
return ima;
}
}
@@ -697,9 +697,9 @@ void free_old_images(void)
int ctime = (int)PIL_check_seconds_timer();
/*
- Run garbage collector once for every collecting period of time
- if textimeout is 0, that's the option to NOT run the collector
- */
+ * Run garbage collector once for every collecting period of time
+ * if textimeout is 0, that's the option to NOT run the collector
+ */
if (U.textimeout == 0 || ctime % U.texcollectrate || ctime == lasttime)
return;
@@ -712,10 +712,8 @@ void free_old_images(void)
ima= G.main->image.first;
while(ima) {
if((ima->flag & IMA_NOCOLLECT)==0 && ctime - ima->lastused > U.textimeout) {
- /*
- If it's in GL memory, deallocate and set time tag to current time
- This gives textures a "second chance" to be used before dying.
- */
+ /* If it's in GL memory, deallocate and set time tag to current time
+ * This gives textures a "second chance" to be used before dying. */
if(ima->bindcode || ima->repbind) {
GPU_free_image(ima);
ima->lastused = ctime;
@@ -797,11 +795,12 @@ void BKE_image_free_all_textures(void)
if(ibuf->userflags & IB_BITMAPDIRTY)
break;
- /* if(ibuf->mipmap[0])
+#if 0
+ if(ibuf->mipmap[0])
totsize+= 1.33*ibuf->x*ibuf->y*4;
else
- totsize+= ibuf->x*ibuf->y*4;*/
-
+ totsize+= ibuf->x*ibuf->y*4;
+#endif
}
if(ibuf==NULL)
image_free_buffers(ima);
@@ -1722,22 +1721,21 @@ struct anim *openanim(const char *name, int flags, int streamindex)
/* Notes about Image storage
-- packedfile
- -> written in .blend
-- filename
- -> written in .blend
-- movie
- -> comes from packedfile or filename
-- renderresult
- -> comes from packedfile or filename
-- listbase
- -> ibufs from exrhandle
-- flipbook array
- -> ibufs come from movie, temporary renderresult or sequence
-- ibuf
- -> comes from packedfile or filename or generated
-
-*/
+ * - packedfile
+ * -> written in .blend
+ * - filename
+ * -> written in .blend
+ * - movie
+ * -> comes from packedfile or filename
+ * - renderresult
+ * -> comes from packedfile or filename
+ * - listbase
+ * -> ibufs from exrhandle
+ * - flipbook array
+ * -> ibufs come from movie, temporary renderresult or sequence
+ * - ibuf
+ * -> comes from packedfile or filename or generated
+ */
/* forces existence of 1 Image for renderout or nodes, returns Image */
@@ -1834,7 +1832,7 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal)
break;
}
- /* dont use notifiers because they are not 100% sure to succseed
+ /* dont use notifiers because they are not 100% sure to succeeded
* this also makes sure all scenes are accounted for. */
{
Scene *scene;
@@ -1910,7 +1908,7 @@ void BKE_image_release_renderresult(Scene *scene, Image *ima)
void BKE_image_backup_render(Scene *scene, Image *ima)
{
/* called right before rendering, ima->renders contains render
- result pointers for everything but the current render */
+ * result pointers for everything but the current render */
Render *re= RE_GetRender(scene->id.name);
int slot= ima->render_slot, last= ima->last_render_slot;
@@ -2229,7 +2227,7 @@ static ImBuf *image_get_ibuf_multilayer(Image *ima, ImageUser *iuser)
/* showing RGBA result itself (from compo/sequence) or
- like exr, using layers etc */
+ * like exr, using layers etc */
/* always returns a single ibuf, also during render progress */
static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_r)
{
@@ -2321,8 +2319,8 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
ibuf->y= rres.recty;
/* free rect buffer if float buffer changes, so it can be recreated with
- the updated result, and also in case we got byte buffer from sequencer,
- so we don't keep reference to freed buffer */
+ * the updated result, and also in case we got byte buffer from sequencer,
+ * so we don't keep reference to freed buffer */
if(ibuf->rect_float!=rectf || rect || !rectf)
imb_freerectImBuf(ibuf);
@@ -2513,7 +2511,7 @@ ImBuf *BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **lock_r)
else if(ima->source == IMA_SRC_VIEWER) {
if(ima->type==IMA_TYPE_R_RESULT) {
/* always verify entirely, and potentially
- returns pointer to release later */
+ * returns pointer to release later */
ibuf= image_get_render_result(ima, iuser, lock_r);
}
else if(ima->type==IMA_TYPE_COMPOSITE) {
diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c
index c6cb8c9582a..d4185af2f98 100644
--- a/source/blender/blenkernel/intern/image_gen.c
+++ b/source/blender/blenkernel/intern/image_gen.c
@@ -69,7 +69,7 @@ void BKE_image_buf_fill_color(unsigned char *rect, float *rect_float, int width,
void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int width, int height)
{
/* these two passes could be combined into one, but it's more readable and
- * easy to tweak like this, speed isn't really that much of an issue in this situation... */
+ * easy to tweak like this, speed isn't really that much of an issue in this situation... */
int checkerwidth= 32, dark= 1;
int x, y;
@@ -202,12 +202,9 @@ static void checker_board_color_tint(unsigned char *rect, float *rect_float, int
int x, y;
float blend_half= blend * 0.5f;
- for(y= 0; y < height; y++)
- {
- for(x= 0; x < width; x++)
- {
- if( ( (y/size)%2 == 1 && (x/size)%2 == 1 ) || ( (y/size)%2 == 0 && (x/size)%2 == 0 ) )
- {
+ for (y= 0; y < height; y++) {
+ for (x= 0; x < width; x++) {
+ if (((y / size) % 2 == 1 && (x / size) % 2 == 1 ) || ( (y / size) % 2 == 0 && (x / size) % 2 == 0 )) {
if (rect) {
rect[0]= (char)BLEND_CHAR(rect[0], blend);
rect[1]= (char)BLEND_CHAR(rect[1], blend);
@@ -251,12 +248,9 @@ static void checker_board_color_tint(unsigned char *rect, float *rect_float, int
static void checker_board_grid_fill(unsigned char *rect, float *rect_float, int width, int height, float blend)
{
int x, y;
- for(y= 0; y < height; y++)
- {
- for(x= 0; x < width; x++)
- {
- if( ((y % 32) == 0) || ((x % 32) == 0) || x == 0 )
- {
+ for(y= 0; y < height; y++) {
+ for(x= 0; x < width; x++) {
+ if (((y % 32) == 0) || ((x % 32) == 0) || x == 0) {
if (rect) {
rect[0]= BLEND_CHAR(rect[0], blend);
rect[1]= BLEND_CHAR(rect[1], blend);
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c
index f54a885c55e..a271513afc0 100644
--- a/source/blender/blenkernel/intern/implicit.c
+++ b/source/blender/blenkernel/intern/implicit.c
@@ -210,7 +210,7 @@ DO_INLINE void init_lfvector(float (*fLongVector)[3], float vector[3], unsigned
unsigned int i = 0;
for(i = 0; i < verts; i++)
{
- VECCOPY(fLongVector[i], vector);
+ copy_v3_v3(fLongVector[i], vector);
}
}
/* zero long vector with float[3] */
@@ -248,9 +248,8 @@ DO_INLINE float dot_lfvector(float (*fLongVectorA)[3], float (*fLongVectorB)[3],
// different results each time you run it!
// schedule(guided, 2)
//#pragma omp parallel for reduction(+: temp) if(verts > CLOTH_OPENMP_LIMIT)
- for(i = 0; i < (long)verts; i++)
- {
- temp += INPR(fLongVectorA[i], fLongVectorB[i]);
+ for(i = 0; i < (long)verts; i++) {
+ temp += dot_v3v3(fLongVectorA[i], fLongVectorB[i]);
}
return temp;
}
@@ -303,7 +302,7 @@ DO_INLINE void sub_lfvector_lfvector(float (*to)[3], float (*fLongVectorA)[3], f
for(i = 0; i < verts; i++)
{
- VECSUB(to[i], fLongVectorA[i], fLongVectorB[i]);
+ sub_v3_v3v3(to[i], fLongVectorA[i], fLongVectorB[i]);
}
}
@@ -324,9 +323,9 @@ static void print_fmatrix(float m3[3][3])
DO_INLINE void cp_fmatrix(float to[3][3], float from[3][3])
{
// memcpy(to, from, sizeof (float) * 9);
- VECCOPY(to[0], from[0]);
- VECCOPY(to[1], from[1]);
- VECCOPY(to[2], from[2]);
+ copy_v3_v3(to[0], from[0]);
+ copy_v3_v3(to[1], from[1]);
+ copy_v3_v3(to[2], from[2]);
}
/* copy 3x3 matrix */
@@ -397,11 +396,11 @@ DO_INLINE void mul_fvector_fmatrix(float *to, float *from, float matrix[3][3])
/* 3x3 matrix multiplied by a vector */
/* STATUS: verified */
-DO_INLINE void mul_fmatrix_fvector(float *to, float matrix[3][3], float *from)
+DO_INLINE void mul_fmatrix_fvector(float *to, float matrix[3][3], float from[3])
{
- to[0] = INPR(matrix[0],from);
- to[1] = INPR(matrix[1],from);
- to[2] = INPR(matrix[2],from);
+ to[0] = dot_v3v3(matrix[0],from);
+ to[1] = dot_v3v3(matrix[1],from);
+ to[2] = dot_v3v3(matrix[2],from);
}
/* 3x3 matrix multiplied by a 3x3 matrix */
/* STATUS: verified */
@@ -449,9 +448,9 @@ DO_INLINE void subadd_fmatrixS_fmatrixS(float to[3][3], float matrixA[3][3], flo
/* A = B - C (3x3 matrix subtraction with 3x3 matrix) */
DO_INLINE void sub_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3])
{
- VECSUB(to[0], matrixA[0], matrixB[0]);
- VECSUB(to[1], matrixA[1], matrixB[1]);
- VECSUB(to[2], matrixA[2], matrixB[2]);
+ sub_v3_v3v3(to[0], matrixA[0], matrixB[0]);
+ sub_v3_v3v3(to[1], matrixA[1], matrixB[1]);
+ sub_v3_v3v3(to[2], matrixA[2], matrixB[2]);
}
/* A += B - C (3x3 matrix add-subtraction with 3x3 matrix) */
DO_INLINE void addsub_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3])
@@ -495,16 +494,16 @@ DO_INLINE void mulsub_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float
/* STATUS: verified */
DO_INLINE void muladd_fmatrix_fvector(float to[3], float matrix[3][3], float from[3])
{
- to[0] += INPR(matrix[0],from);
- to[1] += INPR(matrix[1],from);
- to[2] += INPR(matrix[2],from);
+ to[0] += dot_v3v3(matrix[0], from);
+ to[1] += dot_v3v3(matrix[1], from);
+ to[2] += dot_v3v3(matrix[2], from);
}
/* 3x3 matrix multiplied+sub'ed by a vector */
DO_INLINE void mulsub_fmatrix_fvector(float to[3], float matrix[3][3], float from[3])
{
- to[0] -= INPR(matrix[0],from);
- to[1] -= INPR(matrix[1],from);
- to[2] -= INPR(matrix[2],from);
+ to[0] -= dot_v3v3(matrix[0], from);
+ to[1] -= dot_v3v3(matrix[1], from);
+ to[2] -= dot_v3v3(matrix[2], from);
}
/////////////////////////////////////////////////////////////////
@@ -813,7 +812,7 @@ int implicit_init (Object *UNUSED(ob), ClothModifierData *clmd)
for(i = 0; i < cloth->numverts; i++)
{
- VECCOPY(id->X[i], verts[i].x);
+ copy_v3_v3(id->X[i], verts[i].x);
}
return 1;
@@ -1218,7 +1217,7 @@ DO_INLINE void dfdx_damp(float to[3][3], float dir[3],float length,const float
// return (I-outerprod(dir,dir)) * (-damping * -(dot(dir,vel)/Max(length,rest)));
mul_fvectorT_fvector(to, dir, dir);
sub_fmatrix_fmatrix(to, I, to);
- mul_fmatrix_S(to, (-damping * -(INPR(dir,vel)/MAX2(length,rest))));
+ mul_fmatrix_S(to, (-damping * -(dot_v3v3(dir,vel)/MAX2(length,rest))));
}
@@ -1244,14 +1243,14 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
int no_compress = clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS;
- VECCOPY(s->f, nullf);
+ copy_v3_v3(s->f, nullf);
cp_fmatrix(s->dfdx, nulldfdx);
cp_fmatrix(s->dfdv, nulldfdx);
// calculate elonglation
- VECSUB(extent, X[s->kl], X[s->ij]);
- VECSUB(vel, V[s->kl], V[s->ij]);
- dot = INPR(extent, extent);
+ sub_v3_v3v3(extent, X[s->kl], X[s->ij]);
+ sub_v3_v3v3(vel, V[s->kl], V[s->ij]);
+ dot = dot_v3v3(extent, extent);
length = sqrt(dot);
s->flags &= ~CLOTH_SPRING_FLAG_NEEDED;
@@ -1296,7 +1295,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
// Ascher & Boxman, p.21: Damping only during elonglation
// something wrong with it...
- mul_fvector_S(damping_force, dir, clmd->sim_parms->Cdis * INPR(vel,dir));
+ mul_fvector_S(damping_force, dir, clmd->sim_parms->Cdis * dot_v3v3(vel, dir));
VECADD(s->f, s->f, damping_force);
/* VERIFIED */
@@ -1307,21 +1306,20 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
}
}
- else if(s->type & CLOTH_SPRING_TYPE_GOAL)
- {
+ else if (s->type & CLOTH_SPRING_TYPE_GOAL) {
float tvect[3];
s->flags |= CLOTH_SPRING_FLAG_NEEDED;
// current_position = xold + t * (newposition - xold)
- VECSUB(tvect, verts[s->ij].xconst, verts[s->ij].xold);
+ sub_v3_v3v3(tvect, verts[s->ij].xconst, verts[s->ij].xold);
mul_fvector_S(tvect, tvect, time);
VECADD(tvect, tvect, verts[s->ij].xold);
- VECSUB(extent, X[s->ij], tvect);
+ sub_v3_v3v3(extent, X[s->ij], tvect);
// SEE MSG BELOW (these are UNUSED)
- // dot = INPR(extent, extent);
+ // dot = dot_v3v3(extent, extent);
// length = sqrt(dot);
k = clmd->sim_parms->goalspring;
@@ -1332,7 +1330,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
VECADDS(s->f, s->f, extent, -k);
- mul_fvector_S(damping_force, dir, clmd->sim_parms->goalfrict * 0.01 * INPR(vel,dir));
+ mul_fvector_S(damping_force, dir, clmd->sim_parms->goalfrict * 0.01 * dot_v3v3(vel, dir));
VECADD(s->f, s->f, damping_force);
// HERE IS THE PROBLEM!!!!
@@ -1372,7 +1370,7 @@ DO_INLINE void cloth_apply_spring_force(ClothModifierData *UNUSED(clmd), ClothSp
VECADD(lF[s->ij], lF[s->ij], s->f);
if(!(s->type & CLOTH_SPRING_TYPE_GOAL))
- VECSUB(lF[s->kl], lF[s->kl], s->f);
+ sub_v3_v3v3(lF[s->kl], lF[s->kl], s->f);
sub_fmatrix_fmatrix(dFdX[s->kl].m, dFdX[s->kl].m, s->dfdx);
sub_fmatrix_fmatrix(dFdX[s->ij].m, dFdX[s->ij].m, s->dfdx);
@@ -1416,7 +1414,7 @@ static void CalcFloat4( float *v1, float *v2, float *v3, float *v4, float *n)
static float calculateVertexWindForce(float wind[3], float vertexnormal[3])
{
- return (INPR(wind, vertexnormal));
+ return dot_v3v3(wind, vertexnormal);
}
typedef struct HairGridVert {
@@ -1504,7 +1502,7 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
k = HAIR_GRID_INDEX(loc1->co, gmin, gmax, 2);
if(k>=0 && k<10) {
- VECSUB(vel, loc1->co, loc0->co);
+ sub_v3_v3v3(vel, loc1->co, loc0->co);
colg[i][j][k].velocity[0] += vel[0];
colg[i][j][k].velocity[1] += vel[1];
@@ -1578,7 +1576,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
/* global acceleration (gravitation) */
if(clmd->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
- VECCOPY(gravity, clmd->scene->physics_settings.gravity);
+ copy_v3_v3(gravity, clmd->scene->physics_settings.gravity);
mul_fvector_S(gravity, gravity, 0.001f * clmd->sim_parms->effector_weights->global_gravity); /* scale gravity force */
}
@@ -1598,7 +1596,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
for(i = 0; i < numverts; i++)
{
float temp[3];
- VECCOPY(temp, lF[i]);
+ copy_v3_v3(temp, lF[i]);
mul_fmatrix_fvector(lF[i], M[i].m, temp);
}
@@ -1637,24 +1635,24 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
normalize_v3_v3(trinormal, triunnormal);
// add wind from v1
- VECCOPY(tmp, trinormal);
+ copy_v3_v3(tmp, trinormal);
mul_v3_fl(tmp, calculateVertexWindForce(winvec[mfaces[i].v1], triunnormal));
VECADDS(lF[mfaces[i].v1], lF[mfaces[i].v1], tmp, factor);
// add wind from v2
- VECCOPY(tmp, trinormal);
+ copy_v3_v3(tmp, trinormal);
mul_v3_fl(tmp, calculateVertexWindForce(winvec[mfaces[i].v2], triunnormal));
VECADDS(lF[mfaces[i].v2], lF[mfaces[i].v2], tmp, factor);
// add wind from v3
- VECCOPY(tmp, trinormal);
+ copy_v3_v3(tmp, trinormal);
mul_v3_fl(tmp, calculateVertexWindForce(winvec[mfaces[i].v3], triunnormal));
VECADDS(lF[mfaces[i].v3], lF[mfaces[i].v3], tmp, factor);
// add wind from v4
if(mfaces[i].v4)
{
- VECCOPY(tmp, trinormal);
+ copy_v3_v3(tmp, trinormal);
mul_v3_fl(tmp, calculateVertexWindForce(winvec[mfaces[i].v4], triunnormal));
VECADDS(lF[mfaces[i].v4], lF[mfaces[i].v4], tmp, factor);
}
@@ -1673,15 +1671,15 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
spring = search->link;
if(spring->type == CLOTH_SPRING_TYPE_STRUCTURAL) {
- VECSUB(edgevec, (float*)lX[spring->ij], (float*)lX[spring->kl]);
+ sub_v3_v3v3(edgevec, (float*)lX[spring->ij], (float*)lX[spring->kl]);
project_v3_v3v3(tmp, winvec[spring->ij], edgevec);
- VECSUB(edgeunnormal, winvec[spring->ij], tmp);
+ sub_v3_v3v3(edgeunnormal, winvec[spring->ij], tmp);
/* hair doesn't stretch too much so we can use restlen pretty safely */
VECADDS(lF[spring->ij], lF[spring->ij], edgeunnormal, spring->restlen * factor);
project_v3_v3v3(tmp, winvec[spring->kl], edgevec);
- VECSUB(edgeunnormal, winvec[spring->kl], tmp);
+ sub_v3_v3v3(edgeunnormal, winvec[spring->kl], tmp);
VECADDS(lF[spring->kl], lF[spring->kl], edgeunnormal, spring->restlen * factor);
}
@@ -1844,7 +1842,7 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
// update velocities with constrained velocities from pinned verts
if(verts [i].flags & CLOTH_VERT_FLAG_PINNED)
{
- VECSUB(id->V[i], verts[i].xconst, verts[i].xold);
+ sub_v3_v3v3(id->V[i], verts[i].xconst, verts[i].xold);
// mul_v3_fl(id->V[i], clmd->sim_parms->stepsPerFrame);
}
}
@@ -1872,14 +1870,14 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
if(verts [i].flags & CLOTH_VERT_FLAG_PINNED)
{
float tvect[3] = {.0,.0,.0};
- VECSUB(tvect, verts[i].xconst, verts[i].xold);
+ sub_v3_v3v3(tvect, verts[i].xconst, verts[i].xold);
mul_fvector_S(tvect, tvect, step+dt);
VECADD(tvect, tvect, verts[i].xold);
- VECCOPY(id->Xnew[i], tvect);
+ copy_v3_v3(id->Xnew[i], tvect);
}
}
- VECCOPY(verts[i].txold, id->X[i]);
+ copy_v3_v3(verts[i].txold, id->X[i]);
}
if(clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_ENABLED && clmd->clothObject->bvhtree)
@@ -1890,10 +1888,10 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
// update verts to current positions
for(i = 0; i < numverts; i++)
{
- VECCOPY(verts[i].tx, id->Xnew[i]);
+ copy_v3_v3(verts[i].tx, id->Xnew[i]);
- VECSUB(verts[i].tv, verts[i].tx, verts[i].txold);
- VECCOPY(verts[i].v, verts[i].tv);
+ sub_v3_v3v3(verts[i].tv, verts[i].tx, verts[i].txold);
+ copy_v3_v3(verts[i].v, verts[i].tv);
}
for (i=0, cv=cloth->verts; i<cloth->numverts; i++, cv++) {
@@ -1908,7 +1906,7 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
for(i = 0; i < numverts; i++)
{
// correct velocity again, just to be sure we had to change it due to adaptive collisions
- VECSUB(verts[i].tv, verts[i].tx, id->X[i]);
+ sub_v3_v3v3(verts[i].tv, verts[i].tx, id->X[i]);
}
//if (do_extra_solve)
@@ -1923,8 +1921,8 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
if((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) && (verts [i].flags & CLOTH_VERT_FLAG_PINNED))
continue;
- VECCOPY(id->Xnew[i], verts[i].tx);
- VECCOPY(id->Vnew[i], verts[i].tv);
+ copy_v3_v3(id->Xnew[i], verts[i].tx);
+ copy_v3_v3(id->Vnew[i], verts[i].tv);
mul_v3_fl(id->Vnew[i], spf);
}
}
@@ -1964,15 +1962,15 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
{
if((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) && (verts [i].flags & CLOTH_VERT_FLAG_PINNED))
{
- VECCOPY(verts[i].txold, verts[i].xconst); // TODO: test --> should be .x
- VECCOPY(verts[i].x, verts[i].xconst);
- VECCOPY(verts[i].v, id->V[i]);
+ copy_v3_v3(verts[i].txold, verts[i].xconst); // TODO: test --> should be .x
+ copy_v3_v3(verts[i].x, verts[i].xconst);
+ copy_v3_v3(verts[i].v, id->V[i]);
}
else
{
- VECCOPY(verts[i].txold, id->X[i]);
- VECCOPY(verts[i].x, id->X[i]);
- VECCOPY(verts[i].v, id->V[i]);
+ copy_v3_v3(verts[i].txold, id->X[i]);
+ copy_v3_v3(verts[i].x, id->X[i]);
+ copy_v3_v3(verts[i].v, id->V[i]);
}
}
@@ -1990,8 +1988,8 @@ void implicit_set_positions (ClothModifierData *clmd)
for(i = 0; i < numverts; i++)
{
- VECCOPY(id->X[i], verts[i].x);
- VECCOPY(id->V[i], verts[i].v);
+ copy_v3_v3(id->X[i], verts[i].x);
+ copy_v3_v3(id->V[i], verts[i].v);
}
if(G.rt > 0)
printf("implicit_set_positions\n");
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 40fe3626848..84939925b00 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -663,8 +663,10 @@ static const char *sound_adrcodes_to_paths (int adrcode, int *array_index)
case SND_PITCH:
return "pitch";
/* XXX Joshua -- I had wrapped panning in rna, but someone commented out, calling it "unused" */
- /* case SND_PANNING:
- return "panning"; */
+#if 0
+ case SND_PANNING:
+ return "panning";
+#endif
case SND_ATTEN:
return "attenuation";
}
@@ -762,11 +764,12 @@ static const char *particle_adrcodes_to_paths (int adrcode, int *array_index)
return "settings.billboard_tilt";
/* PartDeflect needs to be sorted out properly in rna_object_force;
- If anyone else works on this, but is unfamiliar, these particular
- settings reference the particles of the system themselves
- being used as forces -- it will use the same rna structure
- as the similar object forces */
- /*case PART_PD_FSTR:
+ * If anyone else works on this, but is unfamiliar, these particular
+ * settings reference the particles of the system themselves
+ * being used as forces -- it will use the same rna structure
+ * as the similar object forces */
+#if 0
+ case PART_PD_FSTR:
if (part->pd) poin= &(part->pd->f_strength);
break;
case PART_PD_FFALL:
@@ -783,11 +786,12 @@ static const char *particle_adrcodes_to_paths (int adrcode, int *array_index)
break;
case PART_PD2_FMAXD:
if (part->pd2) poin= &(part->pd2->maxdist);
- break;*/
+ break;
+#endif
- }
-
- return NULL;
+ }
+
+ return NULL;
}
/* ------- */
@@ -1173,7 +1177,7 @@ static void icu_to_fcurves (ID *id, ListBase *groups, ListBase *list, IpoCurve *
case IPO_CYCLX: /* cyclic extrapolation + offset */
{
/* Add a new FModifier (Cyclic) instead of setting extend value
- * as that's the new equivilant of that option.
+ * as that's the new equivalent of that option.
*/
FModifier *fcm= add_fmodifier(&fcu->modifiers, FMODIFIER_TYPE_CYCLES);
FMod_Cycles *data= (FMod_Cycles *)fcm->data;
@@ -1914,9 +1918,9 @@ void do_versions_ipos_to_animato(Main *main)
}
/* patch adrcode, so that we can map
- to different DNA variables later
- (semi-hack (tm) )
- */
+ * to different DNA variables later
+ * (semi-hack (tm) )
+ */
switch (seq->type) {
case SEQ_IMAGE:
case SEQ_META:
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 1b678225135..6c05ecb33ff 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -221,9 +221,9 @@ void make_local_key(Key *key)
{
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(key==NULL) return;
key->id.lib= NULL;
@@ -265,7 +265,7 @@ void sort_keys(Key *key)
if(key->ipo && key->ipo->curve.first != key->ipo->curve.last ) {
for(icu= key->ipo->curve.first; icu; icu= icu->next) {
/* if we find the curve, remove it and reinsert in the
- right place */
+ * right place */
if(icu->adrcode==kb->adrcode) {
IpoCurve *icu2;
BLI_remlink(&key->ipo->curve, icu);
@@ -537,7 +537,7 @@ static char *key_block_get_data(Key *key, KeyBlock *actkb, KeyBlock *kb, char **
{
if(kb == actkb) {
/* this hack makes it possible to edit shape keys in
- edit mode with shape keys blending applied */
+ * edit mode with shape keys blending applied */
if(GS(key->from->name) == ID_ME) {
Mesh *me;
BMVert *eve;
@@ -1579,7 +1579,7 @@ KeyBlock *key_get_named_keyblock(Key *key, const char name[])
}
/* Get RNA-Path for 'value' setting of the given ShapeKey
- * NOTE: the user needs to free the returned string once they're finishe with it
+ * NOTE: the user needs to free the returned string once they're finish with it
*/
char *key_get_curValue_rnaPath(Key *key, KeyBlock *kb)
{
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c
index 6b4cdc70aea..4e4dca51e7d 100644
--- a/source/blender/blenkernel/intern/lamp.c
+++ b/source/blender/blenkernel/intern/lamp.c
@@ -161,9 +161,9 @@ void make_local_lamp(Lamp *la)
int is_local= FALSE, is_lib= FALSE;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(la->id.lib==NULL) return;
if(la->id.us==1) {
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 79922e47564..0cddd978263 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -459,7 +459,7 @@ void end_latt_deform(Object *ob)
}
/* calculations is in local space of deformed object
- so we store in latmat transform from path coord inside object
+ * so we store in latmat transform from path coord inside object
*/
typedef struct {
float dmin[3], dmax[3];
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index a2db2de6713..34a9bc1d100 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -124,8 +124,8 @@
#define MAX_IDPUP 60 /* was 24 */
/* GS reads the memory pointed at in a specific ordering.
- only use this definition, makes little and big endian systems
- work fine, in conjunction with MAKE_ID */
+ * only use this definition, makes little and big endian systems
+ * work fine, in conjunction with MAKE_ID */
/* from blendef: */
#define GS(a) (*((short *)(a)))
@@ -415,8 +415,8 @@ int id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop)
/* copy animation actions too */
BKE_copy_animdata_id_action(id);
/* us is 1 by convention, but RNA_property_pointer_set
- will also incremement it, so set it to zero */
- newid->us= 0;
+ * will also increment it, so set it to zero */
+ newid->us = 0;
/* assign copy */
RNA_id_pointer_create(newid, &idptr);
@@ -586,14 +586,14 @@ int set_listbasepointers(Main *main, ListBase **lb)
}
/* *********** ALLOC AND FREE *****************
-
-free_libblock(ListBase *lb, ID *id )
- provide a list-basis and datablock, but only ID is read
-
-void *alloc_libblock(ListBase *lb, type, name)
- inserts in list and returns a new ID
-
- ***************************** */
+ *
+ * free_libblock(ListBase *lb, ID *id )
+ * provide a list-basis and datablock, but only ID is read
+ *
+ * void *alloc_libblock(ListBase *lb, type, name)
+ * inserts in list and returns a new ID
+ *
+ * **************************** */
static ID *alloc_libblock_notest(short type)
{
@@ -1283,16 +1283,18 @@ int new_id(ListBase *lb, ID *id, const char *tname)
* however all data in blender should be sorted, not just duplicate names
* sorting should not hurt, but noting just incause it alters the way other
* functions work, so sort every time */
- /* if( result )
- sort_alpha_id(lb, id);*/
-
+#if 0
+ if( result )
+ sort_alpha_id(lb, id);
+#endif
+
sort_alpha_id(lb, id);
return result;
}
/* Pull an ID out of a library (make it local). Only call this for IDs that
- don't have other library users. */
+ * don't have other library users. */
void id_clear_lib_data(Main *bmain, ID *id)
{
BKE_id_lib_local_paths(bmain, id->lib, id);
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index ede3355951d..8a746113035 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -291,9 +291,9 @@ void make_local_material(Material *ma)
int a, is_local= FALSE, is_lib= FALSE;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if (ma->id.lib==NULL) return;
@@ -305,7 +305,7 @@ void make_local_material(Material *ma)
}
/* Check which other IDs reference this one to determine if it's used by
- lib or local */
+ * lib or local */
/* test objects */
ob= bmain->object.first;
while(ob) {
@@ -1615,7 +1615,7 @@ static void calculate_tface_materialname(char *matname, char *newname, int flag)
// otherwise do:
int digits = integer_getdigits(flag);
/* clamp the old name, remove the MA prefix and add the .TF.flag suffix
- e.g. matname = "MALoooooooooooooongName"; newname = "Loooooooooooooon.TF.2" */
+ * e.g. matname = "MALoooooooooooooongName"; newname = "Loooooooooooooon.TF.2" */
BLI_snprintf(newname, MAX_ID_NAME, "%.*s.TF.%0*d", MAX_ID_NAME-(digits+5), matname, digits, flag);
}
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 52e9dcaa578..f3225a6b6f5 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -278,7 +278,7 @@ void tex_space_mball(Object *ob)
min[0] = min[1] = min[2] = -1.0f;
max[0] = max[1] = max[2] = 1.0f;
}
- /*
+#if 0
loc[0]= (min[0]+max[0])/2.0f;
loc[1]= (min[1]+max[1])/2.0f;
loc[2]= (min[2]+max[2])/2.0f;
@@ -286,7 +286,7 @@ void tex_space_mball(Object *ob)
size[0]= (max[0]-min[0])/2.0f;
size[1]= (max[1]-min[1])/2.0f;
size[2]= (max[2]-min[2])/2.0f;
- */
+#endif
boundbox_set_from_min_max(bb, min, max);
}
@@ -485,7 +485,7 @@ Object *find_basis_mball(Scene *scene, Object *basis)
* "An Implicit Surface Polygonizer"
* by Jules Bloomenthal, jbloom@beauty.gmu.edu
* in "Graphics Gems IV", Academic Press, 1994
-
+ *
* Authored by Jules Bloomenthal, Xerox PARC.
* Copyright (c) Xerox Corporation, 1991. All rights reserved.
* Permission is granted to reproduce, use and distribute this code for
@@ -949,7 +949,7 @@ void testface(int i, int j, int k, CUBE* old, int bit, int c1, int c2, int c3, i
}
/* setcorner: return corner with the given lattice location
- set (and cache) its function value */
+ * set (and cache) its function value */
CORNER *setcorner (PROCESS* p, int i, int j, int k)
{
@@ -1753,7 +1753,7 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
}
/* create "new" bb, only point 0 and 6, which are
- * neccesary for octal tree filling */
+ * necessary for octal tree filling */
mainb[a]->bb->vec[0][0] = min_x - ml->rad;
mainb[a]->bb->vec[0][1] = min_y - ml->rad;
mainb[a]->bb->vec[0][2] = min_z - ml->rad;
@@ -1829,7 +1829,7 @@ void fill_metaball_octal_node(octal_node *node, MetaElem *ml, short i)
}
}
-/* Node is subdivided as is ilustrated on the following figure:
+/* Node is subdivided as is illustrated on the following figure:
*
* +------+------+
* / / /|
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 23cda362f74..909a87cfd4b 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -121,8 +121,8 @@ static const char *cmpcode_to_str(int code)
}
}
-/*thresh is threshold for comparing vertices, uvs, vertex colors,
- weights, etc.*/
+/* thresh is threshold for comparing vertices, uvs, vertex colors,
+ * weights, etc.*/
static int customdata_compare(CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2, float thresh)
{
CustomDataLayer *l1, *l2;
@@ -438,8 +438,8 @@ void copy_dverts(MDeformVert *dst, MDeformVert *src, int copycount)
void free_dverts(MDeformVert *dvert, int totvert)
{
/* Instead of freeing the verts directly,
- call this function to delete any special
- vert data */
+ * call this function to delete any special
+ * vert data */
int i;
if (!dvert)
@@ -452,6 +452,19 @@ void free_dverts(MDeformVert *dvert, int totvert)
MEM_freeN (dvert);
}
+static void mesh_tessface_clear_intern(Mesh *mesh, int free_customdata)
+{
+ if (free_customdata)
+ CustomData_free(&mesh->fdata, mesh->totface);
+
+ mesh->mface = NULL;
+ mesh->mtface = NULL;
+ mesh->mcol = NULL;
+ mesh->totface = 0;
+
+ memset(&mesh->fdata, 0, sizeof(mesh->fdata));
+}
+
Mesh *add_mesh(const char *name)
{
Mesh *me;
@@ -474,6 +487,7 @@ Mesh *copy_mesh(Mesh *me)
MTFace *tface;
MTexPoly *txface;
int a, i;
+ const int do_tessface = ((me->totface != 0) && (me->totpoly == 0)); /* only do tessface if we have no polys */
men= copy_libblock(&me->id);
@@ -485,10 +499,16 @@ Mesh *copy_mesh(Mesh *me)
CustomData_copy(&me->vdata, &men->vdata, CD_MASK_MESH, CD_DUPLICATE, men->totvert);
CustomData_copy(&me->edata, &men->edata, CD_MASK_MESH, CD_DUPLICATE, men->totedge);
- CustomData_copy(&me->fdata, &men->fdata, CD_MASK_MESH, CD_DUPLICATE, men->totface);
CustomData_copy(&me->ldata, &men->ldata, CD_MASK_MESH, CD_DUPLICATE, men->totloop);
CustomData_copy(&me->pdata, &men->pdata, CD_MASK_MESH, CD_DUPLICATE, men->totpoly);
- mesh_update_customdata_pointers(men, TRUE);
+ if (do_tessface) {
+ CustomData_copy(&me->fdata, &men->fdata, CD_MASK_MESH, CD_DUPLICATE, men->totface);
+ }
+ else {
+ mesh_tessface_clear_intern(men, FALSE);
+ }
+
+ mesh_update_customdata_pointers(men, do_tessface);
/* ensure indirect linked data becomes lib-extern */
for (i=0; i<me->fdata.totlayer; i++) {
@@ -547,9 +567,7 @@ static void expand_local_mesh(Mesh *me)
for (a=0; a<me->totpoly; a++, txface++) {
/* special case: ima always local immediately */
if (txface->tpage) {
- if (txface->tpage) {
- id_lib_extern((ID *)txface->tpage);
- }
+ id_lib_extern((ID *)txface->tpage);
}
}
}
@@ -562,9 +580,7 @@ static void expand_local_mesh(Mesh *me)
for (a=0; a<me->totface; a++, tface++) {
/* special case: ima always local immediately */
if (tface->tpage) {
- if (tface->tpage) {
- id_lib_extern((ID *)tface->tpage);
- }
+ id_lib_extern((ID *)tface->tpage);
}
}
}
@@ -738,7 +754,7 @@ void transform_mesh_orco_verts(Mesh *me, float (*orco)[3], int totvert, int inve
}
/* rotates the vertices of a face in case v[2] or v[3] (vertex index) is = 0.
- this is necessary to make the if (mface->v4) check for quads work */
+ * this is necessary to make the if (mface->v4) check for quads work */
int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
{
/* first test if the face is legal */
@@ -1852,8 +1868,8 @@ static void bm_corners_to_loops(Mesh *me, int findex, int loopstart, int numTex,
if (corners == 0) {
/* Empty MDisp layers appear in at least one of the sintel.blend files.
- Not sure why this happens, but it seems fine to just ignore them here.
- If corners==0 for a non-empty layer though, something went wrong. */
+ * Not sure why this happens, but it seems fine to just ignore them here.
+ * If corners==0 for a non-empty layer though, something went wrong. */
BLI_assert(fd->totdisp == 0);
}
else {
@@ -1884,6 +1900,12 @@ void convert_mfaces_to_mpolys(Mesh *mesh)
int numTex, numCol;
int i, j, totloop;
+ /* just in case some of these layers are filled in (can happen with python created meshes) */
+ CustomData_free(&mesh->ldata, mesh->totloop);
+ CustomData_free(&mesh->pdata, mesh->totpoly);
+ memset(&mesh->ldata, 0, sizeof(mesh->ldata));
+ memset(&mesh->pdata, 0, sizeof(mesh->pdata));
+
mesh->totpoly = mesh->totface;
mesh->mpoly = MEM_callocN(sizeof(MPoly)*mesh->totpoly, "mpoly converted");
CustomData_add_layer(&mesh->pdata, CD_MPOLY, CD_ASSIGN, mesh->mpoly, mesh->totpoly);
@@ -2071,8 +2093,8 @@ void free_uv_vert_map(UvVertMap *vmap)
}
/* Generates a map where the key is the vertex and the value is a list
- of polys that use that vertex as a corner. The lists are allocated
- from one memory pool. */
+ * of polys that use that vertex as a corner. The lists are allocated
+ * from one memory pool. */
void create_vert_poly_map(ListBase **map, IndexNode **mem,
MPoly *mpoly, MLoop *mloop,
const int totvert, const int totpoly, const int totloop)
@@ -2097,8 +2119,8 @@ void create_vert_poly_map(ListBase **map, IndexNode **mem,
}
/* Generates a map where the key is the vertex and the value is a list
- of edges that use that vertex as an endpoint. The lists are allocated
- from one memory pool. */
+ * of edges that use that vertex as an endpoint. The lists are allocated
+ * from one memory pool. */
void create_vert_edge_map(ListBase **map, IndexNode **mem, const MEdge *medge, const int totvert, const int totedge)
{
int i, j;
@@ -2185,14 +2207,14 @@ void mesh_loops_to_mface_corners(CustomData *fdata, CustomData *ldata,
}
/*
- this function recreates a tessellation.
- returns number of tessellation faces.
+ * this function recreates a tessellation.
+ * returns number of tessellation faces.
*/
int mesh_recalcTessellation(CustomData *fdata,
CustomData *ldata, CustomData *pdata,
MVert *mvert, int totface, int UNUSED(totloop),
int totpoly,
- /* when teseelating to recalcilate normals after
+ /* when tessellating to recalcilate normals after
* we can skip copying here */
const int do_face_nor_cpy)
{
@@ -2281,17 +2303,14 @@ int mesh_recalcTessellation(CustomData *fdata,
else if (mp->totloop == 3) {
- ml = mloop + mp->loopstart;
ML_TO_MF(0, 1, 2)
mface_index++;
}
else if (mp->totloop == 4) {
#ifdef USE_TESSFACE_QUADS
- ml = mloop + mp->loopstart;
ML_TO_MF_QUAD()
mface_index++;
#else
- ml = mloop + mp->loopstart;
ML_TO_MF(0, 1, 2)
mface_index++;
ML_TO_MF(0, 2, 3)
@@ -2585,7 +2604,7 @@ int mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
* polygon See Graphics Gems for
* computing newell normal.
*
-*/
+ */
static void mesh_calc_ngon_normal(MPoly *mpoly, MLoop *loopstart,
MVert *mvert, float normal[3])
{
@@ -2600,9 +2619,9 @@ static void mesh_calc_ngon_normal(MPoly *mpoly, MLoop *loopstart,
v2 = mvert + loopstart[(i+1)%mpoly->totloop].v;
v3 = mvert + loopstart[(i+2)%mpoly->totloop].v;
- VECCOPY(u, v1->co);
- VECCOPY(v, v2->co);
- VECCOPY(w, v3->co);
+ copy_v3db_v3fl(u, v1->co);
+ copy_v3db_v3fl(v, v2->co);
+ copy_v3db_v3fl(w, v3->co);
/*this fixes some weird numerical error*/
if (i==0) {
@@ -2612,16 +2631,16 @@ static void mesh_calc_ngon_normal(MPoly *mpoly, MLoop *loopstart,
}
/* newell's method
-
- so thats?:
- (a[1] - b[1]) * (a[2] + b[2]);
- a[1]*b[2] - b[1]*a[2] - b[1]*b[2] + a[1]*a[2]
-
- odd. half of that is the cross product. . .what's the
- other half?
-
- also could be like a[1]*(b[2] + a[2]) - b[1]*(a[2] - b[2])
- */
+ *
+ * so thats?:
+ * (a[1] - b[1]) * (a[2] + b[2]);
+ * a[1]*b[2] - b[1]*a[2] - b[1]*b[2] + a[1]*a[2]
+ *
+ * odd. half of that is the cross product. . .what's the
+ * other half?
+ *
+ * also could be like a[1]*(b[2] + a[2]) - b[1]*(a[2] - b[2])
+ */
n[0] += (u[1] - v[1]) * (u[2] + v[2]);
n[1] += (u[2] - v[2]) * (u[0] + v[0]);
@@ -2690,9 +2709,9 @@ static void mesh_calc_ngon_normal_coords(MPoly *mpoly, MLoop *loopstart,
v2 = (const float *)(vertex_coords + loopstart[(i+1)%mpoly->totloop].v);
v3 = (const float *)(vertex_coords + loopstart[(i+2)%mpoly->totloop].v);
- VECCOPY(u, v1);
- VECCOPY(v, v2);
- VECCOPY(w, v3);
+ copy_v3db_v3fl(u, v1);
+ copy_v3db_v3fl(v, v2);
+ copy_v3db_v3fl(w, v3);
/*this fixes some weird numerical error*/
if (i==0) {
@@ -2834,7 +2853,7 @@ float mesh_calc_poly_area(MPoly *mpoly, MLoop *loopstart,
}
/* Find the index of the loop in 'poly' which references vertex,
- returns -1 if not found */
+ * returns -1 if not found */
int poly_find_loop_from_vert(const MPoly *poly, const MLoop *loopstart,
unsigned vert)
{
@@ -2848,8 +2867,8 @@ int poly_find_loop_from_vert(const MPoly *poly, const MLoop *loopstart,
}
/* Fill 'adj_r' with the loop indices in 'poly' adjacent to the
- vertex. Returns the index of the loop matching vertex, or -1 if the
- vertex is not in 'poly' */
+ * vertex. Returns the index of the loop matching vertex, or -1 if the
+ * vertex is not in 'poly' */
int poly_get_adj_loops_from_vert(unsigned adj_r[3], const MPoly *poly,
const MLoop *mloop, unsigned vert)
{
@@ -2964,12 +2983,5 @@ void BKE_mesh_tessface_ensure(Mesh *mesh)
void BKE_mesh_tessface_clear(Mesh *mesh)
{
- CustomData_free(&mesh->fdata, mesh->totface);
-
- mesh->mface = NULL;
- mesh->mtface = NULL;
- mesh->mcol = NULL;
- mesh->totface = 0;
-
- memset(&mesh->fdata, 0, sizeof(&mesh->fdata));
+ mesh_tessface_clear_intern(mesh, TRUE);
}
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c
index 4a988f0b278..fbd7a5fb47b 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -538,7 +538,7 @@ void BKE_mesh_calc_edges(Mesh *mesh, int update)
if (mesh->totpoly) {
/* second pass, iterate through all loops again and assign
- the newly created edges to them. */
+ * the newly created edges to them. */
MPoly *mp= mesh->mpoly;
for(i=0; i < mesh->totpoly; i++, mp++) {
MLoop *l= &mesh->mloop[mp->loopstart];
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 9a67260ded4..2421971c53e 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -373,11 +373,11 @@ LinkNode *modifiers_calcDataMasks(struct Scene *scene, Object *ob, ModifierData
}
/* build the list of required data masks - each mask in the list must
- * include all elements of the masks that follow it
- *
- * note the list is currently in reverse order, so "masks that follow it"
- * actually means "masks that precede it" at the moment
- */
+ * include all elements of the masks that follow it
+ *
+ * note the list is currently in reverse order, so "masks that follow it"
+ * actually means "masks that precede it" at the moment
+ */
for(curr = dataMasks, prev = NULL; curr; prev = curr, curr = curr->next) {
if(prev) {
CustomDataMask prev_mask = (CustomDataMask)GET_INT_FROM_POINTER(prev->link);
@@ -414,9 +414,9 @@ ModifierData *modifiers_getLastPreview(struct Scene *scene, ModifierData *md, in
ModifierData *modifiers_getVirtualModifierList(Object *ob)
{
- /* Kinda hacky, but should be fine since we are never
- * reentrant and avoid free hassles.
- */
+ /* Kinda hacky, but should be fine since we are never
+ * re-entrant and avoid free hassles.
+ */
static ArmatureModifierData amd;
static CurveModifierData cmd;
static LatticeModifierData lmd;
@@ -491,8 +491,7 @@ Object *modifiers_isDeformedByArmature(Object *ob)
ModifierData *md = modifiers_getVirtualModifierList(ob);
ArmatureModifierData *amd= NULL;
- /* return the first selected armature, this lets us use multiple armatures
- */
+ /* return the first selected armature, this lets us use multiple armatures */
for (; md; md=md->next) {
if (md->type==eModifierType_Armature) {
amd = (ArmatureModifierData*) md;
@@ -508,16 +507,15 @@ Object *modifiers_isDeformedByArmature(Object *ob)
}
/* Takes an object and returns its first selected lattice, else just its
-* lattice
-* This should work for multiple lattics per object
-*/
+ * lattice
+ * This should work for multiple lattics per object
+ */
Object *modifiers_isDeformedByLattice(Object *ob)
{
ModifierData *md = modifiers_getVirtualModifierList(ob);
LatticeModifierData *lmd= NULL;
- /* return the first selected lattice, this lets us use multiple lattices
- */
+ /* return the first selected lattice, this lets us use multiple lattices */
for (; md; md=md->next) {
if (md->type==eModifierType_Lattice) {
lmd = (LatticeModifierData*) md;
@@ -614,7 +612,7 @@ void test_object_modifiers(Object *ob)
ModifierData *md;
/* just multires checked for now, since only multires
- modifies mesh data */
+ * modifies mesh data */
if(ob->type != OB_MESH) return;
diff --git a/source/blender/blenkernel/intern/modifiers_bmesh.c b/source/blender/blenkernel/intern/modifiers_bmesh.c
index da8af1357ab..8fe8c9cbaed 100644
--- a/source/blender/blenkernel/intern/modifiers_bmesh.c
+++ b/source/blender/blenkernel/intern/modifiers_bmesh.c
@@ -45,7 +45,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
{
MVert *mv, *mvert;
MEdge *me, *medge;
- MPoly *mpoly, *mp;
+ MPoly /* *mpoly, */ /* UNUSED */ *mp;
MLoop *mloop, *ml;
BMVert *v, **vtable, **verts = NULL;
BMEdge *e, **etable, **edges = NULL;
@@ -53,7 +53,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
BMIter liter;
BLI_array_declare(verts);
BLI_array_declare(edges);
- int i, j, k, totvert, totedge, totface;
+ int i, j, k, totvert, totedge /* , totface */ /* UNUSED */ ;
/*merge custom data layout*/
CustomData_bmesh_merge(&dm->vertData, &bm->vdata, CD_MASK_DERIVEDMESH, CD_CALLOC, bm, BM_VERT);
@@ -63,7 +63,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
totvert = dm->getNumVerts(dm);
totedge = dm->getNumEdges(dm);
- totface = dm->getNumPolys(dm);
+ /* totface = dm->getNumPolys(dm); */ /* UNUSED */
vtable = MEM_callocN(sizeof(void**) * totvert, "vert table in BMDM_Copy");
etable = MEM_callocN(sizeof(void**) * totedge, "edge table in BMDM_Copy");
@@ -93,7 +93,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
MEM_freeN(medge);
/*do faces*/
- mpoly = mp = dm->getPolyArray(dm);
+ mp = dm->getPolyArray(dm);
mloop = dm->getLoopArray(dm);
for (i = 0; i < dm->numPolyData; i++, mp++) {
BMLoop *l;
@@ -120,9 +120,8 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
f->mat_nr = mp->mat_nr;
l = BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, f);
- k = mp->loopstart;
- for (j = 0; l; l = BM_iter_step(&liter), k++) {
+ for (k = mp->loopstart; l; l = BM_iter_step(&liter), k++) {
CustomData_to_bmesh_block(&dm->loopData, &bm->ldata, k, &l->head.data);
}
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index 4d8f76467b1..0af6b9dd219 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -154,7 +154,7 @@ static void get_sequence_fname(MovieClip *clip, int framenr, char *name)
BLI_stringdec(name, head, tail, &numlen);
/* movieclips always points to first image from sequence,
- autoguess offset for now. could be something smarter in the future */
+ * autoguess offset for now. could be something smarter in the future */
offset= sequence_guess_offset(clip->name, strlen(head), numlen);
if (numlen) BLI_stringenc(name, head, tail, numlen, offset+framenr-1);
@@ -396,9 +396,9 @@ static MovieClip *movieclip_alloc(const char *name)
}
/* checks if image was already loaded, then returns same image
- otherwise creates new.
- does not load ibuf itself
- pass on optional frame for #name images */
+ * otherwise creates new.
+ * does not load ibuf itself
+ * pass on optional frame for #name images */
MovieClip *BKE_add_movieclip_file(const char *name)
{
MovieClip *clip;
@@ -484,7 +484,7 @@ static ImBuf *get_undistorted_ibuf(MovieClip *clip, struct MovieDistortion *dist
ImBuf *undistibuf;
/* XXX: because of #27997 do not use float buffers to undistort,
- otherwise, undistorted proxy can be darker than it should */
+ * otherwise, undistorted proxy can be darker than it should */
imb_freerectfloatImBuf(ibuf);
if(distortion)
@@ -640,7 +640,7 @@ static ImBuf *movieclip_get_postprocessed_ibuf(MovieClip *clip, MovieClipUser *u
int framenr= user->framenr, need_postprocess= 0;
/* cache isn't threadsafe itself and also loading of movies
- can't happen from concurent threads that's why we use lock here */
+ * can't happen from concurent threads that's why we use lock here */
BLI_lock_thread(LOCK_MOVIECLIP);
/* try to obtain cached postprocessed frame first */
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index 95f4b465beb..06de3cbe5a6 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -106,8 +106,8 @@ MultiresModifierData *find_multires_modifier_before(Scene *scene, ModifierData *
}
/* used for applying scale on mdisps layer and syncing subdivide levels when joining objects
- use_first - return first multires modifier if all multires'es are disabled
-*/
+ * use_first - return first multires modifier if all multires'es are disabled
+ */
MultiresModifierData *get_multires_modifier(Scene *scene, Object *ob, int use_first)
{
ModifierData *md;
@@ -128,7 +128,7 @@ MultiresModifierData *get_multires_modifier(Scene *scene, Object *ob, int use_fi
if (!mmd && use_first) {
/* active multires have not been found
- try to use first one */
+ * try to use first one */
return firstmmd;
}
@@ -269,15 +269,14 @@ static int get_levels_from_disps(Object *ob)
mdisp = CustomData_get_layer(&me->ldata, CD_MDISPS);
for (i = 0; i < me->totpoly; ++i) {
- int S = me->mpoly[i].totloop;
-
md = mdisp + me->mpoly[i].loopstart;
+
for (j=0; j<me->mpoly[i].totloop; j++, md++) {
if (md->totdisp == 0) continue;
while (1) {
int side = (1 << (totlvl-1)) + 1;
- int lvl_totdisp = side*side*S;
+ int lvl_totdisp = side*side;
if (md->totdisp == lvl_totdisp)
break;
else if (md->totdisp < lvl_totdisp)
@@ -491,7 +490,7 @@ static DerivedMesh *subsurf_dm_create_local(Object *ob, DerivedMesh *dm, int lvl
/* assumes no is normalized; return value's sign is negative if v is on
- the other side of the plane */
+ * the other side of the plane */
static float v3_dist_from_plane(float v[3], float center[3], float no[3])
{
float s[3];
@@ -572,7 +571,7 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Object *ob)
float no[3];
/* set up poly, loops, and coords in order to call
- mesh_calc_poly_normal_coords() */
+ * mesh_calc_poly_normal_coords() */
fake_poly.totloop = p->totloop;
fake_poly.loopstart = 0;
fake_loops = MEM_mallocN(sizeof(MLoop) * p->totloop, "fake_loops");
@@ -813,20 +812,20 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, DerivedMesh *dm
switch(op) {
case APPLY_DISPLACEMENTS:
/* Convert displacement to object space
- and add to grid points */
+ * and add to grid points */
mul_v3_m3v3(disp, mat, data);
add_v3_v3v3(co, sco, disp);
break;
case CALC_DISPLACEMENTS:
/* Calculate displacement between new and old
- grid points and convert to tangent space */
+ * grid points and convert to tangent space */
sub_v3_v3v3(disp, co, sco);
invert_m3(mat);
mul_v3_m3v3(data, mat, disp);
break;
case ADD_DISPLACEMENTS:
/* Convert subdivided displacements to tangent
- space and add to the original displacements */
+ * space and add to the original displacements */
invert_m3(mat);
mul_v3_m3v3(d, mat, co);
add_v3_v3(data, d);
@@ -1138,7 +1137,7 @@ DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, int loca
}
/**** Old Multires code ****
-***************************/
+ ***************************/
/* Adapted from sculptmode.c */
void old_mdisps_bilinear(float out[3], float (*disps)[3], const int st, float u, float v)
@@ -1669,7 +1668,7 @@ static void multires_load_old_vcols(Mesh *me)
return;
/* older multires format never supported multiple vcol layers,
- so we can assume the active vcol layer is the correct one */
+ * so we can assume the active vcol layer is the correct one */
if (!(mcol = CustomData_get_layer(&me->fdata, CD_MCOL)))
return;
@@ -1776,9 +1775,9 @@ static void multires_sync_levels(Scene *scene, Object *ob, Object *to_ob)
if (!mmd) {
/* object could have MDISP even when there is no multires modifier
- this could lead to troubles due to i've got no idea how mdisp could be
- upsampled correct without modifier data.
- just remove mdisps if no multires present (nazgul) */
+ * this could lead to troubles due to i've got no idea how mdisp could be
+ * upsampled correct without modifier data.
+ * just remove mdisps if no multires present (nazgul) */
Mesh *me= (Mesh*)ob->data;
diff --git a/source/blender/blenkernel/intern/navmesh_conversion.c b/source/blender/blenkernel/intern/navmesh_conversion.c
index 4c9c0a3a1fc..cdba036a6ae 100644
--- a/source/blender/blenkernel/intern/navmesh_conversion.c
+++ b/source/blender/blenkernel/intern/navmesh_conversion.c
@@ -248,8 +248,7 @@ int buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
//move to next edge
edge = (edge+1)%3;
}
- else
- {
+ else {
//move to next tri
int twinedge = -1;
for (k=0; k<3; k++)
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 814f0715d11..f67d3274b34 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -352,8 +352,7 @@ NlaStrip *add_nla_soundstrip (Scene *scene, Speaker *speaker)
* otherwise default to length of 10 frames
*/
#ifdef WITH_AUDASPACE
- if (speaker->sound)
- {
+ if (speaker->sound) {
AUD_SoundInfo info = AUD_getInfo(speaker->sound->playback_handle);
strip->end = (float)ceil((double)info.length * FPS);
@@ -1395,8 +1394,7 @@ static void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls)
* is directly followed/preceeded by another strip, forming an
* 'island' of continuous strips
*/
- if ( (ps || ns) && ((nls->prev == NULL) || IS_EQF(nls->prev->end, nls->start)==0) )
- {
+ if ((ps || ns) && ((nls->prev == NULL) || IS_EQF(nls->prev->end, nls->start)==0)) {
/* start overlaps - pick the largest overlap */
if ( ((ps && ns) && (*ps > *ns)) || (ps) )
nls->blendin= *ps - nls->start;
@@ -1406,8 +1404,7 @@ static void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls)
else /* no overlap allowed/needed */
nls->blendin= 0.0f;
- if ( (pe || ne) && ((nls->next == NULL) || IS_EQF(nls->next->start, nls->end)==0) )
- {
+ if ((pe || ne) && ((nls->next == NULL) || IS_EQF(nls->next->start, nls->end)==0)) {
/* end overlaps - pick the largest overlap */
if ( ((pe && ne) && (*pe > *ne)) || (pe) )
nls->blendout= nls->end - *pe;
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index f9817d5b6f5..8b9955dd378 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -827,8 +827,8 @@ void ntreeClearPreview(bNodeTree *ntree)
}
/* hack warning! this function is only used for shader previews, and
-since it gets called multiple times per pixel for Ztransp we only
-add the color once. Preview gets cleared before it starts render though */
+ * since it gets called multiple times per pixel for Ztransp we only
+ * add the color once. Preview gets cleared before it starts render though */
void nodeAddToPreview(bNode *node, float *col, int x, int y, int do_manage)
{
bNodePreview *preview= node->preview;
@@ -1036,7 +1036,7 @@ void ntreeSetOutput(bNodeTree *ntree)
}
/* here we could recursively set which nodes have to be done,
- might be different for editor or for "real" use... */
+ * might be different for editor or for "real" use... */
}
typedef struct MakeLocalCallData {
@@ -1083,9 +1083,9 @@ void ntreeMakeLocal(bNodeTree *ntree)
MakeLocalCallData cd;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(ntree->id.lib==NULL) return;
if(ntree->id.us==1) {
@@ -1447,6 +1447,24 @@ void ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***deplist, in
}
}
+/* only updates node->level for detecting cycles links */
+static void ntree_update_node_level(bNodeTree *ntree)
+{
+ bNode *node;
+
+ /* first clear tag */
+ for(node= ntree->nodes.first; node; node= node->next) {
+ node->done= 0;
+ }
+
+ /* recursive check */
+ for(node= ntree->nodes.first; node; node= node->next) {
+ if(node->done==0) {
+ node->level= node_get_deplist_recurs(node, NULL);
+ }
+ }
+}
+
static void ntree_update_link_pointers(bNodeTree *ntree)
{
bNode *node;
@@ -1524,39 +1542,33 @@ void ntreeUpdateTree(bNodeTree *ntree)
{
bNodeTreeType *ntreetype= ntreeGetType(ntree->type);
bNode *node;
- bNode **deplist;
- int totnodes, n;
- ntree_update_link_pointers(ntree);
+ /* set the bNodeSocket->link pointers */
+ if (ntree->update & NTREE_UPDATE_LINKS)
+ ntree_update_link_pointers(ntree);
- /* also updates the node level! */
- ntreeGetDependencyList(ntree, &deplist, &totnodes);
+ /* update the node level from link dependencies */
+ if (ntree->update & (NTREE_UPDATE_LINKS|NTREE_UPDATE_NODES))
+ ntree_update_node_level(ntree);
- if (deplist) {
- /* update individual nodes */
- for (n=0; n < totnodes; ++n) {
- node = deplist[n];
-
- /* node tree update tags override individual node update flags */
- if ((node->update & NODE_UPDATE) || (ntree->update & NTREE_UPDATE)) {
- if (ntreetype->update_node)
- ntreetype->update_node(ntree, node);
- else if (node->typeinfo->updatefunc)
- node->typeinfo->updatefunc(ntree, node);
- }
- /* clear update flag */
- node->update = 0;
+ /* update individual nodes */
+ for (node=ntree->nodes.first; node; node=node->next) {
+ /* node tree update tags override individual node update flags */
+ if ((node->update & NODE_UPDATE) || (ntree->update & NTREE_UPDATE)) {
+ if (ntreetype->update_node)
+ ntreetype->update_node(ntree, node);
+ else if (node->typeinfo->updatefunc)
+ node->typeinfo->updatefunc(ntree, node);
}
-
- MEM_freeN(deplist);
+ /* clear update flag */
+ node->update = 0;
}
- /* general tree updates */
- if (ntree->update & (NTREE_UPDATE_LINKS|NTREE_UPDATE_NODES)) {
+ /* check link validity */
+ if (ntree->update & (NTREE_UPDATE_LINKS|NTREE_UPDATE_NODES))
ntree_validate_links(ntree);
- }
- /* update tree */
+ /* generic tree update callback */
if (ntreetype->update)
ntreetype->update(ntree);
else {
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 3e55e58a71d..50674a7f6c0 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1960,9 +1960,9 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime)
}
/* get object transformation matrix without recalculating dependencies and
- constraints -- assume dependencies are already solved by depsgraph.
- no changes to object and it's parent would be done.
- used for bundles orientation in 3d space relative to parented blender camera */
+ * constraints -- assume dependencies are already solved by depsgraph.
+ * no changes to object and it's parent would be done.
+ * used for bundles orientation in 3d space relative to parented blender camera */
void where_is_object_mat(Scene *scene, Object *ob, float obmat[4][4])
{
float slowmat[4][4] = MAT4_UNITY;
@@ -2068,7 +2068,7 @@ void where_is_object(struct Scene *scene, Object *ob)
void where_is_object_simul(Scene *scene, Object *ob)
/* was written for the old game engine (until 2.04) */
/* It seems that this function is only called
-for a lamp that is the child of another object */
+ * for a lamp that is the child of another object */
{
Object *par;
float *fp1, *fp2;
@@ -2482,16 +2482,16 @@ void object_handle_update(Scene *scene, Object *ob)
if (ob->recalc & OB_RECALC_DATA) {
if (ob->type==OB_ARMATURE) {
/* this happens for reading old files and to match library armatures
- with poses we do it ahead of where_is_object to ensure animation
- is evaluated on the rebuilt pose, otherwise we get incorrect poses
- on file load */
+ * with poses we do it ahead of where_is_object to ensure animation
+ * is evaluated on the rebuilt pose, otherwise we get incorrect poses
+ * on file load */
if (ob->pose==NULL || (ob->pose->flag & POSE_RECALC))
armature_rebuild_pose(ob, ob->data);
}
}
/* XXX new animsys warning: depsgraph tag OB_RECALC_DATA should not skip drivers,
- which is only in where_is_object now */
+ * which is only in where_is_object now */
// XXX: should this case be OB_RECALC_OB instead?
if (ob->recalc & OB_RECALC_ALL) {
@@ -2668,8 +2668,8 @@ void object_sculpt_modifiers_changed(Object *ob)
if (!ss->cache) {
/* we free pbvh on changes, except during sculpt since it can't deal with
- changing PVBH node organization, we hope topology does not change in
- the meantime .. weak */
+ * changing PVBH node organization, we hope topology does not change in
+ * the meantime .. weak */
if (ss->pbvh) {
BLI_pbvh_free(ss->pbvh);
ss->pbvh= NULL;
diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c
index 65db275b61f..87929d6a185 100644
--- a/source/blender/blenkernel/intern/ocean.c
+++ b/source/blender/blenkernel/intern/ocean.c
@@ -435,8 +435,7 @@ void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u
ocr->disp[0] = INTERP(oc->_disp_x);
ocr->disp[2] = INTERP(oc->_disp_z);
}
- else
- {
+ else {
ocr->disp[0] = 0.0;
ocr->disp[2] = 0.0;
}
@@ -479,8 +478,7 @@ void BKE_ocean_eval_ij(struct Ocean *oc, struct OceanResult *ocr, int i,int j)
ocr->disp[0] = oc->_disp_x[i*oc->_N+j];
ocr->disp[2] = oc->_disp_z[i*oc->_N+j];
}
- else
- {
+ else {
ocr->disp[0] = 0.0f;
ocr->disp[2] = 0.0f;
}
@@ -726,14 +724,14 @@ void BKE_simulate_ocean(struct Ocean *o, float t, float scale, float chop_amount
}
fftw_execute(o->_N_z_plan);
- /*for ( i = 0 ; i < o->_M ; ++i)
- {
- for ( j = 0 ; j < o->_N ; ++j)
- {
- o->_N_y[i*o->_N+j] = 1.0f/scale;
- }
- }
- (MEM01)*/
+#if 0
+ for ( i = 0 ; i < o->_M ; ++i) {
+ for ( j = 0 ; j < o->_N ; ++j) {
+ o->_N_y[i*o->_N+j] = 1.0f/scale;
+ }
+ }
+ (MEM01)
+#endif
o->_N_y = 1.0f/scale;
}
} // section 8
@@ -1260,12 +1258,12 @@ void BKE_bake_ocean(struct Ocean *o, struct OceanCache *och, void (*update_cb)(v
// break up the foam where height (Y) is low (wave valley),
// and X and Z displacement is greatest
- /*
+#if 0
vec[0] = ocr.disp[0];
vec[1] = ocr.disp[2];
hor_stretch = len_v2(vec);
CLAMP(hor_stretch, 0.0, 1.0);
- */
+#endif
neg_disp = ocr.disp[1] < 0.0f ? 1.0f+ocr.disp[1] : 1.0f;
neg_disp = neg_disp < 0.0f ? 0.0f : neg_disp;
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index 2decc40da81..aaf15d683d8 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -321,16 +321,14 @@ int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, i
return (ret_value);
}
-/*
-
-This function compares a packed file to a 'real' file.
-It returns an integer indicating if:
-
-PF_EQUAL - the packed file and original file are identical
-PF_DIFFERENT - the packed file and original file differ
-PF_NOFILE - the original file doens't exist
-
-*/
+/*
+ * This function compares a packed file to a 'real' file.
+ * It returns an integer indicating if:
+ *
+ * PF_EQUAL - the packed file and original file are identical
+ * PF_DIFFERENT - the packed file and original file differ
+ * PF_NOFILE - the original file doens't exist
+ */
int checkPackedFile(const char *filename, PackedFile *pf)
{
@@ -380,14 +378,11 @@ int checkPackedFile(const char *filename, PackedFile *pf)
return(ret_val);
}
-/*
-
- unpackFile() looks at the existing files (abs_name, local_name) and a packed file.
-
-It returns a char *to the existing file name / new file name or NULL when
-there was an error or when the user desides to cancel the operation.
-
-*/
+/* unpackFile() looks at the existing files (abs_name, local_name) and a packed file.
+ *
+ * It returns a char *to the existing file name / new file name or NULL when
+ * there was an error or when the user desides to cancel the operation.
+ */
char *unpackFile(ReportList *reports, const char *abs_name, const char *local_name, PackedFile *pf, int how)
{
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 33e2c2376a3..590c307f549 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -543,11 +543,9 @@ void psys_free(Object *ob, ParticleSystem * psys)
}
// check if we are last non-visible particle system
- for(tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next) {
- if(tpsys->part)
- {
- if(ELEM(tpsys->part->ren_as,PART_DRAW_OB,PART_DRAW_GR))
- {
+ for (tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next) {
+ if (tpsys->part) {
+ if (ELEM(tpsys->part->ren_as,PART_DRAW_OB,PART_DRAW_GR)) {
nr++;
break;
}
@@ -2372,7 +2370,7 @@ void psys_find_parents(ParticleSimulationData *sim)
BLI_kdtree_free(tree);
}
-static void get_strand_normal(Material *ma, float *surfnor, float surfdist, float *nor)
+static void get_strand_normal(Material *ma, const float surfnor[3], float surfdist, float nor[3])
{
float cross[3], nstrand[3], vnor[3], blend;
@@ -2383,7 +2381,7 @@ static void get_strand_normal(Material *ma, float *surfnor, float surfdist, floa
cross_v3_v3v3(cross, surfnor, nor);
cross_v3_v3v3(nstrand, nor, cross);
- blend= INPR(nstrand, surfnor);
+ blend = dot_v3v3(nstrand, surfnor);
CLAMP(blend, 0.0f, 1.0f);
interp_v3_v3v3(vnor, nstrand, surfnor, blend);
@@ -2859,8 +2857,8 @@ static void cache_key_incremental_rotation(ParticleCacheKey *key0, ParticleCache
cosangle= dot_v3v3(tangent, prev_tangent);
/* note we do the comparison on cosangle instead of
- * angle, since floating point accuracy makes it give
- * different results across platforms */
+ * angle, since floating point accuracy makes it give
+ * different results across platforms */
if(cosangle > 0.999999f) {
copy_v4_v4(key1->rot, key2->rot);
}
@@ -3487,16 +3485,14 @@ void object_remove_particle_system(Scene *scene, Object *ob)
return;
/* clear all other appearances of this pointer (like on smoke flow modifier) */
- if((md = modifiers_findByType(ob, eModifierType_Smoke)))
- {
+ if ((md = modifiers_findByType(ob, eModifierType_Smoke))) {
SmokeModifierData *smd = (SmokeModifierData *)md;
if((smd->type == MOD_SMOKE_TYPE_FLOW) && smd->flow && smd->flow->psys)
if(smd->flow->psys == psys)
smd->flow->psys = NULL;
}
- if((md = modifiers_findByType(ob, eModifierType_DynamicPaint)))
- {
+ if ((md = modifiers_findByType(ob, eModifierType_DynamicPaint))) {
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
if(pmd->brush && pmd->brush->psys)
if(pmd->brush->psys == psys)
@@ -4426,7 +4422,7 @@ void psys_get_dupli_texture(ParticleSystem *psys, ParticleSettings *part, Partic
if (num >= psmd->dm->getNumTessFaces(psmd->dm)) {
/* happens when simplify is enabled
- * gives invalid coords but would crash otherwise */
+ * gives invalid coords but would crash otherwise */
num= DMCACHE_NOTFOUND;
}
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index e4800ac25a3..8d50d3d69cf 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -332,11 +332,11 @@ static void alloc_child_particles(ParticleSystem *psys, int tot)
void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys)
{
/* use for building derived mesh mapping info:
-
- node: the allocated links - total derived mesh element count
- nodearray: the array of nodes aligned with the base mesh's elements, so
- each original elements can reference its derived elements
- */
+ *
+ * node: the allocated links - total derived mesh element count
+ * nodearray: the array of nodes aligned with the base mesh's elements, so
+ * each original elements can reference its derived elements
+ */
Mesh *me= (Mesh*)ob->data;
PARTICLE_P;
@@ -398,7 +398,7 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys)
else {
/* TODO PARTICLE, make the following line unnecessary, each function
* should know to use the num or num_dmcache, set the num_dmcache to
- * an invalid value, just incase */
+ * an invalid value, just in case */
LOOP_PARTICLES
pa->num_dmcache = -1;
@@ -1277,7 +1277,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
MEM_freeN(element_sum);
- /* For hair, sort by origindex (allows optimizations in rendering), */
+ /* For hair, sort by origindex (allows optimization's in rendering), */
/* however with virtual parents the children need to be in random order. */
if(part->type == PART_HAIR && !(part->childtype==PART_CHILD_FACES && part->parents!=0.0f)) {
COMPARE_ORIG_INDEX = NULL;
@@ -2213,19 +2213,19 @@ static void integrate_particle(ParticleSettings *part, ParticleData *pa, float d
}
/*********************************************************************************************************
- SPH fluid physics
-
- In theory, there could be unlimited implementation of SPH simulators
-
- This code uses in some parts adapted algorithms from the pseudo code as outlined in the Research paper:
-
- Titled: Particle-based Viscoelastic Fluid Simulation.
- Authors: Simon Clavet, Philippe Beaudoin and Pierre Poulin
- Website: http://www.iro.umontreal.ca/labs/infographie/papers/Clavet-2005-PVFS/
-
- Presented at Siggraph, (2005)
-
-***********************************************************************************************************/
+ * SPH fluid physics
+ *
+ * In theory, there could be unlimited implementation of SPH simulators
+ *
+ * This code uses in some parts adapted algorithms from the pseudo code as outlined in the Research paper:
+ *
+ * Titled: Particle-based Viscoelastic Fluid Simulation.
+ * Authors: Simon Clavet, Philippe Beaudoin and Pierre Poulin
+ * Website: http://www.iro.umontreal.ca/labs/infographie/papers/Clavet-2005-PVFS/
+ *
+ * Presented at Siggraph, (2005)
+ *
+ * ********************************************************************************************************/
#define PSYS_FLUID_SPRINGS_INITIAL_SIZE 256
static ParticleSpring *sph_spring_add(ParticleSystem *psys, ParticleSpring *spring)
{
@@ -2343,8 +2343,8 @@ typedef struct SPHData {
float mass;
EdgeHash *eh;
float *gravity;
- /* Average distance to neighbours (other particles in the support domain),
- for calculating the Courant number (adaptive time step). */
+ /* Average distance to neighbors (other particles in the support domain),
+ * for calculating the Courant number (adaptive time step). */
int pass;
float element_size;
float flow[3];
@@ -2411,7 +2411,7 @@ static void sph_particle_courant(SPHData *sphdata, SPHRangeData *pfr)
mul_v3_v3fl(sphdata->flow, flow, 1.0f / pfr->tot_neighbors);
} else {
sphdata->element_size = MAXFLOAT;
- VECCOPY(sphdata->flow, flow);
+ copy_v3_v3(sphdata->flow, flow);
}
}
static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, float *UNUSED(impulse))
@@ -3234,9 +3234,9 @@ static int collision_response(ParticleData *pa, ParticleCollision *col, BVHTreeR
sub_v3_v3v3(v1_tan, v0_tan, vc_tan);
/* The resulting velocity is a weighted average of particle cm & surface
- * velocity. This weight (related to particle's moment of inertia) could
- * be made a parameter for angular <-> linear conversion.
- */
+ * velocity. This weight (related to particle's moment of inertia) could
+ * be made a parameter for angular <-> linear conversion.
+ */
madd_v3_v3fl(v1_tan, vr_tan, -0.4);
mul_v3_fl(v1_tan, 1.0f/1.4f); /* 1/(1+0.4) */
@@ -3699,17 +3699,17 @@ static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra))
}
/* Code for an adaptive time step based on the Courant-Friedrichs-Lewy
- condition. */
+ * condition. */
#define MIN_TIMESTEP 1.0f / 101.0f
-/* Tolerance of 1.5 means the last subframe neither favours growing nor
- shrinking (e.g if it were 1.3, the last subframe would tend to be too
- small). */
+/* Tolerance of 1.5 means the last subframe neither favors growing nor
+ * shrinking (e.g if it were 1.3, the last subframe would tend to be too
+ * small). */
#define TIMESTEP_EXPANSION_TOLERANCE 1.5f
/* Calculate the speed of the particle relative to the local scale of the
- simulation. This should be called once per particle during a simulation
- step, after the velocity has been updated. element_size defines the scale of
- the simulation, and is typically the distance to neighbourning particles. */
+ * simulation. This should be called once per particle during a simulation
+ * step, after the velocity has been updated. element_size defines the scale of
+ * the simulation, and is typically the distance to neighbourning particles. */
void update_courant_num(ParticleSimulationData *sim, ParticleData *pa,
float dtime, SPHData *sphdata)
{
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 705f198865a..fab3f096d3e 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1026,11 +1026,11 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup
/* File handling */
-/* Takes an Object ID and returns a unique name
- - id: object id
- - cfra: frame for the cache, can be negative
- - stack_index: index in the modifier stack. we can have cache for more then one stack_index
-*/
+/* Takes an Object ID and returns a unique name
+ * - id: object id
+ * - cfra: frame for the cache, can be negative
+ * - stack_index: index in the modifier stack. we can have cache for more then one stack_index
+ */
#define MAX_PTCACHE_PATH FILE_MAX
#define MAX_PTCACHE_FILE ((FILE_MAX)*2)
@@ -2107,8 +2107,8 @@ int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra)
}
/* youll need to close yourself after!
* mode - PTCACHE_CLEAR_ALL,
+ */
-*/
/* Clears & resets */
void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
{
@@ -2687,7 +2687,7 @@ void BKE_ptcache_quick_cache_all(Main *bmain, Scene *scene)
}
/* Simulation thread, no need for interlocks as data written in both threads
- are only unitary integers (I/O assumed to be atomic for them) */
+ * are only unitary integers (I/O assumed to be atomic for them) */
typedef struct {
int break_operation;
int thread_ended;
diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c
index 5668907b094..baf682b4cb6 100644
--- a/source/blender/blenkernel/intern/property.c
+++ b/source/blender/blenkernel/intern/property.c
@@ -79,7 +79,7 @@ bProperty *copy_property(bProperty *prop)
void copy_properties(ListBase *lbn, ListBase *lbo)
{
bProperty *prop, *propn;
- free_properties( lbn ); /* incase we are copying to an object with props */
+ free_properties( lbn ); /* in case we are copying to an object with props */
prop= lbo->first;
while(prop) {
propn= copy_property(prop);
diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c
index 92dfe90eec1..30a7449be1b 100644
--- a/source/blender/blenkernel/intern/sca.c
+++ b/source/blender/blenkernel/intern/sca.c
@@ -395,6 +395,7 @@ void init_actuator(bActuator *act)
bRandomActuator *ra;
bSoundActuator *sa;
bSteeringActuator *sta;
+ bArmatureActuator *arma;
if(act->data) MEM_freeN(act->data);
act->data= NULL;
@@ -468,6 +469,8 @@ void init_actuator(bActuator *act)
break;
case ACT_ARMATURE:
act->data = MEM_callocN(sizeof( bArmatureActuator ), "armature act");
+ arma = act->data;
+ arma->influence = 1.f;
break;
case ACT_STEERING:
act->data = MEM_callocN(sizeof( bSteeringActuator), "steering act");
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 59394d1088d..d74ae9f8e83 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -253,7 +253,7 @@ void free_scene(Scene *sce)
if (sce->gpd) {
#if 0 // removed since this can be invalid memory when freeing everything
- // since the grease pencil data is free'd before the scene.
+ // since the grease pencil data is freed before the scene.
// since grease pencil data is not (yet?), shared between objects
// its probably safe not to do this, some save and reload will free this.
sce->gpd->id.us--;
@@ -726,8 +726,8 @@ int next_object(Scene **scene, int val, Base **base, Object **ob)
if (fase!=F_DUPLI) {
if ( (*base)->object->transflag & OB_DUPLI) {
/* groups cannot be duplicated for mballs yet,
- this enters eternal loop because of
- makeDispListMBall getting called inside of group_duplilist */
+ * this enters eternal loop because of
+ * makeDispListMBall getting called inside of group_duplilist */
if ((*base)->object->dup_group == NULL) {
duplilist= object_duplilist((*scene), (*base)->object);
@@ -764,10 +764,12 @@ int next_object(Scene **scene, int val, Base **base, Object **ob)
}
}
}
-
- /* if (ob && *ob) {
+
+#if 0
+ if (ob && *ob) {
printf("Scene: '%s', '%s'\n", (*scene)->id.name+2, (*ob)->id.name+2);
- } */
+ }
+#endif
/* reset recursion test */
in_next_object= 0;
@@ -843,7 +845,7 @@ char *scene_find_marker_name(Scene *scene, int frame)
}
/* return the current marker for this frame,
-we can have more then 1 marker per frame, this just returns the first :/ */
+ * we can have more then 1 marker per frame, this just returns the first :/ */
char *scene_find_last_marker_name(Scene *scene, int frame)
{
TimeMarker *marker, *best_marker = NULL;
@@ -980,7 +982,7 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen
scene->customdata_mask= scene_parent->customdata_mask;
/* sets first, we allow per definition current scene to have
- dependencies on sets, but not the other way around. */
+ * dependencies on sets, but not the other way around. */
if (scene->set)
scene_update_tagged_recursive(bmain, scene->set, scene_parent);
@@ -1016,10 +1018,10 @@ void scene_update_tagged(Main *bmain, Scene *scene)
scene->physics_settings.quick_cache_step= 0;
/* update all objects: drivers, matrices, displists, etc. flags set
- by depgraph or manual, no layer check here, gets correct flushed
-
- in the future this should handle updates for all datablocks, not
- only objects and scenes. - brecht */
+ * by depgraph or manual, no layer check here, gets correct flushed
+ *
+ * in the future this should handle updates for all datablocks, not
+ * only objects and scenes. - brecht */
scene_update_tagged_recursive(bmain, scene, scene);
/* extra call here to recalc scene animation (for sequencer) */
@@ -1064,8 +1066,8 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
}
/* flush recalc flags to dependencies, if we were only changing a frame
- this would not be necessary, but if a user or a script has modified
- some datablock before scene_update_tagged was called, we need the flush */
+ * this would not be necessary, but if a user or a script has modified
+ * some datablock before scene_update_tagged was called, we need the flush */
DAG_ids_flush_tagged(bmain);
/* Following 2 functions are recursive
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 3d28e45f6b7..fe4316bf8d6 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -201,7 +201,7 @@ ARegion *BKE_area_region_copy(SpaceType *st, ARegion *ar)
}
-/* from lb2 to lb1, lb1 is supposed to be free'd */
+/* from lb2 to lb1, lb1 is supposed to be freed */
static void region_copylist(SpaceType *st, ListBase *lb1, ListBase *lb2)
{
ARegion *ar;
diff --git a/source/blender/blenkernel/intern/script.c b/source/blender/blenkernel/intern/script.c
index 5fadebc80f8..2d1577a86c1 100644
--- a/source/blender/blenkernel/intern/script.c
+++ b/source/blender/blenkernel/intern/script.c
@@ -33,12 +33,11 @@
#include "MEM_guardedalloc.h"
-/*
-
+#if 0
#ifdef WITH_PYTHON
#include "BPY_extern.h" // Blender Python library
#endif
-*/
+#endif
/* XXX this function and so also the file should not be needed anymore,
* since we have to force clearing all Python related data before freeing
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index aebdf3cef65..b24b885c001 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -119,8 +119,8 @@ static struct ImBuf * prepare_effect_imbufs(
}
/* **********************************************************************
- PLUGINS
- ********************************************************************** */
+ * PLUGINS
+ * ********************************************************************** */
static void open_plugin_seq(PluginSeq *pis, const char *seqname)
{
@@ -288,8 +288,8 @@ static struct ImBuf * do_plugin_effect(
char *cp;
int float_rendering;
int use_temp_bufs = 0; /* Are needed since blur.c (and maybe some other
- old plugins) do very bad stuff
- with imbuf-internals */
+ * old plugins) do very bad stuff
+ * with imbuf-internals */
struct ImBuf * out = prepare_effect_imbufs(context,ibuf1, ibuf2, ibuf3);
int x = context.rectx;
@@ -394,8 +394,8 @@ static void free_plugin(struct Sequence * seq)
}
/* **********************************************************************
- ALPHA OVER
- ********************************************************************** */
+ * ALPHA OVER
+ * ********************************************************************** */
static void init_alpha_over_or_under(Sequence * seq)
{
@@ -558,8 +558,8 @@ static struct ImBuf * do_alphaover_effect(
/* **********************************************************************
- ALPHA UNDER
- ********************************************************************** */
+ * ALPHA UNDER
+ * ********************************************************************** */
static void do_alphaunder_effect_byte(
float facf0, float facf1, int x, int y, char *rect1,
@@ -730,8 +730,8 @@ static struct ImBuf* do_alphaunder_effect(
/* **********************************************************************
- CROSS
- ********************************************************************** */
+ * CROSS
+ * ********************************************************************** */
static void do_cross_effect_byte(float facf0, float facf1, int x, int y,
char *rect1, char *rect2,
@@ -855,8 +855,8 @@ static struct ImBuf* do_cross_effect(
/* **********************************************************************
- GAMMA CROSS
- ********************************************************************** */
+ * GAMMA CROSS
+ * ********************************************************************** */
/* copied code from initrender.c */
static unsigned short gamtab[65536];
@@ -1124,8 +1124,8 @@ static struct ImBuf * do_gammacross_effect(
/* **********************************************************************
- ADD
- ********************************************************************** */
+ * ADD
+ * ********************************************************************** */
static void do_add_effect_byte(float facf0, float facf1, int x, int y,
unsigned char *rect1, unsigned char *rect2,
@@ -1240,8 +1240,8 @@ static struct ImBuf * do_add_effect(SeqRenderData context,
/* **********************************************************************
- SUB
- ********************************************************************** */
+ * SUB
+ * ********************************************************************** */
static void do_sub_effect_byte(float facf0, float facf1,
int x, int y,
@@ -1355,8 +1355,8 @@ static struct ImBuf * do_sub_effect(
}
/* **********************************************************************
- DROP
- ********************************************************************** */
+ * DROP
+ * ********************************************************************** */
/* Must be > 0 or add precopy, etc to the function */
#define XOFF 8
@@ -1444,8 +1444,8 @@ static void do_drop_effect_float(float facf0, float facf1, int x, int y,
}
/* **********************************************************************
- MUL
- ********************************************************************** */
+ * MUL
+ * ********************************************************************** */
static void do_mul_effect_byte(float facf0, float facf1, int x, int y,
unsigned char *rect1, unsigned char *rect2,
@@ -1464,7 +1464,7 @@ static void do_mul_effect_byte(float facf0, float facf1, int x, int y,
/* formula:
* fac*(a*b) + (1-fac)*a => fac*a*(b-1)+axaux= c*px + py*s ;//+centx
- yaux= -s*px + c*py;//+centy
+ * yaux= -s*px + c*py;//+centy
*/
while(y--) {
@@ -1569,8 +1569,8 @@ static struct ImBuf * do_mul_effect(
}
/* **********************************************************************
- WIPE
- ********************************************************************** */
+ * WIPE
+ * ********************************************************************** */
typedef struct WipeZone {
float angle;
@@ -1616,9 +1616,8 @@ static float check_zone(WipeZone *wipezone, int x, int y,
Sequence *seq, float facf0)
{
float posx, posy,hyp,hyp2,angle,hwidth,b1,b2,b3,pointdist;
-/*some future stuff
-float hyp3,hyp4,b4,b5
-*/
+ /* some future stuff */
+ // float hyp3,hyp4,b4,b5
float temp1,temp2,temp3,temp4; //some placeholder variables
int xo = wipezone->xo;
int yo = wipezone->yo;
@@ -1714,12 +1713,12 @@ float hyp3,hyp4,b4,b5
if(!wipe->forward)output = 1-output;
break;
case DO_CLOCK_WIPE:
- /*
- temp1: angle of effect center in rads
- temp2: angle of line through (halfx,halfy) and (x,y) in rads
- temp3: angle of low side of blur
- temp4: angle of high side of blur
- */
+ /*
+ * temp1: angle of effect center in rads
+ * temp2: angle of line through (halfx,halfy) and (x,y) in rads
+ * temp3: angle of low side of blur
+ * temp4: angle of high side of blur
+ */
output = 1.0f - facf0;
widthf = wipe->edgeWidth*2.0f*(float)M_PI;
temp1 = 2.0f * (float)M_PI * facf0;
@@ -2002,8 +2001,8 @@ static struct ImBuf * do_wipe_effect(
return out;
}
/* **********************************************************************
- TRANSFORM
- ********************************************************************** */
+ * TRANSFORM
+ * ********************************************************************** */
static void init_transform_effect(Sequence *seq)
{
TransformVars *transform;
@@ -2140,8 +2139,8 @@ static struct ImBuf * do_transform_effect(
/* **********************************************************************
- GLOW
- ********************************************************************** */
+ * GLOW
+ * ********************************************************************** */
static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
float blur,
@@ -2667,8 +2666,8 @@ static struct ImBuf * do_glow_effect(
}
/* **********************************************************************
- SOLID COLOR
- ********************************************************************** */
+ * SOLID COLOR
+ * ********************************************************************** */
static void init_solid_color(Sequence *seq)
{
@@ -2786,8 +2785,8 @@ static struct ImBuf * do_solid_color(
}
/* **********************************************************************
- MULTICAM
- ********************************************************************** */
+ * MULTICAM
+ * ********************************************************************** */
/* no effect inputs for multicam, we use give_ibuf_seq */
static int num_inputs_multicam(void)
@@ -2840,8 +2839,8 @@ static struct ImBuf * do_multicam(
}
/* **********************************************************************
- ADJUSTMENT
- ********************************************************************** */
+ * ADJUSTMENT
+ * ********************************************************************** */
/* no effect inputs for adjustment, we use give_ibuf_seq */
static int num_inputs_adjustment(void)
@@ -2871,10 +2870,10 @@ static struct ImBuf * do_adjustment_impl(SeqRenderData context, Sequence * seq,
}
/* found nothing? so let's work the way up the metastrip stack, so
- that it is possible to group a bunch of adjustment strips into
- a metastrip and have that work on everything below the metastrip
- */
-
+ * that it is possible to group a bunch of adjustment strips into
+ * a metastrip and have that work on everything below the metastrip
+ */
+
if (!i) {
Sequence * meta;
@@ -2917,8 +2916,8 @@ static struct ImBuf * do_adjustment(
}
/* **********************************************************************
- SPEED
- ********************************************************************** */
+ * SPEED
+ * ********************************************************************** */
static void init_speed_effect(Sequence *seq)
{
SpeedControlVars * v;
@@ -3010,8 +3009,7 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
}
if ( (seq->seq1 == NULL) ||
(seq->len < 1)
- ) { /* make coverity happy and check for (CID 598)
- input strip ... */
+ ) { /* make coverity happy and check for (CID 598) input strip ... */
return;
}
@@ -3098,8 +3096,8 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
}
/* **********************************************************************
- sequence effect factory
- ********************************************************************** */
+ * sequence effect factory
+ * ********************************************************************** */
static void init_noop(struct Sequence *UNUSED(seq))
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 92199eadf5b..8f8874d3a3c 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -124,8 +124,8 @@ int seq_recursive_apply(Sequence *seq, int (*apply_func)(Sequence *, void *), vo
}
/* **********************************************************************
- alloc / free functions
- ********************************************************************** */
+ * alloc / free functions
+ * ********************************************************************** */
@@ -281,8 +281,8 @@ void seq_free_editing(Scene *scene)
}
/* **********************************************************************
- * sequencer pipeline functions
- ********************************************************************** */
+ * sequencer pipeline functions
+ * ********************************************************************** */
SeqRenderData seq_new_render_data(
struct Main * bmain, struct Scene * scene,
@@ -456,13 +456,13 @@ void seq_end(SeqIterator *iter)
}
/*
- **********************************************************************
- * build_seqar
- **********************************************************************
- * Build a complete array of _all_ sequencies (including those
- * in metastrips!)
- **********************************************************************
-*/
+ * **********************************************************************
+ * build_seqar
+ * *********************************************************************
+ * Build a complete array of _all_ sequencies (including those
+ * in metastrips!)
+ * *********************************************************************
+ */
static void do_seq_count_cb(ListBase *seqbase, int *totseq,
int (*test_func)(Sequence * seq))
@@ -1048,11 +1048,11 @@ StripElem *give_stripelem(Sequence *seq, int cfra)
{
StripElem *se= seq->strip->stripdata;
- if(seq->type == SEQ_IMAGE) { /* only
- IMAGE strips use the whole array,
- MOVIE strips use only
- the first element, all other strips
- don't use this... */
+ if(seq->type == SEQ_IMAGE) { /* only
+ * IMAGE strips use the whole array,
+ * MOVIE strips use only
+ * the first element, all other strips
+ * don't use this... */
int nr = (int) give_stripelem_index(seq, cfra);
if (nr == -1 || se == NULL) return NULL;
@@ -1137,8 +1137,8 @@ static int get_shown_sequences( ListBase * seqbasep, int cfra, int chanshown, Se
/* **********************************************************************
- proxy management
- ********************************************************************** */
+ * proxy management
+ * ********************************************************************** */
typedef struct SeqIndexBuildContext {
struct IndexBuildContext *index_context;
@@ -1214,12 +1214,12 @@ static int seq_proxy_get_fname(Sequence * seq, int cfra, int render_size, char *
}
/* MOVIE tracks (only exception: custom files) are now handled
- internally by ImBuf module for various reasons: proper time code
- support, quicker index build, using one file instead
- of a full directory of jpeg files, etc. Trying to support old
- and new method at once could lead to funny effects, if people
- have both, a directory full of jpeg files and proxy avis, so
- sorry folks, please rebuild your proxies... */
+ * internally by ImBuf module for various reasons: proper time code
+ * support, quicker index build, using one file instead
+ * of a full directory of jpeg files, etc. Trying to support old
+ * and new method at once could lead to funny effects, if people
+ * have both, a directory full of jpeg files and proxy avis, so
+ * sorry folks, please rebuild your proxies... */
if (seq->flag & (SEQ_USE_PROXY_CUSTOM_DIR|SEQ_USE_PROXY_CUSTOM_FILE)) {
BLI_strncpy(dir, seq->strip->proxy->dir, sizeof(dir));
@@ -1339,7 +1339,7 @@ static void seq_proxy_build_frame(SeqRenderData context,
}
/* depth = 32 is intentionally left in, otherwise ALPHA channels
- won't work... */
+ * won't work... */
quality = seq->strip->proxy->quality;
ibuf->ftype= JPG | quality;
@@ -1465,8 +1465,8 @@ void seq_proxy_rebuild_finish(SeqIndexBuildContext *context, short stop)
}
/* **********************************************************************
- color balance
- ********************************************************************** */
+ * color balance
+ * ********************************************************************** */
static StripColorBalance calc_cb(StripColorBalance * cb_)
{
@@ -1628,23 +1628,22 @@ static void color_balance(Sequence * seq, ImBuf* ibuf, float mul)
}
/*
- input preprocessing for SEQ_IMAGE, SEQ_MOVIE and SEQ_SCENE
-
- Do all the things you can't really do afterwards using sequence effects
- (read: before rescaling to render resolution has been done)
-
- Order is important!
-
- - Deinterlace
- - Crop and transform in image source coordinate space
- - Flip X + Flip Y (could be done afterwards, backward compatibility)
- - Promote image to float data (affects pipeline operations afterwards)
- - Color balance (is most efficient in the byte -> float
- (future: half -> float should also work fine!)
- case, if done on load, since we can use lookup tables)
- - Premultiply
-
-*/
+ * input preprocessing for SEQ_IMAGE, SEQ_MOVIE and SEQ_SCENE
+ *
+ * Do all the things you can't really do afterwards using sequence effects
+ * (read: before rescaling to render resolution has been done)
+ *
+ * Order is important!
+ *
+ * - Deinterlace
+ * - Crop and transform in image source coordinate space
+ * - Flip X + Flip Y (could be done afterwards, backward compatibility)
+ * - Promote image to float data (affects pipeline operations afterwards)
+ * - Color balance (is most efficient in the byte -> float
+ * (future: half -> float should also work fine!)
+ * case, if done on load, since we can use lookup tables)
+ * - Premultiply
+ */
int input_have_to_preprocess(
SeqRenderData UNUSED(context), Sequence * seq, float UNUSED(cfra))
@@ -1824,8 +1823,8 @@ static void copy_to_ibuf_still(SeqRenderData context, Sequence * seq, float nr,
{
if (nr == 0 || nr == seq->len - 1) {
/* we have to store a copy, since the passed ibuf
- could be preprocessed afterwards (thereby silently
- changing the cached image... */
+ * could be preprocessed afterwards (thereby silently
+ * changing the cached image... */
ibuf = IMB_dupImBuf(ibuf);
if (nr == 0) {
@@ -1845,8 +1844,8 @@ static void copy_to_ibuf_still(SeqRenderData context, Sequence * seq, float nr,
}
/* **********************************************************************
- strip rendering functions
- ********************************************************************** */
+ * strip rendering functions
+ * ********************************************************************** */
static ImBuf* seq_render_strip_stack(
SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown);
@@ -1964,35 +1963,35 @@ static ImBuf * seq_render_scene_strip_impl(
ListBase oldmarkers;
/* Old info:
- Hack! This function can be called from do_render_seq(), in that case
- the seq->scene can already have a Render initialized with same name,
- so we have to use a default name. (compositor uses scene name to
- find render).
- However, when called from within the UI (image preview in sequencer)
- we do want to use scene Render, that way the render result is defined
- for display in render/imagewindow
-
- Hmm, don't see, why we can't do that all the time,
- and since G.rendering is uhm, gone... (Peter)
- */
+ * Hack! This function can be called from do_render_seq(), in that case
+ * the seq->scene can already have a Render initialized with same name,
+ * so we have to use a default name. (compositor uses scene name to
+ * find render).
+ * However, when called from within the UI (image preview in sequencer)
+ * we do want to use scene Render, that way the render result is defined
+ * for display in render/imagewindow
+ *
+ * Hmm, don't see, why we can't do that all the time,
+ * and since G.rendering is uhm, gone... (Peter)
+ */
/* New info:
- Using the same name for the renders works just fine as the do_render_seq()
- render is not used while the scene strips are rendered.
-
- However rendering from UI (through sequencer_preview_area_draw) can crash in
- very many cases since other renders (material preview, an actual render etc.)
- can be started while this sequence preview render is running. The only proper
- solution is to make the sequencer preview render a proper job, which can be
- stopped when needed. This would also give a nice progress bar for the preview
- space so that users know there's something happening.
-
- As a result the active scene now only uses OpenGL rendering for the sequencer
- preview. This is far from nice, but is the only way to prevent crashes at this
- time.
-
- -jahka
- */
+ * Using the same name for the renders works just fine as the do_render_seq()
+ * render is not used while the scene strips are rendered.
+ *
+ * However rendering from UI (through sequencer_preview_area_draw) can crash in
+ * very many cases since other renders (material preview, an actual render etc.)
+ * can be started while this sequence preview render is running. The only proper
+ * solution is to make the sequencer preview render a proper job, which can be
+ * stopped when needed. This would also give a nice progress bar for the preview
+ * space so that users know there's something happening.
+ *
+ * As a result the active scene now only uses OpenGL rendering for the sequencer
+ * preview. This is far from nice, but is the only way to prevent crashes at this
+ * time.
+ *
+ * -jahka
+ */
int rendering = G.rendering;
int doseq;
@@ -2044,7 +2043,8 @@ static ImBuf * seq_render_scene_strip_impl(
/* opengl offscreen render */
scene_update_for_newframe(context.bmain, scene, scene->lay);
- ibuf= sequencer_view3d_cb(scene, camera, context.rectx, context.recty, IB_rect, context.scene->r.seq_prev_type, err_out);
+ ibuf = sequencer_view3d_cb(scene, camera, context.rectx, context.recty,
+ IB_rect, context.scene->r.seq_prev_type, TRUE, err_out);
if(ibuf == NULL) {
fprintf(stderr, "seq_render_scene_strip_impl failed to get opengl buffer: %s\n", err_out);
}
@@ -2119,7 +2119,7 @@ static ImBuf * seq_render_strip(SeqRenderData context, Sequence * seq, float cfr
ibuf = seq_stripelem_cache_get(context, seq, cfra, SEQ_STRIPELEM_IBUF);
/* currently, we cache preprocessed images in SEQ_STRIPELEM_IBUF,
- but not(!) on SEQ_STRIPELEM_IBUF_ENDSTILL and ..._STARTSTILL */
+ * but not(!) on SEQ_STRIPELEM_IBUF_ENDSTILL and ..._STARTSTILL */
if (ibuf)
use_preprocess = FALSE;
@@ -2262,15 +2262,15 @@ static ImBuf * seq_render_strip(SeqRenderData context, Sequence * seq, float cfr
}
/* **********************************************************************
- strip stack rendering functions
- ********************************************************************** */
+ * strip stack rendering functions
+ * ********************************************************************** */
static int seq_must_swap_input_in_blend_mode(Sequence * seq)
{
int swap_input = FALSE;
/* bad hack, to fix crazy input ordering of
- those two effects */
+ * those two effects */
if (ELEM3(seq->blend_mode, SEQ_ALPHAOVER, SEQ_ALPHAUNDER, SEQ_OVERDROP)) {
swap_input = TRUE;
@@ -2807,13 +2807,13 @@ void free_imbuf_seq(Scene *scene, ListBase * seqbase, int check_mem_usage,
if (check_mem_usage) {
/* Let the cache limitor take care of this (schlaile) */
/* While render let's keep all memory available for render
- (ton)
- At least if free memory is tight...
- This can make a big difference in encoding speed
- (it is around 4 times(!) faster, if we do not waste time
- on freeing _all_ buffers every time on long timelines...)
- (schlaile)
- */
+ * (ton)
+ * At least if free memory is tight...
+ * This can make a big difference in encoding speed
+ * (it is around 4 times(!) faster, if we do not waste time
+ * on freeing _all_ buffers every time on long timelines...)
+ * (schlaile)
+ */
uintptr_t mem_in_use;
uintptr_t mmap_in_use;
@@ -2904,11 +2904,11 @@ void update_changed_seq_and_deps(Scene *scene, Sequence *changed_seq, int len_ch
}
/* seq funcs's for transforming internally
- notice the difference between start/end and left/right.
-
- left and right are the bounds at which the sequence is rendered,
-start and end are from the start and fixed length of the sequence.
-*/
+ * notice the difference between start/end and left/right.
+ *
+ * left and right are the bounds at which the sequence is rendered,
+ * start and end are from the start and fixed length of the sequence.
+ */
int seq_tx_get_start(Sequence *seq)
{
return seq->start;
@@ -2961,7 +2961,7 @@ void seq_tx_set_final_right(Sequence *seq, int val)
}
/* used so we can do a quick check for single image seq
- since they work a bit differently to normal image seq's (during transform) */
+ * since they work a bit differently to normal image seq's (during transform) */
int seq_single_check(Sequence *seq)
{
return (seq->len==1 && (
@@ -3024,14 +3024,14 @@ void seq_tx_handle_xlimits(Sequence *seq, int leftflag, int rightflag)
}
/* dosnt work now - TODO */
- /*
+#if 0
if (seq_tx_get_start(seq) >= seq_tx_get_final_right(seq, 0)) {
int ofs;
ofs = seq_tx_get_start(seq) - seq_tx_get_final_right(seq, 0);
seq->start -= ofs;
seq_tx_set_final_left(seq, seq_tx_get_final_left(seq, 0) + ofs );
- }*/
-
+ }
+#endif
}
}
@@ -3061,7 +3061,7 @@ void seq_single_fix(Sequence *seq)
return;
/* make sure the image is always at the start since there is only one,
- adjusting its start should be ok */
+ * adjusting its start should be ok */
left = seq_tx_get_final_left(seq, 0);
start = seq->start;
if (start != left) {
@@ -3290,13 +3290,13 @@ static void seq_update_muting_recursive(ListBase *seqbasep, Sequence *metaseq, i
int seqmute;
/* for sound we go over full meta tree to update muted state,
- since sound is played outside of evaluating the imbufs, */
+ * since sound is played outside of evaluating the imbufs, */
for(seq=seqbasep->first; seq; seq=seq->next) {
seqmute= (mute || (seq->flag & SEQ_MUTE));
if(seq->type == SEQ_META) {
/* if this is the current meta sequence, unmute because
- all sequences above this were set to mute */
+ * all sequences above this were set to mute */
if(seq == metaseq)
seqmute= 0;
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index efc3477298c..dab945c44f3 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -86,7 +86,7 @@
typedef void ( *Shrinkwrap_ForeachVertexCallback) (DerivedMesh *target, float *co, float *normal);
/* get derived mesh */
-//TODO is anyfunction that does this? returning the derivedFinal witouth we caring if its in edit mode or not?
+//TODO is anyfunction that does this? returning the derivedFinal without we caring if its in edit mode or not?
DerivedMesh *object_get_derived_final(Object *ob)
{
Mesh *me= ob->data;
@@ -236,8 +236,7 @@ int normal_projection_project_vertex(char options, const float *vert, const floa
hit_tmp.dist *= mat4_to_scale( ((SpaceTransform*)transf)->local2target );
}
- else
- {
+ else {
co = vert;
no = dir;
}
@@ -303,8 +302,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
{
if(calc->vert == NULL) return;
}
- else
- {
+ else {
//The code supports any axis that is a combination of X,Y,Z
//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;
@@ -355,8 +353,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
copy_v3_v3(tmp_no, proj_axis);
}
}
- else
- {
+ else {
copy_v3_v3(tmp_co, co);
copy_v3_v3(tmp_no, proj_axis);
}
@@ -439,12 +436,10 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
if(weight == 0.0f) continue;
//Convert the vertex to tree coordinates
- if(calc->vert)
- {
+ if(calc->vert) {
copy_v3_v3(tmp_co, calc->vert[i].co);
}
- else
- {
+ else {
copy_v3_v3(tmp_co, co);
}
space_transform_apply(&calc->local2target, tmp_co);
@@ -469,8 +464,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
//Make the vertex stay on the front side of the face
madd_v3_v3v3fl(tmp_co, nearest.co, nearest.no, calc->keepDist);
}
- else
- {
+ else {
//Adjusting the vertex weight, so that after interpolating it keeps a certain distance from the nearest position
float dist = sasqrt( nearest.dist );
if(dist > FLT_EPSILON)
@@ -508,12 +502,10 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM
//DeformVertex
calc.vgroup = defgroup_name_index(calc.ob, calc.smd->vgroup_name);
- if(dm)
- {
+ if(dm) {
calc.dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
}
- else if(calc.ob->type == OB_LATTICE)
- {
+ else if (calc.ob->type == OB_LATTICE) {
calc.dvert = lattice_get_deform_verts(calc.ob);
}
@@ -568,8 +560,7 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM
}
//Projecting target defined - lets work!
- if(calc.target)
- {
+ if (calc.target) {
switch(smd->shrinkType)
{
case MOD_SHRINKWRAP_NEAREST_SURFACE:
diff --git a/source/blender/blenkernel/intern/sketch.c b/source/blender/blenkernel/intern/sketch.c
index 7134f5ac8c1..90d530cb239 100644
--- a/source/blender/blenkernel/intern/sketch.c
+++ b/source/blender/blenkernel/intern/sketch.c
@@ -258,8 +258,7 @@ void sk_straightenStroke(SK_Stroke *stk, int start, int end, float p_start[3], f
float delta = (float)i / (float)total;
float *p = stk->points[start + 1 + i].p;
- VECCOPY(p, delta_p);
- mul_v3_fl(p, delta);
+ mul_v3_v3fl(p, delta_p, delta);
add_v3_v3(p, p_start);
}
}
@@ -333,7 +332,7 @@ void sk_flattenStroke(SK_Stroke *stk, int start, int end)
sub_v3_v3v3(distance, p, stk->points[start].p);
project_v3_v3v3(distance, distance, normal);
- VECCOPY(offset, normal);
+ copy_v3_v3(offset, normal);
mul_v3_fl(offset, d);
sub_v3_v3(p, distance);
@@ -574,15 +573,13 @@ void sk_selectAllSketch(SK_Sketch *sketch, int mode)
stk->selected = 0;
}
}
- else if (mode == 0)
- {
+ else if (mode == 0) {
for (stk = sketch->strokes.first; stk; stk = stk->next)
{
stk->selected = 1;
}
}
- else if (mode == 1)
- {
+ else if (mode == 1) {
int selected = 1;
for (stk = sketch->strokes.first; stk; stk = stk->next)
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 8f0fcc04e1e..bffd4703ce4 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -211,8 +211,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
smd->domain->res[1] = (int)(size[1] * scale + 0.5);
smd->domain->res[2] = (int)(size[2] * scale + 0.5);
}
- else
- {
+ else {
scale = res / size[2];
smd->domain->dx = size[2] / res;
smd->domain->res[2] = res;
@@ -220,8 +219,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
smd->domain->res[1] = (int)(size[1] * scale + 0.5);
}
}
- else
- {
+ else {
if(size[1] > size[2])
{
scale = res / size[1];
@@ -230,8 +228,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
smd->domain->res[0] = (int)(size[0] * scale + 0.5);
smd->domain->res[2] = (int)(size[2] * scale + 0.5);
}
- else
- {
+ else {
scale = res / size[2];
smd->domain->dx = size[2] / res;
smd->domain->res[2] = res;
@@ -378,8 +375,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
sub_v3_v3v3(side1, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co);
sub_v3_v3v3(side2, mvert[ mface[i].v4 ].co, mvert[ mface[i].v1 ].co);
}
- else
- {
+ else {
sub_v3_v3v3(side1, mvert[ mface[i].v2 ].co, mvert[ mface[i].v1 ].co);
sub_v3_v3v3(side2, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co);
}
@@ -410,8 +406,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
copy_v3_v3(p2, mvert[ mface[i].v3 ].co);
copy_v3_v3(p3, mvert[ mface[i].v4 ].co);
}
- else
- {
+ else {
copy_v3_v3(p2, mvert[ mface[i].v2 ].co);
copy_v3_v3(p3, mvert[ mface[i].v3 ].co);
}
@@ -1073,8 +1068,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
if(psys->particles[p].flag & (PARS_NO_DISP|PARS_UNEXIST))
continue;
}
- else
- {
+ else {
/* handle child particle */
ChildParticle *cpa = &psys->child[p - totpart];
@@ -1272,8 +1266,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
}
- else
- {
+ else {
/*
for()
{
@@ -1630,14 +1623,12 @@ static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int
sub_v3_v3v3(tmp, pos, p0);
mul_v3_fl(tmp, 1.0 / dx);
- if(correct)
- {
+ if (correct) {
cell[0] = MIN2(res[0] - 1, MAX2(0, (int)floor(tmp[0])));
cell[1] = MIN2(res[1] - 1, MAX2(0, (int)floor(tmp[1])));
cell[2] = MIN2(res[2] - 1, MAX2(0, (int)floor(tmp[2])));
}
- else
- {
+ else {
cell[0] = (int)floor(tmp[0]);
cell[1] = (int)floor(tmp[1]);
cell[2] = (int)floor(tmp[2]);
@@ -1687,8 +1678,7 @@ static void smoke_calc_transparency(float *result, float *input, float *p0, floa
// we're ouside
get_cell(p0, res, dx, pos, cell, 1);
}
- else
- {
+ else {
// we're inside
get_cell(p0, res, dx, light, cell, 1);
}
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 4f48fb0270f..b0075f5c121 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -974,7 +974,7 @@ static void free_softbody_intern(SoftBody *sb)
** Q: why not use 'simple' collision here like bouncing back a particle
** --> reverting is velocity on the face normal
** A: because our particles are not alone here
-** and need to tell their neighbours exactly what happens via spring forces
+** and need to tell their neighbors exactly what happens via spring forces
** unless sbObjectStep( .. ) is called on sub frame timing level
** BTW that also questions the use of a 'implicit' solvers on softbodies
** since that would only valid for 'slow' moving collision targets and dito particles
@@ -2756,7 +2756,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/*bjornmose: uugh.. what an evil hack
violation of the 'don't touch bp->pos in here' rule
but works nice, like this-->
- we predict the solution beeing out of the collider
+ we predict the solution being out of the collider
in heun step No1 and leave the heun step No2 adapt to it
so we kind of introduced a implicit solver for this case
*/
@@ -3289,7 +3289,7 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
get_scalar_from_vertexgroup(ob, a,(short) (sb->vertgroup-1), &bp->goal);
/* do this always, regardless successfull read from vertex group */
- /* this is where '2.5 every thing is animateable' goes wrong in the first place jow_go_for2_5 */
+ /* this is where '2.5 every thing is animatable' goes wrong in the first place jow_go_for2_5 */
/* 1st coding action to take : move this to frame level */
/* reads: leave the bp->goal as it was read from vertex group / or default .. we will need it at per frame call */
/* should be fixed for meshes */
@@ -3585,7 +3585,7 @@ static void curve_surf_to_softbody(Scene *scene, Object *ob)
if (nu->bezt) {
/* bezier case ; this is nicly said naive; who ever wrote this part, it was not me (JOW) :) */
/* a: never ever make tangent handles (sub) and or (ob)ject to collision */
- /* b: rather calculate them using some C2 (C2= continous in second derivate -> no jump in bending ) condition */
+ /* b: rather calculate them using some C2 (C2= continuous in second derivate -> no jump in bending ) condition */
/* not too hard to do, but needs some more code to care for; some one may want look at it JOW 2010/06/12*/
for (bezt=nu->bezt, a=0; a<nu->pntsu; a++, bezt++, bp+=3, curindex+=3) {
if (setgoal) {
@@ -3800,18 +3800,18 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
/* void SB_estimate_transform */
/* input Object *ob out (says any object that can do SB like mesh,lattice,curve )
- output float lloc[3],float lrot[3][3],float lscale[3][3]
- that is:
- a precise position vector denoting the motion of the center of mass
- give a rotation/scale matrix using averaging method, that's why estimate and not calculate
- see: this is kind of reverse engeneering: having to states of a point cloud and recover what happend
- our advantage here we know the identity of the vertex
- there are others methods giving other results.
- lloc,lrot,lscale are allowed to be NULL, just in case you don't need it.
- should be pretty useful for pythoneers :)
- not! velocity .. 2nd order stuff
- vcloud_estimate_transform see
- */
+ * output float lloc[3],float lrot[3][3],float lscale[3][3]
+ * that is:
+ * a precise position vector denoting the motion of the center of mass
+ * give a rotation/scale matrix using averaging method, that's why estimate and not calculate
+ * see: this is kind of reverse engeneering: having to states of a point cloud and recover what happend
+ * our advantage here we know the identity of the vertex
+ * there are others methods giving other results.
+ * lloc,lrot,lscale are allowed to be NULL, just in case you don't need it.
+ * should be pretty useful for pythoneers :)
+ * not! velocity .. 2nd order stuff
+ * vcloud_estimate_transform see
+ */
void SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscale[3][3])
{
@@ -3860,16 +3860,16 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
bp->vec[0]= bp->vec[1]= bp->vec[2]= 0.0f;
/* the bp->prev*'s are for rolling back from a canceled try to propagate in time
- adaptive step size algo in a nutshell:
- 1. set sheduled time step to new dtime
- 2. try to advance the sheduled time step, beeing optimistic execute it
- 3. check for success
- 3.a we 're fine continue, may be we can increase sheduled time again ?? if so, do so!
- 3.b we did exceed error limit --> roll back, shorten the sheduled time and try again at 2.
- 4. check if we did reach dtime
- 4.a nope we need to do some more at 2.
- 4.b yup we're done
- */
+ * adaptive step size algo in a nutshell:
+ * 1. set scheduled time step to new dtime
+ * 2. try to advance the scheduled time step, being optimistic execute it
+ * 3. check for success
+ * 3.a we 're fine continue, may be we can increase scheduled time again ?? if so, do so!
+ * 3.b we did exceed error limit --> roll back, shorten the scheduled time and try again at 2.
+ * 4. check if we did reach dtime
+ * 4.a nope we need to do some more at 2.
+ * 4.b yup we're done
+ */
copy_v3_v3(bp->prevpos, bp->pos);
copy_v3_v3(bp->prevvec, bp->vec);
@@ -3917,9 +3917,9 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
sst=PIL_check_seconds_timer();
/* Integration back in time is possible in theory, but pretty useless here.
- So we refuse to do so. Since we do not know anything about 'outside' canges
- especially colliders we refuse to go more than 10 frames.
- */
+ * So we refuse to do so. Since we do not know anything about 'outside' canges
+ * especially colliders we refuse to go more than 10 frames.
+ */
if (dtime < 0 || dtime > 10.5f) return;
ccd_update_deflector_hash(scene, ob, sb->scratch->colliderhash);
@@ -3938,9 +3938,8 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
float forcetimemax = 1.0f; /* set defaults guess we shall do one frame */
float forcetimemin = 0.01f; /* set defaults guess 1/100 is tight enough */
float timedone =0.0; /* how far did we get without violating error condition */
- /* loops = counter for emergency brake
- * we don't want to lock up the system if physics fail
- */
+ /* loops = counter for emergency brake
+ * we don't want to lock up the system if physics fail */
int loops = 0;
SoftHeunTol = sb->rklimit; /* humm .. this should be calculated from sb parameters and sizes */
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 594c7a9a2f3..a41e765695e 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -628,19 +628,16 @@ void sound_seek_scene(struct Main *bmain, struct Scene *scene)
AUD_resume(scene->sound_scene_handle);
if (scene->sound_scrub_handle && AUD_getStatus(scene->sound_scrub_handle) != AUD_STATUS_INVALID)
AUD_seek(scene->sound_scrub_handle, 0);
- else
- {
+ else {
if (scene->sound_scrub_handle)
AUD_stop(scene->sound_scrub_handle);
scene->sound_scrub_handle = AUD_pauseAfter(scene->sound_scene_handle, 1 / FPS);
}
}
- else
- {
+ else {
if (scene->audio.flag & AUDIO_SYNC)
AUD_seekSequencer(scene->sound_scene_handle, CFRA / FPS);
- else
- {
+ else {
if (status == AUD_STATUS_PLAYING)
AUD_seek(scene->sound_scene_handle, CFRA / FPS);
}
@@ -731,14 +728,12 @@ void sound_update_scene(struct Scene* scene)
{
if (speaker->sound)
AUD_moveSequence(strip->speaker_handle, strip->start / FPS, -1, 0);
- else
- {
+ else {
AUD_removeSequence(scene->sound_scene, strip->speaker_handle);
strip->speaker_handle = NULL;
}
}
- else
- {
+ else {
if (speaker->sound)
{
strip->speaker_handle = AUD_addSequence(scene->sound_scene, speaker->sound->playback_handle, strip->start / FPS, -1, 0);
diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c
index d2c8a8031ee..a5d24c79bba 100644
--- a/source/blender/blenkernel/intern/speaker.c
+++ b/source/blender/blenkernel/intern/speaker.c
@@ -83,9 +83,9 @@ void make_local_speaker(Speaker *spk)
int is_local= FALSE, is_lib= FALSE;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(spk->id.lib==NULL) return;
if(spk->id.us==1) {
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 190ad07db6a..2f79c9cdd9f 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -191,11 +191,11 @@ static int getFaceIndex(CCGSubSurf *ss, CCGFace *f, int S, int x, int y, int edg
int numVerts = ccgSubSurf_getFaceNumVerts(f);
if (x==gridSize-1 && y==gridSize-1) {
- CCGVert *v = ccgSubSurf_getFaceVert(ss, f, S);
+ CCGVert *v = ccgSubSurf_getFaceVert(f, S);
return *((int*) ccgSubSurf_getVertUserData(ss, v));
} else if (x==gridSize-1) {
- CCGVert *v = ccgSubSurf_getFaceVert(ss, f, S);
- CCGEdge *e = ccgSubSurf_getFaceEdge(ss, f, S);
+ CCGVert *v = ccgSubSurf_getFaceVert(f, S);
+ CCGEdge *e = ccgSubSurf_getFaceEdge(f, S);
int edgeBase = *((int*) ccgSubSurf_getEdgeUserData(ss, e));
if (v==ccgSubSurf_getEdgeVert0(e)) {
return edgeBase + (gridSize-1-y)-1;
@@ -203,8 +203,8 @@ static int getFaceIndex(CCGSubSurf *ss, CCGFace *f, int S, int x, int y, int edg
return edgeBase + (edgeSize-2-1)-((gridSize-1-y)-1);
}
} else if (y==gridSize-1) {
- CCGVert *v = ccgSubSurf_getFaceVert(ss, f, S);
- CCGEdge *e = ccgSubSurf_getFaceEdge(ss, f, (S+numVerts-1)%numVerts);
+ CCGVert *v = ccgSubSurf_getFaceVert(f, S);
+ CCGEdge *e = ccgSubSurf_getFaceEdge(f, (S+numVerts-1)%numVerts);
int edgeBase = *((int*) ccgSubSurf_getEdgeUserData(ss, e));
if (v==ccgSubSurf_getEdgeVert0(e)) {
return edgeBase + (gridSize-1-x)-1;
@@ -309,7 +309,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
MVert *mv1 = mvert + (ml[ ((j+1)%nverts) ].v);
if (!BLI_edgehash_haskey(ehash, v0, v1)) {
- CCGEdge *e, *orige= ccgSubSurf_getFaceEdge(origss, origf, j);
+ CCGEdge *e, *orige= ccgSubSurf_getFaceEdge(origf, j);
CCGEdgeHDL ehdl= SET_INT_IN_POINTER(i*4 + j);
float crease;
@@ -385,7 +385,7 @@ static void set_subsurf_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *result,
fi = ccgSubSurf_getFaceIterator(uvss);
for(; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(fi);
- faceMap[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(uvss, f))] = f;
+ faceMap[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))] = f;
}
ccgFaceIterator_free(fi);
@@ -920,7 +920,7 @@ static void ccgDM_getFinalFace(DerivedMesh *dm, int faceNum, MFace *mf)
int grid;
int x, y;
/*int lastface = ccgSubSurf_getNumFaces(ss) - 1;*/ /*UNUSED*/
- char *faceFlags = ccgdm->faceFlags;
+ DMFlagMat *faceFlags = ccgdm->faceFlags;
memset(mf, 0, sizeof(*mf));
if (faceNum >= ccgdm->dm.numTessFaceData)
@@ -943,8 +943,8 @@ static void ccgDM_getFinalFace(DerivedMesh *dm, int faceNum, MFace *mf)
mf->v4 = getFaceIndex(ss, f, grid, x+1, y+0, edgeSize, gridSize);
if(faceFlags) {
- mf->flag = faceFlags[i*2];
- mf->mat_nr = faceFlags[i*2+1];
+ mf->flag = faceFlags[i].flag;
+ mf->mat_nr = faceFlags[i].mat_nr;
}
else mf->flag = ME_SMOOTH;
}
@@ -1107,15 +1107,15 @@ static void ccgDM_copyFinalFaceArray(DerivedMesh *dm, MFace *mface)
int gridSize = ccgSubSurf_getGridSize(ss);
int edgeSize = ccgSubSurf_getEdgeSize(ss);
int i = 0;
- char *faceFlags = ccgdm->faceFlags;
+ DMFlagMat *faceFlags = ccgdm->faceFlags;
totface = ccgSubSurf_getNumFaces(ss);
for(index = 0; index < totface; index++) {
CCGFace *f = ccgdm->faceMap[index].face;
int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f);
/* keep types in sync with MFace, avoid many conversions */
- char flag = (faceFlags)? faceFlags[index*2]: ME_SMOOTH;
- short mat_nr = (faceFlags)? faceFlags[index*2+1]: 0;
+ char flag = (faceFlags)? faceFlags[index].flag: ME_SMOOTH;
+ short mat_nr = (faceFlags)? faceFlags[index].mat_nr: 0;
for(S = 0; S < numVerts; S++) {
for(y = 0; y < gridSize - 1; y++) {
@@ -1149,7 +1149,7 @@ static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop)
int edgeSize = ccgSubSurf_getEdgeSize(ss);
int i = 0;
MLoop *mv;
- /* char *faceFlags = ccgdm->faceFlags; */ /* UNUSED */
+ /* DMFlagMat *faceFlags = ccgdm->faceFlags; */ /* UNUSED */
if (!ccgdm->ehash) {
MEdge *medge;
@@ -1215,14 +1215,14 @@ static void ccgDM_copyFinalPolyArray(DerivedMesh *dm, MPoly *mface)
int gridSize = ccgSubSurf_getGridSize(ss);
/* int edgeSize = ccgSubSurf_getEdgeSize(ss); */ /* UNUSED */
int i = 0, k = 0;
- char *faceFlags = ccgdm->faceFlags;
+ DMFlagMat *faceFlags = ccgdm->faceFlags;
totface = ccgSubSurf_getNumFaces(ss);
for(index = 0; index < totface; index++) {
CCGFace *f = ccgdm->faceMap[index].face;
int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f);
- int flag = (faceFlags)? faceFlags[index*2]: ME_SMOOTH;
- int mat_nr = (faceFlags)? faceFlags[index*2+1]: 0;
+ int flag = (faceFlags)? faceFlags[index].flag: ME_SMOOTH;
+ int mat_nr = (faceFlags)? faceFlags[index].mat_nr: 0;
for(S = 0; S < numVerts; S++) {
for(y = 0; y < gridSize - 1; y++) {
@@ -1282,7 +1282,7 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3])
for (; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(fi);
- faceMap2[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f))] = f;
+ faceMap2[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))] = f;
}
ccgFaceIterator_free(fi);
@@ -1534,12 +1534,12 @@ static void ccgDM_glNormalFast(float *a, float *b, float *c, float *d)
}
/* Only used by non-editmesh types */
-static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)[4], int fast, int (*setMaterial)(int, void *attribs))
+static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)[4], int fast, DMSetMaterial setMaterial)
{
CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
CCGSubSurf *ss = ccgdm->ss;
int gridSize = ccgSubSurf_getGridSize(ss);
- char *faceFlags = ccgdm->faceFlags;
+ DMFlagMat *faceFlags = ccgdm->faceFlags;
int step = (fast)? gridSize-1: 1;
int i, totface = ccgSubSurf_getNumFaces(ss);
int drawcurrent = 0, matnr = -1, shademodel = -1;
@@ -1548,12 +1548,7 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)
if(ccgdm->pbvh && ccgdm->multires.mmd && !fast) {
if(dm->numTessFaceData) {
- /* should be per face */
- if(!setMaterial(faceFlags[1]+1, NULL))
- return;
-
- glShadeModel((faceFlags[0] & ME_SMOOTH)? GL_SMOOTH: GL_FLAT);
- BLI_pbvh_draw(ccgdm->pbvh, partial_redraw_planes, NULL, (faceFlags[0] & ME_SMOOTH));
+ BLI_pbvh_draw(ccgdm->pbvh, partial_redraw_planes, NULL, setMaterial);
glShadeModel(GL_FLAT);
}
@@ -1563,12 +1558,12 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)
for(i = 0; i < totface; i++) {
CCGFace *f = ccgdm->faceMap[i].face;
int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f);
- int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f));
+ int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
int new_matnr, new_shademodel;
if(faceFlags) {
- new_shademodel = (faceFlags[index*2] & ME_SMOOTH)? GL_SMOOTH: GL_FLAT;
- new_matnr= faceFlags[index*2 + 1];
+ new_shademodel = (faceFlags[index].flag & ME_SMOOTH)? GL_SMOOTH: GL_FLAT;
+ new_matnr= faceFlags[index].mat_nr;
}
else {
new_shademodel = GL_SMOOTH;
@@ -1629,8 +1624,8 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)
/* Only used by non-editmesh types */
static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm,
- int (*setMaterial)(int, void *attribs),
- int (*setDrawOptions)(void *userData, int index),
+ DMSetMaterial setMaterial,
+ DMSetDrawOptions setDrawOptions,
void *userData)
{
CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
@@ -1641,7 +1636,7 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm,
int gridSize = ccgSubSurf_getGridSize(ss);
int gridFaces = gridSize - 1;
int edgeSize = ccgSubSurf_getEdgeSize(ss);
- char *faceFlags = ccgdm->faceFlags;
+ DMFlagMat *faceFlags = ccgdm->faceFlags;
int a, b, i, doDraw, numVerts, matnr, new_matnr, totface;
ccgdm_pbvh_update(ccgdm);
@@ -1674,14 +1669,14 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm,
for(a = 0, i = 0; i < totface; i++) {
CCGFace *f = ccgdm->faceMap[i].face;
int S, x, y, drawSmooth;
- int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f));
+ int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
int origIndex = ccgDM_getFaceMapIndex(ss, f);
numVerts = ccgSubSurf_getFaceNumVerts(f);
if(faceFlags) {
- drawSmooth = (faceFlags[index*2] & ME_SMOOTH);
- new_matnr= faceFlags[index*2 + 1] + 1;
+ drawSmooth = (faceFlags[index].flag & ME_SMOOTH);
+ new_matnr= faceFlags[index].mat_nr + 1;
}
else {
drawSmooth = 1;
@@ -1694,7 +1689,8 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm,
DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs);
}
- if(!doDraw || (setDrawOptions && (origIndex != ORIGINDEX_NONE) && !setDrawOptions(userData, origIndex))) {
+ if(!doDraw || (setDrawOptions && (origIndex != ORIGINDEX_NONE) &&
+ (setDrawOptions(userData, origIndex) == DM_DRAW_OPTION_SKIP))) {
a += gridFaces*gridFaces*numVerts;
continue;
}
@@ -1769,7 +1765,7 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm,
#undef PASSATTRIB
}
-static void ccgDM_drawFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs))
+static void ccgDM_drawFacesGLSL(DerivedMesh *dm, DMSetMaterial setMaterial)
{
dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL);
}
@@ -1784,7 +1780,7 @@ static void ccgDM_drawMappedFacesMat(DerivedMesh *dm, void (*setMaterial)(void *
int gridSize = ccgSubSurf_getGridSize(ss);
int gridFaces = gridSize - 1;
int edgeSize = ccgSubSurf_getEdgeSize(ss);
- char *faceFlags = ccgdm->faceFlags;
+ DMFlagMat *faceFlags = ccgdm->faceFlags;
int a, b, i, numVerts, matnr, new_matnr, totface;
ccgdm_pbvh_update(ccgdm);
@@ -1822,15 +1818,15 @@ static void ccgDM_drawMappedFacesMat(DerivedMesh *dm, void (*setMaterial)(void *
for(a = 0, i = 0; i < totface; i++) {
CCGFace *f = ccgdm->faceMap[i].face;
int S, x, y, drawSmooth;
- int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f));
+ int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
int origIndex = ccgDM_getFaceMapIndex(ss, f);
numVerts = ccgSubSurf_getFaceNumVerts(f);
/* get flags */
if(faceFlags) {
- drawSmooth = (faceFlags[index*2] & ME_SMOOTH);
- new_matnr= faceFlags[index*2 + 1] + 1;
+ drawSmooth = (faceFlags[index].flag & ME_SMOOTH);
+ new_matnr= faceFlags[index].mat_nr + 1;
}
else {
drawSmooth = 1;
@@ -1920,87 +1916,19 @@ static void ccgDM_drawMappedFacesMat(DerivedMesh *dm, void (*setMaterial)(void *
#undef PASSATTRIB
}
-
-static void ccgDM_drawFacesColored(DerivedMesh *dm, int UNUSED(useTwoSided), unsigned char *col1, unsigned char *col2)
-{
- CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
- CCGSubSurf *ss = ccgdm->ss;
- int gridSize = ccgSubSurf_getGridSize(ss);
- unsigned char *cp1, *cp2;
- int useTwoSide=1, i, totface;
-
- ccgdm_pbvh_update(ccgdm);
-
- cp1= col1;
- if(col2) {
- cp2= col2;
- } else {
- cp2= NULL;
- useTwoSide= 0;
- }
-
- glShadeModel(GL_SMOOTH);
-
- if(col2) {
- glEnable(GL_CULL_FACE);
- }
-
- glBegin(GL_QUADS);
- totface = ccgSubSurf_getNumFaces(ss);
- for(i = 0; i < totface; i++) {
- CCGFace *f = ccgdm->faceMap[i].face;
- int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f);
-
- for (S=0; S<numVerts; S++) {
- DMGridData *faceGridData = ccgSubSurf_getFaceGridDataArray(ss, f, S);
- for (y=0; y<gridSize-1; y++) {
- for (x=0; x<gridSize-1; x++) {
- float *a = faceGridData[(y+0)*gridSize + x].co;
- float *b = faceGridData[(y+0)*gridSize + x + 1].co;
- float *c = faceGridData[(y+1)*gridSize + x + 1].co;
- float *d = faceGridData[(y+1)*gridSize + x].co;
-
- glColor3ub(cp1[3], cp1[2], cp1[1]);
- glVertex3fv(d);
- glColor3ub(cp1[7], cp1[6], cp1[5]);
- glVertex3fv(c);
- glColor3ub(cp1[11], cp1[10], cp1[9]);
- glVertex3fv(b);
- glColor3ub(cp1[15], cp1[14], cp1[13]);
- glVertex3fv(a);
-
- if (useTwoSide) {
- glColor3ub(cp2[15], cp2[14], cp2[13]);
- glVertex3fv(a);
- glColor3ub(cp2[11], cp2[10], cp2[9]);
- glVertex3fv(b);
- glColor3ub(cp2[7], cp2[6], cp2[5]);
- glVertex3fv(c);
- glColor3ub(cp2[3], cp2[2], cp2[1]);
- glVertex3fv(d);
- }
-
- if (cp2) cp2+=16;
- cp1+=16;
- }
- }
- }
- }
- glEnd();
-}
-
static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
- int (*drawParams)(MTFace *tface, int has_mcol, int matnr),
- int (*drawParamsMapped)(void *userData, int index),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ DMSetDrawOptionsTex drawParams,
+ DMSetDrawOptions drawParamsMapped,
+ DMCompareDrawOptions compareDrawOptions,
void *userData)
{
CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
CCGSubSurf *ss = ccgdm->ss;
MCol *mcol = dm->getTessFaceDataArray(dm, CD_WEIGHT_MCOL);
MTFace *tf = DM_get_tessface_data_layer(dm, CD_MTFACE);
- char *faceFlags = ccgdm->faceFlags;
- int i, totface, flag, gridSize = ccgSubSurf_getGridSize(ss);
+ DMFlagMat *faceFlags = ccgdm->faceFlags;
+ DMDrawOption draw_option;
+ int i, totface, gridSize = ccgSubSurf_getGridSize(ss);
int gridFaces = gridSize - 1;
(void) compareDrawOptions;
@@ -2018,13 +1946,13 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
CCGFace *f = ccgdm->faceMap[i].face;
int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f);
int drawSmooth, index = ccgDM_getFaceMapIndex(ss, f);
- int origIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f));
+ int origIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
unsigned char *cp= NULL;
int mat_nr;
if(faceFlags) {
- drawSmooth = (faceFlags[origIndex*2] & ME_SMOOTH);
- mat_nr= faceFlags[origIndex*2 + 1];
+ drawSmooth = (faceFlags[origIndex].flag & ME_SMOOTH);
+ mat_nr= faceFlags[origIndex].mat_nr;
}
else {
drawSmooth = 1;
@@ -2032,14 +1960,14 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
}
if(drawParams)
- flag = drawParams(tf, (mcol != NULL), mat_nr);
+ draw_option = drawParams(tf, (mcol != NULL), mat_nr);
else if (index != ORIGINDEX_NONE)
- flag= (drawParamsMapped)? drawParamsMapped(userData, index): 1;
+ draw_option= (drawParamsMapped)? drawParamsMapped(userData, index): DM_DRAW_OPTION_NORMAL;
else
- flag= GPU_enable_material(mat_nr, NULL) ? 1:0;
+ draw_option= GPU_enable_material(mat_nr, NULL) ? DM_DRAW_OPTION_NORMAL : DM_DRAW_OPTION_SKIP;
- if (flag == 0) { /* flag 0 == the face is hidden or invisible */
+ if (draw_option == DM_DRAW_OPTION_SKIP) {
if(tf) tf += gridFaces*gridFaces*numVerts;
if(mcol) mcol += gridFaces*gridFaces*numVerts*4;
continue;
@@ -2047,7 +1975,8 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
/* flag 1 == use vertex colors */
if(mcol) {
- if(flag==1) cp= (unsigned char*)mcol;
+ if(draw_option != DM_DRAW_OPTION_NO_MCOL)
+ cp= (unsigned char*)mcol;
mcol += gridFaces*gridFaces*numVerts*4;
}
@@ -2136,16 +2065,16 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
}
static void ccgDM_drawFacesTex(DerivedMesh *dm,
- int (*setDrawOptions)(MTFace *tface, int has_vcol, int matnr),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ DMSetDrawOptionsTex setDrawOptions,
+ DMCompareDrawOptions compareDrawOptions,
void *userData)
{
ccgDM_drawFacesTex_common(dm, setDrawOptions, NULL, compareDrawOptions, userData);
}
static void ccgDM_drawMappedFacesTex(DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ DMSetDrawOptions setDrawOptions,
+ DMCompareDrawOptions compareDrawOptions,
void *userData)
{
ccgDM_drawFacesTex_common(dm, NULL, setDrawOptions, compareDrawOptions, userData);
@@ -2185,16 +2114,17 @@ static void ccgDM_drawUVEdges(DerivedMesh *dm)
}
static void ccgDM_drawMappedFaces(DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r),
- int (*setMaterial)(int, void *attribs),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
- void *userData, int useColors)
+ DMSetDrawOptions setDrawOptions,
+ DMSetMaterial setMaterial,
+ DMCompareDrawOptions compareDrawOptions,
+ void *userData, DMDrawFlag flag)
{
CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
CCGSubSurf *ss = ccgdm->ss;
MCol *mcol= NULL;
int i, gridSize = ccgSubSurf_getGridSize(ss);
- char *faceFlags = ccgdm->faceFlags;
+ DMFlagMat *faceFlags = ccgdm->faceFlags;
+ int useColors = flag & DM_DRAW_USE_COLORS;
int gridFaces = gridSize - 1, totface;
/* currently unused -- each original face is handled separately */
@@ -2214,9 +2144,10 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm,
int origIndex;
unsigned char *cp= NULL;
- origIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f));
+ origIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
- if(faceFlags) drawSmooth = (faceFlags[origIndex*2] & ME_SMOOTH);
+ if(flag & DM_DRAW_ALWAYS_SMOOTH) drawSmooth = 1;
+ else if(faceFlags) drawSmooth = (faceFlags[origIndex].flag & ME_SMOOTH);
else drawSmooth = 1;
if(mcol) {
@@ -2225,21 +2156,21 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm,
}
{
- int draw= 1;
+ DMDrawOption draw_option= DM_DRAW_OPTION_NORMAL;
if(index == ORIGINDEX_NONE)
- draw= setMaterial(faceFlags ? faceFlags[origIndex*2 + 1] + 1: 1, NULL); /* XXX, no faceFlags no material */
+ draw_option= setMaterial(faceFlags ? faceFlags[origIndex].mat_nr + 1: 1, NULL); /* XXX, no faceFlags no material */
else if (setDrawOptions)
- draw= setDrawOptions(userData, index, &drawSmooth);
+ draw_option= setDrawOptions(userData, index);
- if (draw) {
- if (draw==2) {
+ if (draw_option != DM_DRAW_OPTION_SKIP) {
+ if (draw_option == DM_DRAW_OPTION_STIPPLE) {
glEnable(GL_POLYGON_STIPPLE);
glPolygonStipple(stipple_quarttone);
}
/* no need to set shading mode to flat because
- * normals are already used to change shading */
+ * normals are already used to change shading */
glShadeModel(GL_SMOOTH);
for (S=0; S<numVerts; S++) {
@@ -2304,14 +2235,16 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm,
glEnd();
}
}
- if (draw==2)
+ if (draw_option == DM_DRAW_OPTION_STIPPLE)
glDisable(GL_POLYGON_STIPPLE);
}
}
}
}
-static void ccgDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index), void *userData)
+static void ccgDM_drawMappedEdges(DerivedMesh *dm,
+ DMSetDrawOptions setDrawOptions,
+ void *userData)
{
CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
CCGSubSurf *ss = ccgdm->ss;
@@ -2326,7 +2259,7 @@ static void ccgDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *u
int index = ccgDM_getEdgeMapIndex(ss, e);
glBegin(GL_LINE_STRIP);
- if (index!=-1 && (!setDrawOptions || setDrawOptions(userData, index))) {
+ if (index!=-1 && (!setDrawOptions || (setDrawOptions(userData, index) != DM_DRAW_OPTION_SKIP))) {
if (useAging && !(G.f&G_BACKBUFSEL)) {
int ageCol = 255-ccgSubSurf_getEdgeAge(ss, e)*4;
glColor3ub(0, ageCol>0?ageCol:0, 0);
@@ -2343,7 +2276,10 @@ static void ccgDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *u
ccgEdgeIterator_free(ei);
}
-static void ccgDM_drawMappedEdgesInterp(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index), void (*setDrawInterpOptions)(void *userData, int index, float t), void *userData)
+static void ccgDM_drawMappedEdgesInterp(DerivedMesh *dm,
+ DMSetDrawOptions setDrawOptions,
+ DMSetDrawInterpOptions setDrawInterpOptions,
+ void *userData)
{
CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
CCGSubSurf *ss = ccgdm->ss;
@@ -2358,7 +2294,7 @@ static void ccgDM_drawMappedEdgesInterp(DerivedMesh *dm, int (*setDrawOptions)(v
int index = ccgDM_getEdgeMapIndex(ss, e);
glBegin(GL_LINE_STRIP);
- if (index!=-1 && (!setDrawOptions || setDrawOptions(userData, index))) {
+ if (index!=-1 && (!setDrawOptions || (setDrawOptions(userData, index) != DM_DRAW_OPTION_SKIP))) {
for (i=0; i<edgeSize; i++) {
setDrawInterpOptions(userData, index, (float) i/(edgeSize-1));
@@ -2419,6 +2355,7 @@ static void ccgDM_release(DerivedMesh *dm)
if(ccgdm->gridData) MEM_freeN(ccgdm->gridData);
if(ccgdm->gridAdjacency) MEM_freeN(ccgdm->gridAdjacency);
if(ccgdm->gridOffset) MEM_freeN(ccgdm->gridOffset);
+ if(ccgdm->gridFlagMats) MEM_freeN(ccgdm->gridFlagMats);
if(ccgdm->freeSS) ccgSubSurf_free(ccgdm->ss);
if(ccgdm->fmap) MEM_freeN(ccgdm->fmap);
if(ccgdm->fmap_mem) MEM_freeN(ccgdm->fmap_mem);
@@ -2656,13 +2593,13 @@ static int ccgDM_getGridSize(DerivedMesh *dm)
return ccgSubSurf_getGridSize(ccgdm->ss);
}
-static int ccgdm_adjacent_grid(CCGSubSurf *ss, int *gridOffset, CCGFace *f, int S, int offset)
+static int ccgdm_adjacent_grid(int *gridOffset, CCGFace *f, int S, int offset)
{
CCGFace *adjf;
CCGEdge *e;
int i, j= 0, numFaces, fIndex, numEdges= 0;
- e = ccgSubSurf_getFaceEdge(ss, f, S);
+ e = ccgSubSurf_getFaceEdge(f, S);
numFaces = ccgSubSurf_getEdgeNumFaces(e);
if(numFaces != 2)
@@ -2674,7 +2611,7 @@ static int ccgdm_adjacent_grid(CCGSubSurf *ss, int *gridOffset, CCGFace *f, int
if(adjf != f) {
numEdges = ccgSubSurf_getFaceNumVerts(adjf);
for(j = 0; j < numEdges; j++)
- if(ccgSubSurf_getFaceEdge(ss, adjf, j) == e)
+ if(ccgSubSurf_getFaceEdge(adjf, j) == e)
break;
if(j != numEdges)
@@ -2685,7 +2622,7 @@ static int ccgdm_adjacent_grid(CCGSubSurf *ss, int *gridOffset, CCGFace *f, int
if(numEdges == 0)
return -1;
- fIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, adjf));
+ fIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(adjf));
return gridOffset[fIndex] + (j + offset)%numEdges;
}
@@ -2696,6 +2633,7 @@ static void ccgdm_create_grids(DerivedMesh *dm)
CCGSubSurf *ss= ccgdm->ss;
DMGridData **gridData;
DMGridAdjacency *gridAdjacency, *adj;
+ DMFlagMat *gridFlagMats;
CCGFace **gridFaces;
int *gridOffset;
int index, numFaces, numGrids, S, gIndex /*, gridSize*/;
@@ -2722,6 +2660,7 @@ static void ccgdm_create_grids(DerivedMesh *dm)
gridData = MEM_mallocN(sizeof(DMGridData*)*numGrids, "ccgdm.gridData");
gridAdjacency = MEM_mallocN(sizeof(DMGridAdjacency)*numGrids, "ccgdm.gridAdjacency");
gridFaces = MEM_mallocN(sizeof(CCGFace*)*numGrids, "ccgdm.gridFaces");
+ gridFlagMats = MEM_mallocN(sizeof(DMFlagMat)*numGrids, "ccgdm.gridFlagMats");
for(gIndex = 0, index = 0; index < numFaces; index++) {
CCGFace *f = ccgdm->faceMap[index].face;
@@ -2733,14 +2672,15 @@ static void ccgdm_create_grids(DerivedMesh *dm)
gridData[gIndex] = ccgSubSurf_getFaceGridDataArray(ss, f, S);
gridFaces[gIndex] = f;
+ gridFlagMats[gIndex] = ccgdm->faceFlags[index];
adj = &gridAdjacency[gIndex];
adj->index[0] = gIndex - S + nextS;
adj->rotation[0] = 3;
- adj->index[1] = ccgdm_adjacent_grid(ss, gridOffset, f, prevS, 0);
+ adj->index[1] = ccgdm_adjacent_grid(gridOffset, f, prevS, 0);
adj->rotation[1] = 1;
- adj->index[2] = ccgdm_adjacent_grid(ss, gridOffset, f, S, 1);
+ adj->index[2] = ccgdm_adjacent_grid(gridOffset, f, S, 1);
adj->rotation[2] = 3;
adj->index[3] = gIndex - S + prevS;
adj->rotation[3] = 1;
@@ -2751,6 +2691,7 @@ static void ccgdm_create_grids(DerivedMesh *dm)
ccgdm->gridFaces = gridFaces;
ccgdm->gridAdjacency = gridAdjacency;
ccgdm->gridOffset = gridOffset;
+ ccgdm->gridFlagMats = gridFlagMats;
}
static DMGridData **ccgDM_getGridData(DerivedMesh *dm)
@@ -2777,6 +2718,14 @@ static int *ccgDM_getGridOffset(DerivedMesh *dm)
return ccgdm->gridOffset;
}
+static DMFlagMat *ccgDM_getGridFlagMats(DerivedMesh *dm)
+{
+ CCGDerivedMesh *ccgdm= (CCGDerivedMesh*)dm;
+
+ ccgdm_create_grids(dm);
+ return ccgdm->gridFlagMats;
+}
+
static ListBase *ccgDM_getPolyMap(Object *ob, DerivedMesh *dm)
{
CCGDerivedMesh *ccgdm= (CCGDerivedMesh*)dm;
@@ -2796,8 +2745,8 @@ static int ccgDM_use_grid_pbvh(CCGDerivedMesh *ccgdm)
{
MultiresModifierData *mmd= ccgdm->multires.mmd;
- /* both of multires and subsurm modifiers are CCG, but
- grids should only be used when sculpting on multires */
+ /* both of multires and subsurf modifiers are CCG, but
+ * grids should only be used when sculpting on multires */
if(!mmd)
return 0;
@@ -2822,9 +2771,9 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
if(ob->sculpt->pbvh) {
if(grid_pbvh) {
/* pbvh's grids, gridadj and gridfaces points to data inside ccgdm
- but this can be freed on ccgdm release, this updates the pointers
- when the ccgdm gets remade, the assumption is that the topology
- does not change. */
+ * but this can be freed on ccgdm release, this updates the pointers
+ * when the ccgdm gets remade, the assumption is that the topology
+ * does not change. */
ccgdm_create_grids(dm);
BLI_pbvh_grids_update(ob->sculpt->pbvh, ccgdm->gridData, ccgdm->gridAdjacency, (void**)ccgdm->gridFaces);
}
@@ -2836,8 +2785,8 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
return ccgdm->pbvh;
/* no pbvh exists yet, we need to create one. only in case of multires
- we build a pbvh over the modified mesh, in other cases the base mesh
- is being sculpted, so we build a pbvh from that. */
+ * we build a pbvh over the modified mesh, in other cases the base mesh
+ * is being sculpted, so we build a pbvh from that. */
if(grid_pbvh) {
ccgdm_create_grids(dm);
@@ -2846,7 +2795,7 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
ob->sculpt->pbvh= ccgdm->pbvh = BLI_pbvh_new();
BLI_pbvh_build_grids(ccgdm->pbvh, ccgdm->gridData, ccgdm->gridAdjacency,
- numGrids, gridSize, (void**)ccgdm->gridFaces);
+ numGrids, gridSize, (void**)ccgdm->gridFaces, ccgdm->gridFlagMats);
} else if(ob->type == OB_MESH) {
Mesh *me= ob->data;
ob->sculpt->pbvh= ccgdm->pbvh = BLI_pbvh_new();
@@ -2882,7 +2831,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
int vertNum, edgeNum, faceNum;
int *vertOrigIndex, *faceOrigIndex, *polyOrigIndex, *base_polyOrigIndex; /* *edgeOrigIndex - as yet, unused */
short *edgeFlags;
- char *faceFlags;
+ DMFlagMat *faceFlags;
int *loopidx = NULL, *vertidx = NULL;
BLI_array_declare(loopidx);
BLI_array_declare(vertidx);
@@ -2958,6 +2907,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgdm->dm.getGridData = ccgDM_getGridData;
ccgdm->dm.getGridAdjacency = ccgDM_getGridAdjacency;
ccgdm->dm.getGridOffset = ccgDM_getGridOffset;
+ ccgdm->dm.getGridFlagMats = ccgDM_getGridFlagMats;
ccgdm->dm.getPolyMap = ccgDM_getPolyMap;
ccgdm->dm.getPBVH = ccgDM_getPBVH;
@@ -2978,7 +2928,6 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgdm->dm.drawEdges = ccgDM_drawEdges;
ccgdm->dm.drawLooseEdges = ccgDM_drawLooseEdges;
ccgdm->dm.drawFacesSolid = ccgDM_drawFacesSolid;
- ccgdm->dm.drawFacesColored = ccgDM_drawFacesColored;
ccgdm->dm.drawFacesTex = ccgDM_drawFacesTex;
ccgdm->dm.drawFacesGLSL = ccgDM_drawFacesGLSL;
ccgdm->dm.drawMappedFaces = ccgDM_drawMappedFaces;
@@ -3021,7 +2970,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
for(; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(fi);
- ccgdm->faceMap[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f))].face = f;
+ ccgdm->faceMap[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))].face = f;
}
ccgFaceIterator_free(fi);
@@ -3047,8 +2996,8 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
base_polyOrigIndex = CustomData_get_layer(&dm->polyData, CD_ORIGINDEX);
/*CDDM hack*/
- edgeFlags = ccgdm->edgeFlags = MEM_callocN(sizeof(short)*totedge, "faceFlags");
- faceFlags = ccgdm->faceFlags = MEM_callocN(sizeof(char)*2*totface, "faceFlags");
+ edgeFlags = ccgdm->edgeFlags = MEM_callocN(sizeof(short)*totedge, "edgeFlags");
+ faceFlags = ccgdm->faceFlags = MEM_callocN(sizeof(DMFlagMat)*totface, "faceFlags");
vertOrigIndex = DM_get_vert_data_layer(&ccgdm->dm, CD_ORIGINDEX);
/*edgeOrigIndex = DM_get_edge_data_layer(&ccgdm->dm, CD_ORIGINDEX);*/
@@ -3066,13 +3015,13 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
has_edge_origindex = CustomData_has_layer(&ccgdm->dm.edgeData, CD_ORIGINDEX);
- faceNum = 0;
+
loopindex = loopindex2 = 0; //current loop index
for (index = 0; index < totface; index++) {
CCGFace *f = ccgdm->faceMap[index].face;
int numVerts = ccgSubSurf_getFaceNumVerts(f);
int numFinalEdges = numVerts * (gridSideEdges + gridInternalEdges);
- int origIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f));
+ int origIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
int g2_wid = gridCuts+2;
float *w2;
int s, x, y;
@@ -3085,9 +3034,9 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgdm->faceMap[index].startEdge = edgeNum;
ccgdm->faceMap[index].startFace = faceNum;
- faceFlags[0] = mpoly ? mpoly[origIndex].flag : 0;
- faceFlags[1] = mpoly ? mpoly[origIndex].mat_nr : 0;
- faceFlags += 2;
+ faceFlags->flag = mpoly ? mpoly[origIndex].flag : 0;
+ faceFlags->mat_nr = mpoly ? mpoly[origIndex].mat_nr : 0;
+ faceFlags++;
/* set the face base vert */
*((int*)ccgSubSurf_getFaceUserData(ss, f)) = vertNum;
@@ -3101,7 +3050,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
BLI_array_empty(vertidx);
BLI_array_growitems(vertidx, numVerts);
for (s = 0; s < numVerts; s++) {
- CCGVert *v = ccgSubSurf_getFaceVert(ss, f, s);
+ CCGVert *v = ccgSubSurf_getFaceVert(f, s);
vertidx[s] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v));
}
@@ -3423,7 +3372,7 @@ void subsurf_calculate_limit_positions(Mesh *me, float (*positions_r)[3])
}
/* ad-hoc correction for boundary vertices, to at least avoid them
- moving completely out of place (brecht) */
+ * moving completely out of place (brecht) */
if(numFaces && numFaces != N)
mul_v3_fl(face_sum, (float)N/(float)numFaces);
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 8e3ec4766e9..3f382cc5543 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -29,7 +29,7 @@
* \ingroup bke
*/
-
+#include <stdlib.h> /* abort */
#include <string.h> /* strstr */
#include <sys/types.h>
#include <sys/stat.h>
@@ -38,7 +38,11 @@
#include "MEM_guardedalloc.h"
-#include "BLI_blenlib.h"
+#include "BLI_path_util.h"
+#include "BLI_string.h"
+#include "BLI_string_cursor_utf8.h"
+#include "BLI_string_utf8.h"
+#include "BLI_listbase.h"
#include "BLI_utildefines.h"
#include "DNA_constraint_types.h"
@@ -61,68 +65,67 @@
#include "BPY_extern.h"
#endif
-/***************/ /*
-
-How Texts should work
---
-A text should relate to a file as follows -
-(Text *)->name should be the place where the
- file will or has been saved.
-
-(Text *)->flags has the following bits
- TXT_ISDIRTY - should always be set if the file in mem. differs from
- the file on disk, or if there is no file on disk.
- TXT_ISMEM - should always be set if the Text has not been mapped to
- a file, in which case (Text *)->name may be NULL or garbage.
- TXT_ISEXT - should always be set if the Text is not to be written into
- the .blend
- TXT_ISSCRIPT - should be set if the user has designated the text
- as a script. (NEW: this was unused, but now it is needed by
- space handler script links (see header_view3d.c, for example)
-
-->>> see also: /makesdna/DNA_text_types.h
-
-Display
---
-The st->top determines at what line the top of the text is displayed.
-If the user moves the cursor the st containing that cursor should
-be popped ... other st's retain their own top location.
-
-Markers
---
-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.
-
-The mrk->clr field is used to visually group markers where the flags may not
-match. A template system, for example, may allow editing of repeating tokens
-(in one group) but include other marked positions (in another group) all in the
-same template with the same color.
-
-Undo
---
-Undo/Redo works by storing
-events in a queue, and a pointer
-to the current position in the
-queue...
-
-Events are stored using an
-arbitrary op-code system
-to keep track of
-a) the two cursors (normal and selected)
-b) input (visible and control (ie backspace))
-
-input data is stored as its
-ASCII value, the opcodes are
-then selected to not conflict.
-
-opcodes with data in between are
-written at the beginning and end
-of the data to allow undo and redo
-to simply check the code at the current
-undo position
-
-*/ /***************/
+/*
+ * How Texts should work
+ * --
+ * A text should relate to a file as follows -
+ * (Text *)->name should be the place where the
+ * file will or has been saved.
+ *
+ * (Text *)->flags has the following bits
+ * TXT_ISDIRTY - should always be set if the file in mem. differs from
+ * the file on disk, or if there is no file on disk.
+ * TXT_ISMEM - should always be set if the Text has not been mapped to
+ * a file, in which case (Text *)->name may be NULL or garbage.
+ * TXT_ISEXT - should always be set if the Text is not to be written into
+ * the .blend
+ * TXT_ISSCRIPT - should be set if the user has designated the text
+ * as a script. (NEW: this was unused, but now it is needed by
+ * space handler script links (see header_view3d.c, for example)
+ *
+ * ->>> see also: /makesdna/DNA_text_types.h
+ *
+ * Display
+ * --
+ * The st->top determines at what line the top of the text is displayed.
+ * If the user moves the cursor the st containing that cursor should
+ * be popped ... other st's retain their own top location.
+ *
+ * Markers
+ * --
+ * 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.
+ *
+ * The mrk->clr field is used to visually group markers where the flags may not
+ * match. A template system, for example, may allow editing of repeating tokens
+ * (in one group) but include other marked positions (in another group) all in the
+ * same template with the same color.
+ *
+ * Undo
+ * --
+ * Undo/Redo works by storing
+ * events in a queue, and a pointer
+ * to the current position in the
+ * queue...
+ *
+ * Events are stored using an
+ * arbitrary op-code system
+ * to keep track of
+ * a) the two cursors (normal and selected)
+ * b) input (visible and control (ie backspace))
+ *
+ * input data is stored as its
+ * ASCII value, the opcodes are
+ * then selected to not conflict.
+ *
+ * opcodes with data in between are
+ * written at the beginning and end
+ * of the data to allow undo and redo
+ * to simply check the code at the current
+ * undo position
+ *
+ */
/***/
@@ -440,11 +443,11 @@ Text *add_text(const char *file, const char *relpath)
}
/* create new line in cases:
- - rest of line (if last line in file hasn't got \n terminator).
- in this case content of such line would be used to fill text line buffer
- - file is empty. in this case new line is needed to start editing from.
- - last characted in buffer is \n. in this case new line is needed to
- deal with newline at end of file. (see [#28087]) (sergey) */
+ * - rest of line (if last line in file hasn't got \n terminator).
+ * in this case content of such line would be used to fill text line buffer
+ * - file is empty. in this case new line is needed to start editing from.
+ * - last characted in buffer is \n. in this case new line is needed to
+ * deal with newline at end of file. (see [#28087]) (sergey) */
if (llen!=0 || ta->nlines==0 || buffer[len-1]=='\n') {
tmp= (TextLine*) MEM_mallocN(sizeof(TextLine), "textline");
tmp->line= (char*) MEM_mallocN(llen+1, "textline_string");
@@ -731,14 +734,6 @@ static void txt_make_dirty (Text *text)
#endif
}
-/* 0:whitespace, 1:punct, 2:alphanumeric */
-static short txt_char_type(unsigned int ch)
-{
- if (iswspace(ch)) return 0;
- if (iswalpha(ch) || iswdigit(ch)) return 2;
- return 1;
-}
-
/****************************/
/* Cursor utility functions */
/****************************/
@@ -957,32 +952,32 @@ void txt_move_right(Text *text, short sel)
void txt_jump_left(Text *text, short sel)
{
TextLine **linep, *oldl;
- int *charp, oldc, count, i;
+ int *charp, oldc, oldflags, i;
unsigned char oldu;
+ int pos;
if (!text) return;
if(sel) txt_curs_sel(text, &linep, &charp);
else { txt_pop_first(text); txt_curs_cur(text, &linep, &charp); }
if (!*linep) return;
+ oldflags = text->flags;
+ text->flags &= ~TXT_TABSTOSPACES;
+
oldl= *linep;
oldc= *charp;
oldu= undoing;
undoing= 1; /* Don't push individual moves to undo stack */
- count= 0;
- for (i=0; i<3; i++) {
- if (count < 2) {
- while (*charp>0) {
- char *sym= BLI_str_prev_char_utf8((*linep)->line + *charp);
- if (txt_char_type(BLI_str_utf8_as_unicode(sym))==i) {
- txt_move_left(text, sel);
- count++;
- } else break;
- }
- }
+ pos = *charp;
+ BLI_str_cursor_step_utf8((*linep)->line, (*linep)->len,
+ &pos, STRCUR_DIR_PREV,
+ STRCUR_JUMP_DELIM);
+ for (i = *charp; i > pos; i--) {
+ txt_move_left(text, sel);
}
- if (count==0) txt_move_left(text, sel);
+
+ text->flags = oldflags;
undoing= oldu;
if(!undoing) txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, txt_get_span(text->lines.first, oldl), oldc, txt_get_span(text->lines.first, *linep), (unsigned short)*charp);
@@ -991,32 +986,32 @@ void txt_jump_left(Text *text, short sel)
void txt_jump_right(Text *text, short sel)
{
TextLine **linep, *oldl;
- int *charp, oldc, count, i;
+ int *charp, oldc, oldflags, i;
unsigned char oldu;
+ int pos;
if (!text) return;
if(sel) txt_curs_sel(text, &linep, &charp);
else { txt_pop_last(text); txt_curs_cur(text, &linep, &charp); }
if (!*linep) return;
+ oldflags = text->flags;
+ text->flags &= ~TXT_TABSTOSPACES;
+
oldl= *linep;
oldc= *charp;
oldu= undoing;
undoing= 1; /* Don't push individual moves to undo stack */
- count= 0;
- for (i=0; i<3; i++) {
- if (count < 2) {
- while (*charp<(*linep)->len) {
- char *sym= (*linep)->line + *charp;
- if (txt_char_type(BLI_str_utf8_as_unicode(sym))==i) {
- txt_move_right(text, sel);
- count++;
- } else break;
- }
- }
+ pos = *charp;
+ BLI_str_cursor_step_utf8((*linep)->line, (*linep)->len,
+ &pos, STRCUR_DIR_NEXT,
+ STRCUR_JUMP_DELIM);
+ for (i = *charp; i < pos; i++) {
+ txt_move_right(text, sel);
}
- if (count==0) txt_move_right(text, sel);
+
+ text->flags = oldflags;
undoing= oldu;
if(!undoing) txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, txt_get_span(text->lines.first, oldl), oldc, txt_get_span(text->lines.first, *linep), (unsigned short)*charp);
@@ -3062,8 +3057,8 @@ void txt_add_marker(Text *text, TextLine *line, int start, int end, const unsign
}
/* Returns the first matching marker on the specified line between two points.
- If the group or flags fields are non-zero the returned flag must be in the
- specified group and have at least the specified flags set. */
+ * If the group or flags fields are non-zero the returned flag must be in the
+ * specified group and have at least the specified flags set. */
TextMarker *txt_find_marker_region(Text *text, TextLine *line, int start, int end, int group, int flags)
{
TextMarker *marker, *next;
@@ -3085,8 +3080,8 @@ TextMarker *txt_find_marker_region(Text *text, TextLine *line, int start, int en
}
/* Clears all markers on the specified line between two points. If the group or
- flags fields are non-zero the returned flag must be in the specified group
- and have at least the specified flags set. */
+ * flags fields are non-zero the returned flag must be in the specified group
+ * and have at least the specified flags set. */
short txt_clear_marker_region(Text *text, TextLine *line, int start, int end, int group, int flags)
{
TextMarker *marker, *next;
@@ -3111,8 +3106,8 @@ short txt_clear_marker_region(Text *text, TextLine *line, int start, int end, in
}
/* Clears all markers in the specified group (if given) with at least the
- specified flags set. Useful for clearing temporary markers (group=0,
- flags=TMARK_TEMP) */
+ * specified flags set. Useful for clearing temporary markers (group=0,
+ * flags=TMARK_TEMP) */
short txt_clear_markers(Text *text, int group, int flags)
{
TextMarker *marker, *next;
@@ -3131,7 +3126,7 @@ short txt_clear_markers(Text *text, int group, int flags)
}
/* Finds the marker at the specified line and cursor position with at least the
- specified flags set in the given group (if non-zero). */
+ * specified flags set in the given group (if non-zero). */
TextMarker *txt_find_marker(Text *text, TextLine *line, int curs, int group, int flags)
{
TextMarker *marker;
@@ -3150,7 +3145,7 @@ TextMarker *txt_find_marker(Text *text, TextLine *line, int curs, int group, int
}
/* Finds the previous marker in the same group. If no other is found, the same
- marker will be returned */
+ * marker will be returned */
TextMarker *txt_prev_marker(Text *text, TextMarker *marker)
{
TextMarker *tmp= marker;
@@ -3164,7 +3159,7 @@ TextMarker *txt_prev_marker(Text *text, TextMarker *marker)
}
/* Finds the next marker in the same group. If no other is found, the same
- marker will be returned */
+ * marker will be returned */
TextMarker *txt_next_marker(Text *text, TextMarker *marker)
{
TextMarker *tmp= marker;
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 4c40dca3365..23a30b6522b 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -911,9 +911,9 @@ void make_local_texture(Tex *tex)
int a, is_local= FALSE, is_lib= FALSE;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(tex->id.lib==NULL) return;
@@ -1157,8 +1157,8 @@ Tex *give_current_material_texture(Material *ma)
if(ma && ma->use_nodes && ma->nodetree) {
/* first check texture, then material, this works together
- with a hack that clears the active ID flag for textures on
- making a material node active */
+ * with a hack that clears the active ID flag for textures on
+ * making a material node active */
node= nodeGetActiveID(ma->nodetree, ID_TE);
if(node) {
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 4a509473ac8..1d275cfdb28 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -745,8 +745,8 @@ static void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
}
/* duplicate currently operating tracks to temporary list.
- this is needed to keep names in unique state and it's faster to change names
- of currently operating tracks (if needed) */
+ * this is needed to keep names in unique state and it's faster to change names
+ * of currently operating tracks (if needed) */
for(a= 0; a<map->num_tracks; a++) {
int replace_sel= 0, replace_rot= 0;
MovieTrackingTrack *new_track, *old;
@@ -977,7 +977,7 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u
* would be used for images
* - MCLIP_USE_PROXY_CUSTOM_DIR is needed because proxy/timecode files might
* be stored in a different location
- * ignore all the rest pssible flags for now */
+ * ignore all the rest possible flags for now */
context->clip_flag= clip->flag&MCLIP_TIMECODE_FLAGS;
context->user= *user;
@@ -1480,7 +1480,7 @@ int BKE_tracking_next(MovieTrackingContext *context)
#pragma omp critical
{
/* check if there's no keyframe/tracked markers before tracking marker.
- if so -- create disabled marker before currently tracking "segment" */
+ * if so -- create disabled marker before currently tracking "segment" */
put_disabled_marker(track, marker, !context->backwards, 0);
}
}
@@ -2451,8 +2451,8 @@ static void calculate_stabdata(MovieTracking *tracking, int framenr, float width
*scale= (stab->scale-1.0f)*stab->scaleinf+1.0f;
*angle= 0.0f;
- loc[0]= (firstmedian[0]-median[0])*width;
- loc[1]= (firstmedian[1]-median[1])*height;
+ loc[0]= (firstmedian[0]-median[0])*width*(*scale);
+ loc[1]= (firstmedian[1]-median[1])*height*(*scale);
mul_v2_fl(loc, stab->locinf);
@@ -2492,7 +2492,7 @@ static float stabilization_auto_scale_factor(MovieTracking *tracking, int width,
if(stabilization_median_point(tracking, 1, firstmedian)) {
int sfra= INT_MAX, efra= INT_MIN, cfra;
- float delta[2]= {0.0f, 0.0f}, scalex= 1.0f, scaley= 1.0f;
+ float scale= 1.0f;
MovieTrackingTrack *track;
stab->scale= 1.0f;
@@ -2509,66 +2509,82 @@ static float stabilization_auto_scale_factor(MovieTracking *tracking, int width,
}
for(cfra=sfra; cfra<=efra; cfra++) {
- float median[2], near[2];
- float loc[2], scale, angle;
+ float median[2];
+ float loc[2], angle, tmp_scale;
+ int i;
+ float mat[4][4];
+ float points[4][2]={{0.0f, 0.0f}, {0.0f, height}, {width, height}, {width, 0.0f}};
+ float si, co;
stabilization_median_point(tracking, cfra, median);
- calculate_stabdata(tracking, cfra, width, height, firstmedian, median,
- loc, &scale, &angle);
+ calculate_stabdata(tracking, cfra, width, height, firstmedian, median, loc, &tmp_scale, &angle);
- if(angle==0.0f) {
- loc[0]= fabsf(loc[0]);
- loc[1]= fabsf(loc[1]);
+ BKE_tracking_stabdata_to_mat4(width, height, aspect, loc, 1.0f, angle, mat);
- delta[0]= MAX2(delta[0], loc[0]);
- delta[1]= MAX2(delta[1], loc[1]);
+ si = sin(angle);
+ co = cos(angle);
- near[0]= MIN2(median[0], 1.0f-median[0]);
- near[1]= MIN2(median[1], 1.0f-median[1]);
- near[0]= MAX2(near[0], 0.05f);
- near[1]= MAX2(near[1], 0.05f);
+ for(i= 0; i<4; i++) {
+ int j;
+ float a[3]= {0.0f, 0.0f, 0.0f}, b[3]= {0.0f, 0.0f, 0.0f};
- scalex= 1.0f+delta[0]/(near[0]*width);
- scaley= 1.0f+delta[1]/(near[1]*height);
- } else {
- int i;
- float mat[4][4];
- float points[4][2]={{0.0f, 0.0f}, {0.0f, height}, {width, height}, {width, 0.0f}};
+ copy_v3_v3(a, points[i]);
+ copy_v3_v3(b, points[(i+1)%4]);
+
+ mul_m4_v3(mat, a);
+ mul_m4_v3(mat, b);
- BKE_tracking_stabdata_to_mat4(width, height, aspect, loc, scale, angle, mat);
+ for(j= 0; j<4; j++) {
+ float point[3]= {points[j][0], points[j][1], 0.0f};
+ float v1[3], v2[3];
- for(i= 0; i<4; i++) {
- int j;
- float a[3]= {0.0f, 0.0f, 0.0f}, b[3]= {0.0f, 0.0f, 0.0f};
+ sub_v3_v3v3(v1, b, a);
+ sub_v3_v3v3(v2, point, a);
- copy_v3_v3(a, points[i]);
- copy_v3_v3(b, points[(i+1)%4]);
+ if(cross_v2v2(v1, v2) >= 0.0f) {
+ const float rotDx[4][2] = {{1.0f, 0.0f}, {0.0f, -1.0f}, {-1.0f, 0.0f}, {0.0f, 1.0f}};
+ const float rotDy[4][2] = {{0.0f, 1.0f}, {1.0f, 0.0f}, {0.0f, -1.0f}, {-1.0f, 0.0f}};
- mul_m4_v3(mat, a);
- mul_m4_v3(mat, b);
+ float dx = loc[0] * rotDx[j][0] + loc[1] * rotDx[j][1],
+ dy = loc[0] * rotDy[j][0] + loc[1] * rotDy[j][1];
- for(j= 0; j<4; j++) {
- float point[3]= {points[j][0], points[j][1], 0.0f};
- float v1[3], v2[3];
+ float w, h, E, F, G, H, I, J, K, S;
+
+ if(j % 2) {
+ w = (float)height / 2.0f;
+ h = (float)width / 2.0f;
+ }
+ else {
+ w = (float)width / 2.0f;
+ h = (float)height / 2.0f;
+ }
- sub_v3_v3v3(v1, b, a);
- sub_v3_v3v3(v2, point, a);
+ E = -w*co + h*si;
+ F = -h*co - w*si;
- if(cross_v2v2(v1, v2) >= 0.0f) {
- float dist= dist_to_line_v2(point, a, b);
- if(i%2==0) {
- scalex= MAX2(scalex, (width+2*dist)/width);
- } else {
- scaley= MAX2(scaley, (height+2*dist)/height);
- }
+ if ((i % 2) == (j % 2)) {
+ G = -w*co - h*si;
+ H = h*co - w*si;
+ }
+ else {
+ G = w*co + h*si;
+ H = -h*co + w*si;
}
+
+ I = F - H;
+ J = G - E;
+ K = G*F - E*H;
+
+ S = (-w*I - h*J) / (dx*I + dy*J + K);
+
+ scale = MAX2(scale, S);
}
}
}
}
- stab->scale= MAX2(scalex, scaley);
+ stab->scale= scale;
if(stab->maxscale>0.0f)
stab->scale= MIN2(stab->scale, stab->maxscale);
@@ -2684,7 +2700,7 @@ ImBuf *BKE_tracking_stabilize(MovieTracking *tracking, int framenr, ImBuf *ibuf,
if(tangle==0.0f) {
/* if angle is zero, then it's much faster to use rect copy
- but could be issues with subpixel precisions */
+ * but could be issues with subpixel precisions */
IMB_rectcpy(tmpibuf, ibuf, tloc[0]-(tscale-1.0f)*width/2.0f, tloc[1]-(tscale-1.0f)*height/2.0f, 0, 0, ibuf->x, ibuf->y);
} else {
float mat[4][4];
@@ -2749,7 +2765,7 @@ void BKE_tracking_stabdata_to_mat4(int width, int height, float aspect, float lo
rotate_m4(rmat, 'Z', angle); /* rotation matrix */
/* compose transformation matrix */
- mul_serie_m4(mat, amat, lmat, cmat, rmat, smat, icmat, iamat, NULL);
+ mul_serie_m4(mat, lmat, cmat, amat, rmat, iamat, smat, icmat, NULL);
}
MovieDistortion *BKE_tracking_distortion_create(void)
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index 9ab91fce302..fba0cba42e0 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -35,7 +35,6 @@
#include "BLI_string.h"
#include "BLI_winstuff.h"
-
#define TEMP_STR_SIZE 256
#define SEP_CHR '#'
@@ -76,15 +75,15 @@
/* define a single unit */
typedef struct bUnitDef {
const char *name;
- const char *name_plural; /* abused a bit for the display name */
- const char *name_short; /* this is used for display*/
- const char *name_alt; /* keyboard-friendly ASCII-only version of name_short, can be NULL */
- /* if name_short has non-ASCII chars, name_alt should be present */
-
- const char *name_display; /* can be NULL */
+ const char *name_plural; /* abused a bit for the display name */
+ const char *name_short; /* this is used for display*/
+ const char *name_alt; /* keyboard-friendly ASCII-only version of name_short, can be NULL */
+ /* if name_short has non-ASCII chars, name_alt should be present */
+
+ const char *name_display; /* can be NULL */
double scalar;
- double bias; /* not used yet, needed for converting temperature */
+ double bias; /* not used yet, needed for converting temperature */
int flag;
} bUnitDef;
@@ -94,19 +93,15 @@ typedef struct bUnitDef {
/* define a single unit */
typedef struct bUnitCollection {
struct bUnitDef *units;
- int base_unit; /* basic unit index (when user doesn't specify unit explicitly) */
- int flag; /* options for this system */
- int length; /* to quickly find the last item */
+ int base_unit; /* basic unit index (when user doesn't specify unit explicitly) */
+ int flag; /* options for this system */
+ int length; /* to quickly find the last item */
} bUnitCollection;
/* Dummy */
-static struct bUnitDef buDummyDef[] = {
- {"", NULL, "", NULL, NULL, 1.0, 0.0},
- {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
-};
+static struct bUnitDef buDummyDef[] = { {"", NULL, "", NULL, NULL, 1.0, 0.0}, {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}};
static struct bUnitCollection buDummyCollecton = {buDummyDef, 0, 0, sizeof(buDummyDef)};
-
/* Lengths */
static struct bUnitDef buMetricLenDef[] = {
{"kilometer", "kilometers", "km", NULL, "Kilometers", UN_SC_KM, 0.0, B_UNIT_DEF_NONE},
@@ -120,10 +115,10 @@ static struct bUnitDef buMetricLenDef[] = {
/* These get displayed because of float precision problems in the transform header,
* could work around, but for now probably people wont use these */
- /*
+#if 0
{"nanometer", "Nanometers", "nm", NULL, 0.000000001, 0.0, B_UNIT_DEF_NONE},
{"picometer", "Picometers", "pm", NULL, 0.000000000001, 0.0,B_UNIT_DEF_NONE},
- */
+#endif
{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buMetricLenCollecton = {buMetricLenDef, 3, 0, sizeof(buMetricLenDef)/sizeof(bUnitDef)};
@@ -292,85 +287,83 @@ static bUnitDef *unit_default(bUnitCollection *usys)
static bUnitDef *unit_best_fit(double value, bUnitCollection *usys, bUnitDef *unit_start, int suppress)
{
bUnitDef *unit;
- double value_abs= value>0.0?value:-value;
+ double value_abs = value > 0.0 ? value : -value;
- for (unit= unit_start ? unit_start:usys->units; unit->name; unit++) {
+ for (unit = unit_start ? unit_start : usys->units; unit->name; unit++) {
if (suppress && (unit->flag & B_UNIT_DEF_SUPPRESS))
continue;
/* scale down scalar so 1cm doesnt convert to 10mm because of float error */
- if (value_abs >= unit->scalar*(1.0-EPS))
+ if (value_abs >= unit->scalar * (1.0 - EPS))
return unit;
}
return unit_default(usys);
}
-
-
/* convert into 2 units and 2 values for "2ft, 3inch" syntax */
-static void unit_dual_convert(double value, bUnitCollection *usys,
- bUnitDef **unit_a, bUnitDef **unit_b, double *value_a, double *value_b)
+static void unit_dual_convert(double value, bUnitCollection *usys, bUnitDef **unit_a, bUnitDef **unit_b,
+ double *value_a, double *value_b)
{
- bUnitDef *unit= unit_best_fit(value, usys, NULL, 1);
+ bUnitDef *unit = unit_best_fit(value, usys, NULL, 1);
- *value_a= (value < 0.0 ? ceil:floor)(value/unit->scalar) * unit->scalar;
- *value_b= value - (*value_a);
+ *value_a = (value < 0.0 ? ceil : floor)(value / unit->scalar) * unit->scalar;
+ *value_b = value - (*value_a);
- *unit_a= unit;
- *unit_b= unit_best_fit(*value_b, usys, *unit_a, 1);
+ *unit_a = unit;
+ *unit_b = unit_best_fit(*value_b, usys, *unit_a, 1);
}
static int unit_as_string(char *str, int len_max, double value, int prec, bUnitCollection *usys,
- /* non exposed options */
- bUnitDef *unit, char pad)
+ /* non exposed options */
+ bUnitDef *unit, char pad)
{
double value_conv;
int len, i;
-
+
if (unit) {
/* use unit without finding the best one */
}
else if (value == 0.0) {
/* use the default units since there is no way to convert */
- unit= unit_default(usys);
+ unit = unit_default(usys);
}
else {
- unit= unit_best_fit(value, usys, NULL, 1);
+ unit = unit_best_fit(value, usys, NULL, 1);
}
- value_conv= value/unit->scalar;
+ value_conv = value / unit->scalar;
/* Convert to a string */
{
- len= BLI_snprintf(str, len_max, "%.*f", prec, value_conv);
+ len = BLI_snprintf(str, len_max, "%.*f", prec, value_conv);
if (len >= len_max)
- len= len_max;
+ len = len_max;
}
-
+
/* Add unit prefix and strip zeros */
/* replace trailing zero's with spaces
* so the number is less complicated but allignment in a button wont
* jump about while dragging */
- i= len-1;
+ i = len - 1;
- while(i>0 && str[i]=='0') { /* 4.300 -> 4.3 */
- str[i--]= pad;
+ while (i > 0 && str[i] == '0') { /* 4.300 -> 4.3 */
+ str[i--] = pad;
}
- if (i>0 && str[i]=='.') { /* 10. -> 10 */
- str[i--]= pad;
+ if (i > 0 && str[i] == '.') { /* 10. -> 10 */
+ str[i--] = pad;
}
-
+
/* Now add the suffix */
- if (i<len_max) {
- int j=0;
+ if (i < len_max) {
+ int j = 0;
i++;
- while(unit->name_short[j] && (i < len_max)) {
- str[i++]= unit->name_short[j++];
+ while (unit->name_short[j] && (i < len_max)) {
+ str[i++] = unit->name_short[j++];
}
if (pad) {
@@ -378,64 +371,62 @@ static int unit_as_string(char *str, int len_max, double value, int prec, bUnitC
* the unit name only used padded chars,
* In that case add padding for the name. */
- while(i<=len+j && (i < len_max)) {
- str[i++]= pad;
+ while (i <= len + j && (i < len_max)) {
+ str[i++] = pad;
}
}
}
/* terminate no matter whats done with padding above */
if (i >= len_max)
- i= len_max-1;
+ i = len_max - 1;
str[i] = '\0';
return i;
}
-
/* Used for drawing number buttons, try keep fast */
void bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, int pad)
{
bUnitCollection *usys = unit_get_system(system, type);
- if (usys==NULL || usys->units[0].name==NULL)
- usys= &buDummyCollecton;
-
+ if (usys == NULL || usys->units[0].name == NULL)
+ usys = &buDummyCollecton;
+
/* split output makes sense only for length, mass and time */
- if (split && (type==B_UNIT_LENGTH || type==B_UNIT_MASS || type==B_UNIT_TIME)) {
+ if (split && (type == B_UNIT_LENGTH || type == B_UNIT_MASS || type == B_UNIT_TIME)) {
bUnitDef *unit_a, *unit_b;
double value_a, value_b;
- unit_dual_convert(value, usys, &unit_a, &unit_b, &value_a, &value_b);
+ unit_dual_convert(value, usys, &unit_a, &unit_b, &value_a, &value_b);
/* check the 2 is a smaller unit */
if (unit_b > unit_a) {
- int i= unit_as_string(str, len_max, value_a, prec, usys, unit_a, '\0');
+ int i = unit_as_string(str, len_max, value_a, prec, usys, unit_a, '\0');
/* is there enough space for at least 1 char of the next unit? */
- if (i+2 < len_max) {
- str[i++]= ' ';
+ if (i + 2 < len_max) {
+ str[i++] = ' ';
/* use low precision since this is a smaller unit */
- unit_as_string(str+i, len_max-i, value_b, prec?1:0, usys, unit_b, '\0');
+ unit_as_string(str + i, len_max - i, value_b, prec ? 1 : 0, usys, unit_b, '\0');
}
return;
}
}
- unit_as_string(str, len_max, value, prec, usys, NULL, pad?' ':'\0');
+ unit_as_string(str, len_max, value, prec, usys, NULL, pad ? ' ' : '\0');
}
-
static const char *unit_find_str(const char *str, const char *substr)
{
const char *str_found;
if (substr && substr[0] != '\0') {
- str_found= strstr(str, substr);
+ str_found = strstr(str, substr);
if (str_found) {
/* previous char cannot be a letter */
- if (str_found == str || isalpha(*(str_found-1))==0) {
+ if (str_found == str || isalpha(*(str_found-1)) == 0) {
/* next char cannot be alphanum */
int len_name = strlen(substr);
@@ -462,60 +453,60 @@ static const char *unit_find_str(const char *str, const char *substr)
/* not too strict, (- = * /) are most common */
static int ch_is_op(char op)
{
- switch(op) {
- case '+':
- case '-':
- case '*':
- case '/':
- case '|':
- case '&':
- case '~':
- case '<':
- case '>':
- case '^':
- case '!':
- case '=':
- case '%':
- return 1;
- default:
- return 0;
+ switch (op) {
+ case '+':
+ case '-':
+ case '*':
+ case '/':
+ case '|':
+ case '&':
+ case '~':
+ case '<':
+ case '>':
+ case '^':
+ case '!':
+ case '=':
+ case '%':
+ return 1;
+ default:
+ return 0;
}
}
-static int unit_scale_str(char *str, int len_max, char *str_tmp,
- double scale_pref, bUnitDef *unit, const char *replace_str)
+static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit,
+ const char *replace_str)
{
char *str_found;
- if ((len_max>0) && (str_found= (char *)unit_find_str(str, replace_str))) {
+ if ((len_max > 0) && (str_found = (char *)unit_find_str(str, replace_str))) {
/* XXX - investigate, does not respect len_max properly */
int len, len_num, len_name, len_move, found_ofs;
- found_ofs = (int)(str_found-str);
+ found_ofs = (int)(str_found - str);
- len= strlen(str);
+ len = strlen(str);
len_name = strlen(replace_str);
- len_move= (len - (found_ofs+len_name)) + 1; /* 1+ to copy the string terminator */
- len_num= BLI_snprintf(str_tmp, TEMP_STR_SIZE, "*%g"SEP_STR, unit->scalar/scale_pref); /* # removed later */
+ len_move = (len - (found_ofs + len_name)) + 1; /* 1+ to copy the string terminator */
+ len_num = BLI_snprintf(str_tmp, TEMP_STR_SIZE, "*%g"SEP_STR, unit->scalar / scale_pref); /* # removed later */
if (len_num > len_max)
- len_num= len_max;
+ len_num = len_max;
- if (found_ofs+len_num+len_move > len_max) {
+ if (found_ofs + len_num + len_move > len_max) {
/* can't move the whole string, move just as much as will fit */
- len_move -= (found_ofs+len_num+len_move) - len_max;
+ len_move -= (found_ofs + len_num + len_move) - len_max;
}
- if (len_move>0) {
+ if (len_move > 0) {
/* resize the last part of the string */
- memmove(str_found+len_num, str_found+len_name, len_move); /* may grow or shrink the string */
+ memmove(str_found + len_num, str_found + len_name, len_move); /* may grow or shrink the string */
}
- if (found_ofs+len_num > len_max) {
+ if (found_ofs + len_num > len_max) {
/* not even the number will fit into the string, only copy part of it */
- len_num -= (found_ofs+len_num) - len_max;
+ len_num -= (found_ofs + len_num) - len_max;
}
if (len_num > 0) {
@@ -525,28 +516,28 @@ static int unit_scale_str(char *str, int len_max, char *str_tmp,
/* since the null terminator wont be moved if the stringlen_max
* was not long enough to fit everything in it */
- str[len_max-1]= '\0';
+ str[len_max - 1] = '\0';
return found_ofs + len_num;
}
return 0;
}
static int unit_replace(char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit)
-{
- int ofs= 0;
- ofs += unit_scale_str(str+ofs, len_max-ofs, str_tmp, scale_pref, unit, unit->name_short);
- ofs += unit_scale_str(str+ofs, len_max-ofs, str_tmp, scale_pref, unit, unit->name_plural);
- ofs += unit_scale_str(str+ofs, len_max-ofs, str_tmp, scale_pref, unit, unit->name_alt);
- ofs += unit_scale_str(str+ofs, len_max-ofs, str_tmp, scale_pref, unit, unit->name);
+{
+ int ofs = 0;
+ ofs += unit_scale_str(str + ofs, len_max - ofs, str_tmp, scale_pref, unit, unit->name_short);
+ ofs += unit_scale_str(str + ofs, len_max - ofs, str_tmp, scale_pref, unit, unit->name_plural);
+ ofs += unit_scale_str(str + ofs, len_max - ofs, str_tmp, scale_pref, unit, unit->name_alt);
+ ofs += unit_scale_str(str + ofs, len_max - ofs, str_tmp, scale_pref, unit, unit->name);
return ofs;
}
static int unit_find(const char *str, bUnitDef *unit)
{
- if (unit_find_str(str, unit->name_short)) return 1;
- if (unit_find_str(str, unit->name_plural)) return 1;
- if (unit_find_str(str, unit->name_alt)) return 1;
- if (unit_find_str(str, unit->name)) return 1;
+ if (unit_find_str(str, unit->name_short)) return 1;
+ if (unit_find_str(str, unit->name_plural)) return 1;
+ if (unit_find_str(str, unit->name_alt)) return 1;
+ if (unit_find_str(str, unit->name)) return 1;
return 0;
}
@@ -554,11 +545,11 @@ static int unit_find(const char *str, bUnitDef *unit)
/* make a copy of the string that replaces the units with numbers
* this is used before parsing
* This is only used when evaluating user input and can afford to be a bit slower
- *
+ *
* This is to be used before python evaluation so..
* 10.1km -> 10.1*1000.0
* ...will be resolved by python.
- *
+ *
* values will be split by a comma's
* 5'2" -> 5'0.0254, 2*0.3048
*
@@ -572,66 +563,63 @@ int bUnit_ReplaceString(char *str, int len_max, const char *str_prev, double sca
bUnitDef *unit;
char str_tmp[TEMP_STR_SIZE];
- int change= 0;
+ int change = 0;
- if (usys==NULL || usys->units[0].name==NULL) {
+ if (usys == NULL || usys->units[0].name == NULL) {
return 0;
}
-
- { /* make lowercase */
+ { /* make lowercase */
int i;
- char *ch= str;
+ char *ch = str;
- for (i=0; (i>=len_max || *ch=='\0'); i++, ch++)
- if ((*ch>='A') && (*ch<='Z'))
- *ch += ('a'-'A');
+ for (i = 0; (i >= len_max || *ch == '\0'); i++, ch++)
+ if ((*ch >= 'A') && (*ch <= 'Z'))
+ *ch += ('a' - 'A');
}
-
- for (unit= usys->units; unit->name; unit++) {
- /* incase there are multiple instances */
- while(unit_replace(str, len_max, str_tmp, scale_pref, unit))
- change= 1;
+ for (unit = usys->units; unit->name; unit++) {
+ /* in case there are multiple instances */
+ while (unit_replace(str, len_max, str_tmp, scale_pref, unit))
+ change = 1;
}
- unit= NULL;
+ unit = NULL;
{
/* try other unit systems now, so we can evaluate imperial when metric is set for eg. */
bUnitCollection *usys_iter;
int system_iter;
- for (system_iter= 0; system_iter<UNIT_SYSTEM_TOT; system_iter++) {
+ for (system_iter = 0; system_iter < UNIT_SYSTEM_TOT; system_iter++) {
if (system_iter != system) {
- usys_iter= unit_get_system(system_iter, type);
+ usys_iter = unit_get_system(system_iter, type);
if (usys_iter) {
- for (unit= usys_iter->units; unit->name; unit++) {
+ for (unit = usys_iter->units; unit->name; unit++) {
int ofs = 0;
- /* incase there are multiple instances */
- while((ofs=unit_replace(str+ofs, len_max-ofs, str_tmp, scale_pref, unit)))
- change= 1;
+ /* in case there are multiple instances */
+ while ((ofs = unit_replace(str + ofs, len_max - ofs, str_tmp, scale_pref, unit)))
+ change = 1;
}
}
}
}
}
- unit= NULL;
-
- if (change==0) {
+ unit = NULL;
+
+ if (change == 0) {
/* no units given so infer a unit from the previous string or default */
if (str_prev) {
/* see which units the original value had */
- for (unit= usys->units; unit->name; unit++) {
+ for (unit = usys->units; unit->name; unit++) {
if (unit_find(str_prev, unit))
break;
}
}
- if (unit==NULL || unit->name == NULL)
- unit= unit_default(usys);
+ if (unit == NULL || unit->name == NULL)
+ unit = unit_default(usys);
-
- /* add the unit prefix and re-run, use brackets incase there was an expression given */
+ /* add the unit prefix and re-run, use brackets in case there was an expression given */
if (BLI_snprintf(str_tmp, sizeof(str_tmp), "(%s)%s", str, unit->name) < sizeof(str_tmp)) {
strncpy(str, str_tmp, len_max);
return bUnit_ReplaceString(str, len_max, NULL, scale_pref, system, type);
@@ -650,29 +638,29 @@ int bUnit_ReplaceString(char *str, int len_max, const char *str_prev, double sca
*
* */
{
- char *str_found= str;
- char *ch= str;
+ char *str_found = str;
+ char *ch = str;
- while((str_found= strchr(str_found, SEP_CHR))) {
+ while ((str_found = strchr(str_found, SEP_CHR))) {
- int op_found= 0;
+ int op_found = 0;
/* any operators after this?*/
- for (ch= str_found+1; *ch!='\0'; ch++) {
+ for (ch = str_found + 1; *ch != '\0'; ch++) {
- if (*ch==' ' || *ch=='\t') {
+ if (*ch == ' ' || *ch == '\t') {
/* do nothing */
}
- else if (ch_is_op(*ch) || *ch==',') { /* found an op, no need to insert a ,*/
- op_found= 1;
+ else if (ch_is_op(*ch) || *ch == ',') { /* found an op, no need to insert a ,*/
+ op_found = 1;
break;
}
else { /* found a non-op character */
- op_found= 0;
+ op_found = 0;
break;
}
}
- *str_found++ = op_found ? ' ':',';
+ *str_found++ = op_found ? ' ' : ',';
}
}
@@ -685,34 +673,33 @@ void bUnit_ToUnitAltName(char *str, int len_max, const char *orig_str, int syste
bUnitCollection *usys = unit_get_system(system, type);
bUnitDef *unit;
- bUnitDef *unit_def= unit_default(usys);
+ bUnitDef *unit_def = unit_default(usys);
/* find and substitute all units */
- for (unit= usys->units; unit->name; unit++) {
- if (len_max > 0 && (unit->name_alt || unit == unit_def))
- {
- const char *found= unit_find_str(orig_str, unit->name_short);
+ for (unit = usys->units; unit->name; unit++) {
+ if (len_max > 0 && (unit->name_alt || unit == unit_def)) {
+ const char *found = unit_find_str(orig_str, unit->name_short);
if (found) {
- int offset= (int)(found - orig_str);
- int len_name= 0;
+ int offset = (int)(found - orig_str);
+ int len_name = 0;
/* copy everything before the unit */
- offset= (offset<len_max? offset: len_max);
+ offset = (offset < len_max ? offset : len_max);
strncpy(str, orig_str, offset);
- str+= offset;
- orig_str+= offset + strlen(unit->name_short);
- len_max-= offset;
+ str += offset;
+ orig_str += offset + strlen(unit->name_short);
+ len_max -= offset;
/* print the alt_name */
if (unit->name_alt)
- len_name= BLI_snprintf(str, len_max, "%s", unit->name_alt);
+ len_name = BLI_snprintf(str, len_max, "%s", unit->name_alt);
else
- len_name= 0;
+ len_name = 0;
- len_name= (len_name<len_max? len_name: len_max);
- str+= len_name;
- len_max-= len_name;
+ len_name = (len_name < len_max ? len_name : len_max);
+ str += len_name;
+ len_max -= len_name;
}
}
}
@@ -726,11 +713,11 @@ double bUnit_ClosestScalar(double value, int system, int type)
bUnitCollection *usys = unit_get_system(system, type);
bUnitDef *unit;
- if (usys==NULL)
+ if (usys == NULL)
return -1;
- unit= unit_best_fit(value, usys, NULL, 1);
- if (unit==NULL)
+ unit = unit_best_fit(value, usys, NULL, 1);
+ if (unit == NULL)
return -1;
return unit->scalar;
@@ -748,18 +735,17 @@ int bUnit_IsValid(int system, int type)
return !(system < 0 || system > UNIT_SYSTEM_TOT || type < 0 || type > B_UNIT_TYPE_TOT);
}
-
void bUnit_GetSystem(void **usys_pt, int *len, int system, int type)
{
bUnitCollection *usys = unit_get_system(system, type);
- *usys_pt= usys;
+ *usys_pt = usys;
- if (usys==NULL) {
- *len= 0;
+ if (usys == NULL) {
+ *len = 0;
return;
}
- *len= usys->length;
+ *len = usys->length;
}
int bUnit_GetBaseUnit(void *usys_pt)
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index b3f1e140829..a4fc4c7bfe3 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -169,9 +169,9 @@ void make_local_world(World *wrld)
int is_local= FALSE, is_lib= FALSE;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(wrld->id.lib==NULL) return;
if(wrld->id.us==1) {
diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c
index dbb37ad9c1d..50212522d3a 100644
--- a/source/blender/blenkernel/intern/writeavi.c
+++ b/source/blender/blenkernel/intern/writeavi.c
@@ -112,7 +112,7 @@ bMovieHandle *BKE_get_movie_handle(const char imtype)
}
#endif
- /* incase all above are disabled */
+ /* in case all above are disabled */
(void)imtype;
return &mh;
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 9d68e1d899c..bca7f6ff7bb 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -627,8 +627,7 @@ static AVStream* alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex
if((c->codec_id >= CODEC_ID_PCM_S16LE) && (c->codec_id <= CODEC_ID_PCM_DVD))
audio_input_samples = audio_outbuf_size * 8 / c->bits_per_coded_sample / c->channels;
- else
- {
+ else {
audio_input_samples = c->frame_size;
if(c->frame_size * c->channels * sizeof(int16_t) * 4 > audio_outbuf_size)
audio_outbuf_size = c->frame_size * c->channels * sizeof(int16_t) * 4;
@@ -994,8 +993,7 @@ void end_ffmpeg(void)
}*/
#ifdef WITH_AUDASPACE
- if(audio_mixdown_device)
- {
+ if (audio_mixdown_device) {
AUD_closeReadDevice(audio_mixdown_device);
audio_mixdown_device = 0;
}
diff --git a/source/blender/blenlib/BLI_bitmap.h b/source/blender/blenlib/BLI_bitmap.h
index 16a6fb8ee15..2aed71a7d44 100644
--- a/source/blender/blenlib/BLI_bitmap.h
+++ b/source/blender/blenlib/BLI_bitmap.h
@@ -29,7 +29,7 @@
typedef unsigned int* BLI_bitmap;
/* warning: the bitmap does not keep track of its own size or check
- for out-of-bounds access */
+ * for out-of-bounds access */
/* internal use */
/* 2^5 = 32 (bits) */
@@ -46,7 +46,7 @@ typedef unsigned int* BLI_bitmap;
(BLI_BITMAP_NUM_BLOCKS(_tot) * sizeof(unsigned int))
/* allocate memory for a bitmap with '_tot' bits; free
- with MEM_freeN() */
+ * with MEM_freeN() */
#define BLI_BITMAP_NEW(_tot, _alloc_string) \
((BLI_bitmap)MEM_callocN(BLI_BITMAP_SIZE(_tot), \
_alloc_string))
diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h
index c802b083f1f..74b477bacaf 100644
--- a/source/blender/blenlib/BLI_blenlib.h
+++ b/source/blender/blenlib/BLI_blenlib.h
@@ -44,7 +44,7 @@
* \subsection issues Known issues with BLI
*
* - blenlib is written in C.
- * - The posix-compliancy may move to a separate lib that deals with
+ * - The posix-compliance may move to a separate lib that deals with
* platform dependencies. (There are other platform-dependent
* fixes as well.)
* - The file i/o has some redundant code. It should be cleaned.
diff --git a/source/blender/blenlib/BLI_bpath.h b/source/blender/blenlib/BLI_bpath.h
index f1639bdb3c1..a0f253d9ad4 100644
--- a/source/blender/blenlib/BLI_bpath.h
+++ b/source/blender/blenlib/BLI_bpath.h
@@ -40,7 +40,7 @@ struct Main;
struct ReportList;
/* Function that does something with an ID's file path. Should return 1 if the
- path has changed, and in that case, should write the result to pathOut. */
+ * path has changed, and in that case, should write the result to pathOut. */
typedef int (*BPathVisitor)(void *userdata, char *path_dst, const char *path_src);
/* Executes 'visit' for each path associated with 'id'. */
void bpath_traverse_id(struct Main *bmain, struct ID *id, BPathVisitor visit_cb, const int flag, void *userdata);
diff --git a/source/blender/blenlib/BLI_dlrbTree.h b/source/blender/blenlib/BLI_dlrbTree.h
index e8765e699c8..7443d7a07fe 100644
--- a/source/blender/blenlib/BLI_dlrbTree.h
+++ b/source/blender/blenlib/BLI_dlrbTree.h
@@ -100,7 +100,7 @@ typedef void (*DLRBT_NUpdate_FP)(void *node, void *data);
/* Create a new tree, and initialize as necessary */
DLRBT_Tree *BLI_dlrbTree_new(void);
-/* Initialises some given trees */
+/* Initializes some given trees */
void BLI_dlrbTree_init(DLRBT_Tree *tree);
/* Free some tree */
diff --git a/source/blender/blenlib/BLI_dynstr.h b/source/blender/blenlib/BLI_dynstr.h
index e6a2bb45a68..f2e62d6e6bd 100644
--- a/source/blender/blenlib/BLI_dynstr.h
+++ b/source/blender/blenlib/BLI_dynstr.h
@@ -92,7 +92,7 @@ int BLI_dynstr_get_len (DynStr *ds);
/**
* Get a DynStr's contents as a c-string.
- * <i> The returned c-string should be free'd
+ * <i> The returned c-string should be freed
* using MEM_freeN. </i>
*
* \param ds The DynStr of interest.
diff --git a/source/blender/blenlib/BLI_editVert.h b/source/blender/blenlib/BLI_editVert.h
index 65807081d71..b8971d87b2f 100644
--- a/source/blender/blenlib/BLI_editVert.h
+++ b/source/blender/blenlib/BLI_editVert.h
@@ -64,8 +64,8 @@ typedef struct EditVert
short xs, ys; /* used to store a screenspace 2d projection of the verts */
/* f stores selection eg. if (eve->f & SELECT) {...
- h for hidden. if (!eve->h) {...
- f1 and f2 can be used for temp data, clear them first*/
+ * h for hidden. if (!eve->h) {...
+ * f1 and f2 can be used for temp data, clear them first*/
unsigned char f, h, f1, f2;
float bweight;
short fast; /* only 0 or 1, for editmesh_fastmalloc, do not store temp data here! */
diff --git a/source/blender/blenlib/BLI_fnmatch.h b/source/blender/blenlib/BLI_fnmatch.h
index 711d1aa756b..5914d150d56 100644
--- a/source/blender/blenlib/BLI_fnmatch.h
+++ b/source/blender/blenlib/BLI_fnmatch.h
@@ -1,21 +1,21 @@
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
-
-NOTE: The canonical source of this file is maintained with the GNU C Library.
-Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-
-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, 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. */
+ *
+ * NOTE: The canonical source of this file is maintained with the GNU C Library.
+ * Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+ *
+ * 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, 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. */
#ifndef __BLI_FNMATCH_H__
#define __BLI_FNMATCH_H__
@@ -35,13 +35,13 @@ extern "C" {
#undef __P
#define __P(protos) ()
/* We can get away without defining `const' here only because in this file
- it is used only inside the prototype for `fnmatch', which is elided in
- non-ANSI C where `const' is problematical. */
+ * it is used only inside the prototype for `fnmatch', which is elided in
+ * non-ANSI C where `const' is problematical. */
#endif /* C++ or ANSI C. */
/* We #undef these before defining them because some losing systems
- (HP-UX A.08.07 for example) define these in <unistd.h>. */
+ * (HP-UX A.08.07 for example) define these in <unistd.h>. */
#undef FNM_PATHNAME
#undef FNM_NOESCAPE
#undef FNM_PERIOD
@@ -61,7 +61,7 @@ extern "C" {
#define FNM_NOMATCH 1
/* Match STRING against the filename pattern PATTERN,
- returning zero if it matches, FNM_NOMATCH if not. */
+ * returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch __P ((const char *__pattern, const char *__string,
int __flags));
diff --git a/source/blender/blenlib/BLI_heap.h b/source/blender/blenlib/BLI_heap.h
index 5c67bf52b9a..5ceccda96e4 100644
--- a/source/blender/blenlib/BLI_heap.h
+++ b/source/blender/blenlib/BLI_heap.h
@@ -41,12 +41,12 @@ typedef struct HeapNode HeapNode;
typedef void (*HeapFreeFP)(void *ptr);
/* Creates a new heap. BLI_memarena is used for allocating nodes. Removed nodes
- are recycled, so memory usage will not shrink. */
+ * are recycled, so memory usage will not shrink. */
Heap* BLI_heap_new (void);
void BLI_heap_free (Heap *heap, HeapFreeFP ptrfreefp);
/* Insert heap node with a value (often a 'cost') and pointer into the heap,
- duplicate values are allowed. */
+ * duplicate values are allowed. */
HeapNode* BLI_heap_insert (Heap *heap, float value, void *ptr);
/* Remove a heap node. */
diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h
index b0a5e80d850..abe7eacb1ac 100644
--- a/source/blender/blenlib/BLI_listbase.h
+++ b/source/blender/blenlib/BLI_listbase.h
@@ -41,15 +41,16 @@ extern "C" {
#endif
void BLI_insertlink(struct ListBase *listbase, void *vprevlink, void *vnewlink);
-void *BLI_findlink(const struct ListBase *listbase, int number);
int BLI_findindex(const struct ListBase *listbase, void *vlink);
int BLI_findstringindex(const struct ListBase *listbase, const char *id, const int offset);
/* find forwards */
+void *BLI_findlink(const struct ListBase *listbase, int number);
void *BLI_findstring(const struct ListBase *listbase, const char *id, const int offset);
void *BLI_findstring_ptr(const struct ListBase *listbase, const char *id, const int offset);
/* find backwards */
+void *BLI_rfindlink(const struct ListBase *listbase, int number);
void *BLI_rfindstring(const struct ListBase *listbase, const char *id, const int offset);
void *BLI_rfindstring_ptr(const struct ListBase *listbase, const char *id, const int offset);
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index 2a5543b10ed..a725a3ff4c1 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -103,8 +103,8 @@ int isect_line_line_strict_v3(const float v1[3], const float v2[3],
const float v3[3], const float v4[3],
float vi[3], float *r_lambda);
-/*if clip is nonzero, will only return true if lambda is >= 0.0
- (i.e. intersection point is along positive d)*/
+/* if clip is nonzero, will only return true if lambda is >= 0.0
+ * (i.e. intersection point is along positive d)*/
int isect_ray_plane_v3(const float p1[3], const float d[3],
const float v0[3], const float v1[3], const float v2[3],
float *r_lambda, const int clip);
@@ -248,9 +248,9 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,
/****************************** Spherical Harmonics *************************/
/* Uses 2nd order SH => 9 coefficients, stored in this order:
- 0 = (0,0),
- 1 = (1,-1), 2 = (1,0), 3 = (1,1),
- 4 = (2,-2), 5 = (2,-1), 6 = (2,0), 7 = (2,1), 8 = (2,2) */
+ * 0 = (0,0),
+ * 1 = (1,-1), 2 = (1,0), 3 = (1,1),
+ * 4 = (2,-2), 5 = (2,-1), 6 = (2,0), 7 = (2,1), 8 = (2,2) */
MINLINE void zero_sh(float r[9]);
MINLINE void copy_sh_sh(float r[9], const float a[9]);
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h
index 8c19941e18c..de4bd203eb6 100644
--- a/source/blender/blenlib/BLI_math_matrix.h
+++ b/source/blender/blenlib/BLI_math_matrix.h
@@ -71,7 +71,7 @@ void mul_m3_m3m3(float R[3][3], float A[3][3], float B[3][3]);
void mul_m4_m3m4(float R[4][4], float A[3][3], float B[4][4]);
void mul_m4_m4m3(float R[4][4], float A[4][4], float B[3][3]);
/* note: the A,B arguments are reversed compared to previous mul_m4_m4m4
- function, for consistency with above functions & math notation. */
+ * function, for consistency with above functions & math notation. */
void mult_m4_m4m4(float R[4][4], float A[4][4], float B[4][4]);
void mult_m3_m3m4(float R[3][3], float A[4][4], float B[3][3]);
@@ -103,6 +103,11 @@ int invert_m3_m3(float R[3][3], float A[3][3]);
int invert_m4(float R[4][4]);
int invert_m4_m4(float R[4][4], float A[4][4]);
+/* double ariphmetics */
+void mul_m4_v4d(float M[4][4], double r[4]);
+void mul_v4d_m4v4d(double r[4], float M[4][4], double v[4]);
+
+
/****************************** Linear Algebra *******************************/
void transpose_m3(float R[3][3]);
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index 7a39fc8b8ce..1a24acfe1a5 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -70,6 +70,14 @@ MINLINE void copy_v4_v4_short(short r[4], const short a[4]);
MINLINE void copy_v2_v2_int(int r[2], const int a[2]);
MINLINE void copy_v3_v3_int(int r[3], const int a[3]);
MINLINE void copy_v4_v4_int(int r[4], const int a[4]);
+/* double -> float */
+MINLINE void copy_v2fl_v2db(float r[2], const double a[2]);
+MINLINE void copy_v3fl_v3db(float r[3], const double a[3]);
+MINLINE void copy_v4fl_v4db(float r[4], const double a[4]);
+/* float -> double */
+MINLINE void copy_v2db_v2fl(double r[2], const float a[2]);
+MINLINE void copy_v3db_v3fl(double r[3], const float a[3]);
+MINLINE void copy_v4db_v4fl(double r[4], const float a[4]);
/********************************* Arithmetic ********************************/
diff --git a/source/blender/blenlib/BLI_md5.h b/source/blender/blenlib/BLI_md5.h
index 51211d548cd..8ce479b1801 100644
--- a/source/blender/blenlib/BLI_md5.h
+++ b/source/blender/blenlib/BLI_md5.h
@@ -29,15 +29,15 @@
#include <stdlib.h>
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
- result is always in little endian byte order, so that a byte-wise
- output yields to the wanted ASCII representation of the message
- digest. */
+ * result is always in little endian byte order, so that a byte-wise
+ * output yields to the wanted ASCII representation of the message
+ * digest. */
void *md5_buffer(const char *buffer, size_t len, void *resblock);
/* Compute MD5 message digest for bytes read from STREAM. The
- resulting message digest number will be written into the 16 bytes
- beginning at RESBLOCK. */
+ * resulting message digest number will be written into the 16 bytes
+ * beginning at RESBLOCK. */
int md5_stream(FILE *stream, void *resblock);
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h
index 3ee548098ff..e02b48feda7 100644
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -115,10 +115,10 @@ void BLI_splitdirstring(char *di,char *fi);
void BLI_clean(char *path);
/**
- * dir can be any input, like from buttons, and this function
- * converts it to a regular full path.
- * Also removes garbage from directory paths, like /../ or double slashes etc
- */
+ * dir can be any input, like from buttons, and this function
+ * converts it to a regular full path.
+ * Also removes garbage from directory paths, like /../ or double slashes etc
+ */
void BLI_cleanup_file(const char *relabase, char *dir); /* removes trailing slash */
void BLI_cleanup_dir(const char *relabase, char *dir); /* same as above but adds a trailing slash */
void BLI_cleanup_path(const char *relabase, char *dir); /* doesn't touch trailing slash */
@@ -129,18 +129,18 @@ int BLI_parent_dir(char *path);
/* return whether directory is root and thus has no parent dir */
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.
- *
- * \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 "//").
- */
+/**
+ * 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.
+ *
+ * \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);
int BLI_path_frame_range(char *path, int sta, int end, int digits);
@@ -155,14 +155,14 @@ void BLI_path_rel(char *file, const char *relfile);
# define BLI_path_ncmp strncmp
#endif
- /**
- * 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
- */
+/**
+ * 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
+ */
void BLI_char_switch(char *string, char from, char to);
/* Initialize path to program executable */
diff --git a/source/blender/blenlib/BLI_pbvh.h b/source/blender/blenlib/BLI_pbvh.h
index 3b52c9b77db..f0d56a3cf52 100644
--- a/source/blender/blenlib/BLI_pbvh.h
+++ b/source/blender/blenlib/BLI_pbvh.h
@@ -26,13 +26,14 @@
* \brief A BVH for high poly meshes.
*/
-struct MFace;
-struct MVert;
+struct DMFlagMat;
struct DMGridAdjacency;
struct DMGridData;
+struct ListBase;
+struct MFace;
+struct MVert;
struct PBVH;
struct PBVHNode;
-struct ListBase;
typedef struct PBVH PBVH;
typedef struct PBVHNode PBVHNode;
@@ -56,12 +57,12 @@ void BLI_pbvh_build_mesh(PBVH *bvh, struct MFace *faces, struct MVert *verts,
int totface, int totvert);
void BLI_pbvh_build_grids(PBVH *bvh, struct DMGridData **grids,
struct DMGridAdjacency *gridadj, int totgrid,
- int gridsize, void **gridfaces);
+ int gridsize, void **gridfaces, struct DMFlagMat *flagmats);
void BLI_pbvh_free(PBVH *bvh);
/* Hierarchical Search in the BVH, two methods:
- * for each hit calling a callback
- * gather nodes in an array (easy to multithread) */
+ * - for each hit calling a callback
+ * - gather nodes in an array (easy to multithread) */
void BLI_pbvh_search_callback(PBVH *bvh,
BLI_pbvh_SearchCallback scb, void *search_data,
@@ -72,9 +73,9 @@ void BLI_pbvh_search_gather(PBVH *bvh,
PBVHNode ***array, int *tot);
/* Raycast
- the hit callback is called for all leaf nodes intersecting the ray;
- it's up to the callback to find the primitive within the leaves that is
- hit first */
+ * the hit callback is called for all leaf nodes intersecting the ray;
+ * it's up to the callback to find the primitive within the leaves that is
+ * hit first */
void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
float ray_start[3], float ray_normal[3], int original);
@@ -85,7 +86,8 @@ int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
void BLI_pbvh_node_draw(PBVHNode *node, void *data);
int BLI_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data);
-void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3], int smooth);
+void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3],
+ int (*setMaterial)(int, void *attribs));
/* Node Access */
@@ -131,8 +133,8 @@ int BLI_pbvh_isDeformed(struct PBVH *pbvh);
/* Vertex Iterator */
/* this iterator has quite a lot of code, but it's designed to:
- - allow the compiler to eliminate dead code and variables
- - spend most of the time in the relatively simple inner loop */
+ * - allow the compiler to eliminate dead code and variables
+ * - spend most of the time in the relatively simple inner loop */
#define PBVH_ITER_ALL 0
#define PBVH_ITER_UNIQUE 1
@@ -159,7 +161,7 @@ typedef struct PBVHVertexIter {
int *vert_indices;
/* result: these are all computed in the macro, but we assume
- that compiler optimizations will skip the ones we don't use */
+ * that compiler optimization's will skip the ones we don't use */
struct MVert *mvert;
float *co;
short *no;
diff --git a/source/blender/blenlib/BLI_scanfill.h b/source/blender/blenlib/BLI_scanfill.h
index d497ffa4941..1fe71bffba8 100644
--- a/source/blender/blenlib/BLI_scanfill.h
+++ b/source/blender/blenlib/BLI_scanfill.h
@@ -82,7 +82,7 @@ struct ScanFillVert *BLI_addfillvert(const float vec[3]);
struct ScanFillEdge *BLI_addfilledge(struct ScanFillVert *v1, struct ScanFillVert *v2);
/* Optionally set ScanFillEdge f to this to mark original boundary edges.
- Only needed if there are internal diagonal edges pased to BLI_edgefill. */
+ * Only needed if there are internal diagonal edges passed to BLI_edgefill. */
#define FILLBOUNDARY 1
int BLI_begin_edgefill(void);
diff --git a/source/blender/blenlib/BLI_string_cursor_utf8.h b/source/blender/blenlib/BLI_string_cursor_utf8.h
new file mode 100644
index 00000000000..11c91aac6ac
--- /dev/null
+++ b/source/blender/blenlib/BLI_string_cursor_utf8.h
@@ -0,0 +1,51 @@
+/*
+ * ***** 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) 2011 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __BLI_STRING_CURSOR_UTF8_H__
+#define __BLI_STRING_CURSOR_UTF8_H__
+
+/** \file BLI_string_utf8.h
+ * \ingroup bli
+ */
+
+typedef enum strCursorJumpType {
+ STRCUR_JUMP_NONE,
+ STRCUR_JUMP_DELIM,
+ STRCUR_JUMP_ALL
+} strCursorJumpType;
+
+typedef enum strCursorJumpDirection {
+ STRCUR_DIR_PREV,
+ STRCUR_DIR_NEXT
+} strCursorJumpDirection;
+
+int BLI_str_cursor_step_next_utf8(const char *str, size_t maxlen, int *pos);
+int BLI_str_cursor_step_prev_utf8(const char *str, size_t maxlen, int *pos);
+
+void BLI_str_cursor_step_utf8(const char *str, size_t maxlen,
+ int *pos, strCursorJumpDirection direction,
+ strCursorJumpType jump);
+
+#endif /* __BLI_STRING_CURSOR_UTF8_H__ */
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index d42e228ca11..06de3ff05fc 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -135,12 +135,6 @@
*(v1)= *(v2); \
*(v1+1)= *(v2+1); \
}
-#define QUATCOPY(v1, v2) { \
- *(v1)= *(v2); \
- *(v1+1)= *(v2+1); \
- *(v1+2)= *(v2+2); \
- *(v1+3)= *(v2+3); \
- }
#define VECADD(v1,v2,v3) { \
*(v1)= *(v2) + *(v3); \
*(v1+1)= *(v2+1) + *(v3+1); \
@@ -165,12 +159,6 @@
*(v1+1)= *(v2+1) - *(v3+1)*(fac); \
*(v1+2)= *(v2+2) - *(v3+2)*(fac); \
}
-#define QUATADDFAC(v1,v2,v3,fac) { \
- *(v1)= *(v2) + *(v3)*(fac); \
- *(v1+1)= *(v2+1) + *(v3+1)*(fac); \
- *(v1+2)= *(v2+2) + *(v3+2)*(fac); \
- *(v1+3)= *(v2+3) + *(v3+3)*(fac); \
- }
#define INPR(v1, v2) ( (v1)[0]*(v2)[0] + (v1)[1]*(v2)[1] + (v1)[2]*(v2)[2] )
@@ -275,7 +263,7 @@
/* BLI_assert(), default only to print
* for aborting need to define WITH_ASSERT_ABORT
*/
-#if !defined NDEBUG
+#ifndef NDEBUG
# ifdef WITH_ASSERT_ABORT
# define _BLI_DUMMY_ABORT abort
# else
diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt
index f442c0e8ae7..9af1e2d0387 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -83,6 +83,7 @@ set(SRC
intern/smallhash.c
intern/storage.c
intern/string.c
+ intern/string_cursor_utf8.c
intern/string_utf8.c
intern/threads.c
intern/time.c
@@ -103,6 +104,7 @@ set(SRC
BLI_dynlib.h
BLI_dynstr.h
BLI_edgehash.h
+ BLI_editVert.h
BLI_fileops.h
BLI_fileops_types.h
BLI_fnmatch.h
@@ -133,6 +135,7 @@ set(SRC
BLI_rect.h
BLI_scanfill.h
BLI_string.h
+ BLI_string_cursor_utf8.h
BLI_string_utf8.h
BLI_threads.h
BLI_utildefines.h
@@ -141,7 +144,6 @@ set(SRC
BLI_voxel.h
BLI_winstuff.h
PIL_time.h
- intern/dynamiclist.h
)
if(WITH_BINRELOC)
diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c
index bbf005e79ac..3d137641889 100644
--- a/source/blender/blenlib/intern/BLI_args.c
+++ b/source/blender/blenlib/intern/BLI_args.c
@@ -237,8 +237,7 @@ void BLI_argsPrintArgDoc(struct bArgs *ba, const char *arg)
{
bArgument *a = lookUp(ba, arg, -1, -1);
- if (a)
- {
+ if (a) {
bArgDoc *d = a->doc;
internalDocPrint(d);
@@ -251,10 +250,8 @@ void BLI_argsPrintOtherDoc(struct bArgs *ba)
{
bArgDoc *d;
- for( d = ba->docs.first; d; d = d->next)
- {
- if (d->done == 0)
- {
+ for (d = ba->docs.first; d; d = d->next) {
+ if (d->done == 0) {
internalDocPrint(d);
}
}
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index afc8a6a4aa6..b992d518b49 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -201,16 +201,18 @@ static int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, in
//////////////////////////////////////////////////////////////////////////////////////////////////////
//static int size_threshold = 16;
/*
-* Common methods for all algorithms
-*/
-/*static int floor_lg(int a)
+ * Common methods for all algorithms
+ */
+#if 0
+static int floor_lg(int a)
{
return (int)(floor(log(a)/log(2)));
-}*/
+}
+#endif
/*
-* Insertion sort algorithm
-*/
+ * Insertion sort algorithm
+ */
static void bvh_insertionsort(BVHNode **a, int lo, int hi, int axis)
{
int i,j;
@@ -244,8 +246,8 @@ static int bvh_partition(BVHNode **a, int lo, int hi, BVHNode * x, int axis)
}
/*
-* Heapsort algorithm
-*/
+ * Heapsort algorithm
+ */
#if 0
static void bvh_downheap(BVHNode **a, int i, int n, int lo, int axis)
{
@@ -310,8 +312,8 @@ static BVHNode *bvh_medianof3(BVHNode **a, int lo, int mid, int hi, int axis) //
#if 0
/*
-* Quicksort algorithm modified for Introsort
-*/
+ * Quicksort algorithm modified for Introsort
+ */
static void bvh_introsort_loop (BVHNode **a, int lo, int hi, int depth_limit, int axis)
{
int p;
@@ -716,8 +718,8 @@ static void split_leafs(BVHNode **leafs_array, int *nth, int partitions, int spl
*
* This function creates an implicit tree on branches_array, the leafs are given on the leafs_array.
*
- * The tree is built per depth levels. First branchs at depth 1.. then branches at depth 2.. etc..
- * The reason is that we can build level N+1 from level N witouth any data dependencies.. thus it allows
+ * The tree is built per depth levels. First branches at depth 1.. then branches at depth 2.. etc..
+ * The reason is that we can build level N+1 from level N without any data dependencies.. thus it allows
* to use multithread building.
*
* To archieve this is necessary to find how much leafs are accessible from a certain branch, BVHBuildHelper
@@ -764,8 +766,7 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array,
//Loop all branches on this level
#pragma omp parallel for private(j) schedule(static)
- for(j = i; j < end_j; j++)
- {
+ for(j = i; j < end_j; j++) {
int k;
const int parent_level_index= j-i;
BVHNode* parent = branches_array + j;
@@ -789,8 +790,7 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array,
//Split_leafs takes care of that "sort" problem.
nth_positions[ 0] = parent_leafs_begin;
nth_positions[tree_type] = parent_leafs_end;
- for(k = 1; k < tree_type; k++)
- {
+ for (k = 1; k < tree_type; k++) {
int child_index = j * tree_type + tree_offset + k;
int child_level_index = child_index - first_of_next_level; //child level index
nth_positions[k] = implicit_leafs_index(&data, depth+1, child_level_index);
@@ -801,26 +801,24 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array,
//Setup children and totnode counters
//Not really needed but currently most of BVH code relies on having an explicit children structure
- for(k = 0; k < tree_type; k++)
- {
+ for (k = 0; k < tree_type; k++) {
int child_index = j * tree_type + tree_offset + k;
int child_level_index = child_index - first_of_next_level; //child level index
int child_leafs_begin = implicit_leafs_index(&data, depth+1, child_level_index);
int child_leafs_end = implicit_leafs_index(&data, depth+1, child_level_index+1);
- if(child_leafs_end - child_leafs_begin > 1)
- {
+ if (child_leafs_end - child_leafs_begin > 1) {
parent->children[k] = branches_array + child_index;
parent->children[k]->parent = parent;
}
- else if(child_leafs_end - child_leafs_begin == 1)
- {
+ else if (child_leafs_end - child_leafs_begin == 1) {
parent->children[k] = leafs_array[ child_leafs_begin ];
parent->children[k]->parent = parent;
}
- else
+ else {
break;
+ }
parent->totnode = k+1;
}
@@ -851,39 +849,32 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis)
//this bug would show up when casting a ray aligned with a kdop-axis and with an edge of 2 faces
epsilon = MAX2(FLT_EPSILON, epsilon);
- if(tree)
- {
+ if(tree) {
tree->epsilon = epsilon;
tree->tree_type = tree_type;
tree->axis = axis;
- if(axis == 26)
- {
+ if (axis == 26) {
tree->start_axis = 0;
tree->stop_axis = 13;
}
- else if(axis == 18)
- {
+ else if (axis == 18) {
tree->start_axis = 7;
tree->stop_axis = 13;
}
- else if(axis == 14)
- {
+ else if (axis == 14) {
tree->start_axis = 0;
tree->stop_axis = 7;
}
- else if(axis == 8) // AABB
- {
+ else if (axis == 8) { /* AABB */
tree->start_axis = 0;
tree->stop_axis = 4;
}
- else if(axis == 6) // OBB
- {
+ else if (axis == 6) { /* OBB */
tree->start_axis = 0;
tree->stop_axis = 3;
}
- else
- {
+ else {
MEM_freeN(tree);
return NULL;
}
@@ -1210,7 +1201,7 @@ static float calc_nearest_point(const float proj[3], BVHNode *node, float *neare
nearest[i] = proj[i];
}
-/*
+#if 0
//nearest on a general hull
copy_v3_v3(nearest, data->co);
for(i = data->tree->start_axis; i != data->tree->stop_axis; i++, bv+=2)
@@ -1219,16 +1210,15 @@ static float calc_nearest_point(const float proj[3], BVHNode *node, float *neare
float dl = bv[0] - proj;
float du = bv[1] - proj;
- if(dl > 0)
- {
+ if(dl > 0) {
madd_v3_v3fl(nearest, KDOP_AXES[i], dl);
}
- else if(du < 0)
- {
+ else if(du < 0) {
madd_v3_v3fl(nearest, KDOP_AXES[i], du);
}
}
-*/
+#endif
+
return len_squared_v3v3(proj, nearest);
}
@@ -1498,7 +1488,7 @@ static void dfs_raycast(BVHRayCastData *data, BVHNode *node)
//ray-bv is really fast.. and simple tests revealed its worth to test it
//before calling the ray-primitive functions
- /* XXX: temporary solution for particles untill fast_ray_nearest_hit supports ray.radius */
+ /* XXX: temporary solution for particles until fast_ray_nearest_hit supports ray.radius */
float dist = (data->ray.radius > 0.0f) ? ray_nearest_hit(data, node->bv) : fast_ray_nearest_hit(data, node);
if(dist >= data->hit.dist) return;
diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c
index 4debe1a4b04..72f312ba6e4 100644
--- a/source/blender/blenlib/intern/BLI_memarena.c
+++ b/source/blender/blenlib/intern/BLI_memarena.c
@@ -94,8 +94,7 @@ void *BLI_memarena_alloc(MemArena *ma, int size)
if (size>ma->cursize) {
unsigned char *tmp;
- if(size > ma->bufsize - (ma->align - 1))
- {
+ if(size > ma->bufsize - (ma->align - 1)) {
ma->cursize = PADUP(size+1, ma->align);
}
else ma->cursize = ma->bufsize;
diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c
index 57174d0c0dd..6631e36fc72 100644
--- a/source/blender/blenlib/intern/boxpack2d.c
+++ b/source/blender/blenlib/intern/boxpack2d.c
@@ -24,12 +24,11 @@
* \ingroup bli
*/
-
#include <stdlib.h> /* for qsort */
#include "MEM_guardedalloc.h"
#include "BLI_boxpack2d.h"
-
+
/* BoxPacker for backing 2D rectangles into a square
*
* The defined Below are for internal use only */
@@ -52,7 +51,7 @@ typedef struct boxVert {
} boxVert;
/* free vert flags */
-#define eps 0.0000001f
+#define EPSILON 0.0000001f
#define BLF 1
#define TRF 2
#define TLF 4
@@ -64,52 +63,54 @@ typedef struct boxVert {
#define TL 2
#define BR 3
-#define BOXLEFT(b) b->v[BL]->x
-#define BOXRIGHT(b) b->v[TR]->x
-#define BOXBOTTOM(b) b->v[BL]->y
-#define BOXTOP(b) b->v[TR]->y
-#define BOXAREA(b) (b->w * b->h)
+#define BOXLEFT(b) ((b)->v[BL]->x)
+#define BOXRIGHT(b) ((b)->v[TR]->x)
+#define BOXBOTTOM(b) ((b)->v[BL]->y)
+#define BOXTOP(b) ((b)->v[TR]->y)
+#define BOXAREA(b) ((b)->w * (b)->h)
-#define UPDATE_V34X(b) b->v[TL]->x = b->v[BL]->x;\
- b->v[BR]->x = b->v[TR]->x
-#define UPDATE_V34Y(b) b->v[TL]->y = b->v[TR]->y;\
- b->v[BR]->y = b->v[BL]->y
-#define UPDATE_V34(b) UPDATE_V34X(b); UPDATE_V34Y(b)
+#define UPDATE_V34X(b) ((b)->v[TL]->x = (b)->v[BL]->x); \
+ ((b)->v[BR]->x = (b)->v[TR]->x)
+#define UPDATE_V34Y(b) ((b)->v[TL]->y = (b)->v[TR]->y); \
+ ((b)->v[BR]->y = (b)->v[BL]->y)
+#define UPDATE_V34(b) UPDATE_V34X(b); UPDATE_V34Y(b)
-#define SET_BOXLEFT(b, f) b->v[TR]->x = f + b->w;\
- b->v[BL]->x = f;\
+#define SET_BOXLEFT(b, f) (b)->v[TR]->x = f + (b)->w; \
+ (b)->v[BL]->x = f; \
UPDATE_V34X(b)
-#define SET_BOXRIGHT(b, f) b->v[BL]->x = f - b->w;\
- b->v[TR]->x = f;\
+#define SET_BOXRIGHT(b, f) (b)->v[BL]->x = f - (b)->w; \
+ (b)->v[TR]->x = f; \
UPDATE_V34X(b)
-#define SET_BOXBOTTOM(b, f) b->v[TR]->y = f + b->h;\
- b->v[BL]->y = f;\
+#define SET_BOXBOTTOM(b, f) (b)->v[TR]->y = f + (b)->h; \
+ (b)->v[BL]->y = f; \
UPDATE_V34Y(b)
-#define SET_BOXTOP(b, f) b->v[BL]->y = f - b->h;\
- b->v[TR]->y = f;\
+#define SET_BOXTOP(b, f) (b)->v[BL]->y = f - (b)->h; \
+ (b)->v[TR]->y = f; \
UPDATE_V34Y(b)
-#define BOXINTERSECT(b1, b2)\
- (!( BOXLEFT(b1)+eps>=BOXRIGHT(b2) ||\
- BOXBOTTOM(b1)+eps>=BOXTOP(b2) ||\
- BOXRIGHT(b1)-eps<=BOXLEFT(b2) ||\
- BOXTOP(b1)-eps<=BOXBOTTOM(b2) ))
+#define BOXINTERSECT(b1, b2) \
+ !(BOXLEFT(b1) + EPSILON >= BOXRIGHT(b2) || \
+ BOXBOTTOM(b1) + EPSILON >= BOXTOP(b2) || \
+ BOXRIGHT(b1) - EPSILON <= BOXLEFT(b2) || \
+ BOXTOP(b1) - EPSILON <= BOXBOTTOM(b2))
-#define MIN2(x,y) ( (x)<(y) ? (x) : (y) )
-#define MAX2(x,y) ( (x)>(y) ? (x) : (y) )
+#define MIN2(x,y) ((x) < (y) ? (x) : (y))
+#define MAX2(x,y) ((x) > (y) ? (x) : (y))
-/* #define BOXDEBUG(b)\
- * printf("\tBox Debug i %i, w:%.3f h:%.3f x:%.3f y:%.3f\n",\
- * b->index, b->w, b->h, b->x, b->y) */
+#if 0
+#define BOXDEBUG(b) \
+ printf("\tBox Debug i %i, w:%.3f h:%.3f x:%.3f y:%.3f\n", \
+ b->index, b->w, b->h, b->x, b->y)
+#endif
/* qsort function - sort largest to smallest */
static int box_areasort(const void *p1, const void *p2)
{
- const boxPack *b1= p1, *b2= p2;
- const float a1= BOXAREA(b1);
- const float a2= BOXAREA(b2);
+ const boxPack *b1 = p1, *b2 = p2;
+ const float a1 = BOXAREA(b1);
+ const float a2 = BOXAREA(b2);
- if ( a1 < a2 ) return 1;
- else if ( a1 > a2 ) return -1;
+ if (a1 < a2) return 1;
+ else if (a1 > a2) return -1;
return 0;
}
@@ -126,16 +127,16 @@ static int vertex_sort(const void *p1, const void *p2)
{
boxVert *v1, *v2;
float a1, a2;
-
- v1 = vertarray + ((int *) p1)[0];
- v2 = vertarray + ((int *) p2)[0];
-
+
+ v1 = vertarray + ((int *)p1)[0];
+ v2 = vertarray + ((int *)p2)[0];
+
a1 = MAX2(v1->x+box_width, v1->y+box_height);
a2 = MAX2(v2->x+box_width, v2->y+box_height);
-
+
/* sort largest to smallest */
- if ( a1 > a2 ) return 1;
- else if ( a1 < a2 ) return -1;
+ if (a1 > a2) return 1;
+ else if (a1 < a2) return -1;
return 0;
}
/* Main boxpacking function accessed from other functions
@@ -155,24 +156,24 @@ void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_he
{
boxVert *vert; /* the current vert */
int box_index, verts_pack_len, i, j, k, isect;
- int quad_flags[4]= {BLF,TRF,TLF,BRF}; /* use for looping */
+ int quad_flags[4] = {BLF, TRF, TLF, BRF}; /* use for looping */
boxPack *box, *box_test; /*current box and another for intersection tests*/
int *vertex_pack_indices; /*an array of indices used for sorting verts*/
-
+
if (!len) {
- *tot_width = 0.0f;
+ *tot_width = 0.0f;
*tot_height = 0.0f;
return;
}
-
+
/* Sort boxes, biggest first */
qsort(boxarray, len, sizeof(boxPack), box_areasort);
-
+
/* add verts to the boxes, these are only used internally */
- vert = vertarray = MEM_mallocN( len*4*sizeof(boxVert), "boxPack Verts");
- vertex_pack_indices = MEM_mallocN( len*3*sizeof(int), "boxPack Indices");
-
- for (box=boxarray, box_index=0, i=0; box_index < len; box_index++, box++) {
+ vert = vertarray = MEM_mallocN(len * 4 * sizeof(boxVert), "boxPack Verts");
+ vertex_pack_indices = MEM_mallocN(len * 3 * sizeof(int), "boxPack Indices");
+
+ for (box = boxarray, box_index = 0, i = 0; box_index < len; box_index++, box++) {
vert->blb = vert->brb = vert->tlb =
vert->isect_cache[0] = vert->isect_cache[1] =
@@ -207,98 +208,98 @@ void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_he
box->v[BR] = vert; vert++;
}
vert = NULL;
-
-
+
/* Pack the First box!
* then enter the main box-packing loop */
-
+
box = boxarray; /* get the first box */
/* First time, no boxes packed */
box->v[BL]->free = 0; /* Can't use any if these */
- box->v[BR]->free &= ~(BLF|BRF);
- box->v[TL]->free &= ~(BLF|TLF);
-
+ box->v[BR]->free &= ~(BLF | BRF);
+ box->v[TL]->free &= ~(BLF | TLF);
+
*tot_width = box->w;
- *tot_height = box->h;
-
+ *tot_height = box->h;
+
/* This sets all the vertex locations */
SET_BOXLEFT(box, 0.0f);
SET_BOXBOTTOM(box, 0.0f);
box->x = box->y = 0.0f;
-
- for (i=0; i<3; i++)
- vertex_pack_indices[i] = box->v[i+1]->index;
+
+ for (i = 0; i < 3; i++)
+ vertex_pack_indices[i] = box->v[i + 1]->index;
verts_pack_len = 3;
box++; /* next box, needed for the loop below */
/* ...done packing the first box */
/* Main boxpacking loop */
- for (box_index=1; box_index < len; box_index++, box++) {
-
+ for (box_index = 1; box_index < len; box_index++, box++) {
+
/* These static floatds are used for sorting */
box_width = box->w;
box_height = box->h;
-
+
qsort(vertex_pack_indices, verts_pack_len, sizeof(int), vertex_sort);
-
+
/* Pack the box in with the others */
/* sort the verts */
isect = 1;
-
- for (i=0; i<verts_pack_len && isect; i++) {
+
+ for (i = 0; i < verts_pack_len && isect; i++) {
vert = vertarray + vertex_pack_indices[i];
/* printf("\ttesting vert %i %i %i %f %f\n", i,
* vert->free, verts_pack_len, vert->x, vert->y); */
-
+
/* This vert has a free quadrant
* Test if we can place the box here
* vert->free & quad_flags[j] - Checks
* */
-
- for (j=0; (j<4) && isect; j++) {
+
+ for (j = 0; (j < 4) && isect; j++) {
if (vert->free & quad_flags[j]) {
switch (j) {
- case BL:
- SET_BOXRIGHT(box, vert->x);
- SET_BOXTOP(box, vert->y);
- break;
- case TR:
- SET_BOXLEFT(box, vert->x);
- SET_BOXBOTTOM(box, vert->y);
- break;
- case TL:
- SET_BOXRIGHT(box, vert->x);
- SET_BOXBOTTOM(box, vert->y);
- break;
- case BR:
- SET_BOXLEFT(box, vert->x);
- SET_BOXTOP(box, vert->y);
- break;
+ case BL:
+ SET_BOXRIGHT(box, vert->x);
+ SET_BOXTOP(box, vert->y);
+ break;
+ case TR:
+ SET_BOXLEFT(box, vert->x);
+ SET_BOXBOTTOM(box, vert->y);
+ break;
+ case TL:
+ SET_BOXRIGHT(box, vert->x);
+ SET_BOXBOTTOM(box, vert->y);
+ break;
+ case BR:
+ SET_BOXLEFT(box, vert->x);
+ SET_BOXTOP(box, vert->y);
+ break;
}
-
+
/* Now we need to check that the box intersects
- * with any other boxes
- * Assume no intersection... */
+ * with any other boxes
+ * Assume no intersection... */
isect = 0;
if (/* Constrain boxes to positive X/Y values */
- BOXLEFT(box)<0.0f || BOXBOTTOM(box) < 0.0f ||
+ BOXLEFT(box) < 0.0f || BOXBOTTOM(box) < 0.0f ||
/* check for last intersected */
( vert->isect_cache[j] &&
- BOXINTERSECT(box, vert->isect_cache[j]) )
- ) {
+ BOXINTERSECT(box, vert->isect_cache[j])))
+ {
/* Here we check that the last intersected
* box will intersect with this one using
* isect_cache that can store a pointer to a
* box for each quadrant
* big speedup */
isect = 1;
- } else {
+ }
+ else {
/* do a full search for colliding box
* 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) {
+ for (box_test = boxarray; box_test != box; box_test++) {
+ if (BOXINTERSECT(box, box_test)) {
/* Store the last intersecting here as cache
* for faster checking next time around */
vert->isect_cache[j] = box_test;
@@ -307,35 +308,35 @@ void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_he
}
}
}
-
+
if (!isect) {
-
+
/* maintain the total width and height */
(*tot_width) = MAX2(BOXRIGHT(box), (*tot_width));
(*tot_height) = MAX2(BOXTOP(box), (*tot_height));
-
+
/* Place the box */
vert->free &= ~quad_flags[j];
-
+
switch (j) {
- case TR:
- box->v[BL]= vert;
- vert->trb = box;
- break;
- case TL:
- box->v[BR]= vert;
- vert->tlb = box;
- break;
- case BR:
- box->v[TL]= vert;
- vert->brb = box;
- break;
- case BL:
- box->v[TR]= vert;
- vert->blb = box;
- break;
+ case TR:
+ box->v[BL] = vert;
+ vert->trb = box;
+ break;
+ case TL:
+ box->v[BR] = vert;
+ vert->tlb = box;
+ break;
+ case BR:
+ box->v[TL] = vert;
+ vert->brb = box;
+ break;
+ case BL:
+ box->v[TR] = vert;
+ vert->blb = box;
+ break;
}
-
+
/* Mask free flags for verts that are
* on the bottom or side so we don't get
* boxes outside the given rectangle ares
@@ -343,68 +344,73 @@ void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_he
* We can do an else/if here because only the first
* box can be at the very bottom left corner */
if (BOXLEFT(box) <= 0) {
- box->v[TL]->free &= ~(TLF|BLF);
- box->v[BL]->free &= ~(TLF|BLF);
- } else if (BOXBOTTOM(box) <= 0) {
- box->v[BL]->free &= ~(BRF|BLF);
- box->v[BR]->free &= ~(BRF|BLF);
+ box->v[TL]->free &= ~(TLF | BLF);
+ box->v[BL]->free &= ~(TLF | BLF);
}
-
+ else if (BOXBOTTOM(box) <= 0) {
+ box->v[BL]->free &= ~(BRF | BLF);
+ box->v[BR]->free &= ~(BRF | BLF);
+ }
+
/* The following block of code does a logical
* check with 2 adjacent boxes, its possible to
* flag verts on one or both of the boxes
* as being used by checking the width or
* height of both boxes */
- if (vert->tlb && vert->trb &&
- (box == vert->tlb || box == vert->trb)) {
+ if (vert->tlb && vert->trb && (box == vert->tlb || box == vert->trb)) {
if (vert->tlb->h > vert->trb->h) {
- vert->trb->v[TL]->free &= ~(TLF|BLF);
- } else if (vert->tlb->h < vert->trb->h) {
- vert->tlb->v[TR]->free &= ~(TRF|BRF);
- } else { /*same*/
+ vert->trb->v[TL]->free &= ~(TLF | BLF);
+ }
+ else if (vert->tlb->h < vert->trb->h) {
+ vert->tlb->v[TR]->free &= ~(TRF | BRF);
+ }
+ else { /*same*/
vert->tlb->v[TR]->free &= ~BLF;
vert->trb->v[TL]->free &= ~BRF;
}
- } else if (vert->blb && vert->brb &&
- (box == vert->blb || box == vert->brb)) {
+ }
+ else if (vert->blb && vert->brb && (box == vert->blb || box == vert->brb)) {
if (vert->blb->h > vert->brb->h) {
- vert->brb->v[BL]->free &= ~(TLF|BLF);
- } else if (vert->blb->h < vert->brb->h) {
- vert->blb->v[BR]->free &= ~(TRF|BRF);
- } else { /*same*/
+ vert->brb->v[BL]->free &= ~(TLF | BLF);
+ }
+ else if (vert->blb->h < vert->brb->h) {
+ vert->blb->v[BR]->free &= ~(TRF | BRF);
+ }
+ else { /*same*/
vert->blb->v[BR]->free &= ~TRF;
vert->brb->v[BL]->free &= ~TLF;
}
}
/* Horizontal */
- if (vert->tlb && vert->blb &&
- (box == vert->tlb || box == vert->blb) ) {
+ if (vert->tlb && vert->blb && (box == vert->tlb || box == vert->blb)) {
if (vert->tlb->w > vert->blb->w) {
- vert->blb->v[TL]->free &= ~(TLF|TRF);
- } else if (vert->tlb->w < vert->blb->w) {
- vert->tlb->v[BL]->free &= ~(BLF|BRF);
- } else { /*same*/
+ vert->blb->v[TL]->free &= ~(TLF | TRF);
+ }
+ else if (vert->tlb->w < vert->blb->w) {
+ vert->tlb->v[BL]->free &= ~(BLF | BRF);
+ }
+ else { /*same*/
vert->blb->v[TL]->free &= ~TRF;
vert->tlb->v[BL]->free &= ~BRF;
}
- } else if ( vert->trb && vert->brb &&
- (box == vert->trb || box == vert->brb) ) {
+ }
+ else if (vert->trb && vert->brb && (box == vert->trb || box == vert->brb)) {
if (vert->trb->w > vert->brb->w) {
- vert->brb->v[TR]->free &= ~(TLF|TRF);
- } else if (vert->trb->w < vert->brb->w) {
- vert->trb->v[BR]->free &= ~(BLF|BRF);
- } else { /*same*/
+ vert->brb->v[TR]->free &= ~(TLF | TRF);
+ }
+ else if (vert->trb->w < vert->brb->w) {
+ vert->trb->v[BR]->free &= ~(BLF | BRF);
+ }
+ else { /*same*/
vert->brb->v[TR]->free &= ~TLF;
vert->trb->v[BR]->free &= ~BLF;
}
}
/* End logical check */
-
-
- for (k=0; k<4; k++) {
+
+ for (k = 0; k < 4; k++) {
if (box->v[k] != vert) {
- vertex_pack_indices[verts_pack_len] =
- box->v[k]->index;
+ vertex_pack_indices[verts_pack_len] = box->v[k]->index;
verts_pack_len++;
}
}
@@ -414,16 +420,16 @@ void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_he
box->x = BOXLEFT(box);
box->y = BOXBOTTOM(box);
}
- }
+ }
}
}
}
/* free all the verts, not really needed because they shouldn't be
* touched anymore but accessing the pointers would crash blender */
- for (box_index=0; box_index < len; box_index++) {
- box = boxarray+box_index;
- box->v[0] = box->v[1] = box->v[2] = box->v[3] = NULL;
+ for (box_index = 0; box_index < len; box_index++) {
+ box = boxarray + box_index;
+ box->v[0] = box->v[1] = box->v[2] = box->v[3] = NULL;
}
MEM_freeN(vertex_pack_indices);
MEM_freeN(vertarray);
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index 7acbf450fed..84519a90477 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -500,7 +500,7 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla
Tex *tex = (Tex *)id;
if (tex->plugin) {
/* FIXME: rewrite_path assumes path length of FILE_MAX, but
- tex->plugin->name is 160. ... is this field even a path? */
+ * tex->plugin->name is 160. ... is this field even a path? */
//rewrite_path(tex->plugin->name, visit_cb, bpath_user_data);
}
if (tex->type == TEX_VOXELDATA && TEX_VD_IS_SOURCE_PATH(tex->vd->file_format)) {
@@ -602,7 +602,7 @@ void bpath_traverse_main(Main *bmain, BPathVisitor visit_cb, const int flag, voi
}
/* Rewrites a relative path to be relative to the main file - unless the path is
- absolute, in which case it is not altered. */
+ * absolute, in which case it is not altered. */
int bpath_relocate_visitor(void *pathbase_v, char *path_dst, const char *path_src)
{
/* be sure there is low chance of the path being too short */
@@ -617,7 +617,7 @@ int bpath_relocate_visitor(void *pathbase_v, char *path_dst, const char *path_sr
}
/* Make referenced file absolute. This would be a side-effect of
- BLI_cleanup_file, but we do it explicitely so we know if it changed. */
+ * BLI_cleanup_file, but we do it explicitly so we know if it changed. */
BLI_strncpy(filepath, path_src, FILE_MAX);
if (BLI_path_abs(filepath, base_old)) {
/* Path was relative and is now absolute. Remap.
diff --git a/source/blender/blenlib/intern/dynamiclist.h b/source/blender/blenlib/intern/dynamiclist.h
deleted file mode 100644
index 64c4a8fd61a..00000000000
--- a/source/blender/blenlib/intern/dynamiclist.h
+++ /dev/null
@@ -1,58 +0,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.
- *
- * Contributor(s): Jiri Hnidek.
- *
- * Documentation of Two way dynamic list with access array can be found at:
- *
- * http://wiki.blender.org/bin/view.pl/Blenderwiki/DynamicListWithAccessArray
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/blenlib/intern/dynamiclist.h
- * \ingroup bli
- */
-
-
-#ifndef __DYNAMICLIST_H__
-#define __DYNAMICLIST_H__
-
-#define PAGE_SIZE 4
-
-struct ListBase;
-
-/*
- * Access array using realloc
- */
-typedef struct DynamicArray{
- unsigned int count; /* count of items in list */
- unsigned int max_item_index; /* max available index */
- unsigned int last_item_index; /* max used index */
- void **items; /* dynamicaly allocated array of pointers
- pointing at items in list */
-} DynamicArray;
-
-/*
- * Two way dynamic list with access array
- */
-typedef struct DynamicList {
- struct DynamicArray da; /* access array */
- struct ListBase lb; /* two way linked dynamic list */
-} DynamicList;
-
-#endif
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 895ae03ab0f..a868cf8ea96 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -60,9 +60,9 @@
/* gzip the file in from and write it to "to".
- return -1 if zlib fails, -2 if the originating file does not exist
- note: will remove the "from" file
- */
+ * return -1 if zlib fails, -2 if the originating file does not exist
+ * note: will remove the "from" file
+ */
int BLI_file_gzip(const char *from, const char *to)
{
char buffer[10240];
@@ -106,8 +106,8 @@ int BLI_file_gzip(const char *from, const char *to)
}
/* gzip the file in from_file and write it to memery to_mem, at most size bytes.
- return the unziped size
- */
+ * return the unziped size
+ */
char *BLI_file_ungzip_to_mem(const char *from_file, int *size_r)
{
gzFile gzfile;
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index 3a0d44db12e..f55ebf915e2 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -99,8 +99,7 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
err= FT_Load_Glyph(face, glyph_index, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP);
// If loading succeeded, convert the FT glyph to the internal format
- if(!err)
- {
+ if(!err) {
int *npoints;
int *onpoints;
@@ -162,9 +161,8 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
if(k == 0) m = l;
//virtual conic on-curve points
- if(k < npoints[j] - 1 )
- {
- if( ftoutline.tags[l] == FT_Curve_Tag_Conic && ftoutline.tags[l+1] == FT_Curve_Tag_Conic) {
+ if (k < npoints[j] - 1) {
+ if (ftoutline.tags[l] == FT_Curve_Tag_Conic && ftoutline.tags[l+1] == FT_Curve_Tag_Conic) {
dx = (ftoutline.points[l].x + ftoutline.points[l+1].x)* scale / 2.0f;
dy = (ftoutline.points[l].y + ftoutline.points[l+1].y)* scale / 2.0f;
@@ -291,8 +289,7 @@ static int objchr_to_ftvfontdata(VFont *vfont, FT_ULong charcode)
if(!tf) return FALSE;
// Load the font to memory
- if(tf->pf)
- {
+ if (tf->pf) {
err= FT_New_Memory_Face( library,
tf->pf->data,
tf->pf->size,
@@ -322,13 +319,13 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
const char *fontname;
VFontData *vfd;
-/*
+#if 0
FT_CharMap found = 0;
FT_CharMap charmap;
FT_UShort my_platform_id = TT_PLATFORM_MICROSOFT;
FT_UShort my_encoding_id = TT_MS_ID_UNICODE_CS;
int n;
-*/
+#endif
// load the freetype font
err = FT_New_Memory_Face( library,
@@ -338,7 +335,8 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
&face );
if(err) return NULL;
-/*
+
+#if 0
for ( n = 0; n < face->num_charmaps; n++ )
{
charmap = face->charmaps[n];
@@ -355,7 +353,7 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
// now, select the charmap for the face object
err = FT_Set_Charmap( face, found );
if ( err ) { return NULL; }
-*/
+#endif
// allocate blender font
vfd= MEM_callocN(sizeof(*vfd), "FTVFontData");
@@ -368,17 +366,14 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
lcode= charcode= FT_Get_First_Char(face, &glyph_index);
// No charmap found from the ttf so we need to figure it out
- if(glyph_index == 0)
- {
+ if (glyph_index == 0) {
FT_CharMap found = NULL;
FT_CharMap charmap;
int n;
- for ( n = 0; n < face->num_charmaps; n++ )
- {
+ for (n = 0; n < face->num_charmaps; n++) {
charmap = face->charmaps[n];
- if (charmap->encoding == FT_ENCODING_APPLE_ROMAN)
- {
+ if (charmap->encoding == FT_ENCODING_APPLE_ROMAN) {
found = charmap;
break;
}
@@ -416,13 +411,13 @@ static int check_freetypefont(PackedFile * pf)
FT_Face face;
FT_GlyphSlot glyph;
FT_UInt glyph_index;
-/*
+#if 0
FT_CharMap charmap;
FT_CharMap found;
FT_UShort my_platform_id = TT_PLATFORM_MICROSOFT;
FT_UShort my_encoding_id = TT_MS_ID_UNICODE_CS;
int n;
-*/
+#endif
int success = 0;
err = FT_New_Memory_Face( library,
@@ -435,24 +430,23 @@ static int check_freetypefont(PackedFile * pf)
//XXX error("This is not a valid font");
}
else {
-/*
- for ( n = 0; n < face->num_charmaps; n++ )
- {
- charmap = face->charmaps[n];
- if ( charmap->platform_id == my_platform_id &&
- charmap->encoding_id == my_encoding_id )
- {
- found = charmap;
- break;
- }
+
+#if 0
+ for ( n = 0; n < face->num_charmaps; n++) {
+ charmap = face->charmaps[n];
+ if (charmap->platform_id == my_platform_id && charmap->encoding_id == my_encoding_id) {
+ found = charmap;
+ break;
+ }
}
- if ( !found ) { return 0; }
+ if (!found ) { return 0; }
// now, select the charmap for the face object
err = FT_Set_Charmap( face, found );
if ( err ) { return 0; }
-*/
+#endif
+
glyph_index = FT_Get_Char_Index( face, 'A' );
err = FT_Load_Glyph(face, glyph_index, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP);
if(err) success = 0;
diff --git a/source/blender/blenlib/intern/graph.c b/source/blender/blenlib/intern/graph.c
index d0d3d0e137e..967c4411903 100644
--- a/source/blender/blenlib/intern/graph.c
+++ b/source/blender/blenlib/intern/graph.c
@@ -895,7 +895,7 @@ static void markdownSecondarySymmetry(BGraph *graph, BNode *node, int depth, int
int i;
/* count the number of branches in this symmetry group
- * and determinte the axis of symmetry
+ * and determinate the axis of symmetry
* */
for (i = 0; i < node->degree; i++)
{
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c
index 52fd857d6e4..71077f8e467 100644
--- a/source/blender/blenlib/intern/listbase.c
+++ b/source/blender/blenlib/intern/listbase.c
@@ -182,10 +182,8 @@ void BLI_sortlist(ListBase *listbase, int (*cmp)(void *, void *))
if (cmp == NULL) return;
if (listbase == NULL) return;
- if (listbase->first != listbase->last)
- {
- for( previous = listbase->first, current = previous->next; current; current = next )
- {
+ if (listbase->first != listbase->last) {
+ for (previous = listbase->first, current = previous->next; current; current = next) {
next = current->next;
previous = current->prev;
@@ -338,6 +336,21 @@ void *BLI_findlink(const ListBase *listbase, int number)
return link;
}
+void *BLI_rfindlink(const ListBase *listbase, int number)
+{
+ Link *link = NULL;
+
+ if (number >= 0) {
+ link = listbase->last;
+ while (link != NULL && number != 0) {
+ number--;
+ link = link->prev;
+ }
+ }
+
+ return link;
+}
+
int BLI_findindex(const ListBase *listbase, void *vlink)
{
Link *link= NULL;
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c
index 2fd1a506004..74c7b67beed 100644
--- a/source/blender/blenlib/intern/math_base_inline.c
+++ b/source/blender/blenlib/intern/math_base_inline.c
@@ -102,7 +102,7 @@ MINLINE float interpf(float target, float origin, float fac)
/* useful to calculate an even width shell, by taking the angle between 2 planes.
* The return value is a scale on the offset.
- * no angle between planes is 1.0, as the angle between the 2 planes approches 180d
+ * no angle between planes is 1.0, as the angle between the 2 planes approaches 180d
* the distance gets very high, 180d would be inf, but this case isn't valid */
MINLINE float shell_angle_to_dist(const float angle)
{
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index b9772b1f3b4..96600b6665f 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -290,8 +290,8 @@ void xyz_to_rgb(float xc, float yc, float zc, float *r, float *g, float *b, int
}
/* we define a 'cpack' here as a (3 byte color code) number that can be expressed like 0xFFAA66 or so.
- for that reason it is sensitive for endianness... with this function it works correctly
-*/
+ * for that reason it is sensitive for endianness... with this function it works correctly
+ */
unsigned int hsv_to_cpack(float h, float s, float v)
{
@@ -413,11 +413,11 @@ void minmax_rgb(short c[])
}
/*If the requested RGB shade contains a negative weight for
- one of the primaries, it lies outside the color gamut
- accessible from the given triple of primaries. Desaturate
- it by adding white, equal quantities of R, G, and B, enough
- to make RGB all positive. The function returns 1 if the
- components were modified, zero otherwise.*/
+ * one of the primaries, it lies outside the color gamut
+ * accessible from the given triple of primaries. Desaturate
+ * it by adding white, equal quantities of R, G, and B, enough
+ * to make RGB all positive. The function returns 1 if the
+ * components were modified, zero otherwise.*/
int constrain_rgb(float *r, float *g, float *b)
{
float w;
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c
index f497470fa4c..47ee54d6215 100644
--- a/source/blender/blenlib/intern/math_color_inline.c
+++ b/source/blender/blenlib/intern/math_color_inline.c
@@ -79,9 +79,9 @@ MINLINE void linearrgb_to_srgb_uchar4(unsigned char srgb[4], const float linear[
}
/* predivide versions to work on associated/premultipled alpha. if this should
- be done or not depends on the background the image will be composited over,
- ideally you would never do color space conversion on an image with alpha
- because it is ill defined */
+ * be done or not depends on the background the image will be composited over,
+ * ideally you would never do color space conversion on an image with alpha
+ * because it is ill defined */
MINLINE void srgb_to_linearrgb_predivide_v4(float linear[4], const float srgb[4])
{
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index 64b31df9c8e..8217439b7be 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -331,8 +331,9 @@ int isect_line_line_v2(const float v1[2], const float v2[2], const float v3[2],
}
/* get intersection point of two 2D segments and return intersection type:
- -1: colliniar
- 1: intersection */
+ * -1: colliniar
+ * 1: intersection
+ */
int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[2], const float v4[2], float vi[2])
{
float a1, a2, b1, b2, c1, c2, d;
@@ -531,29 +532,28 @@ int isect_line_sphere_v2(const float l1[2], const float l2[2],
}
/*
--1: colliniar
- 1: intersection
-
-*/
+ * -1: colliniar
+ * 1: intersection
+ */
static short IsectLLPt2Df(const float x0, const float y0, const float x1, const float y1,
const float x2, const float y2, const float x3, const float y3, float *xi,float *yi)
{
/*
- this function computes the intersection of the sent lines
- and returns the intersection point, note that the function assumes
- the lines intersect. the function can handle vertical as well
- as horizontal lines. note the function isn't very clever, it simply
- applies the math, but we don't need speed since this is a
- pre-processing step
- */
+ * this function computes the intersection of the sent lines
+ * and returns the intersection point, note that the function assumes
+ * the lines intersect. the function can handle vertical as well
+ * as horizontal lines. note the function isn't very clever, it simply
+ * applies the math, but we don't need speed since this is a
+ * pre-processing step
+ */
float c1,c2, // constants of linear equations
det_inv, // the inverse of the determinant of the coefficient
m1,m2; // the slopes of each line
/*
- compute slopes, note the cludge for infinity, however, this will
- be close enough
- */
+ * compute slopes, note the cludge for infinity, however, this will
+ * be close enough
+ */
if (fabs(x1-x0) > 0.000001)
m1 = (y1-y0) / (x1-x0);
else
@@ -629,9 +629,9 @@ int isect_point_quad_v2(const float pt[2], const float v1[2], const float v2[2],
}
/* moved from effect.c
- test if the line starting at p1 ending at p2 intersects the triangle v0..v2
- return non zero if it does
-*/
+ * test if the line starting at p1 ending at p2 intersects the triangle v0..v2
+ * return non zero if it does
+ */
int isect_line_tri_v3(const float p1[3], const float p2[3],
const float v0[3], const float v1[3], const float v2[3],
float *r_lambda, float r_uv[2])
@@ -670,9 +670,9 @@ int isect_line_tri_v3(const float p1[3], const float p2[3],
return 1;
}
/* moved from effect.c
- test if the ray starting at p1 going in d direction intersects the triangle v0..v2
- return non zero if it does
-*/
+ * test if the ray starting at p1 going in d direction intersects the triangle v0..v2
+ * return non zero if it does
+ */
int isect_ray_tri_v3(const float p1[3], const float d[3],
const float v0[3], const float v1[3], const float v2[3],
float *r_lambda, float r_uv[2])
@@ -808,8 +808,7 @@ int isect_ray_tri_threshold_v3(const float p1[3], const float d[3],
if (u > 1) du = u - 1;
if (v < 0) dv = v;
if (v > 1) dv = v - 1;
- if (u > 0 && v > 0 && u + v > 1)
- {
+ if (u > 0 && v > 0 && u + v > 1) {
float t = u + v - 1;
du = u - t/2;
dv = v - t/2;
@@ -818,8 +817,7 @@ int isect_ray_tri_threshold_v3(const float p1[3], const float d[3],
mul_v3_fl(e1, du);
mul_v3_fl(e2, dv);
- if (dot_v3v3(e1, e1) + dot_v3v3(e2, e2) > threshold * threshold)
- {
+ if (dot_v3v3(e1, e1) + dot_v3v3(e2, e2) > threshold * threshold) {
return 0;
}
@@ -895,8 +893,7 @@ static int getLowestRoot(const float a, const float b, const float c, const floa
float determinant = b*b - 4.0f*a*c;
// If determinant is negative it means no solutions.
- if (determinant >= 0.0f)
- {
+ if (determinant >= 0.0f) {
// calculate the two roots: (if determinant == 0 then
// x1==x2 but lets disregard that slight optimization)
float sqrtD = (float)sqrt(determinant);
@@ -908,16 +905,14 @@ static int getLowestRoot(const float a, const float b, const float c, const floa
SWAP(float, r1, r2);
// Get lowest root:
- if (r1 > 0.0f && r1 < maxR)
- {
+ if (r1 > 0.0f && r1 < maxR) {
*root = r1;
return 1;
}
// It is possible that we want x2 - this can happen
// if x1 < 0
- if (r2 > 0.0f && r2 < maxR)
- {
+ if (r2 > 0.0f && r2 < maxR) {
*root = r2;
return 1;
}
@@ -951,14 +946,12 @@ int isect_sweeping_sphere_tri_v3(
a=dot_v3v3(p1,nor)-dot_v3v3(v0,nor);
nordotv=dot_v3v3(nor,vel);
- if (fabsf(nordotv) < 0.000001f)
- {
+ if (fabsf(nordotv) < 0.000001f) {
if(fabsf(a) >= radius) {
return 0;
}
}
- else
- {
+ else {
float t0=(-a+radius)/nordotv;
float t1=(-a-radius)/nordotv;
@@ -993,8 +986,7 @@ int isect_sweeping_sphere_tri_v3(
z=x+y-(a*c-b*b);
- if(z <= 0.0f && (x >= 0.0f && y >= 0.0f))
- {
+ if (z <= 0.0f && (x >= 0.0f && y >= 0.0f)) {
//(((unsigned int)z)& ~(((unsigned int)x)|((unsigned int)y))) & 0x80000000) {
*r_lambda=t0;
copy_v3_v3(ipoint,point);
@@ -1013,8 +1005,7 @@ int isect_sweeping_sphere_tri_v3(
b=2.0f*dot_v3v3(vel,temp);
c=dot_v3v3(temp,temp)-radius2;
- if(getLowestRoot(a, b, c, *r_lambda, r_lambda))
- {
+ if(getLowestRoot(a, b, c, *r_lambda, r_lambda)) {
copy_v3_v3(ipoint,v0);
found_by_sweep=1;
}
@@ -1024,8 +1015,7 @@ int isect_sweeping_sphere_tri_v3(
b=2.0f*dot_v3v3(vel,temp);
c=dot_v3v3(temp,temp)-radius2;
- if(getLowestRoot(a, b, c, *r_lambda, r_lambda))
- {
+ if (getLowestRoot(a, b, c, *r_lambda, r_lambda)) {
copy_v3_v3(ipoint,v1);
found_by_sweep=1;
}
@@ -1035,8 +1025,7 @@ int isect_sweeping_sphere_tri_v3(
b=2.0f*dot_v3v3(vel,temp);
c=dot_v3v3(temp,temp)-radius2;
- if(getLowestRoot(a, b, c, *r_lambda, r_lambda))
- {
+ if(getLowestRoot(a, b, c, *r_lambda, r_lambda)) {
copy_v3_v3(ipoint,v2);
found_by_sweep=1;
}
@@ -1056,12 +1045,10 @@ int isect_sweeping_sphere_tri_v3(
b=2.0f*(elen2*dot_v3v3(vel,bv)-edotv*edotbv);
c=elen2*(radius2-dot_v3v3(bv,bv))+edotbv*edotbv;
- if(getLowestRoot(a, b, c, *r_lambda, &newLambda))
- {
+ if (getLowestRoot(a, b, c, *r_lambda, &newLambda)) {
e=(edotv*newLambda-edotbv)/elen2;
- if(e >= 0.0f && e <= 1.0f)
- {
+ if (e >= 0.0f && e <= 1.0f) {
*r_lambda = newLambda;
copy_v3_v3(ipoint,e1);
mul_v3_fl(ipoint,e);
@@ -1080,12 +1067,10 @@ int isect_sweeping_sphere_tri_v3(
b=2.0f*(elen2*dot_v3v3(vel,bv)-edotv*edotbv);
c=elen2*(radius2-dot_v3v3(bv,bv))+edotbv*edotbv;
- if(getLowestRoot(a, b, c, *r_lambda, &newLambda))
- {
+ if (getLowestRoot(a, b, c, *r_lambda, &newLambda)) {
e=(edotv*newLambda-edotbv)/elen2;
- if(e >= 0.0f && e <= 1.0f)
- {
+ if (e >= 0.0f && e <= 1.0f) {
*r_lambda = newLambda;
copy_v3_v3(ipoint,e2);
mul_v3_fl(ipoint,e);
@@ -1109,12 +1094,10 @@ int isect_sweeping_sphere_tri_v3(
b=2.0f*(elen2*dot_v3v3(vel,bv)-edotv*edotbv);
c=elen2*(radius2-dot_v3v3(bv,bv))+edotbv*edotbv;
- if(getLowestRoot(a, b, c, *r_lambda, &newLambda))
- {
+ if (getLowestRoot(a, b, c, *r_lambda, &newLambda)) {
e=(edotv*newLambda-edotbv)/elen2;
- if(e >= 0.0f && e <= 1.0f)
- {
+ if (e >= 0.0f && e <= 1.0f) {
*r_lambda = newLambda;
copy_v3_v3(ipoint,e3);
mul_v3_fl(ipoint,e);
@@ -1279,13 +1262,11 @@ int isect_line_line_strict_v3(const float v1[3], const float v2[3], const float
return 1; /* intersection found */
}
- else
- {
+ else {
return 0;
}
}
- else
- {
+ else {
return 0;
}
}
@@ -1512,14 +1493,12 @@ int isect_point_tri_v2(float v0[2], float v1[2], float v2[2], float pt[2])
#endif
/*
-
- x1,y2
- | \
- | \ .(a,b)
- | \
- x1,y1-- x2,y1
-
-*/
+ * x1,y2
+ * | \
+ * | \ .(a,b)
+ * | \
+ * x1,y1-- x2,y1
+ */
int isect_point_tri_v2_int(const int x1, const int y1, const int x2, const int y2, const int a, const int b)
{
float v1[2], v2[2], v3[2], p[2];
@@ -1541,18 +1520,18 @@ int isect_point_tri_v2_int(const int x1, const int y1, const int x2, const int y
static int point_in_slice(const float p[3], const float v1[3], const float l1[3], const float l2[3])
{
-/*
-what is a slice ?
-some maths:
-a line including l1,l2 and a point not on the line
-define a subset of R3 delimeted by planes parallel to the line and orthogonal
-to the (point --> line) distance vector,one plane on the line one on the point,
-the room inside usually is rather small compared to R3 though still infinte
-useful for restricting (speeding up) searches
-e.g. all points of triangular prism are within the intersection of 3 'slices'
-onother trivial case : cube
-but see a 'spat' which is a deformed cube with paired parallel planes needs only 3 slices too
-*/
+ /*
+ * what is a slice ?
+ * some maths:
+ * a line including l1,l2 and a point not on the line
+ * define a subset of R3 delimited by planes parallel to the line and orthogonal
+ * to the (point --> line) distance vector,one plane on the line one on the point,
+ * the room inside usually is rather small compared to R3 though still infinte
+ * useful for restricting (speeding up) searches
+ * e.g. all points of triangular prism are within the intersection of 3 'slices'
+ * onother trivial case : cube
+ * but see a 'spat' which is a deformed cube with paired parallel planes needs only 3 slices too
+ */
float h,rp[3],cp[3],q[3];
closest_to_line_v3(cp,v1,l1,l2);
@@ -1565,8 +1544,8 @@ but see a 'spat' which is a deformed cube with paired parallel planes needs only
}
#if 0
-/*adult sister defining the slice planes by the origin and the normal
-NOTE |normal| may not be 1 but defining the thickness of the slice*/
+/* adult sister defining the slice planes by the origin and the normal
+ * NOTE |normal| may not be 1 but defining the thickness of the slice */
static int point_in_slice_as(float p[3],float origin[3],float normal[3])
{
float h,rp[3];
@@ -1791,7 +1770,7 @@ void interp_weights_face_v3(float w[4], const float v1[3], const float v2[3], co
if(degenerate || (w[0] < 0.0f)) {
/* if w[1] is negative, co is on the other side of the v1-v3 edge,
- so we interpolate using the other triangle */
+ * so we interpolate using the other triangle */
degenerate= barycentric_weights(v2, v3, v4, co, n, w2);
if(!degenerate) {
@@ -2035,8 +2014,8 @@ void interp_cubic_v3(float x[3], float v[3], const float x1[3], const float v1[3
void resolve_tri_uv(float r_uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2])
{
/* find UV such that
- t= u*t0 + v*t1 + (1-u-v)*t2
- u*(t0-t2) + v*(t1-t2)= t-t2 */
+ * t= u*t0 + v*t1 + (1-u-v)*t2
+ * u*(t0-t2) + v*(t1-t2)= t-t2 */
const double a= st0[0]-st2[0], b= st1[0]-st2[0];
const double c= st0[1]-st2[1], d= st1[1]-st2[1];
const double det= a*d - c*b;
@@ -2056,7 +2035,7 @@ void resolve_quad_uv(float r_uv[2], const float st[2], const float st0[2], const
(st2[0]*st3[1] - st2[1]*st3[0]) + (st3[0]*st0[1] - st3[1]*st0[0]);
/* X is 2D cross product (determinant)
- A= (p0-p) X (p0-p3)*/
+ * A= (p0-p) X (p0-p3)*/
const double a= (st0[0]-st[0])*(st0[1]-st3[1]) - (st0[1]-st[1])*(st0[0]-st3[0]);
/* B= ( (p0-p) X (p1-p2) + (p1-p) X (p0-p3) ) / 2 */
@@ -2083,7 +2062,7 @@ void resolve_quad_uv(float r_uv[2], const float st[2], const float st0[2], const
}
/* find UV such that
- fST = (1-u)(1-v)*ST0 + u*(1-v)*ST1 + u*v*ST2 + (1-u)*v*ST3 */
+ * fST = (1-u)(1-v)*ST0 + u*(1-v)*ST1 + u*v*ST2 + (1-u)*v*ST3 */
{
const double denom_s= (1-r_uv[0])*(st0[0]-st3[0]) + r_uv[0]*(st1[0]-st2[0]);
const double denom_t= (1-r_uv[0])*(st0[1]-st3[1]) + r_uv[0]*(st1[1]-st2[1]);
@@ -2386,7 +2365,7 @@ void accumulate_vertex_normals(float n1[3], float n2[3], float n3[3],
}
/* Add weighted face normal component into normals of the face vertices.
- Caller must pass pre-allocated vdiffs of nverts length. */
+ * Caller must pass pre-allocated vdiffs of nverts length. */
void accumulate_vertex_normals_poly(float **vertnos, float polyno[3],
float **vertcos, float vdiffs[][3], int nverts)
{
@@ -2405,9 +2384,9 @@ void accumulate_vertex_normals_poly(float **vertnos, float polyno[3],
for(i=0; i<nverts; i++) {
const float *cur_edge = vdiffs[i];
-
+
/* calculate angle between the two poly edges incident on
- this vertex */
+ * this vertex */
const float fac= saacos(-dot_v3v3(cur_edge, prev_edge));
/* accumulate */
@@ -2501,27 +2480,27 @@ void tangent_from_uv(float uv1[2], float uv2[2], float uv3[3], float co1[3], flo
/* vector clouds */
/* void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,float (*rpos)[3], float *rweight,
- float lloc[3],float rloc[3],float lrot[3][3],float lscale[3][3])
-
-input
-(
-int list_size
-4 lists as pointer to array[list_size]
-1. current pos array of 'new' positions
-2. current weight array of 'new'weights (may be NULL pointer if you have no weights )
-3. reference rpos array of 'old' positions
-4. reference rweight array of 'old'weights (may be NULL pointer if you have no weights )
-)
-output
-(
-float lloc[3] center of mass pos
-float rloc[3] center of mass rpos
-float lrot[3][3] rotation matrix
-float lscale[3][3] scale matrix
-pointers may be NULL if not needed
-)
-
-*/
+ * float lloc[3],float rloc[3],float lrot[3][3],float lscale[3][3])
+ *
+ * input
+ * (
+ * int list_size
+ * 4 lists as pointer to array[list_size]
+ * 1. current pos array of 'new' positions
+ * 2. current weight array of 'new'weights (may be NULL pointer if you have no weights )
+ * 3. reference rpos array of 'old' positions
+ * 4. reference rweight array of 'old'weights (may be NULL pointer if you have no weights )
+ * )
+ * output
+ * (
+ * float lloc[3] center of mass pos
+ * float rloc[3] center of mass rpos
+ * float lrot[3][3] rotation matrix
+ * float lscale[3][3] scale matrix
+ * pointers may be NULL if not needed
+ * )
+ */
+
/* can't believe there is none in math utils */
static float _det_m3(float m2[3][3])
{
@@ -2548,8 +2527,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
if (lrot) unit_m3(lrot);
if (lscale) unit_m3(lscale);
/* do com for both clouds */
- if (pos && rpos && (list_size > 0)) /* paranoya check */
- {
+ if (pos && rpos && (list_size > 0)) { /* paranoya check */
/* do com for both clouds */
for(a=0; a<list_size; a++) {
if (weight) {
@@ -2607,8 +2585,8 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
m[2][1] += va[2] * vb[1];
m[2][2] += va[2] * vb[2];
- /* building the referenc matrix on the fly
- needed to scale properly later*/
+ /* building the reference matrix on the fly
+ * needed to scale properly later */
mr[0][0] += va[0] * va[0];
mr[0][1] += va[0] * va[1];
@@ -3063,7 +3041,7 @@ static float ff_quad_form_factor(const float p[3], const float n[3], const float
float form_factor_hemi_poly(float p[3], float n[3], float v1[3], float v2[3], float v3[3], float v4[3])
{
/* computes how much hemisphere defined by point and normal is
- covered by a quad or triangle, cosine weighted */
+ * covered by a quad or triangle, cosine weighted */
float q0[3], q1[3], q2[3], q3[3], contrib= 0.0f;
if(ff_visible_quad(p, n, v1, v2, v3, q0, q1, q2, q3))
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index e07025ccf56..b777b394005 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -373,6 +373,25 @@ void mul_m4_v4(float mat[4][4], float r[4])
mul_v4_m4v4(r, mat, r);
}
+void mul_v4d_m4v4d(double r[4], float mat[4][4], double v[4])
+{
+ double x, y, z;
+
+ x= v[0];
+ y= v[1];
+ z= v[2];
+
+ r[0]= x*(double)mat[0][0] + y*(double)mat[1][0] + z*(double)mat[2][0] + (double)mat[3][0]*v[3];
+ r[1]= x*(double)mat[0][1] + y*(double)mat[1][1] + z*(double)mat[2][1] + (double)mat[3][1]*v[3];
+ r[2]= x*(double)mat[0][2] + y*(double)mat[1][2] + z*(double)mat[2][2] + (double)mat[3][2]*v[3];
+ r[3]= x*(double)mat[0][3] + y*(double)mat[1][3] + z*(double)mat[2][3] + (double)mat[3][3]*v[3];
+}
+
+void mul_m4_v4d(float mat[4][4], double r[4])
+{
+ mul_v4d_m4v4d(r, mat, r);
+}
+
void mul_v3_m3v3(float r[3], float M[3][3], float a[3])
{
r[0]= M[0][0]*a[0] + M[1][0]*a[1] + M[2][0]*a[2];
@@ -1290,7 +1309,7 @@ void print_m4(const char *str, float m[][4])
/*********************************** SVD ************************************
* from TNT matrix library
-
+ *
* Compute the Single Value Decomposition of an arbitrary matrix A
* That is compute the 3 matrices U,W,V with U column orthogonal (m,n)
* ,W a diagonal matrix and V an orthogonal square matrix s.t.
@@ -1724,7 +1743,7 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
void pseudoinverse_m4_m4(float Ainv[4][4], float A[4][4], float epsilon)
{
/* compute moon-penrose pseudo inverse of matrix, singular values
- below epsilon are ignored for stability (truncated SVD) */
+ * below epsilon are ignored for stability (truncated SVD) */
float V[4][4], W[4], Wm[4][4], U[4][4];
int i;
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index 38bc4794135..4e85d033cf7 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -706,12 +706,12 @@ void eulO_to_axis_angle(float axis[3], float *angle, const float eul[3], const s
quat_to_axis_angle(axis, angle,q);
}
-/* axis angle to 3x3 matrix - safer version (normalisation of axis performed) */
+/* axis angle to 3x3 matrix - safer version (normalization of axis performed) */
void axis_angle_to_mat3(float mat[3][3], const float axis[3], const float angle)
{
float nor[3], nsi[3], co, si, ico;
- /* normalise the axis first (to remove unwanted scaling) */
+ /* normalize the axis first (to remove unwanted scaling) */
if(normalize_v3_v3(nor, axis) == 0.0f) {
unit_m3(mat);
return;
@@ -737,7 +737,7 @@ void axis_angle_to_mat3(float mat[3][3], const float axis[3], const float angle)
mat[2][2] = ((nor[2] * nor[2]) * ico) + co;
}
-/* axis angle to 4x4 matrix - safer version (normalisation of axis performed) */
+/* axis angle to 4x4 matrix - safer version (normalization of axis performed) */
void axis_angle_to_mat4(float mat[4][4], const float axis[3], const float angle)
{
float tmat[3][3];
@@ -1077,7 +1077,7 @@ void compatible_eul(float eul[3], const float oldrot[3])
}
/* the method below was there from ancient days... but why! probably because the code sucks :)
- */
+ */
#if 0
/* calc again */
dx= eul[0] - oldrot[0];
@@ -1134,10 +1134,10 @@ void mat3_to_compatible_eul(float eul[3], const float oldrot[3], float mat[][3])
/* Euler Rotation Order Code:
* was adapted from
- ANSI C code from the article
- "Euler Angle Conversion"
- by Ken Shoemake, shoemake@graphics.cis.upenn.edu
- in "Graphics Gems IV", Academic Press, 1994
+ * ANSI C code from the article
+ * "Euler Angle Conversion"
+ * by Ken Shoemake, shoemake@graphics.cis.upenn.edu
+ * in "Graphics Gems IV", Academic Press, 1994
* for use in Blender
*/
@@ -1393,37 +1393,37 @@ void eulO_to_gimbal_axis(float gmat[][3], const float eul[3], const short order)
/******************************* Dual Quaternions ****************************/
-/*
- Conversion routines between (regular quaternion, translation) and
- dual quaternion.
-
- Version 1.0.0, February 7th, 2007
-
- Copyright (C) 2006-2007 University of Dublin, Trinity College, All Rights
- Reserved
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the author(s) be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Author: Ladislav Kavan, kavanl@cs.tcd.ie
-
- Changes for Blender:
- - renaming, style changes and optimizations
- - added support for scaling
-*/
+/**
+ * Conversion routines between (regular quaternion, translation) and
+ * dual quaternion.
+ *
+ * Version 1.0.0, February 7th, 2007
+ *
+ * Copyright (C) 2006-2007 University of Dublin, Trinity College, All Rights
+ * Reserved
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the author(s) be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ *
+ * \author Ladislav Kavan, kavanl@cs.tcd.ie
+ *
+ * Changes for Blender:
+ * - renaming, style changes and optimization's
+ * - added support for scaling
+ */
void mat4_to_dquat(DualQuat *dq,float basemat[][4], float mat[][4])
{
@@ -1432,7 +1432,7 @@ void mat4_to_dquat(DualQuat *dq,float basemat[][4], float mat[][4])
float R[4][4], S[4][4];
/* split scaling and rotation, there is probably a faster way to do
- this, it's done like this now to correctly get negative scaling */
+ * this, it's done like this now to correctly get negative scaling */
mult_m4_m4m4(baseRS, mat, basemat);
mat4_to_size(scale,baseRS);
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index ce9896b99cc..01ba62bc741 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -293,8 +293,8 @@ void bisect_v3_v3v3v3(float out[3], const float v1[3], const float v2[3], const
}
/* Returns a reflection vector from a vector and a normal vector
-reflect = vec - ((2 * DotVecs(vec, mirror)) * mirror)
-*/
+ * reflect = vec - ((2 * DotVecs(vec, mirror)) * mirror)
+ */
void reflect_v3_v3v3(float out[3], const float v1[3], const float v2[3])
{
float vec[3], normal[3];
@@ -336,8 +336,8 @@ void ortho_basis_v3v3_v3(float v1[3], float v2[3], const float v[3])
}
/* Rotate a point p by angle theta around an arbitrary axis r
- http://local.wasp.uwa.edu.au/~pbourke/geometry/
-*/
+ * http://local.wasp.uwa.edu.au/~pbourke/geometry/
+ */
void rotate_normalized_v3_v3v3fl(float r[3], const float p[3], const float axis[3], const float angle)
{
const float costheta= cos(angle);
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 12e11714a13..6414245fb3e 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -164,6 +164,51 @@ MINLINE void copy_v4_v4_int(int r[4], const int a[4])
r[3]= a[3];
}
+/* double -> float */
+MINLINE void copy_v2fl_v2db(float r[2], const double a[2])
+{
+ r[0] = (float)a[0];
+ r[1] = (float)a[1];
+}
+
+MINLINE void copy_v3fl_v3db(float r[3], const double a[3])
+{
+ r[0] = (float)a[0];
+ r[1] = (float)a[1];
+ r[2] = (float)a[2];
+}
+
+MINLINE void copy_v4fl_v4db(float r[4], const double a[4])
+{
+ r[0] = (float)a[0];
+ r[1] = (float)a[1];
+ r[2] = (float)a[2];
+ r[3] = (float)a[3];
+}
+
+/* float -> double */
+MINLINE void copy_v2db_v2fl(double r[2], const float a[2])
+{
+ r[0] = (double)a[0];
+ r[1] = (double)a[1];
+}
+
+MINLINE void copy_v3db_v3fl(double r[3], const float a[3])
+{
+ r[0] = (double)a[0];
+ r[1] = (double)a[1];
+ r[2] = (double)a[2];
+}
+
+MINLINE void copy_v4db_v4fl(double r[4], const float a[4])
+{
+ r[0] = (double)a[0];
+ r[1] = (double)a[1];
+ r[2] = (double)a[2];
+ r[3] = (double)a[3];
+}
+
+
MINLINE void swap_v2_v2(float a[2], float b[2])
{
SWAP(float, a[0], b[0]);
@@ -523,7 +568,7 @@ MINLINE float normalize_v3_v3(float r[3], const float a[3])
float d= dot_v3v3(a, a);
/* a larger value causes normalize errors in a
- scaled down models with camera xtreme close */
+ * scaled down models with camera xtreme close */
if(d > 1.0e-35f) {
d= sqrtf(d);
mul_v3_v3fl(r, a, 1.0f/d);
@@ -541,7 +586,7 @@ MINLINE double normalize_v3_d(double n[3])
double d= n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
/* a larger value causes normalize errors in a
- scaled down models with camera xtreme close */
+ * scaled down models with camera xtreme close */
if(d > 1.0e-35) {
double mul;
diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c
index f77ea3895c3..ddf165662fc 100644
--- a/source/blender/blenlib/intern/noise.c
+++ b/source/blender/blenlib/intern/noise.c
@@ -1043,7 +1043,8 @@ float BLI_hnoisep(float noisesize, float x, float y, float z)
return noise3_perlin(vec);
}
-/*static float turbulencep(float noisesize, float x, float y, float z, int nr)
+#if 0
+static float turbulencep(float noisesize, float x, float y, float z, int nr)
{
float vec[3];
@@ -1052,7 +1053,8 @@ float BLI_hnoisep(float noisesize, float x, float y, float z)
vec[2]= z/noisesize;
nr++;
return turbulence_perlin(vec, 1.0, (float)(1<<nr));
-}*/
+}
+#endif
/******************/
/* VORONOI/WORLEY */
@@ -1106,7 +1108,7 @@ static float dist_Minkovsky(float x, float y, float z, float e)
/* Not 'pure' Worley, but the results are virtually the same.
- Returns distances in da and point coords in pa */
+ * Returns distances in da and point coords in pa */
void voronoi(float x, float y, float z, float* da, float* pa, float me, int dtype)
{
int xx, yy, zz, xi, yi, zi;
@@ -1222,7 +1224,7 @@ static float voronoi_Cr(float x, float y, float z)
/* Signed version of all 6 of the above, just 2x-1, not really correct though (range is potentially (0, sqrt(6)).
- Used in the musgrave functions */
+ * Used in the musgrave functions */
static float voronoi_F1S(float x, float y, float z)
{
float da[4], pa[12];
@@ -1506,9 +1508,10 @@ float mg_fBm(float x, float y, float z, float H, float lacunarity, float octaves
* ``octaves'' is the number of frequencies in the fBm
* ``offset'' is the zero offset, which determines multifractality (NOT USED??)
*/
- /* this one is in fact rather confusing,
- * there seem to be errors in the original source code (in all three versions of proc.text&mod),
- * I modified it to something that made sense to me, so it might be wrong... */
+
+/* this one is in fact rather confusing,
+ * there seem to be errors in the original source code (in all three versions of proc.text&mod),
+ * I modified it to something that made sense to me, so it might be wrong... */
float mg_MultiFractal(float x, float y, float z, float H, float lacunarity, float octaves, int noisebasis)
{
float rmd, value=1.0, pwr=1.0, pwHL=powf(lacunarity, -H);
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index ec8e1cf6b82..a512ac746f9 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -264,7 +264,7 @@ int BLI_uniquename_cb(int (*unique_check)(void *, const char *), void *arg, cons
* name_offs: should be calculated using offsetof(structname, membername) macro from stddef.h
* len: maximum length of string (to prevent overflows, etc.)
* defname: the name that should be used by default if none is specified already
- * delim: the character which acts as a delimeter between parts of the name
+ * delim: the character which acts as a delimiter between parts of the name
*/
static int uniquename_find_dupe(ListBase *list, void *vlink, const char *name, short name_offs)
{
@@ -335,7 +335,7 @@ void BLI_cleanup_path(const char *relabase, char *dir)
* is the same as
* strcpy( start, eind );
* except strcpy should not be used because there is overlap,
- * so use memmove's slightly more obscure syntax - Campbell
+ * so use memmove's slightly more obscure syntax - Campbell
*/
#ifdef WIN32
@@ -439,7 +439,7 @@ void BLI_path_rel(char *file, const char *relfile)
if (BLI_strnlen(relfile, 3) > 2 && relfile[1] != ':') {
char* ptemp;
/* fix missing volume name in relative base,
- can happen with old recent-files.txt files */
+ * can happen with old recent-files.txt files */
get_default_root(temp);
ptemp = &temp[2];
if (relfile[0] != '\\' && relfile[0] != '/') {
@@ -468,10 +468,9 @@ void BLI_path_rel(char *file, const char *relfile)
/* the last slash in the file indicates where the path part ends */
lslash = BLI_last_slash(temp);
- if (lslash)
- {
+ if (lslash) {
/* find the prefix of the filename that is equal for both filenames.
- This is replaced by the two slashes at the beginning */
+ * This is replaced by the two slashes at the beginning */
char *p= temp;
char *q= file;
@@ -490,8 +489,8 @@ void BLI_path_rel(char *file, const char *relfile)
}
/* we might have passed the slash when the beginning of a dir matches
- so we rewind. Only check on the actual filename
- */
+ * so we rewind. Only check on the actual filename
+ */
if (*q != '/') {
while ( (q >= file) && (*q != '/') ) { --q; --p; }
}
@@ -502,10 +501,10 @@ void BLI_path_rel(char *file, const char *relfile)
strcpy(res, "//");
/* p now points to the slash that is at the beginning of the part
- where the path is different from the relative path.
- We count the number of directories we need to go up in the
- hierarchy to arrive at the common 'prefix' of the path
- */
+ * where the path is different from the relative path.
+ * We count the number of directories we need to go up in the
+ * hierarchy to arrive at the common 'prefix' of the path
+ */
while (p && p < lslash) {
if (*p == '/')
strcat(res, "../");
@@ -646,9 +645,9 @@ int BLI_path_abs(char *path, const char *basepath)
BLI_strncpy(vol, path, 3);
/* we are checking here if we have an absolute path that is not in the current
- blend file as a lib main - we are basically checking for the case that a
- UNIX root '/' is passed.
- */
+ * blend file as a lib main - we are basically checking for the case that a
+ * UNIX root '/' is passed.
+ */
if (!wasrelative && (vol[1] != ':' && (vol[0] == '\0' || vol[0] == '/' || vol[0] == '\\'))) {
char *p = path;
get_default_root(tmp);
@@ -685,11 +684,11 @@ int BLI_path_abs(char *path, const char *basepath)
BLI_cleanup_path(NULL, base);
/* push slashes into unix mode - strings entering this part are
- potentially messed up: having both back- and forward slashes.
- Here we push into one conform direction, and at the end we
- push them into the system specific dir. This ensures uniformity
- of paths and solving some problems (and prevent potential future
- ones) -jesterKing. */
+ * potentially messed up: having both back- and forward slashes.
+ * Here we push into one conform direction, and at the end we
+ * push them into the system specific dir. This ensures uniformity
+ * of paths and solving some problems (and prevent potential future
+ * ones) -jesterKing. */
BLI_char_switch(tmp, '\\', '/');
BLI_char_switch(base, '\\', '/');
@@ -716,11 +715,11 @@ int BLI_path_abs(char *path, const char *basepath)
#ifdef WIN32
/* skip first two chars, which in case of
- absolute path will be drive:/blabla and
- in case of relpath //blabla/. So relpath
- // will be retained, rest will be nice and
- shiny win32 backward slashes :) -jesterKing
- */
+ * absolute path will be drive:/blabla and
+ * in case of relpath //blabla/. So relpath
+ * // will be retained, rest will be nice and
+ * shiny win32 backward slashes :) -jesterKing
+ */
BLI_char_switch(path+2, '/', '\\');
#endif
@@ -730,7 +729,7 @@ int BLI_path_abs(char *path, const char *basepath)
/*
* Should only be done with command line paths.
- * this is NOT somthing blenders internal paths support like the // prefix
+ * this is NOT something blenders internal paths support like the // prefix
*/
int BLI_path_cwd(char *path)
{
@@ -747,18 +746,18 @@ int BLI_path_cwd(char *path)
if (wasrelative==1) {
char cwd[FILE_MAX]= "";
- BLI_current_working_dir(cwd, sizeof(cwd)); /* incase the full path to the blend isnt used */
+ BLI_current_working_dir(cwd, sizeof(cwd)); /* in case the full path to the blend isnt used */
if (cwd[0] == '\0') {
printf( "Could not get the current working directory - $PWD for an unknown reason.");
} else {
/* uses the blend path relative to cwd important for loading relative linked files.
- *
- * cwd should contain c:\ etc on win32 so the relbase can be NULL
- * relbase being NULL also prevents // being misunderstood as relative to the current
- * blend file which isnt a feature we want to use in this case since were dealing
- * with a path from the command line, rather than from inside Blender */
-
+ *
+ * cwd should contain c:\ etc on win32 so the relbase can be NULL
+ * relbase being NULL also prevents // being misunderstood as relative to the current
+ * blend file which isnt a feature we want to use in this case since were dealing
+ * with a path from the command line, rather than from inside Blender */
+
char origpath[FILE_MAX];
BLI_strncpy(origpath, path, FILE_MAX);
@@ -805,7 +804,7 @@ void BLI_getlastdir(const char* dir, char *last, const size_t maxlen)
/* This is now only used to really get the user's default document folder */
/* On Windows I chose the 'Users/<MyUserName>/Documents' since it's used
- as default location to save documents */
+ * as default location to save documents */
const char *BLI_getDefaultDocumentFolder(void)
{
#ifndef WIN32
@@ -838,8 +837,7 @@ const char *BLI_getDefaultDocumentFolder(void)
*/
hResult = SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, documentfolder);
- if (hResult == S_OK)
- {
+ if (hResult == S_OK) {
if (BLI_is_dir(documentfolder)) return documentfolder;
}
@@ -1153,7 +1151,7 @@ char *BLI_get_folder_version(const int id, const int ver, const int do_check)
ok= get_path_system(path, NULL, NULL, NULL, ver);
break;
default:
- path[0]= '\0'; /* incase do_check is false */
+ path[0]= '\0'; /* in case do_check is false */
ok= FALSE;
BLI_assert(!"incorrect ID");
}
@@ -1196,8 +1194,8 @@ void BLI_setenv(const char *env, const char*val)
/**
- Only set an env var if already not there.
- Like Unix setenv(env, val, 0);
+ * Only set an env var if already not there.
+ * Like Unix setenv(env, val, 0);
*/
void BLI_setenv_if_new(const char *env, const char* val)
{
@@ -1288,13 +1286,13 @@ void BLI_make_file_string(const char *relabase, char *string, const char *dir,
/* we first push all slashes into unix mode, just to make sure we don't get
- any mess with slashes later on. -jesterKing */
+ * any mess with slashes later on. -jesterKing */
/* constant strings can be passed for those parameters - don't change them - elubie */
- /*
+#if 0
BLI_char_switch(relabase, '\\', '/');
BLI_char_switch(dir, '\\', '/');
BLI_char_switch(file, '\\', '/');
- */
+#endif
/* Resolve relative references */
if (relabase && dir[0] == '/' && dir[1] == '/') {
@@ -1547,31 +1545,31 @@ char *BLI_path_basename(char *path)
return filename ? filename + 1 : path;
}
-/*
- Produce image export path.
-
- Fails returning 0 if image filename is empty or if destination path
- matches image path (i.e. both are the same file).
-
- Trailing slash in dest_dir is optional.
-
- Logic:
-
- - if an image is "below" current .blend file directory, rebuild the
- same dir structure in dest_dir
-
- For example //textures/foo/bar.png becomes
- [dest_dir]/textures/foo/bar.png.
-
- - if an image is not "below" current .blend file directory,
- disregard it's path and copy it in the same directory where 3D file
- goes.
-
- For example //../foo/bar.png becomes [dest_dir]/bar.png.
-
- 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 behavior across exporters.
+/**
+ * Produce image export path.
+ *
+ * Fails returning 0 if image filename is empty or if destination path
+ * matches image path (i.e. both are the same file).
+ *
+ * Trailing slash in dest_dir is optional.
+ *
+ * Logic:
+ *
+ * - if an image is "below" current .blend file directory, rebuild the
+ * same dir structure in dest_dir
+ *
+ * For example //textures/foo/bar.png becomes
+ * [dest_dir]/textures/foo/bar.png.
+ *
+ * - if an image is not "below" current .blend file directory,
+ * disregard it's path and copy it in the same directory where 3D file
+ * goes.
+ *
+ * For example //../foo/bar.png becomes [dest_dir]/bar.png.
+ *
+ * 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 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)
{
@@ -1740,18 +1738,18 @@ static int add_win32_extension(char *name)
return (retval);
}
-/*
-* Checks if name is a fully qualified filename to an executable.
-* If not it searches $PATH for the file. On Windows it also
-* adds the correct extension (.com .exe etc) from
-* $PATHEXT if necessary. Also on Windows it translates
-* 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
-* (must be FILE_MAX minimum)
-* \param name The name of the executable (usually argv[0]) to be checked
-*/
+/**
+ * Checks if name is a fully qualified filename to an executable.
+ * If not it searches $PATH for the file. On Windows it also
+ * adds the correct extension (.com .exe etc) from
+ * $PATHEXT if necessary. Also on Windows it translates
+ * 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
+ * (must be FILE_MAX minimum)
+ * \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)
{
char filename[FILE_MAX];
@@ -1849,15 +1847,15 @@ const char *BLI_program_dir(void)
}
/**
-* Gets the temp directory when blender first runs.
-* If the default path is not found, use try $TEMP
-*
-* 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
-*/
+ * Gets the temp directory when blender first runs.
+ * If the default path is not found, use try $TEMP
+ *
+ * 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
+ */
static void BLI_where_is_temp(char *fullname, const size_t maxlen, char *userdir)
{
fullname[0] = '\0';
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index 318cd15d2e9..dcf03590808 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -63,52 +63,52 @@ struct PBVHNode {
BB orig_vb;
/* For internal nodes, the offset of the children in the PBVH
- 'nodes' array. */
+ * 'nodes' array. */
int children_offset;
/* Pointer into the PBVH prim_indices array and the number of
- primitives used by this leaf node.
-
- Used for leaf nodes in both mesh- and multires-based PBVHs.
- */
+ * primitives used by this leaf node.
+ *
+ * Used for leaf nodes in both mesh- and multires-based PBVHs.
+ */
int *prim_indices;
unsigned int totprim;
/* Array of indices into the mesh's MVert array. Contains the
- indices of all vertices used by faces that are within this
- node's bounding box.
-
- Note that a vertex might be used by a multiple faces, and
- these faces might be in different leaf nodes. Such a vertex
- will appear in the vert_indices array of each of those leaf
- nodes.
-
- In order to support cases where you want access to multiple
- nodes' vertices without duplication, the vert_indices array
- is ordered such that the first part of the array, up to
- index 'uniq_verts', contains "unique" vertex indices. These
- vertices might not be truly unique to this node, but if
- they appear in another node's vert_indices array, they will
- be above that node's 'uniq_verts' value.
-
- Used for leaf nodes in a mesh-based PBVH (not multires.)
- */
+ * indices of all vertices used by faces that are within this
+ * node's bounding box.
+ *
+ * Note that a vertex might be used by a multiple faces, and
+ * these faces might be in different leaf nodes. Such a vertex
+ * will appear in the vert_indices array of each of those leaf
+ * nodes.
+ *
+ * In order to support cases where you want access to multiple
+ * nodes' vertices without duplication, the vert_indices array
+ * is ordered such that the first part of the array, up to
+ * index 'uniq_verts', contains "unique" vertex indices. These
+ * vertices might not be truly unique to this node, but if
+ * they appear in another node's vert_indices array, they will
+ * be above that node's 'uniq_verts' value.
+ *
+ * Used for leaf nodes in a mesh-based PBVH (not multires.)
+ */
int *vert_indices;
unsigned int uniq_verts, face_verts;
/* An array mapping face corners into the vert_indices
- array. The array is sized to match 'totprim', and each of
- the face's corners gets an index into the vert_indices
- array, in the same order as the corners in the original
- MFace. The fourth value should not be used if the original
- face is a triangle.
-
- Used for leaf nodes in a mesh-based PBVH (not multires.)
- */
+ * array. The array is sized to match 'totprim', and each of
+ * the face's corners gets an index into the vert_indices
+ * array, in the same order as the corners in the original
+ * MFace. The fourth value should not be used if the original
+ * face is a triangle.
+ *
+ * Used for leaf nodes in a mesh-based PBVH (not multires.)
+ */
int (*face_vert_indices)[4];
/* Indicates whether this node is a leaf or not; also used for
- marking various updates that need to be applied. */
+ * marking various updates that need to be applied. */
PBVHNodeFlags flag : 8;
/* Used for raycasting: how close bb is to the ray point. */
@@ -136,11 +136,12 @@ struct PBVH {
DMGridData **grids;
DMGridAdjacency *gridadj;
void **gridfaces;
+ const DMFlagMat *grid_flag_mats;
int totgrid;
int gridsize;
/* Only used during BVH build and update,
- don't need to remain valid after */
+ * don't need to remain valid after */
BLI_bitmap vert_bitmap;
#ifdef PERFCNTRS
@@ -261,6 +262,17 @@ static void update_node_vb(PBVH *bvh, PBVHNode *node)
// BB_expand(&node->vb, co);
//}
+static int face_materials_match(const MFace *f1, const MFace *f2)
+{
+ return ((f1->flag & ME_SMOOTH) == (f2->flag & ME_SMOOTH) &&
+ (f1->mat_nr == f2->mat_nr));
+}
+
+static int grid_materials_match(const DMFlagMat *f1, const DMFlagMat *f2)
+{
+ return ((f1->flag & ME_SMOOTH) == (f2->flag & ME_SMOOTH) &&
+ (f1->mat_nr == f2->mat_nr));
+}
/* Adapted from BLI_kdopbvh.c */
/* Returns the index of the first element on the right of the partition */
@@ -280,17 +292,35 @@ static int partition_indices(int *prim_indices, int lo, int hi, int axis,
}
}
-static void check_partitioning(int *prim_indices, int lo, int hi, int axis,
- float mid, BBC *prim_bbc, int index_of_2nd_partition)
+/* Returns the index of the first element on the right of the partition */
+static int partition_indices_material(PBVH *bvh, int lo, int hi)
{
- int i;
- for(i = lo; i <= hi; ++i) {
- const float c = prim_bbc[prim_indices[i]].bcentroid[axis];
+ const MFace *faces = bvh->faces;
+ const DMFlagMat *flagmats = bvh->grid_flag_mats;
+ const int *indices = bvh->prim_indices;
+ const void *first;
+ int i=lo, j=hi;
- if((i < index_of_2nd_partition && c > mid) ||
- (i > index_of_2nd_partition && c < mid)) {
- printf("fail\n");
+ if(bvh->faces)
+ first = &faces[bvh->prim_indices[lo]];
+ else
+ first = &flagmats[bvh->prim_indices[lo]];
+
+ for(;;) {
+ if(bvh->faces) {
+ for(; face_materials_match(first, &faces[indices[i]]); i++);
+ for(; !face_materials_match(first, &faces[indices[j]]); j--);
+ }
+ else {
+ for(; grid_materials_match(first, &flagmats[indices[i]]); i++);
+ for(; !grid_materials_match(first, &flagmats[indices[j]]); j--);
}
+
+ if(!(i < j))
+ return i;
+
+ SWAP(int, bvh->prim_indices[i], bvh->prim_indices[j]);
+ i++;
}
}
@@ -311,7 +341,7 @@ static void grow_nodes(PBVH *bvh, int totnode)
}
/* Add a vertex to the map, with a positive value for unique vertices and
- a negative value for additional vertices */
+ * a negative value for additional vertices */
static int map_insert_vert(PBVH *bvh, GHash *map,
unsigned int *face_verts,
unsigned int *uniq_verts, int vertex)
@@ -416,83 +446,127 @@ static void build_grids_leaf_node(PBVH *bvh, PBVHNode *node)
node->flag |= PBVH_UpdateDrawBuffers;
}
-/* Recursively build a node in the tree
+static void update_vb(PBVH *bvh, PBVHNode *node, BBC *prim_bbc,
+ int offset, int count)
+{
+ int i;
+
+ BB_reset(&node->vb);
+ for(i = offset + count - 1; i >= offset; --i) {
+ BB_expand_with_bb(&node->vb, (BB*)(&prim_bbc[bvh->prim_indices[i]]));
+ }
+ node->orig_vb = node->vb;
+}
+
+static void build_leaf(PBVH *bvh, int node_index, BBC *prim_bbc,
+ int offset, int count)
+{
+ bvh->nodes[node_index].flag |= PBVH_Leaf;
+
+ bvh->nodes[node_index].prim_indices = bvh->prim_indices + offset;
+ bvh->nodes[node_index].totprim = count;
+
+ /* Still need vb for searches */
+ update_vb(bvh, &bvh->nodes[node_index], prim_bbc, offset, count);
+
+ if(bvh->faces)
+ build_mesh_leaf_node(bvh, bvh->nodes + node_index);
+ else
+ build_grids_leaf_node(bvh, bvh->nodes + node_index);
+}
- vb is the voxel box around all of the primitives contained in
- this node.
+/* Return zero if all primitives in the node can be drawn with the
+ * same material (including flat/smooth shading), non-zerootherwise */
+int leaf_needs_material_split(PBVH *bvh, int offset, int count)
+{
+ int i, prim;
- cb is the bounding box around all the centroids of the primitives
- contained in this node
+ if(count <= 1)
+ return 0;
- offset and start indicate a range in the array of primitive indices
-*/
+ if(bvh->faces) {
+ const MFace *first = &bvh->faces[bvh->prim_indices[offset]];
+
+ for(i = offset + count - 1; i > offset; --i) {
+ prim = bvh->prim_indices[i];
+ if(!face_materials_match(first, &bvh->faces[prim]))
+ return 1;
+ }
+ }
+ else {
+ const DMFlagMat *first = &bvh->grid_flag_mats[bvh->prim_indices[offset]];
+
+ for(i = offset + count - 1; i > offset; --i) {
+ prim = bvh->prim_indices[i];
+ if(!grid_materials_match(first, &bvh->grid_flag_mats[prim]))
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+
+/* Recursively build a node in the tree
+ *
+ * vb is the voxel box around all of the primitives contained in
+ * this node.
+ *
+ * cb is the bounding box around all the centroids of the primitives
+ * contained in this node
+ *
+ * offset and start indicate a range in the array of primitive indices
+ */
static void build_sub(PBVH *bvh, int node_index, BB *cb, BBC *prim_bbc,
- int offset, int count)
+ int offset, int count)
{
- int i, axis, end;
+ int i, axis, end, below_leaf_limit;
BB cb_backing;
/* Decide whether this is a leaf or not */
- // XXX adapt leaf limit for grids
- if(count <= bvh->leaf_limit) {
- bvh->nodes[node_index].flag |= PBVH_Leaf;
-
- bvh->nodes[node_index].prim_indices = bvh->prim_indices + offset;
- bvh->nodes[node_index].totprim = count;
-
- /* Still need vb for searches */
- BB_reset(&bvh->nodes[node_index].vb);
- for(i = offset + count - 1; i >= offset; --i) {
- BB_expand_with_bb(&bvh->nodes[node_index].vb,
- (BB*)(prim_bbc +
- bvh->prim_indices[i]));
+ below_leaf_limit = count <= bvh->leaf_limit;
+ if(below_leaf_limit) {
+ if(!leaf_needs_material_split(bvh, offset, count)) {
+ build_leaf(bvh, node_index, prim_bbc, offset, count);
+ return;
}
-
- if(bvh->faces)
- build_mesh_leaf_node(bvh, bvh->nodes + node_index);
- else
- build_grids_leaf_node(bvh, bvh->nodes + node_index);
- bvh->nodes[node_index].orig_vb= bvh->nodes[node_index].vb;
-
- /* Done with this subtree */
- return;
}
- else {
- BB_reset(&bvh->nodes[node_index].vb);
- bvh->nodes[node_index].children_offset = bvh->totnode;
- grow_nodes(bvh, bvh->totnode + 2);
+ /* Add two child nodes */
+ bvh->nodes[node_index].children_offset = bvh->totnode;
+ grow_nodes(bvh, bvh->totnode + 2);
+
+ /* Update parent node bounding box */
+ update_vb(bvh, &bvh->nodes[node_index], prim_bbc, offset, count);
+
+ if(!below_leaf_limit) {
+ /* Find axis with widest range of primitive centroids */
if(!cb) {
cb = &cb_backing;
BB_reset(cb);
for(i = offset + count - 1; i >= offset; --i)
BB_expand(cb, prim_bbc[bvh->prim_indices[i]].bcentroid);
}
+ axis = BB_widest_axis(cb);
+
+ /* Partition primitives along that axis */
+ end = partition_indices(bvh->prim_indices,
+ offset, offset + count - 1,
+ axis,
+ (cb->bmax[axis] + cb->bmin[axis]) * 0.5f,
+ prim_bbc);
}
-
- axis = BB_widest_axis(cb);
-
- for(i = offset + count - 1; i >= offset; --i) {
- BB_expand_with_bb(&bvh->nodes[node_index].vb,
- (BB*)(prim_bbc + bvh->prim_indices[i]));
+ else {
+ /* Partition primitives by material */
+ end = partition_indices_material(bvh, offset, offset + count - 1);
}
- bvh->nodes[node_index].orig_vb= bvh->nodes[node_index].vb;
-
- end = partition_indices(bvh->prim_indices, offset, offset + count - 1,
- axis,
- (cb->bmax[axis] + cb->bmin[axis]) * 0.5f,
- prim_bbc);
- check_partitioning(bvh->prim_indices, offset, offset + count - 1,
- axis,
- (cb->bmax[axis] + cb->bmin[axis]) * 0.5f,
- prim_bbc, end);
-
+ /* Build children */
build_sub(bvh, bvh->nodes[node_index].children_offset, NULL,
- prim_bbc, offset, end - offset);
+ prim_bbc, offset, end - offset);
build_sub(bvh, bvh->nodes[node_index].children_offset + 1, NULL,
- prim_bbc, end, offset + count - end);
+ prim_bbc, end, offset + count - end);
}
static void pbvh_build(PBVH *bvh, BB *cb, BBC *prim_bbc, int totprim)
@@ -562,7 +636,7 @@ void BLI_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int
/* Do a full rebuild with on Grids data structure */
void BLI_pbvh_build_grids(PBVH *bvh, DMGridData **grids, DMGridAdjacency *gridadj,
- int totgrid, int gridsize, void **gridfaces)
+ int totgrid, int gridsize, void **gridfaces, DMFlagMat *flagmats)
{
BBC *prim_bbc = NULL;
BB cb;
@@ -571,6 +645,7 @@ void BLI_pbvh_build_grids(PBVH *bvh, DMGridData **grids, DMGridAdjacency *gridad
bvh->grids= grids;
bvh->gridadj= gridadj;
bvh->gridfaces= gridfaces;
+ bvh->grid_flag_mats= flagmats;
bvh->totgrid= totgrid;
bvh->gridsize= gridsize;
bvh->leaf_limit = MAX2(LEAF_LIMIT/((gridsize-1)*(gridsize-1)), 1);
@@ -689,7 +764,7 @@ static PBVHNode *pbvh_iter_next(PBVHIter *iter)
int revisiting;
/* purpose here is to traverse tree, visiting child nodes before their
- parents, this order is necessary for e.g. computing bounding boxes */
+ * parents, this order is necessary for e.g. computing bounding boxes */
while(iter->stacksize) {
/* pop node */
@@ -925,18 +1000,18 @@ static void pbvh_update_normals(PBVH *bvh, PBVHNode **nodes,
return;
/* could be per node to save some memory, but also means
- we have to store for each vertex which node it is in */
+ * we have to store for each vertex which node it is in */
vnor= MEM_callocN(sizeof(float)*3*bvh->totvert, "bvh temp vnors");
- /* subtle assumptions:
- - We know that for all edited vertices, the nodes with faces
- adjacent to these vertices have been marked with PBVH_UpdateNormals.
- This is true because if the vertex is inside the brush radius, the
- bounding box of it's adjacent faces will be as well.
- - However this is only true for the vertices that have actually been
- edited, not for all vertices in the nodes marked for update, so we
- can only update vertices marked with ME_VERT_PBVH_UPDATE.
- */
+ /* subtle assumptions:
+ * - We know that for all edited vertices, the nodes with faces
+ * adjacent to these vertices have been marked with PBVH_UpdateNormals.
+ * This is true because if the vertex is inside the brush radius, the
+ * bounding box of it's adjacent faces will be as well.
+ * - However this is only true for the vertices that have actually been
+ * edited, not for all vertices in the nodes marked for update, so we
+ * can only update vertices marked with ME_VERT_PBVH_UPDATE.
+ */
#pragma omp parallel for private(n) schedule(static)
for(n = 0; n < totnode; n++) {
@@ -966,7 +1041,7 @@ static void pbvh_update_normals(PBVH *bvh, PBVHNode **nodes,
if(bvh->verts[v].flag & ME_VERT_PBVH_UPDATE) {
/* this seems like it could be very slow but profile
- does not show this, so just leave it for now? */
+ * does not show this, so just leave it for now? */
#pragma omp atomic
vnor[v][0] += fn[0];
#pragma omp atomic
@@ -1039,7 +1114,7 @@ static void pbvh_update_BB_redraw(PBVH *bvh, PBVHNode **nodes,
}
}
-static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode, int smooth)
+static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode)
{
PBVHNode *node;
int n;
@@ -1052,18 +1127,17 @@ static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode, i
if(bvh->grids) {
GPU_update_grid_buffers(node->draw_buffers,
bvh->grids,
+ bvh->grid_flag_mats,
node->prim_indices,
node->totprim,
- bvh->gridsize,
- smooth);
+ bvh->gridsize);
}
else {
GPU_update_mesh_buffers(node->draw_buffers,
bvh->verts,
node->vert_indices,
node->uniq_verts +
- node->face_verts,
- smooth);
+ node->face_verts);
}
node->flag &= ~PBVH_UpdateDrawBuffers;
@@ -1432,7 +1506,7 @@ int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
//#include <GL/glew.h>
-void BLI_pbvh_node_draw(PBVHNode *node, void *UNUSED(data))
+void BLI_pbvh_node_draw(PBVHNode *node, void *setMaterial)
{
#if 0
/* XXX: Just some quick code to show leaf nodes in different colors */
@@ -1450,14 +1524,14 @@ void BLI_pbvh_node_draw(PBVHNode *node, void *UNUSED(data))
glColor3f(1, 0, 0);
#endif
- GPU_draw_buffers(node->draw_buffers);
+ GPU_draw_buffers(node->draw_buffers, setMaterial);
}
/* Adapted from:
- http://www.gamedev.net/community/forums/topic.asp?topic_id=512123
- Returns true if the AABB is at least partially within the frustum
- (ok, not a real frustum), false otherwise.
-*/
+ * http://www.gamedev.net/community/forums/topic.asp?topic_id=512123
+ * Returns true if the AABB is at least partially within the frustum
+ * (ok, not a real frustum), false otherwise.
+ */
int BLI_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data)
{
float (*planes)[4] = data;
@@ -1485,7 +1559,8 @@ int BLI_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data)
return 1;
}
-void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3], int smooth)
+void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3],
+ DMSetMaterial setMaterial)
{
PBVHNode **nodes;
int totnode;
@@ -1494,16 +1569,16 @@ void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3], int smo
&nodes, &totnode);
pbvh_update_normals(bvh, nodes, totnode, face_nors);
- pbvh_update_draw_buffers(bvh, nodes, totnode, smooth);
+ pbvh_update_draw_buffers(bvh, nodes, totnode);
if(nodes) MEM_freeN(nodes);
if(planes) {
BLI_pbvh_search_callback(bvh, BLI_pbvh_node_planes_contain_AABB,
- planes, BLI_pbvh_node_draw, NULL);
+ planes, BLI_pbvh_node_draw, setMaterial);
}
else {
- BLI_pbvh_search_callback(bvh, NULL, NULL, BLI_pbvh_node_draw, NULL);
+ BLI_pbvh_search_callback(bvh, NULL, NULL, BLI_pbvh_node_draw, setMaterial);
}
}
diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c
index b828ae052f8..6a20d858214 100644
--- a/source/blender/blenlib/intern/scanfill.c
+++ b/source/blender/blenlib/intern/scanfill.c
@@ -139,9 +139,9 @@ struct mem_elements {
/* simple optimization for allocating thousands of small memory blocks
- only to be used within loops, and not by one function at a time
- free in the end, with argument '-1'
-*/
+ * only to be used within loops, and not by one function at a time
+ * free in the end, with argument '-1'
+ */
#define MEM_ELEM_BLOCKSIZE 16384
static struct mem_elements * melem__cur= NULL;
static int melem__offs= 0; /* the current free address */
@@ -423,7 +423,7 @@ static short boundinsideEV(ScanFillEdge *eed, ScanFillVert *eve)
static void testvertexnearedge(void)
{
/* only vertices with ->h==1 are being tested for
- being close to an edge, if true insert */
+ * being close to an edge, if true insert */
ScanFillVert *eve;
ScanFillEdge *eed,*ed1;
@@ -528,7 +528,8 @@ static int scanfill(PolyFill *pf)
nr= pf->nr;
- /* PRINTS
+ /* PRINTS */
+#if 0
verts= pf->verts;
eve= fillvertbase.first;
while(eve) {
@@ -539,7 +540,8 @@ static int scanfill(PolyFill *pf)
while(eed) {
printf("edge: %x verts: %x %x\n",eed,eed->v1,eed->v2);
eed= eed->next;
- } */
+ }
+#endif
/* STEP 0: remove zero sized edges */
eed= filledgebase.first;
@@ -567,8 +569,8 @@ static int scanfill(PolyFill *pf)
}
/* STEP 1: make using FillVert and FillEdge lists a sorted
- ScanFillVertLink list
- */
+ * ScanFillVertLink list
+ */
sc= scdata= (ScanFillVertLink *)MEM_callocN(pf->verts*sizeof(ScanFillVertLink),"Scanfill1");
eve= fillvertbase.first;
verts= 0;
@@ -591,10 +593,10 @@ static int scanfill(PolyFill *pf)
nexted= eed->next;
BLI_remlink(&filledgebase,eed);
/* This code is for handling zero-length edges that get
- collapsed in step 0. It was removed for some time to
- fix trunk bug #4544, so if that comes back, this code
- may need some work, or there will have to be a better
- fix to #4544. */
+ * collapsed in step 0. It was removed for some time to
+ * fix trunk bug #4544, so if that comes back, this code
+ * may need some work, or there will have to be a better
+ * fix to #4544. */
if(eed->v1->f==255) {
v1= eed->v1;
while((eed->v1->f == 255) && (eed->v1->tmp.v != v1))
@@ -609,7 +611,7 @@ static int scanfill(PolyFill *pf)
eed= nexted;
}
- /*
+#if 0
sc= scdata;
for(a=0;a<verts;a++) {
printf("\nscvert: %x\n",sc->v1);
@@ -619,7 +621,8 @@ static int scanfill(PolyFill *pf)
eed= eed->next;
}
sc++;
- }*/
+ }
+#endif
/* STEP 2: FILL LOOP */
@@ -788,13 +791,13 @@ int BLI_begin_edgefill(void)
int BLI_edgefill(short mat_nr)
{
/*
- - fill works with its own lists, so create that first (no faces!)
- - for vertices, put in ->tmp.v the old pointer
- - struct elements xs en ys are not used here: don't hide stuff in it
- - edge flag ->f becomes 2 when it's a new edge
- - mode: & 1 is check for crossings, then create edges (TO DO )
- - returns number of triangle faces added.
- */
+ * - fill works with its own lists, so create that first (no faces!)
+ * - for vertices, put in ->tmp.v the old pointer
+ * - struct elements xs en ys are not used here: don't hide stuff in it
+ * - edge flag ->f becomes 2 when it's a new edge
+ * - mode: & 1 is check for crossings, then create edges (TO DO )
+ * - returns number of triangle faces added.
+ */
ListBase tempve, temped;
ScanFillVert *eve;
ScanFillEdge *eed,*nexted;
@@ -829,7 +832,7 @@ int BLI_edgefill(short mat_nr)
sub_v3_v3v3(vec1, eve->co, eve->next->next->co);
sub_v3_v3v3(vec2, eve->next->co, eve->next->next->next->co);
- if (INPR(vec1, vec1) < INPR(vec2, vec2)) {
+ if (dot_v3v3(vec1, vec1) < dot_v3v3(vec2, vec2)) {
addfillface(eve, eve->next, eve->next->next);
addfillface(eve->next->next, eve->next->next->next, eve);
} else{
@@ -990,14 +993,14 @@ int BLI_edgefill(short mat_nr)
/* CURRENT STATUS:
- - eve->f :1= availalble in edges
- - eve->xs :polynumber
- - eve->h :amount of edges connected to vertex
- - eve->tmp.v :store! original vertex number
-
- - eed->f :1= boundary edge (optionally set by caller)
- - eed->f1 :poly number
- */
+ * - eve->f :1= availalble in edges
+ * - eve->xs :polynumber
+ * - eve->h :amount of edges connected to vertex
+ * - eve->tmp.v :store! original vertex number
+ *
+ * - eed->f :1= boundary edge (optionally set by caller)
+ * - eed->poly_nr :poly number
+ */
/* STEP 3: MAKE POLYFILL STRUCT */
@@ -1040,13 +1043,15 @@ int BLI_edgefill(short mat_nr)
/* so, sort first */
qsort(pflist, poly, sizeof(PolyFill), vergpoly);
-
- /*pf= pflist;
+
+#if 0
+ pf= pflist;
for(a=1;a<=poly;a++) {
printf("poly:%d edges:%d verts:%d flag: %d\n",a,pf->edges,pf->verts,pf->f);
PRINT2(f, f, pf->min[0], pf->min[1]);
pf++;
- }*/
+ }
+#endif
polycache= pc= MEM_callocN(sizeof(short)*poly, "polycache");
pf= pflist;
@@ -1071,13 +1076,15 @@ int BLI_edgefill(short mat_nr)
}
MEM_freeN(polycache);
}
-
- /* printf("after merge\n");
+
+#if 0
+ printf("after merge\n");
pf= pflist;
for(a=1;a<=poly;a++) {
printf("poly:%d edges:%d verts:%d flag: %d\n",a,pf->edges,pf->verts,pf->f);
pf++;
- } */
+ }
+#endif
/* STEP 5: MAKE TRIANGLES */
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 7c48d000d39..29f11ee0550 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -444,9 +444,9 @@ int BLI_exists(const char *name)
{
#if defined(WIN32) && !defined(__MINGW32__)
struct _stat64i32 st;
- /* in Windows stat doesn't recognize dir ending on a slash
- To not break code where the ending slash is expected we
- don't mess with the argument name directly here - elubie */
+ /* in Windows stat doesn't recognize dir ending on a slash
+ * To not break code where the ending slash is expected we
+ * don't mess with the argument name directly here - elubie */
char tmp[FILE_MAX];
int len, res;
BLI_strncpy(tmp, name, FILE_MAX);
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index e2c86d70872..80f1606414c 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -326,11 +326,11 @@ int BLI_strncasecmp(const char *s1, const char *s2, size_t len)
int BLI_natstrcmp(const char *s1, const char *s2)
{
int d1= 0, d2= 0;
-
+
/* if both chars are numeric, to a strtol().
- then increase string deltas as long they are
- numeric, else do a tolower and char compare */
-
+ * then increase string deltas as long they are
+ * numeric, else do a tolower and char compare */
+
while(1) {
char c1 = tolower(s1[d1]);
char c2 = tolower(s2[d2]);
diff --git a/source/blender/blenlib/intern/string_cursor_utf8.c b/source/blender/blenlib/intern/string_cursor_utf8.c
new file mode 100644
index 00000000000..56998cfd927
--- /dev/null
+++ b/source/blender/blenlib/intern/string_cursor_utf8.c
@@ -0,0 +1,191 @@
+/*
+ * ***** 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) 2011 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Campbell Barton.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ *
+ */
+
+/** \file blender/blenlib/intern/string_cursor_utf8.c
+ * \ingroup bli
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "BLI_utildefines.h"
+#include "BLI_string_utf8.h"
+
+#include "BLI_string_cursor_utf8.h" /* own include */
+
+typedef enum strCursorDelimType {
+ STRCUR_DELIM_NONE,
+ STRCUR_DELIM_ALPHA,
+ STRCUR_DELIM_PUNCT,
+ STRCUR_DELIM_BRACE,
+ STRCUR_DELIM_OPERATOR,
+ STRCUR_DELIM_QUOTE,
+ STRCUR_DELIM_WHITESPACE,
+ STRCUR_DELIM_OTHER
+} strCursorDelimType;
+
+/* return 1 if char ch is special character, otherwise return 0 */
+static strCursorDelimType test_special_char(const char ch)
+{
+ /* TODO - use BLI_str_utf8_as_unicode rather then assuming ascii */
+
+ if ((ch >= 'a' && ch <= 'z') ||
+ (ch >= 'A' && ch <= 'Z') ||
+ (ch == '_') /* not quite correct but allow for python, could become configurable */
+ )
+ {
+ return STRCUR_DELIM_ALPHA;
+ }
+
+ switch (ch) {
+ case ',':
+ case '.':
+ return STRCUR_DELIM_PUNCT;
+
+ case '{':
+ case '}':
+ case '[':
+ case ']':
+ case '(':
+ case ')':
+ return STRCUR_DELIM_BRACE;
+
+ case '+':
+ case '-':
+ case '=':
+ case '~':
+ case '%':
+ case '/':
+ case '<':
+ case '>':
+ case '^':
+ case '*':
+ case '&':
+ return STRCUR_DELIM_OPERATOR;
+
+ case '\'':
+ case '\"': // " - an extra closing one for Aligorith's text editor
+ return STRCUR_DELIM_QUOTE;
+
+ case ' ':
+ return STRCUR_DELIM_WHITESPACE;
+
+ case '\\':
+ case '!':
+ case '@':
+ case '#':
+ case '$':
+ case ':':
+ case ';':
+ case '?':
+ /* case '_': */ /* special case, for python */
+ return STRCUR_DELIM_OTHER;
+
+ default:
+ break;
+ }
+ return STRCUR_DELIM_NONE;
+}
+
+int BLI_str_cursor_step_next_utf8(const char *str, size_t maxlen, int *pos)
+{
+ const char *str_end= str + (maxlen + 1);
+ const char *str_pos= str + (*pos);
+ const char *str_next= BLI_str_find_next_char_utf8(str_pos, str_end);
+ if (str_next) {
+ (*pos) += (str_next - str_pos);
+ if((*pos) > maxlen) (*pos)= maxlen;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+int BLI_str_cursor_step_prev_utf8(const char *str, size_t UNUSED(maxlen), int *pos)
+{
+ if((*pos) > 0) {
+ const char *str_pos= str + (*pos);
+ const char *str_prev= BLI_str_find_prev_char_utf8(str, str_pos);
+ if (str_prev) {
+ (*pos) -= (str_pos - str_prev);
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+void BLI_str_cursor_step_utf8(const char *str, size_t maxlen,
+ int *pos, strCursorJumpDirection direction,
+ strCursorJumpType jump)
+{
+ const short pos_prev= *pos;
+
+ if (direction == STRCUR_DIR_NEXT) {
+ BLI_str_cursor_step_next_utf8(str, maxlen, pos);
+
+ if (jump != STRCUR_JUMP_NONE) {
+ const strCursorDelimType is_special= (*pos) < maxlen ? test_special_char(str[(*pos)]) : STRCUR_DELIM_NONE;
+ /* jump between special characters (/,\,_,-, etc.),
+ * look at function test_special_char() for complete
+ * list of special character, ctr -> */
+ while ((*pos) < maxlen) {
+ if (BLI_str_cursor_step_next_utf8(str, maxlen, pos)) {
+ if ((jump != STRCUR_JUMP_ALL) && (is_special != test_special_char(str[(*pos)]))) break;
+ }
+ else {
+ break; /* unlikely but just in case */
+ }
+ }
+ }
+ }
+ else if (direction == STRCUR_DIR_PREV) {
+ BLI_str_cursor_step_prev_utf8(str, maxlen, pos);
+
+ if(jump != STRCUR_JUMP_NONE) {
+ const strCursorDelimType is_special= (*pos) > 1 ? test_special_char(str[(*pos) - 1]) : STRCUR_DELIM_NONE;
+ /* jump between special characters (/,\,_,-, etc.),
+ * look at function test_special_char() for complete
+ * list of special character, ctr -> */
+ while ((*pos) > 0) {
+ if (BLI_str_cursor_step_prev_utf8(str, maxlen, pos)) {
+ if ((jump != STRCUR_JUMP_ALL) && (is_special != test_special_char(str[(*pos)]))) break;
+ }
+ else {
+ break;
+ }
+ }
+
+ /* left only: compensate for index/change in direction */
+ if (((*pos) != 0) && ABS(pos_prev - (*pos)) >= 1) {
+ BLI_str_cursor_step_next_utf8(str, maxlen, pos);
+ }
+ }
+ }
+ else {
+ BLI_assert(0);
+ }
+}
diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c
index c958648836b..c60df413161 100644
--- a/source/blender/blenlib/intern/string_utf8.c
+++ b/source/blender/blenlib/intern/string_utf8.c
@@ -27,8 +27,8 @@
*/
/** \file blender/blenlib/intern/string_utf8.c
- * \ingroup bli
- */
+ * \ingroup bli
+ */
#include <string.h>
#include <wchar.h>
@@ -41,9 +41,9 @@
* http://svn.swish-e.org/libswish3/trunk/src/libswish3/utf8.c r3044 - campbell */
/* based on the valid_utf8 routine from the PCRE library by Philip Hazel
-
- length is in bytes, since without knowing whether the string is valid
- it's hard to know how many characters there are! */
+ *
+ * length is in bytes, since without knowing whether the string is valid
+ * it's hard to know how many characters there are! */
static const char trailingBytesForUTF8[256] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -101,7 +101,7 @@ int BLI_utf8_invalid_byte(const char *str, int length)
break;
/* Check for leading 0xfe or 0xff,
- and then for 1111 1100, xx00 00xx */
+ * and then for 1111 1100, xx00 00xx */
case 5:
if (c == 0xfe || c == 0xff ||
(c == 0xfc && (*p & 0x3c) == 0)) goto utf8_error;
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c
index e92b445c27f..3894a6a0b8e 100644
--- a/source/blender/blenlib/intern/threads.c
+++ b/source/blender/blenlib/intern/threads.c
@@ -63,48 +63,48 @@ static void *thread_tls_data;
#endif
/* ********** basic thread control API ************
-
-Many thread cases have an X amount of jobs, and only an Y amount of
-threads are useful (typically amount of cpus)
-
-This code can be used to start a maximum amount of 'thread slots', which
-then can be filled in a loop with an idle timer.
-
-A sample loop can look like this (pseudo c);
-
- ListBase lb;
- int maxthreads= 2;
- int cont= 1;
-
- BLI_init_threads(&lb, do_something_func, maxthreads);
-
- while(cont) {
- if(BLI_available_threads(&lb) && !(escape loop event)) {
- // get new job (data pointer)
- // tag job 'processed
- BLI_insert_thread(&lb, job);
- }
- else PIL_sleep_ms(50);
-
- // find if a job is ready, this the do_something_func() should write in job somewhere
- cont= 0;
- for(go over all jobs)
- if(job is ready) {
- if(job was not removed) {
- BLI_remove_thread(&lb, job);
- }
- }
- else cont= 1;
- }
- // conditions to exit loop
- if(if escape loop event) {
- if(BLI_available_threadslots(&lb)==maxthreads)
- break;
- }
- }
-
- BLI_end_threads(&lb);
-
+ *
+ * Many thread cases have an X amount of jobs, and only an Y amount of
+ * threads are useful (typically amount of cpus)
+ *
+ * This code can be used to start a maximum amount of 'thread slots', which
+ * then can be filled in a loop with an idle timer.
+ *
+ * A sample loop can look like this (pseudo c);
+ *
+ * ListBase lb;
+ * int maxthreads= 2;
+ * int cont= 1;
+ *
+ * BLI_init_threads(&lb, do_something_func, maxthreads);
+ *
+ * while(cont) {
+ * if(BLI_available_threads(&lb) && !(escape loop event)) {
+ * // get new job (data pointer)
+ * // tag job 'processed
+ * BLI_insert_thread(&lb, job);
+ * }
+ * else PIL_sleep_ms(50);
+ *
+ * // find if a job is ready, this the do_something_func() should write in job somewhere
+ * cont= 0;
+ * for(go over all jobs)
+ * if(job is ready) {
+ * if(job was not removed) {
+ * BLI_remove_thread(&lb, job);
+ * }
+ * }
+ * else cont= 1;
+ * }
+ * // conditions to exit loop
+ * if(if escape loop event) {
+ * if(BLI_available_threadslots(&lb)==maxthreads)
+ * break;
+ * }
+ * }
+ *
+ * BLI_end_threads(&lb);
+ *
************************************************ */
static pthread_mutex_t _malloc_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t _image_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -146,8 +146,8 @@ void BLI_threadapi_init(void)
}
/* tot = 0 only initializes malloc mutex in a safe way (see sequence.c)
- problem otherwise: scene render will kill of the mutex!
-*/
+ * problem otherwise: scene render will kill of the mutex!
+ */
void BLI_init_threads(ListBase *threadbase, void *(*do_thread)(void *), int tot)
{
@@ -172,8 +172,8 @@ void BLI_init_threads(ListBase *threadbase, void *(*do_thread)(void *), int tot)
#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
/* workaround for Apple gcc 4.2.1 omp vs background thread bug,
- we copy gomp thread local storage pointer to setting it again
- inside the thread that we start */
+ * we copy gomp thread local storage pointer to setting it again
+ * inside the thread that we start */
thread_tls_data = pthread_getspecific(gomp_tls_key);
#endif
}
@@ -213,7 +213,7 @@ static void *tslot_thread_start(void *tslot_p)
#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
/* workaround for Apple gcc 4.2.1 omp vs background thread bug,
- set gomp thread local storage pointer which was copied beforehand */
+ * set gomp thread local storage pointer which was copied beforehand */
pthread_setspecific (gomp_tls_key, thread_tls_data);
#endif
@@ -464,12 +464,10 @@ ThreadedWorker *BLI_create_worker(void *(*do_thread)(void *), int tot, int sleep
worker = MEM_callocN(sizeof(ThreadedWorker), "threadedworker");
- if (tot > RE_MAX_THREAD)
- {
+ if (tot > RE_MAX_THREAD) {
tot = RE_MAX_THREAD;
}
- else if (tot < 1)
- {
+ else if (tot < 1) {
tot= 1;
}
@@ -498,25 +496,20 @@ void BLI_insert_work(ThreadedWorker *worker, void *param)
WorkParam *p = MEM_callocN(sizeof(WorkParam), "workparam");
int index;
- if (BLI_available_threads(&worker->threadbase) == 0)
- {
+ if (BLI_available_threads(&worker->threadbase) == 0) {
index = worker->total;
- while(index == worker->total)
- {
+ while(index == worker->total) {
PIL_sleep_ms(worker->sleep_time);
- for (index = 0; index < worker->total; index++)
- {
- if (worker->busy[index] == 0)
- {
+ for (index = 0; index < worker->total; index++) {
+ if (worker->busy[index] == 0) {
BLI_remove_thread_index(&worker->threadbase, index);
break;
}
}
}
}
- else
- {
+ else {
index = BLI_available_thread_index(&worker->threadbase);
}
diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c
index b2002b63a22..4665b08b202 100644
--- a/source/blender/blenlib/intern/winstuff.c
+++ b/source/blender/blenlib/intern/winstuff.c
@@ -96,8 +96,7 @@ void RegisterBlendExtension(void)
// root is HKLM by default
lresult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Classes", 0, KEY_ALL_ACCESS, &root);
- if (lresult != ERROR_SUCCESS)
- {
+ if (lresult != ERROR_SUCCESS) {
// try HKCU on failure
usr_mode = TRUE;
lresult = RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Classes", 0, KEY_ALL_ACCESS, &root);
@@ -161,8 +160,7 @@ void RegisterBlendExtension(void)
RegCloseKey(root);
printf("success (%s)\n",usr_mode ? "user" : "system");
- if (!G.background)
- {
+ if (!G.background) {
sprintf(MBox,"File extension registered for %s.",usr_mode ? "the current user. To register for all users, run as an administrator" : "all users");
MessageBox(0,MBox,"Blender",MB_OK|MB_ICONINFORMATION);
}
@@ -227,8 +225,8 @@ void get_default_root(char* root)
char str[MAX_PATH+1];
/* the default drive to resolve a directory without a specified drive
- should be the Windows installation drive, since this was what the OS
- assumes. */
+ * should be the Windows installation drive, since this was what the OS
+ * assumes. */
if (GetWindowsDirectory(str,MAX_PATH+1)) {
root[0] = str[0];
root[1] = ':';
@@ -236,7 +234,7 @@ void get_default_root(char* root)
root[3] = '\0';
} else {
/* if GetWindowsDirectory fails, something has probably gone wrong,
- we are trying the blender install dir though */
+ * we are trying the blender install dir though */
if (GetModuleFileName(NULL,str,MAX_PATH+1)) {
printf("Error! Could not get the Windows Directory - Defaulting to Blender installation Dir!");
root[0] = str[0];
diff --git a/source/blender/blenloader/BLO_sys_types.h b/source/blender/blenloader/BLO_sys_types.h
index 9430878a641..7dbd4df1056 100644
--- a/source/blender/blenloader/BLO_sys_types.h
+++ b/source/blender/blenloader/BLO_sys_types.h
@@ -49,7 +49,7 @@ extern "C" {
#if defined(_WIN32) && !defined(FREE_WINDOWS)
-/* The __intXX are built-in types of the visual complier! So we don't
+/* The __intXX are built-in types of the visual compiler! So we don't
* need to include anything else here. */
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 09a7d92baa8..22da276fcad 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -953,7 +953,7 @@ static FileData *filedata_new(void)
fd->gzfiledes = NULL;
/* XXX, this doesn't need to be done all the time,
- * but it keeps us reentrant, remove once we have
+ * but it keeps us re-entrant, remove once we have
* a lib that provides a nice lock. - zr
*/
fd->memsdna = DNA_sdna_from_data(DNAstr, DNAlen, 0);
@@ -3751,18 +3751,7 @@ static void direct_link_mdisps(FileData *fd, int count, MDisps *mdisps, int exte
for(i = 0; i < count; ++i) {
mdisps[i].disps = newdataadr(fd, mdisps[i].disps);
-
- /*put .disps into cellalloc system*/
- if (mdisps[i].disps) {
- float *disp2;
-
- disp2 = MEM_mallocN(MEM_allocN_len(mdisps[i].disps), "cellalloc .disps copy");
- memcpy(disp2, mdisps[i].disps, MEM_allocN_len(mdisps[i].disps));
-
- MEM_freeN(mdisps[i].disps);
- mdisps[i].disps = (float (*)[3])disp2;
- }
-
+
if( (fd->flags & FD_FLAGS_SWITCH_ENDIAN) && (mdisps[i].disps) ) {
/* DNA_struct_switch_endian doesn't do endian swap for (*disps)[] */
/* this does swap for data written at write_mdisps() - readfile.c */
@@ -4258,7 +4247,7 @@ static void direct_link_pose(FileData *fd, bPose *pose)
pchan->iktree.first= pchan->iktree.last= NULL;
pchan->siktree.first= pchan->siktree.last= NULL;
- /* incase this value changes in future, clamp else we get undefined behavior */
+ /* in case this value changes in future, clamp else we get undefined behavior */
CLAMP(pchan->rotmode, ROT_MODE_MIN, ROT_MODE_MAX);
}
pose->ikdata = NULL;
@@ -4361,16 +4350,14 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
smd->domain->point_cache[1] = NULL;
}
}
- else if(smd->type==MOD_SMOKE_TYPE_FLOW)
- {
+ else if (smd->type==MOD_SMOKE_TYPE_FLOW) {
smd->domain = NULL;
smd->coll = NULL;
smd->flow = newdataadr(fd, smd->flow);
smd->flow->smd = smd;
smd->flow->psys = newdataadr(fd, smd->flow->psys);
}
- else if(smd->type==MOD_SMOKE_TYPE_COLL)
- {
+ else if (smd->type==MOD_SMOKE_TYPE_COLL) {
smd->flow = NULL;
smd->domain = NULL;
smd->coll = newdataadr(fd, smd->coll);
@@ -4714,7 +4701,7 @@ static void direct_link_object(FileData *fd, Object *ob)
/* Do conversion here because if we have loaded
* a hook we need to make sure it gets converted
- * and free'd, regardless of version.
+ * and freed, regardless of version.
*/
copy_v3_v3(hmd->cent, hook->cent);
hmd->falloff = hook->falloff;
@@ -4739,7 +4726,7 @@ static void direct_link_object(FileData *fd, Object *ob)
ob->gpulamp.first= ob->gpulamp.last= NULL;
link_list(fd, &ob->pc_ids);
- /* incase this value changes in future, clamp else we get undefined behavior */
+ /* in case this value changes in future, clamp else we get undefined behavior */
CLAMP(ob->rotmode, ROT_MODE_MIN, ROT_MODE_MAX);
if(ob->sculpt) {
@@ -10278,7 +10265,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 5)) {
- /* foreground color needs to be somthing other then black */
+ /* foreground color needs to be something other then black */
Scene *sce;
for(sce= main->scene.first; sce; sce=sce->id.next) {
sce->r.fg_stamp[0] = sce->r.fg_stamp[1] = sce->r.fg_stamp[2] = 0.8f;
@@ -11007,8 +10994,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sAct->sound3D.min_gain = sound->min_gain;
sAct->sound3D.rolloff_factor = sound->attenuation;
}
- else
- {
+ else {
sAct->sound3D.reference_distance = 1.0f;
sAct->volume = 1.0f;
sAct->sound3D.max_gain = 1.0f;
@@ -12407,8 +12393,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- else if((smd->type & MOD_SMOKE_TYPE_FLOW) && smd->flow)
- {
+ else if ((smd->type & MOD_SMOKE_TYPE_FLOW) && smd->flow) {
smd->flow->vel_multi = 1.0f;
}
@@ -13158,10 +13143,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* sigh, this dscale vs dsize version patching was not done right, fix for fix,
* this intentionally checks an exact subversion, also note this was never in a release,
* at some point this could be removed. */
- else if (main->versionfile == 260 && main->subversionfile == 6)
- {
+ else if (main->versionfile == 260 && main->subversionfile == 6) {
Object *ob;
- for (ob= main->object.first; ob; ob= ob->id.next) {
+ for (ob = main->object.first; ob; ob= ob->id.next) {
if (is_zero_v3(ob->dscale)) {
fill_vn_fl(ob->dscale, 3, 1.0f);
}
@@ -13439,6 +13423,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
do_versions_nodetree_multi_file_output_format_2_62_1(NULL, ntree);
}
+ /* put compatibility code here until next subversion bump */
+ {
+ {
+ /* Set new idname of keyingsets from their now "label-only" name. */
+ Scene *scene;
+ for (scene = main->scene.first; scene; scene = scene->id.next) {
+ KeyingSet *ks;
+ for (ks = scene->keyingsets.first; ks; ks = ks->next) {
+ if (!ks->idname[0])
+ BLI_strncpy(ks->idname, ks->name, sizeof(ks->idname));
+ }
+ }
+ }
+ }
/* default values in Freestyle settings */
{
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 47d0ee2246b..d7ecd9eac44 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -3108,7 +3108,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
BLI_split_dir_part(filepath, dir1, sizeof(dir1));
BLI_split_dir_part(mainvar->name, dir2, sizeof(dir2));
- /* just incase there is some subtle difference */
+ /* just in case there is some subtle difference */
BLI_cleanup_dir(mainvar->name, dir1);
BLI_cleanup_dir(mainvar->name, dir2);
diff --git a/source/blender/blenpluginapi/iff.h b/source/blender/blenpluginapi/iff.h
index cf235c2f0ca..450dfc7f8d1 100644
--- a/source/blender/blenpluginapi/iff.h
+++ b/source/blender/blenpluginapi/iff.h
@@ -57,9 +57,9 @@ typedef struct ImBuf {
unsigned int encodedsize; /**< Size of data written to encodedbuffer */
unsigned int encodedbuffersize; /**< Size of encodedbuffer */
- float *rect_float; /**< floating point Rect equivalent
- Linear RGB color space - may need gamma correction to
- sRGB when generating 8bit representations */
+ float *rect_float; /** < floating point Rect equivalent
+ * Linear RGB color space - may need gamma correction to
+ * sRGB when generating 8bit representations */
int channels; /**< amount of channels in rect_float (0 = 4 channel default) */
float dither; /**< random dither value, for conversion from float -> byte rect */
short profile; /** color space/profile preset that the byte rect buffer represents */
diff --git a/source/blender/blenpluginapi/intern/pluginapi.c b/source/blender/blenpluginapi/intern/pluginapi.c
index b6bd15fd1c3..aac20a96f08 100644
--- a/source/blender/blenpluginapi/intern/pluginapi.c
+++ b/source/blender/blenpluginapi/intern/pluginapi.c
@@ -42,7 +42,7 @@
*/
#define PLUGIN_INTERN /* This tells the LIBEXPORT macro to compile with
- dll export set on windows */
+ * dll export set on windows */
#ifdef WIN32
#include "blenpluginapi/util.h"
diff --git a/source/blender/bmesh/CMakeLists.txt b/source/blender/bmesh/CMakeLists.txt
index 0d39a99117c..b9a63f439f1 100644
--- a/source/blender/bmesh/CMakeLists.txt
+++ b/source/blender/bmesh/CMakeLists.txt
@@ -26,40 +26,11 @@
set(INC
.
- intern
- operators
- ../avi
- ../blenfont
../blenkernel
../blenlib
- ../blenloader
../editors/include
- ../editors/mesh
- ../gpu
- ../ikplugin
- ../imbuf
../makesdna
- ../makesrna
- ../modifiers
- ../nodes
- ../render/extern/include
- ../../../extern/glew/include
- ../../../intern/audaspace/intern
- ../../../intern/bsp/extern
- ../../../intern/decimation/extern
- ../../../intern/elbeem/extern
../../../intern/guardedalloc
- ../../../intern/iksolver/extern
- ../../../intern/memutil
- ../../../intern/mikktspace
- ../../../intern/opennl/extern
- ../../../intern/smoke/extern
- # XXX - BAD LEVEL CALL WM_api.h
- ../../../source/blender/windowmanager
-)
-
-set(INC_SYS
- ${ZLIB_INCLUDE_DIRS}
)
set(SRC
@@ -94,6 +65,8 @@ set(SRC
intern/bmesh_marking.h
intern/bmesh_mesh.c
intern/bmesh_mesh.h
+ intern/bmesh_mesh_conv.c
+ intern/bmesh_mesh_conv.h
intern/bmesh_mods.c
intern/bmesh_mods.h
intern/bmesh_opdefines.c
@@ -121,22 +94,6 @@ set(SRC
bmesh_operator_api.h
)
-add_definitions(-DGLEW_STATIC)
-
-if(WITH_LZO)
- add_definitions(-DWITH_LZO)
- list(APPEND INC_SYS
- ../../../extern/lzo/minilzo
- )
-endif()
-
-if(WITH_LZMA)
- add_definitions(-DWITH_LZMA)
- list(APPEND INC_SYS
- ../../../extern/lzma
- )
-endif()
-
if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
endif()
diff --git a/source/blender/bmesh/SConscript b/source/blender/bmesh/SConscript
index 76496dfdb7b..e545dd64b02 100644
--- a/source/blender/bmesh/SConscript
+++ b/source/blender/bmesh/SConscript
@@ -2,39 +2,19 @@
Import ('env')
cflags=''
-"""
-sources = ['intern/bmesh_eulers.c']
-sources.append('intern/bmesh_mesh.c')
-sources.append('intern/bmesh_polygon.c')
-sources.append('intern/bmesh_structure.c')
-sources.append('intern/bmesh_marking.c')
-
-sources.append('intern/bmesh_construct.c')
-sources.append('intern/bmesh_interp.c')
-sources.append('intern/bmesh_filters.c')
-sources.append('intern/bmesh_iterators.c')
-sources.append('intern/bmesh_mods.c')
-sources.append('intern/bmesh_queries.c')
-sources.append('intern/bmesh_operators.c')
-"""
-#sources.append('api/BME_walkers.c')
-
sources = env.Glob('intern/*.c')
sources += env.Glob('operators/*.c')
-#sources += env.Glob('tools/*.c')
-
-incs = ['#/intern/guardedalloc']
-incs.append('../blenlib')
-incs.append('../blenloader')
-incs.append('../makesdna')
-incs.append('../makesrna')
-incs.append('../blenkernel')
-incs.append('./')
-incs.append('./intern')
-incs.append('../editors/mesh')
-incs.append('../editors/include')
+incs = [
+ '#/intern/guardedalloc',
+ '../blenlib',
+ '../blenloader',
+ '../makesdna',
+ '../blenkernel',
+ './',
+ '../editors/include',
+ ]
defs = []
env.BlenderLib ( libname = 'bf_bmesh', sources = sources, includes = Split(incs), libtype = ['core','player'], defines=defs, priority=[100, 100], compileflags=cflags )
diff --git a/source/blender/bmesh/bmesh.h b/source/blender/bmesh/bmesh.h
index 9cf71e66b1c..7f9982c07cf 100644
--- a/source/blender/bmesh/bmesh.h
+++ b/source/blender/bmesh/bmesh.h
@@ -286,6 +286,7 @@ BM_INLINE void _bm_elem_index_set(BMHeader *ele, const int index);
#include "intern/bmesh_iterators.h"
#include "intern/bmesh_marking.h"
#include "intern/bmesh_mesh.h"
+#include "intern/bmesh_mesh_conv.h"
#include "intern/bmesh_mods.h"
#include "intern/bmesh_operators.h"
#include "intern/bmesh_polygon.h"
diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h
index 59ad60f32e5..394ae66c84b 100644
--- a/source/blender/bmesh/bmesh_class.h
+++ b/source/blender/bmesh/bmesh_class.h
@@ -217,7 +217,7 @@ enum {
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 */
+ * 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
diff --git a/source/blender/bmesh/bmesh_operator_api.h b/source/blender/bmesh/bmesh_operator_api.h
index 04cca767d9e..beb601878c8 100644
--- a/source/blender/bmesh/bmesh_operator_api.h
+++ b/source/blender/bmesh/bmesh_operator_api.h
@@ -35,7 +35,7 @@ extern "C" {
#include <stdarg.h>
-/*
+/**
* operators represent logical, executable mesh modules. all topological
* operations involving a bmesh has to go through them.
*
@@ -55,18 +55,22 @@ extern "C" {
* bmesh_opdefines.c and the BMOpDefine struct for how to define new operators.
*
* in general, operators are fed arrays of elements, created using either
- * BM_HeaderFlag_To_Slot or BM_Flag_To_Slot (or through one of the format
- * specifyers in BMO_op_callf or BMO_op_initf). Note that multiple element
- * types (e.g. faces and edges) can be fed to the same slot array. Operators
- * act on this data, and possibly spit out data into output slots.
+ * #BMO_slot_buffer_from_hflag or #BMO_slot_buffer_from_flag
+ * (or through one of the format specifiers in #BMO_op_callf or #BMO_op_initf).
+ *
+ * \note multiple element types (e.g. faces and edges)
+ * can be fed to the same slot array. Operators act on this data,
+ * and possibly spit out data into output slots.
+ *
+ * \note operators should never read from header flags (e.g. element->head.flag).
+ * For example, if you want an operator to only operate on selected faces, you
+ * should use #BMO_slot_buffer_from_hflag to put the selected elements into a slot.
+ *
+ * \note when you read from an element slot array or mapping, you can either tool-flag
+ * all the elements in it, or read them using an iterator API (which is semantically
+ * similar to the iterator api in bmesh_iterators.h).
*
- * some notes:
- * - operators should never read from header flags (e.g. element->head.flag). for
- * example, if you want an operator to only operate on selected faces, you
- * should use BM_HeaderFlag_To_Slot to put the selected elements into a slot.
- * - when you read from an element slot array or mapping, you can either tool-flag
- * all the elements in it, or read them using an iterator APi (which is
- * semantically similar to the iterator api in bmesh_iterators.h).
+ * \note only #BMLoop items can't be put into slots as with verts, edges & faces.
*/
struct GHashIterator;
@@ -369,9 +373,6 @@ typedef struct BMOIter {
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
- * over an element buffer (not a mapping).*/
void *BMO_iter_new(BMOIter *iter, BMesh *bm, BMOperator *op,
const char *slotname, const char restrictmask);
void *BMO_iter_step(BMOIter *iter);
diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c
index ccb8fd9b1af..d903d939452 100644
--- a/source/blender/bmesh/intern/bmesh_construct.c
+++ b/source/blender/bmesh/intern/bmesh_construct.c
@@ -41,7 +41,7 @@
#include "DNA_meshdata_types.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
#define SELECT 1
@@ -667,7 +667,7 @@ BMesh *BM_mesh_copy(BMesh *bm_old)
f2 = BM_face_create_ngon(bm_new, v, v2, edges, f->len, FALSE);
if (!f2)
continue;
- /* use totface incase adding some faces fails */
+ /* use totface in case adding some faces fails */
BM_elem_index_set(f2, (bm_new->totface - 1)); /* set_inline */
ftable[i] = f2;
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c
index a04e5eda5a2..133e446f891 100644
--- a/source/blender/bmesh/intern/bmesh_core.c
+++ b/source/blender/bmesh/intern/bmesh_core.c
@@ -35,14 +35,12 @@
#include "BLI_array.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
/* use so valgrinds memcheck alerts us when undefined index is used.
* TESTING ONLY! */
// #define USE_DEBUG_INDEX_MEMCHECK
-static int bm_edge_splice(BMesh *bm, BMEdge *e, BMEdge *etarget);
-
#ifdef USE_DEBUG_INDEX_MEMCHECK
#define DEBUG_MEMCHECK_INDEX_INVALIDATE(ele) \
{ \
@@ -144,10 +142,12 @@ static BMLoop *bm_loop_create(BMesh *bm, BMVert *v, BMEdge *e, BMFace *f, const
bm->totloop++;
- if (example)
+ if (example) {
CustomData_bmesh_copy_data(&bm->ldata, &bm->ldata, example->head.data, &l->head.data);
- else
+ }
+ else {
CustomData_bmesh_set_default(&bm->ldata, &l->head.data);
+ }
return l;
}
@@ -377,8 +377,8 @@ int bmesh_elem_check(BMesh *UNUSED(bm), void *element, const char htype)
if (l->f->len <= 0)
err |= (1 << 13);
- /* validate boundary loop--invalid for hole loops, of course,
- * but we won't be allowing those for a while ye */
+ /* validate boundary loop -- invalid for hole loops, of course,
+ * but we won't be allowing those for a while yet */
l2 = l;
i = 0;
do {
@@ -649,7 +649,7 @@ static int bm_loop_length(BMLoop *l)
* \brief Loop Reverse
*
* Changes the winding order of a face from CW to CCW or vice versa.
- * This euler is a bit peculiar in compairson to others as it is its
+ * This euler is a bit peculiar in comparison to others as it is its
* own inverse.
*
* BMESH_TODO: reinsert validation code.
@@ -955,7 +955,7 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface)
}
- /* create region fac */
+ /* create region face */
newf = BM_face_create_ngon(bm, v1, v2, edges, tote, FALSE);
if (!newf || BMO_error_occurred(bm)) {
if (!BMO_error_occurred(bm))
@@ -1034,6 +1034,7 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface)
BM_CHECK_ELEMENT(bm, newf);
return newf;
+
error:
bm_elements_systag_disable(bm, faces, totface, _FLAG_JF);
BLI_array_free(edges);
@@ -1096,7 +1097,7 @@ static BMFace *bm_face_create__sfme(BMesh *bm, BMFace *UNUSED(example))
* level wrapping functions (when holes are fully implemented, anyway).
*
* \note that holes represents which holes goes to the new face, and of
- * course this requires removing them from the exitsing face first, since
+ * course this requires removing them from the existing face first, since
* you cannot have linked list links inside multiple lists.
*
* \return A BMFace pointer
@@ -1106,7 +1107,8 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2,
#ifdef USE_BMESH_HOLES
ListBase *holes,
#endif
- BMEdge *example
+ BMEdge *example,
+ const short nodouble
)
{
#ifdef USE_BMESH_HOLES
@@ -1131,7 +1133,7 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2,
}
/* allocate new edge between v1 and v2 */
- e = BM_edge_create(bm, v1, v2, example, FALSE);
+ e = BM_edge_create(bm, v1, v2, example, nodouble);
f2 = bm_face_create__sfme(bm, f);
f1loop = bm_loop_create(bm, v2, e, f, v2loop);
@@ -1210,11 +1212,16 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2,
* \brief Split Edge Make Vert (SEMV)
*
* Takes \a e edge and splits it into two, creating a new vert.
+ * \a tv should be one end of \a e : the newly created edge
+ * will be attached to that end and is returned in \a r_e.
*
* \par Examples:
*
- * Before: OV---------TV
- * After: OV----NV---TV
+ * E
+ * Before: OV-------------TV
+ *
+ * E RE
+ * After: OV------NV-----TV
*
* \return The newly created BMVert pointer.
*/
@@ -1225,15 +1232,12 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
BMVert *nv, *ov;
int i, edok, valence1 = 0, valence2 = 0;
- if (bmesh_vert_in_edge(e, tv) == 0) {
- return NULL;
- }
+ BLI_assert(bmesh_vert_in_edge(e, tv) != FALSE);
+
ov = bmesh_edge_other_vert_get(e, tv);
- /* count valence of v1 */
valence1 = bmesh_disk_count(ov);
- /* count valence of v2 */
valence2 = bmesh_disk_count(tv);
nv = BM_vert_create(bm, tv->co, tv);
@@ -1242,7 +1246,7 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
bmesh_disk_edge_remove(ne, tv);
bmesh_disk_edge_remove(ne, nv);
- /* remove e from v2's disk cycle */
+ /* remove e from tv's disk cycle */
bmesh_disk_edge_remove(e, tv);
/* swap out tv for nv in e */
@@ -1524,7 +1528,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou
if (check_edge_double) {
if (e_splice) {
/* removes e_splice */
- bm_edge_splice(bm, e_splice, oe);
+ BM_edge_splice(bm, e_splice, oe);
}
}
@@ -1733,14 +1737,16 @@ static int bm_vert_splice(BMesh *bm, BMVert *v, BMVert *vtarget)
}
/**
- * \brief Cut Vert
+ * \brief Separate Vert
*
- * Cut all disjoint fans that meet at a vertex, making a unique
+ * Separates all disjoint fans that meet at a vertex, making a unique
* vertex for each region. returns an array of all resulting vertices.
*
+ * \note this is a low level function, bm_edge_separate needs to run on edges first
+ *
* \return Success
*/
-static int bm_vert_cut(BMesh *bm, BMVert *v, BMVert ***vout, int *len)
+int bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len)
{
BMEdge **stack = NULL;
BLI_array_declare(stack);
@@ -1752,7 +1758,7 @@ static int bm_vert_cut(BMesh *bm, BMVert *v, BMVert ***vout, int *len)
int i, maxindex;
BMLoop *nl;
- visithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh_vert_cut visithash");
+ visithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, __func__);
maxindex = 0;
BM_ITER(e, &eiter, bm, BM_EDGES_OF_VERT, v) {
@@ -1780,7 +1786,7 @@ static int bm_vert_cut(BMesh *bm, BMVert *v, BMVert ***vout, int *len)
}
/* Make enough verts to split v for each group */
- verts = MEM_callocN(sizeof(BMVert *) * maxindex, "bmesh_vert_cut");
+ verts = MEM_callocN(sizeof(BMVert *) * maxindex, __func__);
verts[0] = v;
for (i = 1; i < maxindex; i++) {
verts[i] = BM_vert_create(bm, v->co, v);
@@ -1823,12 +1829,12 @@ static int bm_vert_cut(BMesh *bm, BMVert *v, BMVert ***vout, int *len)
BM_CHECK_ELEMENT(bm, verts[i]);
}
- if (len != NULL) {
- *len = maxindex;
+ if (r_vout_len != NULL) {
+ *r_vout_len = maxindex;
}
- if (vout != NULL) {
- *vout = verts;
+ if (r_vout != NULL) {
+ *r_vout = verts;
}
else {
MEM_freeN(verts);
@@ -1838,6 +1844,24 @@ static int bm_vert_cut(BMesh *bm, BMVert *v, BMVert ***vout, int *len)
}
/**
+ * High level function which wraps both #bm_vert_separate and #bm_edge_separate
+ */
+int BM_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len,
+ BMEdge **e_in, int e_in_len)
+{
+ int i;
+
+ for (i = 0; i < e_in_len; i++) {
+ BMEdge *e = e_in[i];
+ if (e->l && BM_vert_in_edge(e, v)) {
+ bmesh_edge_separate(bm, e, e->l);
+ }
+ }
+
+ return bmesh_vert_separate(bm, v, r_vout, r_vout_len);
+}
+
+/**
* \brief Splice Edge
*
* Splice two unique edges which share the same two vertices into one edge.
@@ -1846,7 +1870,7 @@ static int bm_vert_cut(BMesh *bm, BMVert *v, BMVert ***vout, int *len)
*
* \note Edges must already have the same vertices.
*/
-static int bm_edge_splice(BMesh *bm, BMEdge *e, BMEdge *etarget)
+int BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *etarget)
{
BMLoop *l;
@@ -1875,22 +1899,22 @@ static int bm_edge_splice(BMesh *bm, BMEdge *e, BMEdge *etarget)
}
/**
- * \brief Cut Edge
+ * \brief Separate Edge
*
- * Cuts a single edge into two edge: the original edge and
- * a new edge that has only \a cutl in its radial.
+ * Separates a single edge into two edge: the original edge and
+ * a new edge that has only \a l_sep in its radial.
*
* \return Success
*
- * \note Does nothing if \a cutl is already the only loop in the
+ * \note Does nothing if \a l_sep is already the only loop in the
* edge radial.
*/
-static int bm_edge_cut(BMesh *bm, BMEdge *e, BMLoop *cutl)
+int bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep)
{
BMEdge *ne;
int radlen;
- BLI_assert(cutl->e == e);
+ BLI_assert(l_sep->e == e);
BLI_assert(e->l);
radlen = bmesh_radial_length(e->l);
@@ -1899,14 +1923,14 @@ static int bm_edge_cut(BMesh *bm, BMEdge *e, BMLoop *cutl)
return TRUE;
}
- if (cutl == e->l) {
- e->l = cutl->radial_next;
+ if (l_sep == e->l) {
+ e->l = l_sep->radial_next;
}
ne = BM_edge_create(bm, e->v1, e->v2, e, FALSE);
- bmesh_radial_loop_remove(cutl, e);
- bmesh_radial_append(ne, cutl);
- cutl->e = ne;
+ bmesh_radial_loop_remove(l_sep, e);
+ bmesh_radial_append(ne, l_sep);
+ l_sep->e = ne;
BLI_assert(bmesh_radial_length(e->l) == radlen - 1);
BLI_assert(bmesh_radial_length(ne->l) == 1);
@@ -1924,7 +1948,7 @@ static int bm_edge_cut(BMesh *bm, BMEdge *e, BMLoop *cutl)
*
* \return The newly created BMVert
*/
-static BMVert *bm_urmv_loop(BMesh *bm, BMLoop *sl)
+BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *sl)
{
BMVert **vtar;
int len, i;
@@ -1933,8 +1957,8 @@ static BMVert *bm_urmv_loop(BMesh *bm, BMLoop *sl)
/* peel the face from the edge radials on both sides of the
* loop vert, disconnecting the face from its fan */
- bm_edge_cut(bm, sl->e, sl);
- bm_edge_cut(bm, sl->prev->e, sl->prev);
+ bmesh_edge_separate(bm, sl->e, sl);
+ bmesh_edge_separate(bm, sl->prev->e, sl->prev);
if (bmesh_disk_count(sv) == 2) {
/* If there are still only two edges out of sv, then
@@ -1943,7 +1967,7 @@ static BMVert *bm_urmv_loop(BMesh *bm, BMLoop *sl)
}
/* Update the disk start, so that v->e points to an edge
- * not touching the split loop. This is so that bmesh_vert_cut
+ * not touching the split loop. This is so that BM_vert_split
* will leave the original sv on some *other* fan (not the
* one-face fan that holds the unglue face). */
while (sv->e == sl->e || sv->e == sl->prev->e) {
@@ -1952,7 +1976,7 @@ static BMVert *bm_urmv_loop(BMesh *bm, BMLoop *sl)
/* Split all fans connected to the vert, duplicating it for
* each fans. */
- bm_vert_cut(bm, sv, &vtar, &len);
+ bmesh_vert_separate(bm, sv, &vtar, &len);
/* There should have been at least two fans cut apart here,
* otherwise the early exit would have kicked in. */
@@ -2001,20 +2025,6 @@ static BMVert *bm_urmv_loop(BMesh *bm, BMLoop *sl)
*/
BMVert *bmesh_urmv(BMesh *bm, BMFace *sf, BMVert *sv)
{
- BMLoop *l_first;
- BMLoop *l_iter;
-
- l_iter = l_first = BM_FACE_FIRST_LOOP(sf);
- do {
- if (l_iter->v == sv) {
- break;
- }
- } while ((l_iter = l_iter->next) != l_first);
-
- if (l_iter->v != sv) {
- /* sv is not part of sf */
- return NULL;
- }
-
- return bm_urmv_loop(bm, l_iter);
+ BMLoop *l = BM_face_vert_share_loop(sf, sv);
+ return bmesh_urmv_loop(bm, l);
}
diff --git a/source/blender/bmesh/intern/bmesh_core.h b/source/blender/bmesh/intern/bmesh_core.h
index bfdb17e2a1e..e10222dc29a 100644
--- a/source/blender/bmesh/intern/bmesh_core.h
+++ b/source/blender/bmesh/intern/bmesh_core.h
@@ -33,16 +33,23 @@ BMVert *BM_vert_create(BMesh *bm, const float co[3], const BMVert *example);
BMEdge *BM_edge_create(BMesh *bm, BMVert *v1, BMVert *v2, const BMEdge *example, int nodouble);
BMFace *BM_face_create(BMesh *bm, BMVert **verts, BMEdge **edges, const int len, int nodouble);
-void BM_face_edges_kill(BMesh *bm, BMFace *f);
-void BM_face_verts_kill(BMesh *bm, BMFace *f);
+void BM_face_edges_kill(BMesh *bm, BMFace *f);
+void BM_face_verts_kill(BMesh *bm, BMFace *f);
-void BM_face_kill(BMesh *bm, BMFace *f);
-void BM_edge_kill(BMesh *bm, BMEdge *e);
-void BM_vert_kill(BMesh *bm, BMVert *v);
+void BM_face_kill(BMesh *bm, BMFace *f);
+void BM_edge_kill(BMesh *bm, BMEdge *e);
+void BM_vert_kill(BMesh *bm, BMVert *v);
-int bmesh_loop_reverse(BMesh *bm, BMFace *f);
+int BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *etarget);
+int bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep);
+
+int bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len);
+
+int bmesh_loop_reverse(BMesh *bm, BMFace *f);
BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface);
+int BM_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len,
+ BMEdge **e_in, int e_in_len);
/* EULER API - For modifying structure */
BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1,
@@ -50,12 +57,14 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1,
#ifdef USE_BMESH_HOLES
ListBase *holes,
#endif
- BMEdge *example
+ BMEdge *example,
+ const short nodouble
);
BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e);
BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_splice);
BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e);
BMVert *bmesh_urmv(BMesh *bm, BMFace *sf, BMVert *sv);
+BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *sl);
#endif /* __BMESH_CORE_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c
index d2af98a5e9f..7074adc324f 100644
--- a/source/blender/bmesh/intern/bmesh_interp.c
+++ b/source/blender/bmesh/intern/bmesh_interp.c
@@ -43,7 +43,7 @@
#include "BLI_math.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
/**
* \brief Data, Interp From Verts
@@ -283,7 +283,7 @@ static int quad_co(float *x, float *y, float v1[3], float v2[3], float v3[3], fl
normal_quad_v3(n2, projverts[0], projverts[1], projverts[2], projverts[3]);
- if (INPR(n, n2) < -FLT_EPSILON) {
+ if (dot_v3v3(n, n2) < -FLT_EPSILON) {
return 0;
}
diff --git a/source/blender/bmesh/intern/bmesh_iterators.c b/source/blender/bmesh/intern/bmesh_iterators.c
index 9694053e967..e58e989c41f 100644
--- a/source/blender/bmesh/intern/bmesh_iterators.c
+++ b/source/blender/bmesh/intern/bmesh_iterators.c
@@ -30,7 +30,7 @@
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
const char bm_iter_itype_htype_map[BM_ITYPE_MAX] = {
'\0',
diff --git a/source/blender/bmesh/intern/bmesh_iterators.h b/source/blender/bmesh/intern/bmesh_iterators.h
index 24653fc0b73..7b13d2de723 100644
--- a/source/blender/bmesh/intern/bmesh_iterators.h
+++ b/source/blender/bmesh/intern/bmesh_iterators.h
@@ -37,7 +37,7 @@
* the iterators provided in this file instead
* of inspecting the structure directly.
*
-*/
+ */
#include "BLI_mempool.h"
diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c
index ab1b57a5999..f05a75e74bf 100644
--- a/source/blender/bmesh/intern/bmesh_marking.c
+++ b/source/blender/bmesh/intern/bmesh_marking.c
@@ -312,7 +312,9 @@ void BM_edge_select_set(BMesh *bm, BMEdge *e, int select)
}
}
- if (deselect) BM_vert_select_set(bm, verts[i], FALSE);
+ if (deselect) {
+ BM_vert_select_set(bm, verts[i], FALSE);
+ }
}
}
else {
@@ -366,8 +368,7 @@ void BM_face_select_set(BMesh *bm, BMFace *f, int select)
break;
}
- if (!f2)
- {
+ if (!f2) {
BM_elem_select_set(bm, l->e, FALSE);
}
}
@@ -756,14 +757,27 @@ void BM_mesh_elem_flag_disable_all(BMesh *bm, const char htype, const char hflag
BM_select_history_clear(bm);
}
- for (i = 0; i < 3; i++) {
- if (htype & iter_types[i]) {
+ if (htype == (BM_VERT | BM_EDGE | BM_FACE) && (hflag == BM_ELEM_SELECT)) {
+ /* fast path for deselect all, avoid topology loops
+ * since we know all will be de-selected anyway. */
+ for (i = 0; i < 3; i++) {
ele = BM_iter_new(&iter, bm, iter_types[i], NULL);
for ( ; ele; ele = BM_iter_step(&iter)) {
- if (hflag & BM_ELEM_SELECT) {
- BM_elem_select_set(bm, ele, FALSE);
+ BM_elem_flag_disable(ele, BM_ELEM_SELECT);
+ }
+ }
+ bm->totvertsel = bm->totedgesel = bm->totfacesel = 0;
+ }
+ else {
+ for (i = 0; i < 3; i++) {
+ if (htype & iter_types[i]) {
+ ele = BM_iter_new(&iter, bm, iter_types[i], NULL);
+ for ( ; ele; ele = BM_iter_step(&iter)) {
+ if (hflag & BM_ELEM_SELECT) {
+ BM_elem_select_set(bm, ele, FALSE);
+ }
+ BM_elem_flag_disable(ele, hflag);
}
- BM_elem_flag_disable(ele, hflag);
}
}
}
@@ -782,6 +796,10 @@ void BM_mesh_elem_flag_enable_all(BMesh *bm, const char htype, const char hflag)
BM_select_history_clear(bm);
}
+ /* note, better not attempt a fast path for selection as done with de-select
+ * because hidden geometry and different selection modes can give different results,
+ * we could ofcourse check for no hiddent faces and then use quicker method but its not worth it. */
+
for (i = 0; i < 3; i++) {
if (htype & iter_types[i]) {
ele = BM_iter_new(&iter, bm, iter_types[i], NULL);
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index 944b3b434c7..63719e778f7 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -41,7 +41,7 @@
#include "ED_mesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
/* used as an extern, defined in bmesh.h */
BMAllocTemplate bm_mesh_allocsize_default = {512, 1024, 2048, 512};
@@ -213,24 +213,8 @@ void BM_mesh_normals_update(BMesh *bm, const short skip_hidden)
BMIter faces;
BMIter loops;
BMIter edges;
- unsigned int maxlength = 0;
int index;
- float (*projectverts)[3];
float (*edgevec)[3];
-
- /* first, find out the largest face in mesh */
- BM_ITER(f, &faces, bm, BM_FACES_OF_MESH, NULL) {
- if (skip_hidden && BM_elem_flag_test(f, BM_ELEM_HIDDEN))
- continue;
-
- if (f->len > maxlength) maxlength = f->len;
- }
-
- /* make sure we actually have something to do */
- if (maxlength < 3) return;
-
- /* allocate projectverts array */
- projectverts = MEM_callocN(sizeof(float) * maxlength * 3, "BM normal computation array");
/* calculate all face normals */
BM_ITER(f, &faces, bm, BM_FACES_OF_MESH, NULL) {
@@ -241,7 +225,7 @@ void BM_mesh_normals_update(BMesh *bm, const short skip_hidden)
continue;
#endif
- bmesh_face_normal_update(bm, f, f->no, projectverts);
+ bmesh_face_normal_update(bm, f, f->no);
}
/* Zero out vertex normals */
@@ -314,7 +298,6 @@ void BM_mesh_normals_update(BMesh *bm, const short skip_hidden)
}
MEM_freeN(edgevec);
- MEM_freeN(projectverts);
}
/*
@@ -358,7 +341,7 @@ static void bm_rationalize_normals(BMesh *bm, int undo)
BMO_op_finish(bm, &bmop);
}
-static void bm_mdisps_space_set(BMesh *bm, int from, int to)
+static void UNUSED_FUNCTION(bm_mdisps_space_set)(BMesh *bm, int from, int to)
{
/* switch multires data out of tangent space */
if (CustomData_has_layer(&bm->ldata, CD_MDISPS)) {
diff --git a/source/blender/bmesh/intern/bmesh_mesh_conv.c b/source/blender/bmesh/intern/bmesh_mesh_conv.c
new file mode 100644
index 00000000000..7b0a59d2ca1
--- /dev/null
+++ b/source/blender/bmesh/intern/bmesh_mesh_conv.c
@@ -0,0 +1,901 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Geoffrey Bantle.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/bmesh/intern/bmesh_mesh_conv.c
+ * \ingroup bmesh
+ *
+ * BM mesh conversion functions.
+ */
+
+
+#include "bmesh.h"
+#include "intern/bmesh_private.h" /* for element checking */
+
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_object_types.h"
+#include "DNA_modifier_types.h"
+#include "DNA_key_types.h"
+
+#include "BLI_listbase.h"
+#include "BLI_array.h"
+#include "BLI_math_vector.h"
+
+#include "BKE_mesh.h"
+#include "BKE_customdata.h"
+
+#include "BKE_global.h" /* ugh - for looping over all objects */
+#include "BKE_main.h"
+
+#include "MEM_guardedalloc.h"
+
+/* Mesh -> BMesh */
+void BM_mesh_to_bmesh(BMesh *bm, Mesh *me, int set_key, int act_key_nr)
+{
+ MVert *mvert;
+ BLI_array_declare(verts);
+ MEdge *medge;
+ MLoop *ml;
+ MPoly *mpoly;
+ KeyBlock *actkey, *block;
+ BMVert *v, **vt = NULL, **verts = NULL;
+ BMEdge *e, **fedges = NULL, **et = NULL;
+ BMFace *f;
+ BMLoop *l;
+ BLI_array_declare(fedges);
+ float (*keyco)[3] = NULL;
+ int *keyi;
+ int totuv, i, j;
+
+ if (!me || !me->totvert) {
+ return; /* sanity check */
+ }
+
+ vt = MEM_mallocN(sizeof(void **) * me->totvert, "mesh to bmesh vtable");
+
+ CustomData_copy(&me->vdata, &bm->vdata, CD_MASK_BMESH, CD_CALLOC, 0);
+ CustomData_copy(&me->edata, &bm->edata, CD_MASK_BMESH, CD_CALLOC, 0);
+ CustomData_copy(&me->ldata, &bm->ldata, CD_MASK_BMESH, CD_CALLOC, 0);
+ CustomData_copy(&me->pdata, &bm->pdata, CD_MASK_BMESH, CD_CALLOC, 0);
+
+ /* make sure uv layer names are consisten */
+ totuv = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY);
+ for (i = 0; i < totuv; i++) {
+ int li = CustomData_get_layer_index_n(&bm->pdata, CD_MTEXPOLY, i);
+ CustomData_set_layer_name(&bm->ldata, CD_MLOOPUV, i, bm->pdata.layers[li].name);
+ }
+
+ if (!CustomData_has_layer(&bm->edata, CD_CREASE))
+ CustomData_add_layer(&bm->edata, CD_CREASE, CD_ASSIGN, NULL, 0);
+
+ if (!CustomData_has_layer(&bm->edata, CD_BWEIGHT))
+ CustomData_add_layer(&bm->edata, CD_BWEIGHT, CD_ASSIGN, NULL, 0);
+
+ if (!CustomData_has_layer(&bm->vdata, CD_BWEIGHT))
+ CustomData_add_layer(&bm->vdata, CD_BWEIGHT, CD_ASSIGN, NULL, 0);
+
+ if ((act_key_nr != 0) && (me->key != NULL)) {
+ actkey = BLI_findlink(&me->key->block, act_key_nr - 1);
+ }
+ else {
+ actkey = NULL;
+ }
+
+ if (actkey && actkey->totelem == me->totvert) {
+ CustomData_add_layer(&bm->vdata, CD_SHAPE_KEYINDEX, CD_ASSIGN, NULL, 0);
+
+ /* check if we need to generate unique ids for the shapekeys.
+ * this also exists in the file reading code, but is here for
+ * a sanity check */
+ if (!me->key->uidgen) {
+ fprintf(stderr,
+ "%s had to generate shape key uid's in a situation we shouldn't need to! "
+ "(bmesh internal error)\n",
+ __func__);
+
+ me->key->uidgen = 1;
+ for (block = me->key->block.first; block; block = block->next) {
+ block->uid = me->key->uidgen++;
+ }
+ }
+
+ keyco = actkey->data;
+ bm->shapenr = act_key_nr;
+ for (i = 0, block = me->key->block.first; block; block = block->next, i++) {
+ CustomData_add_layer_named(&bm->vdata, CD_SHAPEKEY,
+ CD_ASSIGN, NULL, 0, block->name);
+
+ j = CustomData_get_layer_index_n(&bm->vdata, CD_SHAPEKEY, i);
+ bm->vdata.layers[j].uid = block->uid;
+ }
+ }
+ else if (actkey) {
+ printf("shapekey <-> mesh mismatch!\n");
+ }
+
+ 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);
+ BM_elem_index_set(v, i); /* set_ok */
+ vt[i] = v;
+
+ /* transfer flag */
+ v->head.hflag = BM_vert_flag_from_mflag(mvert->flag);
+
+ /* this is necessary for selection counts to work properly */
+ 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);
+
+ BM_elem_float_data_set(&bm->vdata, v, CD_BWEIGHT, (float)mvert->bweight / 255.0f);
+
+ /* Copy Custom Dat */
+ CustomData_to_bmesh_block(&me->vdata, &bm->vdata, i, &v->head.data);
+
+ /* set shapekey data */
+ if (me->key) {
+ /* set shape key original index */
+ keyi = CustomData_bmesh_get(&bm->vdata, v->head.data, CD_SHAPE_KEYINDEX);
+ if (keyi) {
+ *keyi = i;
+ }
+
+ for (block = me->key->block.first, j = 0; block; block = block->next, j++) {
+ float *co = CustomData_bmesh_get_n(&bm->vdata, v->head.data, CD_SHAPEKEY, j);
+
+ if (co) {
+ copy_v3_v3(co, ((float *)block->data) + 3 * i);
+ }
+ }
+ }
+ }
+
+ bm->elem_index_dirty &= ~BM_VERT; /* added in order, clear dirty flag */
+
+ if (!me->totedge) {
+ MEM_freeN(vt);
+ return;
+ }
+
+ et = MEM_mallocN(sizeof(void **) * me->totedge, "mesh to bmesh etable");
+
+ medge = me->medge;
+ for (i = 0; i < me->totedge; i++, medge++) {
+ e = BM_edge_create(bm, vt[medge->v1], vt[medge->v2], NULL, FALSE);
+ BM_elem_index_set(e, i); /* set_ok */
+ et[i] = e;
+
+ /* transfer flags */
+ e->head.hflag = BM_edge_flag_from_mflag(medge->flag);
+
+ /* 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 Data */
+ CustomData_to_bmesh_block(&me->edata, &bm->edata, i, &e->head.data);
+
+ BM_elem_float_data_set(&bm->edata, e, CD_CREASE, (float)medge->crease / 255.0f);
+ BM_elem_float_data_set(&bm->edata, e, CD_BWEIGHT, (float)medge->bweight / 255.0f);
+ }
+
+ bm->elem_index_dirty &= ~BM_EDGE; /* added in order, clear dirty flag */
+
+ mpoly = me->mpoly;
+ for (i = 0; i < me->totpoly; i++, mpoly++) {
+ BMIter iter;
+
+ BLI_array_empty(fedges);
+ BLI_array_empty(verts);
+
+ BLI_array_growitems(fedges, mpoly->totloop);
+ BLI_array_growitems(verts, mpoly->totloop);
+
+ for (j = 0; j < mpoly->totloop; j++) {
+ ml = &me->mloop[mpoly->loopstart + j];
+ v = vt[ml->v];
+ e = et[ml->e];
+
+ fedges[j] = e;
+ verts[j] = v;
+ }
+
+ /* not sure what this block is supposed to do,
+ * but its unused. so commenting - campbell */
+#if 0
+ {
+ BMVert *v1, *v2;
+ v1 = vt[me->mloop[mpoly->loopstart].v];
+ v2 = vt[me->mloop[mpoly->loopstart + 1].v];
+
+ if (v1 == fedges[0]->v1) {
+ v2 = fedges[0]->v2;
+ }
+ else {
+ v1 = fedges[0]->v2;
+ v2 = fedges[0]->v1;
+ }
+ }
+#endif
+
+ f = BM_face_create(bm, verts, fedges, mpoly->totloop, FALSE);
+
+ if (!f) {
+ printf("%s: Warning! Bad face in mesh"
+ " \"%s\" at index %d!, skipping\n",
+ __func__, me->id.name + 2, i);
+ continue;
+ }
+
+ /* dont use 'i' since we may have skipped the face */
+ BM_elem_index_set(f, bm->totface - 1); /* set_ok */
+
+ /* transfer flag */
+ f->head.hflag = BM_face_flag_from_mflag(mpoly->flag);
+
+ /* this is necessary for selection counts to work properly */
+ if (BM_elem_flag_test(f, BM_ELEM_SELECT)) BM_elem_select_set(bm, f, TRUE);
+
+ f->mat_nr = mpoly->mat_nr;
+ if (i == me->act_face) bm->act_face = f;
+
+ j = 0;
+ BM_ITER_INDEX(l, &iter, bm, BM_LOOPS_OF_FACE, f, j) {
+ /* Save index of correspsonding MLoop */
+ BM_elem_index_set(l, mpoly->loopstart + j); /* set_loop */
+ }
+
+ /* Copy Custom Data */
+ CustomData_to_bmesh_block(&me->pdata, &bm->pdata, i, &f->head.data);
+ }
+
+ bm->elem_index_dirty &= ~BM_FACE; /* added in order, clear dirty flag */
+
+ {
+ BMIter fiter;
+ BMIter liter;
+
+ /* Copy over loop CustomData. Doing this in a separate loop isn't necessary
+ * but is an optimization, to avoid copying a bunch of interpolated customdata
+ * for each BMLoop (from previous BMLoops using the same edge), always followed
+ * by freeing the interpolated data and overwriting it with data from the Mesh. */
+ BM_ITER(f, &fiter, bm, BM_FACES_OF_MESH, NULL) {
+ BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
+ int li = BM_elem_index_get(l);
+ CustomData_to_bmesh_block(&me->ldata, &bm->ldata, li, &l->head.data);
+ BM_elem_index_set(l, 0); /* set_loop */
+ }
+ }
+ }
+
+ if (me->mselect && me->totselect != 0) {
+ BMIter iter;
+ BMVert *vertex;
+ BMEdge *edge;
+ BMFace *face;
+ BMVert **vertex_array = MEM_callocN(sizeof(BMVert *) * bm->totvert,
+ "Selection Conversion Vertex Pointer Array");
+ BMEdge **edge_array = MEM_callocN(sizeof(BMEdge *) * bm->totedge,
+ "Selection Conversion Edge Pointer Array");
+ BMFace **face_array = MEM_callocN(sizeof(BMFace *) * bm->totface,
+ "Selection Conversion Face Pointer Array");
+
+ for (i = 0, vertex = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL);
+ vertex;
+ i++, vertex = BM_iter_step(&iter))
+ {
+ vertex_array[i] = vertex;
+ }
+
+ for (i = 0, edge = BM_iter_new(&iter, bm, BM_EDGES_OF_MESH, NULL);
+ edge;
+ i++, edge = BM_iter_step(&iter))
+ {
+ edge_array[i] = edge;
+ }
+
+ for (i = 0, face = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, NULL);
+ face;
+ i++, face = BM_iter_step(&iter))
+ {
+ face_array[i] = face;
+ }
+
+ if (me->mselect) {
+ for (i = 0; i < me->totselect; i++) {
+ if (me->mselect[i].type == ME_VSEL) {
+ BM_select_history_store(bm, (BMElem *)vertex_array[me->mselect[i].index]);
+ }
+ else if (me->mselect[i].type == ME_ESEL) {
+ BM_select_history_store(bm, (BMElem *)edge_array[me->mselect[i].index]);
+ }
+ else if (me->mselect[i].type == ME_FSEL) {
+ BM_select_history_store(bm, (BMElem *)face_array[me->mselect[i].index]);
+ }
+ }
+ }
+ else {
+ me->totselect = 0;
+ }
+
+ MEM_freeN(vertex_array);
+ MEM_freeN(edge_array);
+ MEM_freeN(face_array);
+ }
+ else {
+ me->totselect = 0;
+ if (me->mselect) {
+ MEM_freeN(me->mselect);
+ me->mselect = NULL;
+ }
+ }
+
+ BLI_array_free(fedges);
+ BLI_array_free(verts);
+
+ MEM_freeN(vt);
+ MEM_freeN(et);
+}
+
+
+/* BMesh -> Mesh */
+static BMVert **bm_to_mesh_vertex_map(BMesh *bm, int ototvert)
+{
+ BMVert **vertMap = NULL;
+ BMVert *eve;
+ int index;
+ int i = 0;
+ BMIter iter;
+
+ /* caller needs to ensure this */
+ BLI_assert(ototvert > 0);
+
+ vertMap = MEM_callocN(sizeof(*vertMap)*ototvert, "vertMap");
+ if (CustomData_has_layer(&bm->vdata, CD_SHAPE_KEYINDEX)) {
+ int *keyi;
+ BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ keyi = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_SHAPE_KEYINDEX);
+ if (keyi) {
+ if (((index = *keyi) != ORIGINDEX_NONE) && (index < ototvert)) {
+ vertMap[index] = eve;
+ }
+ }
+ else {
+ if (i < ototvert) {
+ vertMap[i] = eve;
+ }
+ }
+ i++;
+ }
+ }
+ else {
+ BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ if (i < ototvert) {
+ vertMap[i] = eve;
+ }
+ else {
+ break;
+ }
+ i++;
+ }
+ }
+
+ return vertMap;
+}
+
+BM_INLINE void bmesh_quick_edgedraw_flag(MEdge *med, BMEdge *e)
+{
+ /* this is a cheap way to set the edge draw, its not precise and will
+ * pick the first 2 faces an edge uses */
+
+
+ if ( /* (med->flag & ME_EDGEDRAW) && */ /* assume to be true */
+ (e->l && (e->l != e->l->radial_next)) &&
+ (dot_v3v3(e->l->f->no, e->l->radial_next->f->no) > 0.998f))
+ {
+ med->flag &= ~ME_EDGEDRAW;
+ }
+}
+
+void BM_mesh_from_bmesh(BMesh *bm, Mesh *me, int dotess)
+{
+ MLoop *mloop;
+ MPoly *mpoly;
+ MVert *mvert, *oldverts;
+ MEdge *med, *medge;
+ BMVert *v, *eve;
+ BMEdge *e;
+ BMLoop *l;
+ BMFace *f;
+ BMIter iter, liter;
+ int i, j, *keyi, ototvert, totloop;
+
+ ototvert = me->totvert;
+
+ /* new Vertex block */
+ if (bm->totvert == 0) mvert = NULL;
+ else mvert = MEM_callocN(bm->totvert * sizeof(MVert), "loadeditbMesh vert");
+
+ /* new Edge block */
+ if (bm->totedge == 0) medge = NULL;
+ else medge = MEM_callocN(bm->totedge * sizeof(MEdge), "loadeditbMesh edge");
+
+ /* build ngon data */
+ /* new Ngon Face block */
+ if (bm->totface == 0) mpoly = NULL;
+ else mpoly = MEM_callocN(bm->totface * sizeof(MPoly), "loadeditbMesh poly");
+
+ /* find number of loops to allocate */
+ totloop = 0;
+ BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
+ totloop += f->len;
+ }
+
+ if (totloop == 0) mloop = NULL;
+ else mloop = MEM_callocN(totloop * sizeof(MLoop), "loadeditbMesh loop");
+
+ /* lets save the old verts just in case we are actually working on
+ * a key ... we now do processing of the keys at the end */
+ oldverts = me->mvert;
+
+ /* don't free this yet */
+ CustomData_set_layer(&me->vdata, CD_MVERT, NULL);
+
+ /* free custom data */
+ CustomData_free(&me->vdata, me->totvert);
+ CustomData_free(&me->edata, me->totedge);
+ CustomData_free(&me->fdata, me->totface);
+ CustomData_free(&me->ldata, me->totloop);
+ CustomData_free(&me->pdata, me->totpoly);
+
+ /* add new custom data */
+ me->totvert = bm->totvert;
+ me->totedge = bm->totedge;
+ me->totloop = totloop;
+ me->totpoly = bm->totface;
+ /* will be overwritten with a valid value if 'dotess' is set, otherwise we
+ * end up with 'me->totface' and me->mface == NULL which can crash [#28625]
+ */
+ me->totface = 0;
+
+ CustomData_copy(&bm->vdata, &me->vdata, CD_MASK_MESH, CD_CALLOC, me->totvert);
+ CustomData_copy(&bm->edata, &me->edata, CD_MASK_MESH, CD_CALLOC, me->totedge);
+ CustomData_copy(&bm->ldata, &me->ldata, CD_MASK_MESH, CD_CALLOC, me->totloop);
+ CustomData_copy(&bm->pdata, &me->pdata, CD_MASK_MESH, CD_CALLOC, me->totpoly);
+
+ CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, mvert, me->totvert);
+ CustomData_add_layer(&me->edata, CD_MEDGE, CD_ASSIGN, medge, me->totedge);
+ CustomData_add_layer(&me->ldata, CD_MLOOP, CD_ASSIGN, mloop, me->totloop);
+ CustomData_add_layer(&me->pdata, CD_MPOLY, CD_ASSIGN, mpoly, me->totpoly);
+
+ /* this is called again, 'dotess' arg is used there */
+ mesh_update_customdata_pointers(me, 0);
+
+ i = 0;
+ BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ float *bweight = CustomData_bmesh_get(&bm->vdata, v->head.data, CD_BWEIGHT);
+
+ mvert->bweight = bweight ? (char)((*bweight) * 255) : 0;
+
+ copy_v3_v3(mvert->co, v->co);
+ normal_float_to_short_v3(mvert->no, v->no);
+
+ mvert->flag = BM_vert_flag_to_mflag(v);
+
+ BM_elem_index_set(v, i); /* set_inline */
+
+ /* copy over customdat */
+ CustomData_from_bmesh_block(&bm->vdata, &me->vdata, v->head.data, i);
+
+ i++;
+ mvert++;
+
+ BM_CHECK_ELEMENT(bm, v);
+ }
+ bm->elem_index_dirty &= ~BM_VERT;
+
+ med = medge;
+ i = 0;
+ BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ float *crease = CustomData_bmesh_get(&bm->edata, e->head.data, CD_CREASE);
+ float *bweight = CustomData_bmesh_get(&bm->edata, e->head.data, CD_BWEIGHT);
+
+ med->v1 = BM_elem_index_get(e->v1);
+ med->v2 = BM_elem_index_get(e->v2);
+ med->crease = crease ? (char)((*crease) * 255) : 0;
+ med->bweight = bweight ? (char)((*bweight) * 255) : 0;
+
+ med->flag = BM_edge_flag_to_mflag(e);
+
+ BM_elem_index_set(e, i); /* set_inline */
+
+ /* copy over customdata */
+ CustomData_from_bmesh_block(&bm->edata, &me->edata, e->head.data, i);
+
+ bmesh_quick_edgedraw_flag(med, e);
+
+ i++;
+ med++;
+ BM_CHECK_ELEMENT(bm, e);
+ }
+ bm->elem_index_dirty &= ~BM_EDGE;
+
+ i = 0;
+ j = 0;
+ BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
+ mpoly->loopstart = j;
+ mpoly->totloop = f->len;
+ mpoly->mat_nr = f->mat_nr;
+ mpoly->flag = BM_face_flag_to_mflag(f);
+
+ l = BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, f);
+ for ( ; l; l = BM_iter_step(&liter), j++, mloop++) {
+ mloop->e = BM_elem_index_get(l->e);
+ mloop->v = BM_elem_index_get(l->v);
+
+ /* copy over customdat */
+ CustomData_from_bmesh_block(&bm->ldata, &me->ldata, l->head.data, j);
+ BM_CHECK_ELEMENT(bm, l);
+ BM_CHECK_ELEMENT(bm, l->e);
+ BM_CHECK_ELEMENT(bm, l->v);
+ }
+
+ if (f == bm->act_face) me->act_face = i;
+
+ /* copy over customdata */
+ CustomData_from_bmesh_block(&bm->pdata, &me->pdata, f->head.data, i);
+
+ i++;
+ mpoly++;
+ BM_CHECK_ELEMENT(bm, f);
+ }
+
+ /* patch hook indices and vertex parents */
+ if (ototvert > 0) {
+ Object *ob;
+ ModifierData *md;
+ BMVert **vertMap = NULL;
+ int i, j;
+
+ for (ob = G.main->object.first; ob; ob = ob->id.next) {
+ if (ob->parent == bm->ob && ELEM(ob->partype, PARVERT1, PARVERT3)) {
+
+ if (vertMap == NULL) {
+ vertMap = bm_to_mesh_vertex_map(bm, ototvert);
+ }
+
+ if (ob->par1 < ototvert) {
+ eve = vertMap[ob->par1];
+ if (eve) ob->par1 = BM_elem_index_get(eve);
+ }
+ if (ob->par2 < ototvert) {
+ eve = vertMap[ob->par2];
+ if (eve) ob->par2 = BM_elem_index_get(eve);
+ }
+ if (ob->par3 < ototvert) {
+ eve = vertMap[ob->par3];
+ if (eve) ob->par3 = BM_elem_index_get(eve);
+ }
+
+ }
+ if (ob->data == me) {
+ for (md = ob->modifiers.first; md; md = md->next) {
+ if (md->type == eModifierType_Hook) {
+ HookModifierData *hmd = (HookModifierData *) md;
+
+ if (vertMap == NULL) {
+ vertMap = bm_to_mesh_vertex_map(bm, ototvert);
+ }
+
+ for (i = j = 0; i < hmd->totindex; i++) {
+ if (hmd->indexar[i] < ototvert) {
+ eve = vertMap[hmd->indexar[i]];
+
+ if (eve) {
+ hmd->indexar[j++] = BM_elem_index_get(eve);
+ }
+ }
+ else j++;
+ }
+
+ hmd->totindex = j;
+ }
+ }
+ }
+ }
+
+ if (vertMap) MEM_freeN(vertMap);
+ }
+
+ if (dotess) {
+ BKE_mesh_tessface_calc(me);
+ }
+
+ mesh_update_customdata_pointers(me, dotess);
+
+ {
+ BMEditSelection *selected;
+ me->totselect = BLI_countlist(&(bm->selected));
+
+ if (me->mselect) MEM_freeN(me->mselect);
+
+ me->mselect = MEM_callocN(sizeof(MSelect) * me->totselect, "Mesh selection history");
+
+
+ for (i = 0, selected = bm->selected.first; selected; i++, selected = selected->next) {
+ if (selected->htype == BM_VERT) {
+ me->mselect[i].type = ME_VSEL;
+
+ }
+ else if (selected->htype == BM_EDGE) {
+ me->mselect[i].type = ME_ESEL;
+
+ }
+ else if (selected->htype == BM_FACE) {
+ me->mselect[i].type = ME_FSEL;
+ }
+
+ me->mselect[i].index = BM_elem_index_get(selected->ele);
+ }
+ }
+
+ /* see comment below, this logic is in twice */
+
+ if (me->key) {
+ KeyBlock *currkey;
+ KeyBlock *actkey = BLI_findlink(&me->key->block, bm->shapenr - 1);
+
+ float (*ofs)[3] = NULL;
+
+ /* go through and find any shapekey customdata layers
+ * that might not have corresponding KeyBlocks, and add them if
+ * necessary */
+ j = 0;
+ for (i = 0; i < bm->vdata.totlayer; i++) {
+ if (bm->vdata.layers[i].type != CD_SHAPEKEY)
+ continue;
+
+ for (currkey = me->key->block.first; currkey; currkey = currkey->next) {
+ if (currkey->uid == bm->vdata.layers[i].uid)
+ break;
+ }
+
+ if (!currkey) {
+ currkey = MEM_callocN(sizeof(KeyBlock), "KeyBlock mesh_conv.c");
+ currkey->type = KEY_LINEAR;
+ currkey->slidermin = 0.0f;
+ currkey->slidermax = 1.0f;
+
+ BLI_addtail(&me->key->block, currkey);
+ me->key->totkey++;
+ }
+
+ j++;
+ }
+
+
+ /* editing the base key should update others */
+ if (me->key->type == KEY_RELATIVE && oldverts) {
+ int act_is_basis = 0;
+ /* find if this key is a basis for any others */
+ for (currkey = me->key->block.first; currkey; currkey = currkey->next) {
+ if (bm->shapenr - 1 == currkey->relative) {
+ act_is_basis = 1;
+ break;
+ }
+ }
+
+ if (act_is_basis) { /* active key is a base */
+ float (*fp)[3] = actkey->data;
+ int *keyi;
+ i = 0;
+ ofs = MEM_callocN(sizeof(float) * 3 * bm->totvert, "currkey->data");
+ mvert = me->mvert;
+ BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ keyi = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_SHAPE_KEYINDEX);
+ if (keyi && *keyi != ORIGINDEX_NONE) {
+ sub_v3_v3v3(ofs[i], mvert->co, fp[*keyi]);
+ }
+ i++;
+ mvert++;
+ }
+ }
+ }
+
+
+ for (currkey = me->key->block.first; currkey; currkey = currkey->next) {
+ j = 0;
+
+ for (i = 0; i < bm->vdata.totlayer; i++) {
+ if (bm->vdata.layers[i].type != CD_SHAPEKEY)
+ continue;
+
+ if (currkey->uid == bm->vdata.layers[i].uid) {
+ int apply_offset = (ofs && (currkey != actkey) && (bm->shapenr - 1 == currkey->relative));
+ float *fp, *co;
+ float (*ofs_pt)[3] = ofs;
+
+ if (currkey->data)
+ MEM_freeN(currkey->data);
+ currkey->data = fp = MEM_mallocN(sizeof(float) * 3 * bm->totvert, "shape key data");
+ currkey->totelem = bm->totvert;
+
+ mvert = me->mvert;
+ BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ co = (currkey == actkey) ?
+ eve->co :
+ CustomData_bmesh_get_n(&bm->vdata, eve->head.data, CD_SHAPEKEY, j);
+
+ copy_v3_v3(fp, co);
+
+ /* propagate edited basis offsets to other shapes */
+ if (apply_offset) {
+ add_v3_v3(fp, *ofs_pt++);
+ }
+
+ if (currkey == actkey && oldverts) {
+ keyi = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_SHAPE_KEYINDEX);
+
+ if (*keyi >= 0 && *keyi < currkey->totelem) // valid old vertex
+ copy_v3_v3(mvert->co, oldverts[*keyi].co);
+
+ mvert++;
+ }
+
+ fp += 3;
+ }
+ break;
+ }
+
+ j++;
+ }
+
+ /* if we didn't find a shapekey, tag the block to be reconstructed
+ * via the old method below */
+ if (j == CustomData_number_of_layers(&bm->vdata, CD_SHAPEKEY)) {
+ currkey->flag |= KEYBLOCK_MISSING;
+ }
+ }
+
+ if (ofs) MEM_freeN(ofs);
+ }
+
+ /* XXX, code below is from trunk and a duplicate functionality
+ * to the block above.
+ * We should use one or the other, having both means we have to maintain
+ * both and keep them working the same way which is a hassle - campbell */
+
+ /* old method of reconstructing keys via vertice's original key indices,
+ * currently used if the new method above fails (which is theoretically
+ * possible in certain cases of undo) */
+ if (me->key) {
+ float *fp, *newkey, *oldkey;
+ KeyBlock *currkey;
+ KeyBlock *actkey = BLI_findlink(&me->key->block, bm->shapenr - 1);
+
+ float (*ofs)[3] = NULL;
+
+ /* editing the base key should update others */
+ if (me->key->type == KEY_RELATIVE && oldverts) {
+ int act_is_basis = 0;
+ /* find if this key is a basis for any others */
+ for (currkey = me->key->block.first; currkey; currkey = currkey->next) {
+ if (bm->shapenr - 1 == currkey->relative) {
+ act_is_basis = 1;
+ break;
+ }
+ }
+
+ if (act_is_basis) { /* active key is a base */
+ float (*fp)[3] = actkey->data;
+ int *keyi;
+ i = 0;
+ ofs = MEM_callocN(sizeof(float) * 3 * bm->totvert, "currkey->data");
+ mvert = me->mvert;
+ BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ keyi = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_SHAPE_KEYINDEX);
+ if (keyi && *keyi != ORIGINDEX_NONE) {
+ sub_v3_v3v3(ofs[i], mvert->co, fp[*keyi]);
+ }
+ i++;
+ mvert++;
+ }
+ }
+ }
+
+ /* Lets reorder the key data so that things line up roughly
+ * with the way things were before editmode */
+ currkey = me->key->block.first;
+ while (currkey) {
+ int apply_offset = (ofs && (currkey != actkey) && (bm->shapenr - 1 == currkey->relative));
+
+ if (!(currkey->flag & KEYBLOCK_MISSING)) {
+ currkey = currkey->next;
+ continue;
+ }
+
+ printf("warning: had to hackishly reconstruct shape key \"%s\","
+ " it may not be correct anymore.\n", currkey->name);
+
+ currkey->flag &= ~KEYBLOCK_MISSING;
+
+ fp = newkey = MEM_callocN(me->key->elemsize * bm->totvert, "currkey->data");
+ oldkey = currkey->data;
+
+ eve = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL);
+
+ i = 0;
+ mvert = me->mvert;
+ while (eve) {
+ keyi = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_SHAPE_KEYINDEX);
+ if (!keyi) {
+ break;
+ }
+ if (*keyi >= 0 && *keyi < currkey->totelem) { // valid old vertex
+ if (currkey == actkey) {
+ if (actkey == me->key->refkey) {
+ copy_v3_v3(fp, mvert->co);
+ }
+ else {
+ copy_v3_v3(fp, mvert->co);
+ if (oldverts) {
+ copy_v3_v3(mvert->co, oldverts[*keyi].co);
+ }
+ }
+ }
+ else {
+ if (oldkey) {
+ copy_v3_v3(fp, oldkey + 3 * *keyi);
+ }
+ }
+ }
+ else {
+ copy_v3_v3(fp, mvert->co);
+ }
+
+ /* propagate edited basis offsets to other shapes */
+ if (apply_offset) {
+ add_v3_v3(fp, ofs[i]);
+ }
+
+ fp += 3;
+ i++;
+ mvert++;
+ eve = BM_iter_step(&iter);
+ }
+ currkey->totelem = bm->totvert;
+ if (currkey->data) MEM_freeN(currkey->data);
+ currkey->data = newkey;
+
+ currkey = currkey->next;
+ }
+
+ if (ofs) MEM_freeN(ofs);
+ }
+
+ if (oldverts) MEM_freeN(oldverts);
+}
diff --git a/source/blender/bmesh/intern/bmesh_mesh_conv.h b/source/blender/bmesh/intern/bmesh_mesh_conv.h
new file mode 100644
index 00000000000..f1b820767d4
--- /dev/null
+++ b/source/blender/bmesh/intern/bmesh_mesh_conv.h
@@ -0,0 +1,40 @@
+/*
+ * ***** 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) 2004 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Geoffrey Bantle.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __BMESH_MESH_CONV_H__
+#define __BMESH_MESH_CONV_H__
+
+/** \file blender/bmesh/intern/bmesh_mesh_conv.h
+ * \ingroup bmesh
+ */
+
+struct Mesh;
+
+void BM_mesh_to_bmesh(BMesh *bm, struct Mesh *me, int set_key, int act_key_nr);
+void BM_mesh_from_bmesh(BMesh *bm, struct Mesh *me, int dotess);
+
+#endif /* __BMESH_MESH_CONV_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c
index ae53d5f83e4..72f6814dc89 100644
--- a/source/blender/bmesh/intern/bmesh_mods.c
+++ b/source/blender/bmesh/intern/bmesh_mods.c
@@ -37,22 +37,28 @@
#include "BKE_customdata.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
/**
* \brief Dissolve Vert
*
* Turns the face region surrounding a manifold vertex into a single polygon.
*
- *
* \par Example:
*
- * |=========| |=========|
+ * +---------+ +---------+
* | \ / | | |
- * Before: | V | After: | |
+ * Before: | v | After: | |
* | / \ | | |
- * |=========| |=========|
+ * +---------+ +---------+
+ *
+ *
+ * This function can also collapse edges too
+ * in cases when it cant merge into faces.
*
+ * \par Example:
+ *
+ * Before: +----v----+ After: +---------+
*
* \note dissolves vert, in more situations then BM_disk_dissolve
* (e.g. if the vert is part of a wire edge, etc).
@@ -127,7 +133,7 @@ int BM_disk_dissolve(BMesh *bm, BMVert *v)
* increasing valence to four. this may be hackish. . */
BMLoop *loop = e->l;
if (loop->v == v) loop = loop->next;
- if (!BM_face_split(bm, loop->f, v, loop->v, NULL, NULL))
+ if (!BM_face_split(bm, loop->f, v, loop->v, NULL, NULL, FALSE))
return FALSE;
if (!BM_disk_dissolve(bm, v)) {
@@ -218,7 +224,6 @@ int BM_disk_dissolve(BMesh *bm, BMVert *v)
*
* \return pointer to the combined face
*/
-
BMFace *BM_faces_join_pair(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
{
BMLoop *l1, *l2;
@@ -273,7 +278,6 @@ BMFace *BM_faces_join_pair(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
*
* \return The newly created edge.
*/
-
BMEdge *BM_verts_connect(BMesh *bm, BMVert *v1, BMVert *v2, BMFace **r_f)
{
BMIter fiter;
@@ -287,7 +291,7 @@ BMEdge *BM_verts_connect(BMesh *bm, BMVert *v1, BMVert *v2, BMFace **r_f)
if (v_iter == v2) {
BMLoop *nl;
- f_iter = BM_face_split(bm, f_iter, v1, v2, &nl, NULL);
+ f_iter = BM_face_split(bm, f_iter, v1, v2, &nl, NULL, FALSE);
if (r_f) {
*r_f = f_iter;
@@ -313,13 +317,15 @@ BMEdge *BM_verts_connect(BMesh *bm, BMVert *v1, BMVert *v2, BMFace **r_f)
* \param f the original face
* \param v1, v2 vertices which define the split edge, must be different
* \param r_l pointer which will receive the BMLoop for the split edge in the new face
- * \param example Face used to initialize settings
+ * \param example Edge used for attributes of splitting edge, if non-NULL
+ * \param nodouble Use an existing edge if found
*
* \return Pointer to the newly created face representing one side of the split
* if the split is successful (and the original original face will be the
* other side). NULL if the split fails.
*/
-BMFace *BM_face_split(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, BMLoop **r_l, BMEdge *example)
+BMFace *BM_face_split(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, BMLoop **r_l,
+ BMEdge *example, const short nodouble)
{
const int has_mdisp = CustomData_has_layer(&bm->ldata, CD_MDISPS);
BMFace *nf, *of;
@@ -332,9 +338,9 @@ BMFace *BM_face_split(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, BMLoop **r_l
}
#ifdef USE_BMESH_HOLES
- nf = bmesh_sfme(bm, f, v1, v2, r_l, NULL, example);
+ nf = bmesh_sfme(bm, f, v1, v2, r_l, NULL, example, nodouble);
#else
- nf = bmesh_sfme(bm, f, v1, v2, r_l, example);
+ nf = bmesh_sfme(bm, f, v1, v2, r_l, example, nodouble);
#endif
if (nf) {
@@ -370,6 +376,78 @@ BMFace *BM_face_split(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, BMLoop **r_l
}
/**
+ * \brief Face Split with intermediate points
+ *
+ * Like BM_face_split, but with an edge split by \a n intermediate points with given coordinates.
+ *
+ * \param bm The bmesh
+ * \param f the original face
+ * \param v1, v2 vertices which define the split edge, must be different
+ * \param co Array of coordinates for intermediate points
+ * \param n Length of \a cos (must be > 0)
+ * \param r_l pointer which will receive the BMLoop for the first split edge (from \a v1) in the new face
+ * \param example Edge used for attributes of splitting edge, if non-NULL
+ *
+ * \return Pointer to the newly created face representing one side of the split
+ * if the split is successful (and the original original face will be the
+ * other side). NULL if the split fails.
+ */
+BMFace *BM_face_split_n(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, float cos[][3], int n,
+ BMLoop **r_l, BMEdge *example)
+{
+ BMFace *nf, *of;
+ BMLoop *l_dummy;
+ BMEdge *e, *newe;
+ BMVert *newv;
+ int i, j;
+
+ BLI_assert(v1 != v2);
+
+ of = BM_face_copy(bm, f, TRUE, TRUE);
+
+ if (!r_l)
+ r_l = &l_dummy;
+
+#ifdef USE_BMESH_HOLES
+ nf = bmesh_sfme(bm, f, v1, v2, r_l, NULL, example, FALSE);
+#else
+ nf = bmesh_sfme(bm, f, v1, v2, r_l, example, FALSE);
+#endif
+ /* bmesh_sfme returns in r_l a Loop for nf going from v1 to v2.
+ * The radial_next is for f and goes from v2 to v1 */
+
+ if (nf) {
+ BM_elem_attrs_copy(bm, bm, f, nf);
+ copy_v3_v3(nf->no, f->no);
+
+ e = (*r_l)->e;
+ for (i = 0; i < n; i++) {
+ newv = bmesh_semv(bm, v2, e, &newe);
+ BLI_assert(newv != NULL);
+ /* bmesh_semv returns in newe the edge going from newv to tv */
+ copy_v3_v3(newv->co, cos[i]);
+
+ /* interpolate the loop data for the loops with v==newv, using orig face */
+ for (j = 0; j < 2; j++) {
+ BMEdge *e_iter = (j==0)? e : newe;
+ BMLoop *l_iter = e_iter->l;
+ do {
+ if (l_iter->v == newv) {
+ /* this interpolates both loop and vertex data */
+ BM_loop_interp_from_face(bm, l_iter, of, TRUE, TRUE);
+ }
+ } while ((l_iter = l_iter->radial_next) != e_iter->l);
+ }
+ e = newe;
+ }
+ }
+
+ BM_face_verts_kill(bm, of);
+
+ return nf;
+}
+
+/**
* \brief Vert Collapse Faces
*
* Collapses vertex \a kv that has only two manifold edges
@@ -451,7 +529,7 @@ BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
BMFace *f2 = BM_faces_join(bm, faces, BLI_array_count(faces));
if (f2) {
BMLoop *nl = NULL;
- if (BM_face_split(bm, f2, tv, tv2, &nl, NULL)) {
+ if (BM_face_split(bm, f2, tv, tv2, &nl, NULL, FALSE)) {
ne = nl->e;
}
}
@@ -492,7 +570,6 @@ BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
*
* \return The New Edge
*/
-
BMEdge *BM_vert_collapse_edge(BMesh *bm, BMEdge *ke, BMVert *kv,
const short kill_degenerate_faces)
{
@@ -504,7 +581,7 @@ BMEdge *BM_vert_collapse_edge(BMesh *bm, BMEdge *ke, BMVert *kv,
/* Collapse between 2 edges */
/* in this case we want to keep all faces and not join them,
- * rather just get rid of the veretex - see bug [#28645] */
+ * rather just get rid of the vertex - see bug [#28645] */
BMVert *tv = bmesh_edge_other_vert_get(ke, kv);
if (tv) {
BMEdge *e2 = bmesh_disk_edge_next(ke, kv);
@@ -533,7 +610,10 @@ BMEdge *BM_vert_collapse_edge(BMesh *bm, BMEdge *ke, BMVert *kv,
* \brief Edge Split
*
* Splits an edge. \a v should be one of the vertices in \a e and defines
- * the direction of the splitting operation for interpolation purposes.
+ * the "from" end of the splitting operation: the new vertex will be
+ * \a percent of the way from \a v to the other end.
+ * The newly created edge is attached to \a v and is returned in \a r_e.
+ * The original edge \a e will be the other half of the split.
*
* \return The new vert
*/
@@ -544,6 +624,7 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
BMEdge *e_dummy;
BLI_array_staticdeclare(oldfaces, 32);
SmallHash hash;
+ const int do_mdisp = (e->l && CustomData_has_layer(&bm->ldata, CD_MDISPS));
/* we need this for handling multire */
if (!r_e) {
@@ -551,7 +632,7 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
}
/* do we have a multires layer */
- if (CustomData_has_layer(&bm->ldata, CD_MDISPS) && e->l) {
+ if (do_mdisp) {
BMLoop *l;
int i;
@@ -572,9 +653,8 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
v2 = bmesh_edge_other_vert_get(e, v);
nv = bmesh_semv(bm, v, e, r_e);
- if (nv == NULL) {
- return NULL;
- }
+
+ BLI_assert(nv != NULL);
sub_v3_v3v3(nv->co, v2->co, v->co);
madd_v3_v3v3fl(nv->co, v->co, nv->co, percent);
@@ -588,7 +668,7 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
BM_data_interp_face_vert_edge(bm, v2, v, nv, e, percent);
BM_data_interp_from_verts(bm, v, v2, nv, percent);
- if (CustomData_has_layer(&bm->ldata, CD_MDISPS) && e->l && nv) {
+ if (do_mdisp) {
int i, j;
/* interpolate new/changed loop data from copied old face */
@@ -645,11 +725,13 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
BLI_array_free(oldfaces);
BLI_smallhash_release(&hash);
}
-
+
return nv;
}
-/* split an edge multiple times evenly */
+/**
+ * \brief Split an edge multiple times evenly
+ */
BMVert *BM_edge_split_n(BMesh *bm, BMEdge *e, int numcuts)
{
int i;
@@ -663,7 +745,9 @@ BMVert *BM_edge_split_n(BMesh *bm, BMEdge *e, int numcuts)
return nv;
}
-/* checks if a face is valid in the data structure */
+/**
+ * Checks if a face is valid in the data structure
+ */
int BM_face_validate(BMesh *bm, BMFace *face, FILE *err)
{
BMIter iter;
@@ -708,6 +792,200 @@ int BM_face_validate(BMesh *bm, BMFace *face, FILE *err)
return ret;
}
+
+/**
+ * Calculate the 2 loops which _would_ make up the newly rotated Edge
+ * but don't actually change anything.
+ *
+ * Use this to further inspect if the loops to be connected have issues:
+ *
+ * Examples:
+ * - the newly formed edge already exists
+ * - the new face would be degenerate (zero area / concav / bow-tie)
+ * - may want to measure if the new edge gives improved results topology.
+ * over the old one, as with beauty fill.
+ *
+ * \note #BM_edge_rotate_check must have already run.
+ */
+void BM_edge_rotate_calc(BMesh *bm, BMEdge *e, int ccw,
+ BMLoop **r_l1, BMLoop **r_l2)
+{
+ BMVert *v1, *v2;
+ BMFace *fa, *fb;
+
+ /* this should have already run */
+ BLI_assert(BM_edge_rotate_check(bm, e) == TRUE);
+
+ /* we know this will work */
+ BM_edge_face_pair(e, &fa, &fb);
+
+ /* so we can use ccw variable correctly,
+ * otherwise we could use the egdes verts direct */
+ BM_edge_ordered_verts(e, &v1, &v2);
+
+ /* we could swap the verts _or_ the faces, swapping faces
+ * gives more pradictable resuts since that way the next vert
+ * just sitches from face fa / fb */
+ if (ccw) {
+ SWAP(BMFace *, fa, fb);
+ }
+
+ *r_l1 = BM_face_other_vert_loop(fb, v2, v1);
+ *r_l2 = BM_face_other_vert_loop(fa, v1, v2);
+
+ /* when assert isnt used */
+ (void)bm;
+}
+
+/**
+ * \brief Check if Rotate Edge is OK
+ *
+ * Quick check to see if we could rotate the edge,
+ * use this to avoid calling exceptions on common cases.
+ */
+int BM_edge_rotate_check(BMesh *UNUSED(bm), BMEdge *e)
+{
+ BMFace *fa, *fb;
+ if (BM_edge_face_pair(e, &fa, &fb)) {
+ BMLoop *la, *lb;
+
+ la = BM_face_other_vert_loop(fa, e->v2, e->v1);
+ lb = BM_face_other_vert_loop(fb, e->v2, e->v1);
+
+ /* check that the next vert in both faces isnt the same
+ * (ie - the next edge doesnt share the same faces).
+ * since we can't rotate usefully in this case. */
+ if (la->v == lb->v) {
+ return FALSE;
+ }
+
+ /* mirror of the check above but in the opposite direction */
+ la = BM_face_other_vert_loop(fa, e->v1, e->v2);
+ lb = BM_face_other_vert_loop(fb, e->v1, e->v2);
+
+ if (la->v == lb->v) {
+ return FALSE;
+ }
+
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
+
+/**
+ * \brief Check if Edge Rotate Gives Degenerate Faces
+ *
+ * Check 2 cases
+ * 1) does the newly forms edge form a flipped face (compare with previous cross product)
+ * 2) does the newly formed edge caise a zero area corner (or close enough to be almost zero)
+ *
+ * \param l1,l2 are the loops of the proposed verts to rotate too and should
+ * be the result of calling #BM_edge_rotate_calc
+ */
+int BM_edge_rotate_check_degenerate(BMesh *bm, BMEdge *e,
+ BMLoop *l1, BMLoop *l2)
+{
+ /* note: for these vars 'old' just means initial edge state. */
+
+ float ed_dir_old[3]; /* edge vector */
+ float ed_dir_new[3]; /* edge vector */
+ float ed_dir_new_flip[3]; /* edge vector */
+
+ float ed_dir_v1_old[3];
+ float ed_dir_v2_old[3];
+
+ float ed_dir_v1_new[3];
+ float ed_dir_v2_new[3];
+
+ float cross_old[3];
+ float cross_new[3];
+
+ /* original verts - these will be in the edge 'e' */
+ BMVert *v1_old, *v2_old;
+
+ /* verts from the loops passed */
+
+ BMVert *v1, *v2;
+ /* these are the opposite verts - the verts that _would_ be used if 'ccw' was inverted*/
+ BMVert *v1_alt, *v2_alt;
+
+ /* this should have already run */
+ BLI_assert(BM_edge_rotate_check(bm, e) == TRUE);
+
+ BM_edge_ordered_verts(e, &v1_old, &v2_old);
+
+ v1 = l1->v;
+ v2 = l2->v;
+
+ /* get the next vert along */
+ v1_alt = BM_face_other_vert_loop(l1->f, v1_old, v1)->v;
+ v2_alt = BM_face_other_vert_loop(l2->f, v2_old, v2)->v;
+
+ /* normalize all so comparisons are scale independent */
+
+ BLI_assert(BM_edge_exists(v1_old, v1));
+ BLI_assert(BM_edge_exists(v1, v1_alt));
+
+ BLI_assert(BM_edge_exists(v2_old, v2));
+ BLI_assert(BM_edge_exists(v2, v2_alt));
+
+ /* old and new edge vecs */
+ sub_v3_v3v3(ed_dir_old, v1_old->co, v2_old->co);
+ sub_v3_v3v3(ed_dir_new, v1->co, v2->co);
+ normalize_v3(ed_dir_old);
+ normalize_v3(ed_dir_new);
+
+ /* old edge corner vecs */
+ sub_v3_v3v3(ed_dir_v1_old, v1_old->co, v1->co);
+ sub_v3_v3v3(ed_dir_v2_old, v2_old->co, v2->co);
+ normalize_v3(ed_dir_v1_old);
+ normalize_v3(ed_dir_v2_old);
+
+ /* old edge corner vecs */
+ sub_v3_v3v3(ed_dir_v1_new, v1->co, v1_alt->co);
+ sub_v3_v3v3(ed_dir_v2_new, v2->co, v2_alt->co);
+ normalize_v3(ed_dir_v1_new);
+ normalize_v3(ed_dir_v2_new);
+
+ /* compare */
+ cross_v3_v3v3(cross_old, ed_dir_old, ed_dir_v1_old);
+ cross_v3_v3v3(cross_new, ed_dir_new, ed_dir_v1_new);
+ if (dot_v3v3(cross_old, cross_new) < 0.0f) { /* does this flip? */
+ return FALSE;
+ }
+ cross_v3_v3v3(cross_old, ed_dir_old, ed_dir_v2_old);
+ cross_v3_v3v3(cross_new, ed_dir_new, ed_dir_v2_new);
+ if (dot_v3v3(cross_old, cross_new) < 0.0f) { /* does this flip? */
+ return FALSE;
+ }
+
+ negate_v3_v3(ed_dir_new_flip, ed_dir_new);
+
+ /* result is zero area corner */
+ if ((dot_v3v3(ed_dir_new, ed_dir_v1_new) > 0.999f) ||
+ (dot_v3v3(ed_dir_new_flip, ed_dir_v2_new) > 0.999f))
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+
+ /* when assert isnt used */
+ (void)bm;
+}
+
+int BM_edge_rotate_check_beauty(BMesh *UNUSED(bm), BMEdge *e,
+ BMLoop *l1, BMLoop *l2)
+{
+ /* Stupid check for now:
+ * Could compare angles of surrounding edges
+ * before & after, but this is OK.*/
+ return (len_squared_v3v3(e->v1->co, e->v2->co) >
+ len_squared_v3v3(l1->v->co, l2->v->co));
+}
+
/**
* \brief Rotate Edge
*
@@ -719,54 +997,93 @@ int BM_face_validate(BMesh *bm, BMFace *face, FILE *err)
*
* \note This works by dissolving the edge then re-creating it,
* so the returned edge won't have the same pointer address as the original one.
+ *
+ * \see header definition for \a check_flag enum.
*/
-BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, int ccw)
+BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const short ccw, const short check_flag)
{
BMVert *v1, *v2;
- BMLoop *l, *l1, *l2, *nl;
+ BMLoop *l1, *l2;
BMFace *f;
- BMIter liter;
-
- v1 = e->v1;
- v2 = e->v2;
+ BMEdge *e_new = NULL;
- if (BM_edge_face_count(e) != 2)
+ if (!BM_edge_rotate_check(bm, e)) {
return NULL;
+ }
- /* If either of e's vertices has valence 2, then
- * dissolving the edge would leave a spur, so not allowed */
- if (BM_vert_edge_count(e->v1) == 2 || BM_vert_edge_count(e->v2) == 2)
- return NULL;
+ BM_edge_rotate_calc(bm, e, ccw, &l1, &l2);
- f = BM_faces_join_pair(bm, e->l->f, e->l->radial_next->f, e);
+ /* the loops will be freed so assign verts */
+ v1 = l1->v;
+ v2 = l2->v;
- if (f == NULL)
- return NULL;
- BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
- if (l->v == v1)
- l1 = l;
- else if (l->v == v2)
- l2 = l;
+
+ /* --------------------------------------- */
+ /* Checking Code - make sure we can rotate */
+
+ if (check_flag & BM_EDGEROT_CHECK_BEAUTY) {
+ if (!BM_edge_rotate_check_beauty(bm, e, l1, l2)) {
+ return NULL;
+ }
}
-
- if (ccw) {
- l1 = l1->prev;
- l2 = l2->prev;
+
+ /* check before applying */
+ if (check_flag & BM_EDGEROT_CHECK_EXISTS) {
+ if (BM_edge_exists(v1, v2)) {
+ return NULL;
+ }
}
- else {
- l1 = l1->next;
- l2 = l2->next;
+
+ /* slowest, check last */
+ if (check_flag & BM_EDGEROT_CHECK_DEGENERATE) {
+ if (!BM_edge_rotate_check_degenerate(bm, e, l1, l2)) {
+ return NULL;
+ }
+ }
+ /* Done Checking */
+ /* ------------- */
+
+
+
+ /* --------------- */
+ /* Rotate The Edge */
+
+ /* first create the new edge, this is so we can copy the customdata from the old one
+ * if splice if disabled, always add in a new edge even if theres one there. */
+ e_new = BM_edge_create(bm, v1, v2, e, (check_flag & BM_EDGEROT_CHECK_SPLICE)!=0);
+
+ /* don't delete the edge, manually remove the egde after so we can copy its attributes */
+ f = BM_faces_join_pair(bm, l1->f, l2->f, NULL);
+
+ if (f == NULL) {
+ return NULL;
}
- if (!BM_face_split(bm, f, l1->v, l2->v, &nl, NULL))
+ /* note, this assumes joining the faces _didnt_ also remove the verts.
+ * the #BM_edge_rotate_check will ensure this, but its possibly corrupt state or future edits
+ * break this */
+ if (!BM_face_split(bm, f, v1, v2, NULL, NULL, TRUE)) {
return NULL;
+ }
- return nl->e;
+ return e_new;
}
-/* Rip a single face from a vertex fan */
-BMVert *BM_vert_rip(BMesh *bm, BMFace *sf, BMVert *sv)
+/**
+ * \brief Rip a single face from a vertex fan
+ */
+BMVert *BM_face_vert_separate(BMesh *bm, BMFace *sf, BMVert *sv)
{
return bmesh_urmv(bm, sf, sv);
}
+
+/**
+ * \brief Rip a single face from a vertex fan
+ *
+ * \note same as #BM_face_vert_separate but faster (avoids a loop lookup)
+ */
+BMVert *BM_face_loop_separate(BMesh *bm, BMLoop *sl)
+{
+ return bmesh_urmv_loop(bm, sl);
+}
diff --git a/source/blender/bmesh/intern/bmesh_mods.h b/source/blender/bmesh/intern/bmesh_mods.h
index 6d4b1333549..f87cdcc02e2 100644
--- a/source/blender/bmesh/intern/bmesh_mods.h
+++ b/source/blender/bmesh/intern/bmesh_mods.h
@@ -39,6 +39,12 @@ BMEdge *BM_verts_connect(BMesh *bm, BMVert *v1, BMVert *v2, BMFace **r_f);
BMFace *BM_face_split(BMesh *bm, BMFace *f,
BMVert *v1, BMVert *v2,
+ BMLoop **r_l,
+ BMEdge *example, const short nodouble);
+
+BMFace *BM_face_split_n(BMesh *bm, BMFace *f,
+ BMVert *v1, BMVert *v2,
+ float cos[][3], int n,
BMLoop **r_l, BMEdge *example);
BMEdge* BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
@@ -53,8 +59,25 @@ BMVert *BM_edge_split_n(BMesh *bm, BMEdge *e, int numcuts);
int BM_face_validate(BMesh *bm, BMFace *face, FILE *err);
-BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, int ccw);
-
-BMVert *BM_vert_rip(BMesh *bm, BMFace *sf, BMVert *sv);
+void BM_edge_rotate_calc(BMesh *bm, BMEdge *e, int ccw,
+ BMLoop **r_l1, BMLoop **r_l2);
+int BM_edge_rotate_check(BMesh *UNUSED(bm), BMEdge *e);
+int BM_edge_rotate_check_degenerate(BMesh *bm, BMEdge *e,
+ BMLoop *l1, BMLoop *l2);
+int BM_edge_rotate_check_beauty(BMesh *bm, BMEdge *e,
+ BMLoop *l1, BMLoop *l2);
+BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const short ccw, const short check_flag);
+
+/* flags for BM_edge_rotate */
+enum {
+ BM_EDGEROT_CHECK_EXISTS = (1 << 0), /* disallow to rotate when the new edge matches an existing one */
+ BM_EDGEROT_CHECK_SPLICE = (1 << 1), /* overrides existing check, if the edge already, rotate and merge them */
+ BM_EDGEROT_CHECK_DEGENERATE = (1 << 2), /* disallow creating bow-tie, concave or zero area faces */
+ BM_EDGEROT_CHECK_BEAUTY = (1 << 3) /* disallow to rotate into ugly topology */
+};
+
+
+BMVert *BM_face_vert_separate(BMesh *bm, BMFace *sf, BMVert *sv);
+BMVert *BM_face_loop_separate(BMesh *bm, BMLoop *sl);
#endif /* __BMESH_MODS_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c
index 37df243d3fc..f2dcaded8ca 100644
--- a/source/blender/bmesh/intern/bmesh_opdefines.c
+++ b/source/blender/bmesh/intern/bmesh_opdefines.c
@@ -55,7 +55,7 @@
*/
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
/* ok, I'm going to write a little docgen script. so all
* bmop comments must conform to the following template/rules:
@@ -75,7 +75,7 @@
* """
*
* so the first line is the "title" of the bmop.
- * subsequent line blocks seperated by blank lines
+ * subsequent line blocks separated by blank lines
* are paragraphs. individual descriptions of slots
* would be extracted from comments
* next to them, e.g.
@@ -676,6 +676,7 @@ static BMOpDefine bmo_triangulate_def = {
{BMO_OP_SLOT_ELEMENT_BUF, "edgeout"},
{BMO_OP_SLOT_ELEMENT_BUF, "faceout"},
{BMO_OP_SLOT_MAPPING, "facemap"},
+ {BMO_OP_SLOT_BOOL, "use_beauty"},
{0} /* null-terminating sentine */},
bmo_triangulate_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
@@ -889,8 +890,7 @@ static BMOpDefine bmo_vertexshortestpath_def = {
static BMOpDefine bmo_edgesplit_def = {
"edgesplit",
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, /* input edges */
- {BMO_OP_SLOT_ELEMENT_BUF, "edgeout1"}, /* old output disconnected edges */
- {BMO_OP_SLOT_ELEMENT_BUF, "edgeout2"}, /* new output disconnected edges */
+ {BMO_OP_SLOT_ELEMENT_BUF, "edgeout"}, /* old output disconnected edges */
{0} /* null-terminating sentine */},
bmo_edgesplit_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c
index 911c3872161..eb83d5f6b35 100644
--- a/source/blender/bmesh/intern/bmesh_operators.c
+++ b/source/blender/bmesh/intern/bmesh_operators.c
@@ -37,7 +37,7 @@
#include "BLI_array.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
/* forward declarations */
static void bmo_flag_layer_alloc(BMesh *bm);
@@ -679,7 +679,7 @@ static void BMO_slot_buffer_from_all(BMesh *bm, BMOperator *op, const char *slot
* into a slot for an operator.
*/
void BMO_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, const char *slotname,
- const char hflag, const char htype)
+ const char hflag, const char htype)
{
BMIter elements;
BMElem *ele;
@@ -1042,6 +1042,12 @@ void *BMO_slot_buffer_elem_first(BMOperator *op, const char *slotname)
return slot->data.buf ? *(void **)slot->data.buf : NULL;
}
+/**
+ * \brief New Iterator
+ *
+ * \param restrictmask restricts the iteration to certain element types
+ * (e.g. combination of BM_VERT, BM_EDGE, BM_FACE), if iterating
+ * over an element buffer (not a mapping). */
void *BMO_iter_new(BMOIter *iter, BMesh *UNUSED(bm), BMOperator *op,
const char *slotname, const char restrictmask)
{
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c
index f6111e75e80..54063c28ea5 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.c
+++ b/source/blender/bmesh/intern/bmesh_polygon.c
@@ -28,7 +28,7 @@
* tessellation, etc)
*
* BMESH_TODO:
- * - Add in Tesselator frontend that creates
+ * - Add in Tessellator frontend that creates
* BMTriangles from copied faces
*
* - Add in Function that checks for and flags
@@ -41,13 +41,13 @@
#include "MEM_guardedalloc.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
/**
* \brief TEST EDGE SIDE and POINT IN TRIANGLE
*
* Point in triangle tests stolen from scanfill.c.
- * Used for tesselator
+ * Used for tessellator
*/
static short testedgesidef(const float v1[2], const float v2[2], const float v3[2])
@@ -77,77 +77,84 @@ static short testedgesidef(const float v1[2], const float v2[2], const float v3[
*/
static void compute_poly_normal(float normal[3], float (*verts)[3], int nverts)
{
+ float const *v_prev = verts[nverts - 1];
+ float const *v_curr = verts[0];
+ float n[3] = {0.0f};
+ int i;
- float u[3], v[3], w[3]; /*, *w, v1[3], v2[3]; */
- float n[3] = {0.0f, 0.0f, 0.0f} /*, l, v1[3], v2[3] */;
- /* double l2; */
- int i /*, s = 0 */;
+ verts[0][0] = 1;
- /* this fixes some weird numerical erro */
- add_v3_fl(verts[0], 0.0001f);
+ /* Newell's Method */
+ for (i = 0; i < nverts; v_prev = v_curr, v_curr = verts[++i]) {
+ n[0] += (v_prev[1] - v_curr[1]) * (v_prev[2] + v_curr[2]);
+ n[1] += (v_prev[2] - v_curr[2]) * (v_prev[0] + v_curr[0]);
+ n[2] += (v_prev[0] - v_curr[0]) * (v_prev[1] + v_curr[1]);
+ }
- for (i = 0; i < nverts; i++) {
- copy_v3_v3(u, verts[i]);
- copy_v3_v3(v, verts[(i + 1) % nverts]);
- copy_v3_v3(w, verts[(i + 2) % nverts]);
-
-#if 0
- sub_v3_v3v3(v1, w, v);
- sub_v3_v3v3(v2, v, u);
- normalize_v3(v1);
- normalize_v3(v2);
+ if (UNLIKELY(normalize_v3_v3(normal, n) == 0.0f)) {
+ normal[2] = 1.0f; /* other axis set to 0.0 */
+ }
+}
- l = dot_v3v3(v1, v2);
- if (fabsf(l - 1.0) < 0.1f) {
- continue;
- }
-#endif
- /* newell's method
+/**
+ * \brief COMPUTE POLY NORMAL (BMFace)
+ *
+ * Same as #compute_poly_normal but operates directly on a bmesh face.
+ */
+static void bm_face_compute_poly_normal(BMFace *f)
+{
+ BMLoop *l_first = BM_FACE_FIRST_LOOP(f);
+ BMLoop *l_iter = l_first;
+ float const *v_prev = l_first->prev->v->co;
+ float const *v_curr = l_first->v->co;
+ float n[3] = {0.0f};
- so thats?:
- (a[1] - b[1]) * (a[2] + b[2]);
- a[1] * b[2] - b[1] * a[2] - b[1] * b[2] + a[1] * a[2]
+ /* Newell's Method */
+ do {
+ n[0] += (v_prev[1] - v_curr[1]) * (v_prev[2] + v_curr[2]);
+ n[1] += (v_prev[2] - v_curr[2]) * (v_prev[0] + v_curr[0]);
+ n[2] += (v_prev[0] - v_curr[0]) * (v_prev[1] + v_curr[1]);
- odd. half of that is the cross product. . .what's the
- other half?
+ l_iter = l_iter->next;
+ v_prev = v_curr;
+ v_curr = l_iter->v->co;
- also could be like a[1] * (b[2] + a[2]) - b[1] * (a[2] - b[2])
- */
+ } while (l_iter != l_first);
- n[0] += (u[1] - v[1]) * (u[2] + v[2]);
- n[1] += (u[2] - v[2]) * (u[0] + v[0]);
- n[2] += (u[0] - v[0]) * (u[1] + v[1]);
+ if (UNLIKELY(normalize_v3_v3(f->no, n) == 0.0f)) {
+ f->no[2] = 1.0f; /* other axis set to 0.0 */
}
+}
- if (normalize_v3_v3(normal, n) == 0.0f) {
- normal[2] = 1.0f; /* other axis set to 0.0 */
- }
+/**
+ * \brief COMPUTE POLY NORMAL (BMFace)
+ *
+ * Same as #compute_poly_normal and #bm_face_compute_poly_normal
+ * but takes an array of vertex locations.
+ */
+static void bm_face_compute_poly_normal_vcos(BMFace *f, float (*vertexCos)[3])
+{
+ BMLoop *l_first = BM_FACE_FIRST_LOOP(f);
+ BMLoop *l_iter = l_first;
+ float const *v_prev = vertexCos[BM_elem_index_get(l_first->prev->v)];
+ float const *v_curr = vertexCos[BM_elem_index_get(l_first->v)];
+ float n[3] = {0.0f};
-#if 0
- l = len_v3(n);
- /* fast square root, newton/babylonian method:
- l2 = l * 0.1;
- l2 = (l / l2 + l2) * 0.5;
- l2 = (l / l2 + l2) * 0.5;
- l2 = (l / l2 + l2) * 0.5;
- */
+ /* Newell's Method */
+ do {
+ n[0] += (v_prev[1] - v_curr[1]) * (v_prev[2] + v_curr[2]);
+ n[1] += (v_prev[2] - v_curr[2]) * (v_prev[0] + v_curr[0]);
+ n[2] += (v_prev[0] - v_curr[0]) * (v_prev[1] + v_curr[1]);
- if (l == 0.0) {
- normal[0] = 0.0f;
- normal[1] = 0.0f;
- normal[2] = 1.0f;
+ l_iter = l_iter->next;
+ v_prev = v_curr;
+ v_curr = vertexCos[BM_elem_index_get(l_iter->v)];
+ } while (l_iter != l_first);
- return;
- }
- else {
- l = 1.0f / l;
+ if (UNLIKELY(normalize_v3_v3(f->no, n) == 0.0f)) {
+ f->no[2] = 1.0f; /* other axis set to 0.0 */
}
-
- mul_v3_fl(n, l);
-
- copy_v3_v3(normal, n);
-#endif
}
/**
@@ -220,39 +227,39 @@ float BM_face_area_calc(BMesh *bm, BMFace *f)
/**
* computes center of face in 3d. uses center of bounding box.
*/
-void BM_face_center_bounds_calc(BMesh *bm, BMFace *f, float r_cent[3])
+void BM_face_center_bounds_calc(BMesh *UNUSED(bm), BMFace *f, float r_cent[3])
{
- BMIter iter;
- BMLoop *l;
+ BMLoop *l_iter;
+ BMLoop *l_first;
float min[3], max[3];
- int i;
INIT_MINMAX(min, max);
- l = BM_iter_new(&iter, bm, BM_LOOPS_OF_FACE, f);
- for (i = 0; l; l = BM_iter_step(&iter), i++) {
- DO_MINMAX(l->v->co, min, max);
- }
+
+ l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+ do {
+ DO_MINMAX(l_iter->v->co, min, max);
+ } while ((l_iter = l_iter->next) != l_first);
mid_v3_v3v3(r_cent, min, max);
}
/**
- * computes the centroid of a face, using the mean average
+ * computes the center of a face, using the mean average
*/
-void BM_face_center_mean_calc(BMesh *bm, BMFace *f, float r_cent[3])
+void BM_face_center_mean_calc(BMesh *UNUSED(bm), BMFace *f, float r_cent[3])
{
- BMIter iter;
- BMLoop *l;
- int i;
+ BMLoop *l_iter;
+ BMLoop *l_first;
zero_v3(r_cent);
- l = BM_iter_new(&iter, bm, BM_LOOPS_OF_FACE, f);
- for (i = 0; l; l = BM_iter_step(&iter), i++) {
- add_v3_v3(r_cent, l->v->co);
- }
+ l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+ do {
+ add_v3_v3(r_cent, l_iter->v->co);
+ } while ((l_iter = l_iter->next) != l_first);
- if (f->len) mul_v3_fl(r_cent, 1.0f / (float)f->len);
+ if (f->len)
+ mul_v3_fl(r_cent, 1.0f / (float) f->len);
}
/**
@@ -291,11 +298,6 @@ void compute_poly_plane(float (*verts)[3], int nverts)
avgn[2] = 1.0f;
}
else {
- /* XXX, why is this being divided and _then_ normalized
- * division could be removed? - campbell */
- avgn[0] /= nverts;
- avgn[1] /= nverts;
- avgn[2] /= nverts;
normalize_v3(avgn);
}
@@ -368,28 +370,12 @@ void poly_rotate_plane(const float normal[3], float (*verts)[3], const int nvert
*/
void BM_face_normal_update(BMesh *bm, BMFace *f)
{
- if (f->len >= 3) {
- float (*proj)[3];
-
- BLI_array_fixedstack_declare(proj, BM_NGON_STACK_SIZE, f->len, __func__);
-
- bmesh_face_normal_update(bm, f, f->no, proj);
-
- BLI_array_fixedstack_free(proj);
- }
+ bmesh_face_normal_update(bm, f, f->no);
}
/* same as BM_face_normal_update but takes vertex coords */
void BM_face_normal_update_vcos(BMesh *bm, BMFace *f, float no[3], float (*vertexCos)[3])
{
- if (f->len >= 3) {
- float (*proj)[3];
-
- BLI_array_fixedstack_declare(proj, BM_NGON_STACK_SIZE, f->len, __func__);
-
- bmesh_face_normal_update_vertex_cos(bm, f, no, proj, vertexCos);
-
- BLI_array_fixedstack_free(proj);
- }
+ bmesh_face_normal_update_vertex_cos(bm, f, no, vertexCos);
}
/**
@@ -454,8 +440,7 @@ void BM_vert_normal_update_all(BMesh *bm, BMVert *v)
BM_vert_normal_update(bm, v);
}
-void bmesh_face_normal_update(BMesh *bm, BMFace *f, float no[3],
- float (*projectverts)[3])
+void bmesh_face_normal_update(BMesh *UNUSED(bm), BMFace *f, float no[3])
{
BMLoop *l;
@@ -463,19 +448,21 @@ void bmesh_face_normal_update(BMesh *bm, BMFace *f, float no[3],
switch (f->len) {
case 4:
{
- BMVert *v1 = (l = BM_FACE_FIRST_LOOP(f))->v;
- BMVert *v2 = (l = l->next)->v;
- BMVert *v3 = (l = l->next)->v;
- BMVert *v4 = (l->next)->v;
- normal_quad_v3(no, v1->co, v2->co, v3->co, v4->co);
+ const float *co1 = (l = BM_FACE_FIRST_LOOP(f))->v->co;
+ const float *co2 = (l = l->next)->v->co;
+ const float *co3 = (l = l->next)->v->co;
+ const float *co4 = (l->next)->v->co;
+
+ normal_quad_v3(no, co1, co2, co3, co4);
break;
}
case 3:
{
- BMVert *v1 = (l = BM_FACE_FIRST_LOOP(f))->v;
- BMVert *v2 = (l = l->next)->v;
- BMVert *v3 = (l->next)->v;
- normal_tri_v3(no, v1->co, v2->co, v3->co);
+ const float *co1 = (l = BM_FACE_FIRST_LOOP(f))->v->co;
+ const float *co2 = (l = l->next)->v->co;
+ const float *co3 = (l->next)->v->co;
+
+ normal_tri_v3(no, co1, co2, co3);
break;
}
case 0:
@@ -485,20 +472,14 @@ void bmesh_face_normal_update(BMesh *bm, BMFace *f, float no[3],
}
default:
{
- BMIter iter;
- int i = 0;
- BM_ITER(l, &iter, bm, BM_LOOPS_OF_FACE, f) {
- copy_v3_v3(projectverts[i], l->v->co);
- i += 1;
- }
- compute_poly_normal(no, projectverts, f->len);
+ bm_face_compute_poly_normal(f);
break;
}
}
}
/* exact same as 'bmesh_face_normal_update' but accepts vertex coords */
void bmesh_face_normal_update_vertex_cos(BMesh *bm, BMFace *f, float no[3],
- float (*projectverts)[3], float (*vertexCos)[3])
+ float (*vertexCos)[3])
{
BMLoop *l;
@@ -509,26 +490,21 @@ void bmesh_face_normal_update_vertex_cos(BMesh *bm, BMFace *f, float no[3],
switch (f->len) {
case 4:
{
- BMVert *v1 = (l = BM_FACE_FIRST_LOOP(f))->v;
- BMVert *v2 = (l = l->next)->v;
- BMVert *v3 = (l = l->next)->v;
- BMVert *v4 = (l->next)->v;
- normal_quad_v3(no,
- vertexCos[BM_elem_index_get(v1)],
- vertexCos[BM_elem_index_get(v2)],
- vertexCos[BM_elem_index_get(v3)],
- vertexCos[BM_elem_index_get(v4)]);
+ const float *co1 = vertexCos[BM_elem_index_get((l = BM_FACE_FIRST_LOOP(f))->v)];
+ const float *co2 = vertexCos[BM_elem_index_get((l = l->next)->v)];
+ const float *co3 = vertexCos[BM_elem_index_get((l = l->next)->v)];
+ const float *co4 = vertexCos[BM_elem_index_get((l->next)->v)];
+
+ normal_quad_v3(no, co1, co2, co3, co4);
break;
}
case 3:
{
- BMVert *v1 = (l = BM_FACE_FIRST_LOOP(f))->v;
- BMVert *v2 = (l = l->next)->v;
- BMVert *v3 = (l->next)->v;
- normal_tri_v3(no,
- vertexCos[BM_elem_index_get(v1)],
- vertexCos[BM_elem_index_get(v2)],
- vertexCos[BM_elem_index_get(v3)]);
+ const float *co1 = vertexCos[BM_elem_index_get((l = BM_FACE_FIRST_LOOP(f))->v)];
+ const float *co2 = vertexCos[BM_elem_index_get((l = l->next)->v)];
+ const float *co3 = vertexCos[BM_elem_index_get((l->next)->v)];
+
+ normal_tri_v3(no, co1, co2, co3);
break;
}
case 0:
@@ -538,13 +514,7 @@ void bmesh_face_normal_update_vertex_cos(BMesh *bm, BMFace *f, float no[3],
}
default:
{
- BMIter iter;
- int i = 0;
- BM_ITER(l, &iter, bm, BM_LOOPS_OF_FACE, f) {
- copy_v3_v3(projectverts[i], vertexCos[BM_elem_index_get(l->v)]);
- i += 1;
- }
- compute_poly_normal(no, projectverts, f->len);
+ bm_face_compute_poly_normal_vcos(f, vertexCos);
break;
}
}
@@ -588,7 +558,7 @@ static int linecrossesf(const float v1[2], const float v2[2], const float v3[2],
/* do an interval test on the x and y axe */
/* first do x axi */
-#define T FLT_EPSILON * 15
+#define T (FLT_EPSILON * 15)
if ( ABS(v1[1] - v2[1]) < T &&
ABS(v3[1] - v4[1]) < T &&
ABS(v1[1] - v3[1]) < T)
@@ -703,55 +673,76 @@ static int goodline(float (*projectverts)[3], BMFace *f, int v1i,
}
/**
- * \brief FIND EAR
+ * \brief Find Ear
*
- * Used by tesselator to find
+ * Used by tessellator to find
* the next triangle to 'clip off'
- * of a polygon while tesselating.
+ * of a polygon while tessellating.
+ *
+ * \param use_beauty Currently only applies to quads, can be extended later on.
*/
-static BMLoop *find_ear(BMesh *UNUSED(bm), BMFace *f, float (*verts)[3], const int nvert)
+static BMLoop *find_ear(BMesh *UNUSED(bm), BMFace *f, float (*verts)[3], const int nvert, const int use_beauty)
{
- BMVert *v1, *v2, *v3;
BMLoop *bestear = NULL;
BMLoop *l_iter;
BMLoop *l_first;
- /* float angle, bestangle = 180.0f; */
- int isear /*, i = 0 */;
-
- l_iter = l_first = BM_FACE_FIRST_LOOP(f);
- do {
- isear = 1;
-
- v1 = l_iter->prev->v;
- v2 = l_iter->v;
- v3 = l_iter->next->v;
- if (BM_edge_exists(v1, v3)) {
- isear = 0;
- }
- else if (!goodline(verts, f, BM_elem_index_get(v1), BM_elem_index_get(v2), BM_elem_index_get(v3), nvert)) {
- isear = 0;
- }
+ if (f->len == 4) {
+ BMLoop *larr[4];
+ int i = 0;
- if (isear) {
-#if 0
- /* if this code comes back, it needs to be converted to radians */
- angle = angle_v3v3v3(verts[v1->head.eflag2], verts[v2->head.eflag2], verts[v3->head.eflag2]);
- if (!bestear || ABS(angle - 45.0f) < bestangle) {
- bestear = l;
- bestangle = ABS(45.0f - angle);
+ l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+ do {
+ larr[i] = l_iter;
+ i++;
+ } while ((l_iter = l_iter->next) != l_first);
+
+ /* pick 0/1 based on best lenth */
+ bestear = larr[(((len_squared_v3v3(larr[0]->v->co, larr[2]->v->co) >
+ len_squared_v3v3(larr[1]->v->co, larr[3]->v->co))) != use_beauty)];
+
+ }
+ else {
+ BMVert *v1, *v2, *v3;
+
+ /* float angle, bestangle = 180.0f; */
+ int isear /*, i = 0 */;
+
+ l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+ do {
+ isear = 1;
+
+ v1 = l_iter->prev->v;
+ v2 = l_iter->v;
+ v3 = l_iter->next->v;
+
+ if (BM_edge_exists(v1, v3)) {
+ isear = 0;
+ }
+ else if (!goodline(verts, f, BM_elem_index_get(v1), BM_elem_index_get(v2), BM_elem_index_get(v3), nvert)) {
+ isear = 0;
}
-
- if (angle > 20 && angle < 90) break;
- if (angle < 100 && i > 5) break;
- i += 1;
-#endif
- bestear = l_iter;
- break;
- }
- } while ((l_iter = l_iter->next) != l_first);
+ if (isear) {
+ #if 0
+ /* if this code comes back, it needs to be converted to radians */
+ angle = angle_v3v3v3(verts[v1->head.eflag2], verts[v2->head.eflag2], verts[v3->head.eflag2]);
+ if (!bestear || ABS(angle - 45.0f) < bestangle) {
+ bestear = l;
+ bestangle = ABS(45.0f - angle);
+ }
+
+ if (angle > 20 && angle < 90) break;
+ if (angle < 100 && i > 5) break;
+ i += 1;
+ #endif
+
+ bestear = l_iter;
+ break;
+ }
+ } while ((l_iter = l_iter->next) != l_first);
+ }
return bestear;
}
@@ -772,7 +763,8 @@ static BMLoop *find_ear(BMesh *UNUSED(bm), BMFace *f, float (*verts)[3], const i
* \note newedgeflag sets a flag layer flag, obviously not the header flag.
*/
void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3],
- const short newedge_oflag, const short newface_oflag, BMFace **newfaces)
+ const short newedge_oflag, const short newface_oflag, BMFace **newfaces,
+ const short use_beauty)
{
int i, done, nvert, nf_i = 0;
BMLoop *newl, *nextloop;
@@ -806,13 +798,13 @@ void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3],
done = 0;
while (!done && f->len > 3) {
done = 1;
- l_iter = find_ear(bm, f, projectverts, nvert);
+ l_iter = find_ear(bm, f, projectverts, nvert, use_beauty);
if (l_iter) {
done = 0;
/* v = l->v; */ /* UNUSED */
f = BM_face_split(bm, l_iter->f, l_iter->prev->v,
l_iter->next->v,
- &newl, NULL);
+ &newl, NULL, TRUE);
if (UNLIKELY(!f)) {
fprintf(stderr, "%s: triangulator failed to split face! (bmesh internal error)\n", __func__);
@@ -825,14 +817,17 @@ void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3],
if (newfaces) newfaces[nf_i++] = f;
- /* l = f->loopbase;
+#if 0
+ l = f->loopbase;
do {
if (l->v == v) {
f->loopbase = l;
break;
}
l = l->next;
- } while (l != f->loopbase); */
+ } while (l != f->loopbase);
+#endif
+
}
}
@@ -841,11 +836,11 @@ void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3],
while (l_iter->f->len > 3) {
nextloop = l_iter->next->next;
f = BM_face_split(bm, l_iter->f, l_iter->v, nextloop->v,
- &newl, NULL);
+ &newl, NULL, TRUE);
if (!f) {
printf("triangle fan step of triangulator failed.\n");
- /* NULL-terminat */
+ /* NULL-terminate */
if (newfaces) newfaces[nf_i] = NULL;
return;
}
@@ -858,7 +853,7 @@ void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3],
}
}
- /* NULL-terminat */
+ /* NULL-terminate */
if (newfaces) newfaces[nf_i] = NULL;
}
diff --git a/source/blender/bmesh/intern/bmesh_polygon.h b/source/blender/bmesh/intern/bmesh_polygon.h
index 9ee1714d125..49fe2d7a809 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.h
+++ b/source/blender/bmesh/intern/bmesh_polygon.h
@@ -43,7 +43,8 @@ void BM_face_normal_flip(BMesh *bm, BMFace *f);
int BM_face_point_inside_test(BMesh *bm, BMFace *f, const float co[3]);
void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3],
- const short newedge_oflag, const short newface_oflag, BMFace **newfaces);
+ const short newedge_oflag, const short newface_oflag, BMFace **newfaces,
+ const short use_beauty);
void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len);
diff --git a/source/blender/bmesh/intern/bmesh_private.h b/source/blender/bmesh/intern/bmesh_private.h
index 49145324ab1..d44eaba039b 100644
--- a/source/blender/bmesh/intern/bmesh_private.h
+++ b/source/blender/bmesh/intern/bmesh_private.h
@@ -65,10 +65,9 @@ int bmesh_disk_count(BMVert *v);
#define BM_ELEM_API_FLAG_DISABLE(element, f) ((element)->oflags[0].pflag &= ~(f))
#define BM_ELEM_API_FLAG_TEST(element, f) ((element)->oflags[0].pflag & (f))
-void bmesh_face_normal_update(BMesh *bm, BMFace *f, float no[3],
- float (*projectverts)[3]);
+void bmesh_face_normal_update(BMesh *bm, BMFace *f, float no[3]);
void bmesh_face_normal_update_vertex_cos(BMesh *bm, BMFace *f, float no[3],
- float (*projectverts)[3], float (*vertexCos)[3]);
+ float (*vertexCos)[3]);
void compute_poly_plane(float (*verts)[3], int nverts);
void poly_rotate_plane(const float normal[3], float (*verts)[3], const int nverts);
diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c
index e597145a54c..e6dc1e1dd80 100644
--- a/source/blender/bmesh/intern/bmesh_queries.c
+++ b/source/blender/bmesh/intern/bmesh_queries.c
@@ -37,7 +37,7 @@
#include "BLI_math.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
#define BM_OVERLAP (1 << 13)
@@ -63,27 +63,95 @@ int BM_vert_in_edge(BMEdge *e, BMVert *v)
}
/**
- * \brief BMESH OTHER EDGE IN FACE SHARING A VERTEX
+ * \brief Other Loop in Face Sharing an Edge
+ *
+ * Finds the other loop that shares \a v with \a e loop in \a f.
+ *
+ * +----------+
+ * | |
+ * | f |
+ * | |
+ * +----------+ <-- return the face loop of this vertex.
+ * v --> e
+ * ^ ^ <------- These vert args define direction
+ * in the face to check.
+ * The faces loop direction is ignored.
*
- * Finds the other loop that shares 'v' with 'e's loop in 'f'.
*/
-BMLoop *BM_face_other_loop(BMEdge *e, BMFace *f, BMVert *v)
+BMLoop *BM_face_other_edge_loop(BMFace *f, BMEdge *e, BMVert *v)
{
BMLoop *l_iter;
BMLoop *l_first;
- l_iter = l_first = BM_FACE_FIRST_LOOP(f);
-
+ /* we could loop around the face too, but turns out this uses a lot
+ * more iterations (approx double with quads, many more with 5+ ngons) */
+ l_iter = l_first = e->l;
+
do {
- if (l_iter->e == e) {
+ if (l_iter->e == e && l_iter->f == f) {
break;
}
- } while ((l_iter = l_iter->next) != l_first);
+ } while ((l_iter = l_iter->radial_next) != l_first);
return l_iter->v == v ? l_iter->prev : l_iter->next;
}
/**
+ * \brief Other Loop in Face Sharing a Vertex
+ *
+ * Finds the other loop in a face.
+ *
+ * This function returns a loop in \a f that shares an edge with \a v
+ * The direction is defined by \a v_prev, where the return value is
+ * the loop of what would be 'v_next'
+ *
+ *
+ * +----------+ <-- return the face loop of this vertex.
+ * | |
+ * | f |
+ * | |
+ * +----------+
+ * v_prev --> v
+ * ^^^^^^ ^ <-- These vert args define direction
+ * in the face to check.
+ * The faces loop direction is ignored.
+ *
+ * \note \a v_prev and \a v _implicitly_ define an edge.
+ */
+BMLoop *BM_face_other_vert_loop(BMFace *f, BMVert *v_prev, BMVert *v)
+{
+ BMIter liter;
+ BMLoop *l_iter;
+
+ BLI_assert(BM_edge_exists(v_prev, v) != NULL);
+
+ BM_ITER(l_iter, &liter, NULL, BM_LOOPS_OF_VERT, v) {
+ if (l_iter->f == f) {
+ break;
+ }
+ }
+
+ if (l_iter) {
+ if (l_iter->prev->v == v_prev) {
+ return l_iter->next;
+ }
+ else if (l_iter->next->v == v_prev) {
+ return l_iter->prev;
+ }
+ else {
+ /* invalid args */
+ BLI_assert(0);
+ return NULL;
+ }
+ }
+ else {
+ /* invalid args */
+ BLI_assert(0);
+ return NULL;
+ }
+}
+
+/**
* Returns TRUE if the vertex is used in a given face.
*/
@@ -191,6 +259,31 @@ BMVert *BM_edge_other_vert(BMEdge *e, BMVert *v)
}
/**
+ * Utility function, since enough times we have an edge
+ * and want to access 2 connected faces.
+ *
+ * \return TRUE when only 2 faces are found.
+ */
+int BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb)
+{
+ BMLoop *la, *lb;
+
+ if ((la = e->l) &&
+ (lb = la->radial_next) &&
+ (lb->radial_next == la))
+ {
+ *r_fa = la->f;
+ *r_fb = lb->f;
+ return TRUE;
+ }
+ else {
+ *r_fa = NULL;
+ *r_fb = NULL;
+ return FALSE;
+ }
+}
+
+/**
* Returns the number of edges around this vertex.
*/
int BM_vert_edge_count(BMVert *v)
@@ -464,6 +557,29 @@ BMVert *BM_edge_share_vert(BMEdge *e1, BMEdge *e2)
}
/**
+ * \brief Radial Find a Vertex Loop in Face
+ *
+ * Finds the loop used which uses \a v in face loop \a l
+ *
+ * \note currenly this just uses simple loop in future may be speeded up
+ * using radial vars
+ */
+BMLoop *BM_face_vert_share_loop(BMFace *f, BMVert *v)
+{
+ BMLoop *l_first;
+ BMLoop *l_iter;
+
+ l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+ do {
+ if (l_iter->v == v) {
+ return l_iter;
+ }
+ } while ((l_iter = l_iter->next) != l_first);
+
+ return NULL;
+}
+
+/**
* Returns the verts of an edge as used in a face
* if used in a face at all, otherwise just assign as used in the edge.
*
diff --git a/source/blender/bmesh/intern/bmesh_queries.h b/source/blender/bmesh/intern/bmesh_queries.h
index 1fb0df7e2af..a394999d439 100644
--- a/source/blender/bmesh/intern/bmesh_queries.h
+++ b/source/blender/bmesh/intern/bmesh_queries.h
@@ -37,8 +37,10 @@ int BM_edge_in_face(BMFace *f, BMEdge *e);
int BM_vert_in_edge(BMEdge *e, BMVert *v);
int BM_verts_in_edge(BMVert *v1, BMVert *v2, BMEdge *e);
+int BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb);
BMVert *BM_edge_other_vert(BMEdge *e, BMVert *v);
-BMLoop *BM_face_other_loop(BMEdge *e, BMFace *f, BMVert *v);
+BMLoop *BM_face_other_edge_loop(BMFace *f, BMEdge *e, BMVert *v);
+BMLoop *BM_face_other_vert_loop(BMFace *f, BMVert *v_prev, BMVert *v);
int BM_vert_edge_count(BMVert *v);
int BM_edge_face_count(BMEdge *e);
@@ -70,6 +72,7 @@ int BM_edge_share_face_count(BMEdge *e1, BMEdge *e2);
int BM_edge_share_vert_count(BMEdge *e1, BMEdge *e2);
BMVert *BM_edge_share_vert(BMEdge *e1, BMEdge *e2);
+BMLoop *BM_face_vert_share_loop(BMFace *f, BMVert *v);
void BM_edge_ordered_verts(BMEdge *edge, BMVert **r_v1, BMVert **r_v2);
diff --git a/source/blender/bmesh/intern/bmesh_structure.c b/source/blender/bmesh/intern/bmesh_structure.c
index ad6a8a615e3..eca90e8e7f2 100644
--- a/source/blender/bmesh/intern/bmesh_structure.c
+++ b/source/blender/bmesh/intern/bmesh_structure.c
@@ -32,13 +32,12 @@
*/
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
#include <stdlib.h>
/**
* MISC utility functions.
- *
*/
int bmesh_vert_in_edge(BMEdge *e, BMVert *v)
@@ -201,15 +200,13 @@ void bmesh_disk_edge_remove(BMEdge *e, BMVert *v)
dl1->next = dl1->prev = NULL;
}
-/*
- * bmesh_disk_edge_next
+/**
+ * \brief Next Disk Edge
*
* Find the next edge in a disk cycle
*
- * Returns -
- * Pointer to the next edge in the disk cycle for the vertex v.
+ * \return Pointer to the next edge in the disk cycle for the vertex v.
*/
-
BMEdge *bmesh_disk_edge_next(BMEdge *e, BMVert *v)
{
if (v == e->v1)
diff --git a/source/blender/bmesh/intern/bmesh_structure.h b/source/blender/bmesh/intern/bmesh_structure.h
index c3780a5dede..8b43f72c725 100644
--- a/source/blender/bmesh/intern/bmesh_structure.h
+++ b/source/blender/bmesh/intern/bmesh_structure.h
@@ -64,6 +64,7 @@ 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);
BMLoop *bmesh_radial_faceloop_find_next(BMLoop *l, BMVert *v);
+BMLoop *bmesh_radial_faceloop_find_vert(BMFace *f, BMVert *v);
int bmesh_radial_validate(int radlen, BMLoop *l);
/* EDGE UTILITIES */
diff --git a/source/blender/bmesh/intern/bmesh_walkers.h b/source/blender/bmesh/intern/bmesh_walkers.h
index 765576c9ab7..9ea9e332c5f 100644
--- a/source/blender/bmesh/intern/bmesh_walkers.h
+++ b/source/blender/bmesh/intern/bmesh_walkers.h
@@ -30,8 +30,8 @@
#include "BLI_ghash.h"
/*
- NOTE: do NOT modify topology while walking a mesh!
-*/
+ * NOTE: do NOT modify topology while walking a mesh!
+ */
typedef enum {
BMW_DEPTH_FIRST,
@@ -85,25 +85,25 @@ void *BMW_walk(BMWalker *walker);
void BMW_reset(BMWalker *walker);
/*
-example of usage, walking over an island of tool flagged faces:
-
-BMWalker walker;
-BMFace *f;
-
-BMW_init(&walker, bm, BMW_ISLAND, SOME_OP_FLAG);
-f = BMW_begin(&walker, some_start_face);
-for (; f; f = BMW_step(&walker))
-{
- //do something with f
-}
-BMW_end(&walker);
-*/
+ * example of usage, walking over an island of tool flagged faces:
+ *
+ * BMWalker walker;
+ * BMFace *f;
+ *
+ * BMW_init(&walker, bm, BMW_ISLAND, SOME_OP_FLAG);
+ * f = BMW_begin(&walker, some_start_face);
+ * for (; f; f = BMW_step(&walker))
+ * {
+ * //do something with f
+ * }
+ * BMW_end(&walker);
+ */
enum {
/* walk over connected geometry. can restrict to a search flag,
* or not, it's optional.
*
- * takes a vert as an arugment, and spits out edges, restrict flag acts
+ * takes a vert as an argument, and spits out edges, restrict flag acts
* on the edges as well. */
BMW_SHELL,
/*walk over an edge loop. search flag doesn't do anything.*/
diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c
index 23cc18c8e26..30bbc9e9b2a 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_impl.c
+++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c
@@ -29,7 +29,7 @@
#include "BKE_customdata.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
#include "bmesh_walkers_private.h"
/**
@@ -273,7 +273,7 @@ static void *bmw_IslandboundWalker_step(BMWalker *walker)
f = l->f;
while (1) {
- l = BM_face_other_loop(e, f, v);
+ l = BM_face_other_edge_loop(f, e, v);
if (l != l->radial_next) {
l = l->radial_next;
f = l->f;
@@ -474,7 +474,7 @@ static void *bmw_LoopWalker_step(BMWalker *walker)
while (1) {
if (rlen != 1 && i == stopi) break;
- l = BM_face_other_loop(l->e, l->f, v);
+ l = BM_face_other_edge_loop(l->f, l->e, v);
if (!l)
break;
@@ -639,6 +639,8 @@ static void *bmw_FaceLoopWalker_step(BMWalker *walker)
return f;
}
+// #define BMW_EDGERING_NGON
+
/**
* Edge Ring Walker:
*
@@ -673,8 +675,14 @@ static void bmw_EdgeringWalker_begin(BMWalker *walker, void *data)
lwalk = BMW_state_add(walker);
*lwalk = owalk;
+#ifdef BMW_EDGERING_NGON
if (lwalk->l->f->len % 2 != 0)
+#else
+ if (lwalk->l->f->len != 4)
+#endif
+ {
lwalk->l = lwalk->l->radial_next;
+ }
BLI_ghash_free(walker->visithash, NULL, NULL);
walker->visithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh walkers 4");
@@ -689,10 +697,12 @@ static void *bmw_EdgeringWalker_yield(BMWalker *walker)
return NULL;
}
- if (lwalk->l)
+ if (lwalk->l) {
return lwalk->l->e;
- else
+ }
+ else {
return lwalk->wireedge;
+ }
}
static void *bmw_EdgeringWalker_step(BMWalker *walker)
@@ -701,7 +711,9 @@ static void *bmw_EdgeringWalker_step(BMWalker *walker)
BMEdge *e;
BMLoop *l = lwalk->l /* , *origl = lwalk->l */;
BMesh *bm = walker->bm;
+#ifdef BMW_EDGERING_NGON
int i, len;
+#endif
BMW_state_remove(walker);
@@ -717,6 +729,7 @@ static void *bmw_EdgeringWalker_step(BMWalker *walker)
return e;
}
+#ifdef BMW_EDGERING_NGON
l = l->radial_next;
i = len = l->f->len;
@@ -733,11 +746,23 @@ static void *bmw_EdgeringWalker_step(BMWalker *walker)
i -= 2;
}
}
+ /* only walk to manifold edge */
+ if ((l->f->len % 2 == 0) && BM_edge_is_manifold(bm, l->e) &&
+ !BLI_ghash_haskey(walker->visithash, l->e))
+#else
+ l = l->radial_next;
+ l = l->next->next;
+
+ if ((l->f->len != 4) || !BM_edge_is_manifold(bm, l->e)) {
+ l = lwalk->l->next->next;
+ }
/* only walk to manifold edge */
- if ((l->f->len % 2 == 0) && BM_edge_is_manifold(bm, l->e) &&
- !BLI_ghash_haskey(walker->visithash, l->e)) {
+ if ((l->f->len == 4) && BM_edge_is_manifold(bm, l->e) &&
+ !BLI_ghash_haskey(walker->visithash, l->e))
+#endif
+ {
lwalk = BMW_state_add(walker);
lwalk->l = l;
lwalk->wireedge = NULL;
diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c
index e6262f52282..e881e1e277a 100644
--- a/source/blender/bmesh/operators/bmo_bevel.c
+++ b/source/blender/bmesh/operators/bmo_bevel.c
@@ -362,8 +362,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op)
float co[3];
if (BMO_elem_flag_test(bm, l->e, BEVEL_FLAG)) {
- if (BMO_elem_flag_test(bm, l->prev->e, BEVEL_FLAG))
- {
+ if (BMO_elem_flag_test(bm, l->prev->e, BEVEL_FLAG)) {
tag = tags + BM_elem_index_get(l);
calc_corner_co(bm, l, fac, co, do_dist, do_even);
tag->newv = BM_vert_create(bm, co, l->v);
@@ -522,10 +521,12 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op)
if (!vv || BMO_elem_flag_test(bm, vv, BEVEL_FLAG))
continue;
- if (j)
+ if (j) {
v1 = vv;
- else
+ }
+ else {
v2 = vv;
+ }
break;
}
}
@@ -551,7 +552,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op)
/* set edge lengths of cross edges as the average of the cross edges they're based o */
if (has_elens) {
/* angle happens not to be used. why? - not sure it just isnt - campbell.
- * leave this in incase we need to use it later */
+ * leave this in in case we need to use it later */
#if 0
float ang;
#endif
diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c
index 03f10cc8814..af930d6647a 100644
--- a/source/blender/bmesh/operators/bmo_connect.c
+++ b/source/blender/bmesh/operators/bmo_connect.c
@@ -103,7 +103,7 @@ void bmo_connectverts_exec(BMesh *bm, BMOperator *op)
}
for (i = 0; i < BLI_array_count(verts) / 2; i++) {
- nf = BM_face_split(bm, f, verts[i * 2], verts[i * 2 + 1], &nl, NULL);
+ nf = BM_face_split(bm, f, verts[i * 2], verts[i * 2 + 1], &nl, NULL, FALSE);
f = nf;
if (!nl || !nf) {
diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c
index 67e4f09463d..2dfd1867379 100644
--- a/source/blender/bmesh/operators/bmo_create.c
+++ b/source/blender/bmesh/operators/bmo_create.c
@@ -76,12 +76,11 @@ static int count_edge_faces(BMesh *bm, BMEdge *e);
/**** rotation system code * */
-#define RS_GET_EDGE_LINK(e, v, e_data) ( \
- (v) == ((BMEdge *)(e))->v1 ? \
- &(((EdgeData *)(e_data))->v1_disk_link) : \
- &(((EdgeData *)(e_data))->v2_disk_link) \
- )
-
+BM_INLINE BMDiskLink *rs_edge_link_get(BMEdge *e, BMVert *v, EdgeData *e_data)
+{
+ return v == ((BMEdge *)e)->v1 ? &(((EdgeData *)e_data)->v1_disk_link) :
+ &(((EdgeData *)e_data)->v2_disk_link) ;
+}
static int rotsys_append_edge(BMEdge *e, BMVert *v,
EdgeData *edata, VertData *vdata)
@@ -90,7 +89,7 @@ static int rotsys_append_edge(BMEdge *e, BMVert *v,
VertData *vd = &vdata[BM_elem_index_get(v)];
if (!vd->e) {
- Link *e1 = (Link *)RS_GET_EDGE_LINK(e, v, ed);
+ Link *e1 = (Link *)rs_edge_link_get(e, v, ed);
vd->e = e;
e1->next = e1->prev = (Link *)e;
@@ -99,9 +98,9 @@ static int rotsys_append_edge(BMEdge *e, BMVert *v,
BMDiskLink *dl1, *dl2, *dl3;
EdgeData *ved = &edata[BM_elem_index_get(vd->e)];
- dl1 = RS_GET_EDGE_LINK(e, v, ed);
- dl2 = RS_GET_EDGE_LINK(vd->e, v, ved);
- dl3 = dl2->prev ? RS_GET_EDGE_LINK(dl2->prev, v, &edata[BM_elem_index_get(dl2->prev)]) : NULL;
+ dl1 = rs_edge_link_get(e, v, ed);
+ dl2 = rs_edge_link_get(vd->e, v, ved);
+ dl3 = dl2->prev ? rs_edge_link_get(dl2->prev, v, &edata[BM_elem_index_get(dl2->prev)]) : NULL;
dl1->next = vd->e;
dl1->prev = dl2->prev;
@@ -122,14 +121,14 @@ static void UNUSED_FUNCTION(rotsys_remove_edge)(BMEdge *e, BMVert *v,
VertData *vd = vdata + BM_elem_index_get(v);
BMDiskLink *e1, *e2;
- e1 = RS_GET_EDGE_LINK(e, v, ed);
+ e1 = rs_edge_link_get(e, v, ed);
if (e1->prev) {
- e2 = RS_GET_EDGE_LINK(e1->prev, v, ed);
+ e2 = rs_edge_link_get(e1->prev, v, ed);
e2->next = e1->next;
}
if (e1->next) {
- e2 = RS_GET_EDGE_LINK(e1->next, v, ed);
+ e2 = rs_edge_link_get(e1->next, v, ed);
e2->prev = e1->prev;
}
@@ -228,11 +227,13 @@ static int UNUSED_FUNCTION(rotsys_fill_faces)(BMesh *bm, EdgeData *edata, VertDa
rad = count_edge_faces(bm, e);
- if (rad < 2)
+ if (rad < 2) {
starte = e;
- else
+ }
+ else {
continue;
-
+ }
+
/* do two passes, going forward then backwar */
for (i = 0; i < 2; i++) {
BLI_smallhash_init(hash);
@@ -857,6 +858,16 @@ static int count_edge_faces(BMesh *bm, BMEdge *e)
return i;
}
+BM_INLINE void vote_on_winding(BMEdge *edge, EPathNode *node, unsigned int winding[2])
+{
+ BMVert *test_v1, *test_v2;
+ /* we want to use the reverse winding to the existing order */
+ BM_edge_ordered_verts(edge, &test_v2, &test_v1);
+
+ /* edges vote on which winding wins out */
+ winding[(test_v1 == node->v)]++;
+}
+
void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op)
{
BMIter iter;
@@ -969,12 +980,7 @@ void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op)
/* check on the winding */
if (e->l) {
- BMVert *test_v1, *test_v2;
- /* we want to use the reverse winding to the existing order */
- BM_edge_ordered_verts(edge, &test_v2, &test_v1);
-
- /* edges vote on which winding wins out */
- winding[(test_v1 == node->v)]++;
+ vote_on_winding(e, node, winding);
}
edata[BM_elem_index_get(e)].ftag++;
@@ -984,6 +990,10 @@ void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op)
BLI_array_append(verts, node->v);
}
+ if (edge->l) {
+ vote_on_winding(edge, path->nodes.last, winding);
+ }
+
BLI_array_growone(edges);
edges[i++] = edge;
edata[BM_elem_index_get(edge)].ftag++;
@@ -1008,7 +1018,7 @@ void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op)
/* if these are even it doesnt really matter what to do,
* with consistent geometry one will be zero, the choice is clear */
- if (winding[0] > winding[1]) {
+ if (winding[0] < winding[1]) {
v1 = verts[0];
v2 = verts[1];
}
@@ -1238,7 +1248,10 @@ void bmo_edgenet_prepare(BMesh *bm, BMOperator *op)
BLI_array_free(edges2);
}
-/* this is essentially new fke */
+/* This is what runs when pressing the F key
+ * doing the best thing here isnt always easy create vs dissolve, its nice to support
+ * but it it _really_ gives issues we might have to not call dissolve. - campbell
+ */
void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
{
BMOperator op2;
diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c
index 9e07cb177dd..3f17c7040b3 100644
--- a/source/blender/bmesh/operators/bmo_dissolve.c
+++ b/source/blender/bmesh/operators/bmo_dissolve.c
@@ -26,9 +26,9 @@
#include "BLI_math.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
-#include "bmesh_operators_private.h" /* own include */
+#include "intern/bmesh_operators_private.h" /* own include */
#define FACE_MARK 1
#define FACE_ORIG 2
@@ -198,17 +198,16 @@ void bmo_dissolve_edgeloop_exec(BMesh *bm, BMOperator *op)
BMVert *v, **verts = NULL;
BLI_array_declare(verts);
BMEdge *e;
- /* BMFace *f; */
+ BMFace *fa, *fb;
int i;
+
BMO_ITER(e, &oiter, bm, op, "edges", BM_EDGE) {
- if (BM_edge_face_count(e) == 2) {
+ if (BM_edge_face_pair(e, &fa, &fb)) {
BMO_elem_flag_enable(bm, e->v1, VERT_MARK);
BMO_elem_flag_enable(bm, e->v2, VERT_MARK);
- BM_faces_join_pair(bm, e->l->f,
- e->l->radial_next->f,
- e);
+ BM_faces_join_pair(bm, fa, fb, e);
}
}
@@ -256,13 +255,12 @@ void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op)
}
BMO_ITER(e, &eiter, bm, op, "edges", BM_EDGE) {
- const int edge_face_count = BM_edge_face_count(e);
- if (edge_face_count == 2) {
+ BMFace *fa, *fb;
+
+ if (BM_edge_face_pair(e, &fa, &fb)) {
/* join faces */
- BM_faces_join_pair(bm, e->l->f,
- e->l->radial_next->f,
- e);
+ BM_faces_join_pair(bm, fa, fb, e);
}
}
diff --git a/source/blender/bmesh/operators/bmo_edgesplit.c b/source/blender/bmesh/operators/bmo_edgesplit.c
index 059ee882fb8..44d0ad4ff94 100644
--- a/source/blender/bmesh/operators/bmo_edgesplit.c
+++ b/source/blender/bmesh/operators/bmo_edgesplit.c
@@ -15,414 +15,109 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * Contributor(s): Joseph Eagar
+ * Contributor(s): Campbell Barton
*
* ***** END GPL LICENSE BLOCK *****
*/
-#include <string.h> /* for memcpy */
-
#include "MEM_guardedalloc.h"
-#include "BLI_array.h"
-
#include "bmesh.h"
-#include "bmesh_operators_private.h" /* own include */
-
-typedef struct EdgeTag {
- BMVert *newv1, *newv2;
- BMEdge *newe1, *newe2;
- int tag;
-} EdgeTag;
-
-/* (EDGE_DEL == FACE_DEL) - this must be the case */
-#define EDGE_DEL 1
-#define EDGE_SEAM 2
-#define EDGE_MARK 4
-#define EDGE_RET1 8
-#define EDGE_RET2 16
-
-#define FACE_DEL 1
-#define FACE_NEW 2
-
-static BMFace *remake_face(BMesh *bm, EdgeTag *etags, BMFace *f, BMVert **verts, BMEdge **edges_tmp)
-{
- BMIter liter1, liter2;
- EdgeTag *et;
- BMFace *f2;
- BMLoop *l, *l2;
- BMEdge *e;
- BMVert *lastv1, *lastv2 /* , *v1, *v2 */ /* UNUSED */;
- int i;
-
- /* we do final edge last */
- lastv1 = verts[f->len - 1];
- lastv2 = verts[0];
- /* v1 = verts[0]; */ /* UNUSED */
- /* v2 = verts[1]; */ /* UNUSED */
- for (i = 0; i < f->len - 1; i++) {
- e = BM_edge_create(bm, verts[i], verts[i + 1], NULL, TRUE);
- if (!e) {
- return NULL;
- }
- edges_tmp[i] = e;
- }
-
- edges_tmp[i] = BM_edge_create(bm, lastv1, lastv2, NULL, TRUE);
-
- f2 = BM_face_create(bm, verts, edges_tmp, f->len, FALSE);
- if (!f2) {
- return NULL;
- }
-
- BM_elem_attrs_copy(bm, bm, f, f2);
-
- l = BM_iter_new(&liter1, bm, BM_LOOPS_OF_FACE, f);
- l2 = BM_iter_new(&liter2, bm, BM_LOOPS_OF_FACE, f2);
- for ( ; l && l2; l = BM_iter_step(&liter1), l2 = BM_iter_step(&liter2)) {
- BM_elem_attrs_copy(bm, bm, l, l2);
- if (l->e != l2->e) {
- /* set up data for figuring out the two sides of
- * the split */
-
- /* set edges index as dirty after running all */
- BM_elem_index_set(l2->e, BM_elem_index_get(l->e)); /* set_dirty! */
- et = &etags[BM_elem_index_get(l->e)];
-
- if (!et->newe1) {
- et->newe1 = l2->e;
- }
- else if (!et->newe2) {
- et->newe2 = l2->e;
- }
- else {
- /* Only two new edges should be created from each original edge
- * for edge split operation */
-
- //BLI_assert(et->newe1 == l2->e || et->newe2 == l2->e);
- et->newe2 = l2->e;
- }
-
- if (BMO_elem_flag_test(bm, l->e, EDGE_SEAM)) {
- BMO_elem_flag_enable(bm, l2->e, EDGE_SEAM);
- }
-
- BM_elem_attrs_copy(bm, bm, l->e, l2->e);
- }
+#include "intern/bmesh_operators_private.h" /* own include */
- BMO_elem_flag_enable(bm, l->e, EDGE_MARK);
- BMO_elem_flag_enable(bm, l2->e, EDGE_MARK);
- }
-
- return f2;
-}
+enum {
+ EDGE_SEAM = 1
+};
-static void tag_out_edges(BMesh *bm, EdgeTag *etags, BMOperator *UNUSED(op))
+/**
+ * Remove the EDGE_SEAM flag for edges we cant split
+ *
+ * un-tag edges not connected to other tagged edges,
+ * unless they are on a boundry
+ */
+static void bm_edgesplit_validate_seams(BMesh *bm, BMOperator *op)
{
- EdgeTag *et;
+ BMOIter siter;
BMIter iter;
- BMLoop *l, *startl;
BMEdge *e;
- BMVert *v;
- int i, ok;
-
- ok = 0;
- while (ok++ < 100000) {
- BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
- if (!BMO_elem_flag_test(bm, e, EDGE_SEAM))
- continue;
- et = &etags[BM_elem_index_get(e)];
- if (!et->tag && e->l) {
- break;
- }
- }
-
- if (!e) {
- break;
- }
+ unsigned char *vtouch;
+ unsigned char *vt;
- /* ok we found an edge, part of a region of splits we need
- * to identify. now walk along it */
- for (i = 0; i < 2; i++) {
- l = e->l;
-
- v = i ? l->next->v : l->v;
+ BM_mesh_elem_index_ensure(bm, BM_VERT);
- while (1) {
- et = &etags[BM_elem_index_get(l->e)];
- if (et->newe1 == l->e) {
- if (et->newe1) {
- BMO_elem_flag_enable(bm, et->newe1, EDGE_RET1);
- BMO_elem_flag_disable(bm, et->newe1, EDGE_SEAM);
- }
- if (et->newe2) {
- BMO_elem_flag_enable(bm, et->newe2, EDGE_RET2);
- BMO_elem_flag_disable(bm, et->newe2, EDGE_SEAM);
- }
- }
- else {
- if (et->newe1) {
- BMO_elem_flag_enable(bm, et->newe1, EDGE_RET2);
- BMO_elem_flag_disable(bm, et->newe1, EDGE_SEAM);
- }
- if (et->newe2) {
- BMO_elem_flag_enable(bm, et->newe2, EDGE_RET1);
- BMO_elem_flag_disable(bm, et->newe2, EDGE_SEAM);
- }
- }
+ vtouch = MEM_callocN(sizeof(char) * bm->totvert, __func__);
- /* If the original edge was non-manifold edges, then it is
- * possible l->e is not et->newe1 or et->newe2. So always clear
- * the flag on l->e as well, to prevent infinite looping. */
- BMO_elem_flag_disable(bm, l->e, EDGE_SEAM);
+ /* tag all boundry verts so as not to untag an edge which is inbetween only 2 faces [] */
+ BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
- startl = l;
- do {
- l = BM_face_other_loop(l->e, l->f, v);
- if (l == startl || BM_edge_face_count(l->e) != 2) {
- break;
- }
- l = l->radial_next;
- } while (l != startl && !BMO_elem_flag_test(bm, l->e, EDGE_SEAM));
-
- if (l == startl || !BMO_elem_flag_test(bm, l->e, EDGE_SEAM)) {
- break;
- }
+ /* unrelated to flag assignment in this function - since this is the
+ * only place we loop over all edges, disable tag */
+ BM_elem_flag_disable(e, BM_ELEM_INTERNAL_TAG);
- v = (l->v == v) ? l->next->v : l->v;
- }
+ if (BM_edge_is_boundary(e)) {
+ vt = &vtouch[BM_elem_index_get(e->v1)]; if (*vt < 2) (*vt)++;
+ vt = &vtouch[BM_elem_index_get(e->v2)]; if (*vt < 2) (*vt)++;
+
+ /* while the boundry verts need to be tagged,
+ * the edge its self can't be split */
+ BMO_elem_flag_disable(bm, e, EDGE_SEAM);
}
}
-}
-void bmo_edgesplit_exec(BMesh *bm, BMOperator *op)
-{
- EdgeTag *etags, *et;
- BMIter iter, liter;
- BMOIter siter;
- BMFace *f, *f2;
- BMLoop *l, *nextl, *prevl, *l2, *l3;
- BMEdge *e, *e2;
- BMVert *v, *v2, **verts = NULL;
- BLI_array_declare(verts);
- BMEdge **edges_tmp = NULL;
- BLI_array_declare(edges_tmp);
- int i, j;
-
- BMO_slot_buffer_flag_enable(bm, op, "edges", EDGE_SEAM, BM_EDGE);
-
/* single marked edges unconnected to any other marked edges
* are illegal, go through and unmark them */
BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) {
- for (i = 0; i < 2; i++) {
- BM_ITER(e2, &iter, bm, BM_EDGES_OF_VERT, i ? e->v2 : e->v1) {
- if (e != e2 && BMO_elem_flag_test(bm, e2, EDGE_SEAM)) {
- break;
- }
- }
- if (e2) {
- break;
- }
- }
-
- if (!e2) {
+ /* lame, but we dont want the count to exceed 255,
+ * so just count to 2, its all we need */
+ unsigned char *vt;
+ vt = &vtouch[BM_elem_index_get(e->v1)]; if (*vt < 2) (*vt)++;
+ vt = &vtouch[BM_elem_index_get(e->v2)]; if (*vt < 2) (*vt)++;
+ }
+ BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) {
+ if (vtouch[BM_elem_index_get(e->v1)] == 1 &&
+ vtouch[BM_elem_index_get(e->v2)] == 1)
+ {
BMO_elem_flag_disable(bm, e, EDGE_SEAM);
}
}
- etags = MEM_callocN(sizeof(EdgeTag) * bm->totedge, "EdgeTag");
-
- BM_mesh_elem_index_ensure(bm, BM_EDGE);
-
-#ifdef ETV
-# undef ETV
-#endif
-#ifdef SETETV
-# undef SETETV
-#endif
-
-#define ETV(et, v, l) (l->e->v1 == v ? et->newv1 : et->newv2)
-#define SETETV(et, v, l, vs) l->e->v1 == v ? (et->newv1 = vs) : (et->newv2 = vs)
-
- BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
-
- if (BMO_elem_flag_test(bm, f, FACE_NEW)) {
- continue;
- }
-
- BLI_array_empty(verts);
- BLI_array_growitems(verts, f->len);
- memset(verts, 0, sizeof(BMVert *) * f->len);
-
- /* this is passed onto remake_face() so it doesnt need to allocate
- * a new array on each call. */
- BLI_array_empty(edges_tmp);
- BLI_array_growitems(edges_tmp, f->len);
-
- i = 0;
- BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
- if (!BMO_elem_flag_test(bm, l->e, EDGE_SEAM)) {
- if (!verts[i]) {
-
- et = &etags[BM_elem_index_get(l->e)];
- if (ETV(et, l->v, l)) {
- verts[i] = ETV(et, l->v, l);
- }
- else
- {
- verts[i] = l->v;
- }
- }
- i++;
- continue;
- }
-
- nextl = l->next;
- prevl = l->prev;
-
- for (j = 0; j < 2; j++) {
- /* correct as long as i & j dont change during the loop */
- const int fv_index = j ? (i + 1) % f->len : i; /* face vert index */
- l2 = j ? nextl : prevl;
- v = j ? l2->v : l->v;
-
- if (BMO_elem_flag_test(bm, l2->e, EDGE_SEAM)) {
- if (verts[fv_index] == NULL) {
- /* make unique vert here for this face only */
- v2 = BM_vert_create(bm, v->co, v);
- verts[fv_index] = v2;
- }
- else {
- v2 = verts[fv_index];
- }
- }
- else {
- /* generate unique vert for non-seam edge(s)
- * around the manifold vert fan if necessary */
-
- /* first check that we have two seam edges
- * somewhere within this fa */
- l3 = l2;
- do {
- if (BM_edge_face_count(l3->e) != 2) {
- /* if we hit a boundary edge, tag
- * l3 as null so we know to disconnect
- * it */
- if (BM_edge_face_count(l3->e) == 1) {
- l3 = NULL;
- }
- break;
- }
-
- l3 = l3->radial_next;
- l3 = BM_face_other_loop(l3->e, l3->f, v);
- } while (l3 != l2 && !BMO_elem_flag_test(bm, l3->e, EDGE_SEAM));
-
- if (l3 == NULL || (BMO_elem_flag_test(bm, l3->e, EDGE_SEAM) && l3->e != l->e)) {
- et = &etags[BM_elem_index_get(l2->e)];
- if (ETV(et, v, l2) == NULL) {
- v2 = BM_vert_create(bm, v->co, v);
-
- l3 = l2;
- do {
- SETETV(et, v, l3, v2);
- if (BM_edge_face_count(l3->e) != 2) {
- break;
- }
-
- l3 = l3->radial_next;
- l3 = BM_face_other_loop(l3->e, l3->f, v);
-
- et = &etags[BM_elem_index_get(l3->e)];
- } while (l3 != l2 && !BMO_elem_flag_test(bm, l3->e, EDGE_SEAM));
- }
- else {
- v2 = ETV(et, v, l2);
- }
+ MEM_freeN(vtouch);
+}
- verts[fv_index] = v2;
- }
- else {
- verts[fv_index] = v;
- }
- }
- }
+void bmo_edgesplit_exec(BMesh *bm, BMOperator *op)
+{
+ BMOIter siter;
+ BMEdge *e;
- i++;
- }
+ BMO_slot_buffer_flag_enable(bm, op, "edges", EDGE_SEAM, BM_EDGE);
- /* debugging code, quick way to find the face/vert combination
- * which is failing assuming quads start planer - campbell */
-#if 0
- if (f->len == 4) {
- float no1[3];
- float no2[3];
- float angle_error;
- printf(" ** found QUAD\n");
- normal_tri_v3(no1, verts[0]->co, verts[1]->co, verts[2]->co);
- normal_tri_v3(no2, verts[0]->co, verts[2]->co, verts[3]->co);
- if ((angle_error = angle_v3v3(no1, no2)) > 0.05) {
- printf(" ERROR %.4f\n", angle_error);
- print_v3("0", verts[0]->co);
- print_v3("1", verts[1]->co);
- print_v3("2", verts[2]->co);
- print_v3("3", verts[3]->co);
+ bm_edgesplit_validate_seams(bm, op);
- }
- }
- else {
- printf(" ** fount %d len face\n", f->len);
- }
-#endif
+ BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) {
+ if (BMO_elem_flag_test(bm, e, EDGE_SEAM)) {
+ /* this flag gets copied so we can be sure duplicate edges get it too (important) */
+ BM_elem_flag_enable(e, BM_ELEM_INTERNAL_TAG);
- f2 = remake_face(bm, etags, f, verts, edges_tmp);
- if (!f2) {
- continue;
+ bmesh_edge_separate(bm, e, e->l);
+ BM_elem_flag_enable(e->v1, BM_ELEM_TAG);
+ BM_elem_flag_enable(e->v2, BM_ELEM_TAG);
}
-
- BMO_elem_flag_enable(bm, f, FACE_DEL);
- BMO_elem_flag_enable(bm, f2, FACE_NEW);
}
-
- /* remake_face() sets invalid indecies,
- * likely these will be corrected on operator exit anyway */
- bm->elem_index_dirty &= ~BM_EDGE;
-
- /* cant call the operator because 'tag_out_edges'
- * relies on original index values, from before editing geometry */
-
-#if 0
- BMO_op_callf(bm, "del geom=%ff context=%i", FACE_DEL, DEL_ONLYFACES);
-#else
- BMO_remove_tagged_context(bm, FACE_DEL, DEL_ONLYFACES);
-#endif
- /* test EDGE_MARK'd edges if we need to delete them, EDGE_MARK
- * is set in remake_face */
- BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
- if (BMO_elem_flag_test(bm, e, EDGE_MARK)) {
- if (!e->l) {
- BMO_elem_flag_enable(bm, e, EDGE_DEL);
+ BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) {
+ if (BMO_elem_flag_test(bm, e, EDGE_SEAM)) {
+ if (BM_elem_flag_test(e->v1, BM_ELEM_TAG)) {
+ BM_elem_flag_disable(e->v1, BM_ELEM_TAG);
+ bmesh_vert_separate(bm, e->v1, NULL, NULL);
+ }
+ if (BM_elem_flag_test(e->v2, BM_ELEM_TAG)) {
+ BM_elem_flag_disable(e->v2, BM_ELEM_TAG);
+ bmesh_vert_separate(bm, e->v2, NULL, NULL);
}
}
}
-#if 0
- BMO_op_callf(bm, "del geom=%fe context=%i", EDGE_DEL, DEL_EDGES);
-#else
- BMO_remove_tagged_context(bm, EDGE_DEL, DEL_EDGES);
-#endif
-
- tag_out_edges(bm, etags, op);
- 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);
- if (etags) MEM_freeN(etags);
+ BMO_slot_buffer_from_hflag(bm, op, "edgeout", BM_ELEM_INTERNAL_TAG, BM_EDGE);
}
-
-#undef ETV
-#undef SETETV
diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c
index ab5287a3d89..595502586b9 100644
--- a/source/blender/bmesh/operators/bmo_extrude.c
+++ b/source/blender/bmesh/operators/bmo_extrude.c
@@ -27,7 +27,7 @@
#include "bmesh.h"
-#include "bmesh_operators_private.h" /* own include */
+#include "intern/bmesh_operators_private.h" /* own include */
enum {
EXT_INPUT = 1,
@@ -495,7 +495,7 @@ static void calc_solidify_normals(BMesh *bm)
}
else {
/* can't do anything useful here!
- * Set the face index for a vert incase it gets a zero normal */
+ * Set the face index for a vert in case it gets a zero normal */
BM_elem_flag_disable(e->v1, BM_ELEM_TAG);
BM_elem_flag_disable(e->v2, BM_ELEM_TAG);
continue;
diff --git a/source/blender/bmesh/operators/bmo_join_triangles.c b/source/blender/bmesh/operators/bmo_join_triangles.c
index 76e64aee821..1d8b77e9300 100644
--- a/source/blender/bmesh/operators/bmo_join_triangles.c
+++ b/source/blender/bmesh/operators/bmo_join_triangles.c
@@ -31,7 +31,7 @@
#include "bmesh.h"
-#include "bmesh_operators_private.h" /* own include */
+#include "intern/bmesh_operators_private.h" /* own include */
/*
* JOIN_TRIANGLES.C
@@ -251,14 +251,11 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op)
if (!BMO_elem_flag_test(bm, e, EDGE_MARK))
continue;
- if (BM_edge_face_count(e) != 2) {
+ if (!BM_edge_face_pair(e, &f1, &f2)) {
BMO_elem_flag_disable(bm, e, EDGE_MARK);
continue;
}
- f1 = e->l->f;
- f2 = e->l->radial_next->f;
-
if (f1->len != 3 || f2->len != 3) {
BMO_elem_flag_disable(bm, e, EDGE_MARK);
continue;
@@ -332,9 +329,8 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op)
if (!BMO_elem_flag_test(bm, e, EDGE_CHOSEN))
continue;
- f1 = e->l->f;
- f2 = e->l->radial_next->f;
+ BM_edge_face_pair(e, &f1, &f2); /* checked above */
BM_faces_join_pair(bm, f1, f2, e);
}
diff --git a/source/blender/bmesh/operators/bmo_mesh_conv.c b/source/blender/bmesh/operators/bmo_mesh_conv.c
index 63d8e3b65c3..3e0fc881bfa 100644
--- a/source/blender/bmesh/operators/bmo_mesh_conv.c
+++ b/source/blender/bmesh/operators/bmo_mesh_conv.c
@@ -20,6 +20,14 @@
* ***** END GPL LICENSE BLOCK *****
*/
+/** \file blender/bmesh/operators/bmesh_mesh_conv.c
+ * \ingroup bmesh
+ *
+ * This file contains functions
+ * for converting a Mesh
+ * into a Bmesh, and back again.
+ */
+
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
@@ -39,329 +47,21 @@
#include "BLI_array.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
-#include "bmesh_operators_private.h" /* own include */
-
-/*
- * MESH CONV.C
- *
- * This file contains functions
- * for converting a Mesh
- * into a Bmesh, and back again.
- *
- */
+#include "intern/bmesh_operators_private.h" /* own include */
void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op)
{
Object *ob = BMO_slot_ptr_get(op, "object");
Mesh *me = BMO_slot_ptr_get(op, "mesh");
- MVert *mvert;
- BLI_array_declare(verts);
- MEdge *medge;
- MLoop *ml;
- MPoly *mpoly;
- KeyBlock *actkey, *block;
- BMVert *v, **vt = NULL, **verts = NULL;
- BMEdge *e, **fedges = NULL, **et = NULL;
- BMFace *f;
- BMLoop *l;
- BLI_array_declare(fedges);
- float (*keyco)[3] = NULL;
- int *keyi;
int set_key = BMO_slot_bool_get(op, "set_shapekey");
- int totuv, i, j;
-
- if (!me || !me->totvert) {
- return; /* sanity check */
- }
-
- vt = MEM_mallocN(sizeof(void **) * me->totvert, "mesh to bmesh vtable");
-
- CustomData_copy(&me->vdata, &bm->vdata, CD_MASK_BMESH, CD_CALLOC, 0);
- CustomData_copy(&me->edata, &bm->edata, CD_MASK_BMESH, CD_CALLOC, 0);
- CustomData_copy(&me->ldata, &bm->ldata, CD_MASK_BMESH, CD_CALLOC, 0);
- CustomData_copy(&me->pdata, &bm->pdata, CD_MASK_BMESH, CD_CALLOC, 0);
-
- /* make sure uv layer names are consisten */
- totuv = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY);
- for (i = 0; i < totuv; i++) {
- int li = CustomData_get_layer_index_n(&bm->pdata, CD_MTEXPOLY, i);
- CustomData_set_layer_name(&bm->ldata, CD_MLOOPUV, i, bm->pdata.layers[li].name);
- }
-
- if (!CustomData_has_layer(&bm->edata, CD_CREASE))
- CustomData_add_layer(&bm->edata, CD_CREASE, CD_ASSIGN, NULL, 0);
-
- if (!CustomData_has_layer(&bm->edata, CD_BWEIGHT))
- CustomData_add_layer(&bm->edata, CD_BWEIGHT, CD_ASSIGN, NULL, 0);
-
- if (!CustomData_has_layer(&bm->vdata, CD_BWEIGHT))
- CustomData_add_layer(&bm->vdata, CD_BWEIGHT, CD_ASSIGN, NULL, 0);
+ BM_mesh_to_bmesh(bm, me, set_key, ob->shapenr - 1);
if (me->key && ob->shapenr > me->key->totkey) {
ob->shapenr = me->key->totkey - 1;
}
-
- actkey = ob_get_keyblock(ob);
- if (actkey && actkey->totelem == me->totvert) {
- CustomData_add_layer(&bm->vdata, CD_SHAPE_KEYINDEX, CD_ASSIGN, NULL, 0);
-
- /* check if we need to generate unique ids for the shapekeys.
- * this also exists in the file reading code, but is here for
- * a sanity chec */
- if (!me->key->uidgen) {
- fprintf(stderr,
- "%s had to generate shape key uid's in a situation we shouldn't need to! "
- "(bmesh internal error)\n",
- __func__);
-
- me->key->uidgen = 1;
- for (block = me->key->block.first; block; block = block->next) {
- block->uid = me->key->uidgen++;
- }
- }
-
- keyco = actkey->data;
- bm->shapenr = ob->shapenr;
- for (i = 0, block = me->key->block.first; block; block = block->next, i++) {
- CustomData_add_layer_named(&bm->vdata, CD_SHAPEKEY,
- CD_ASSIGN, NULL, 0, block->name);
-
- j = CustomData_get_layer_index_n(&bm->vdata, CD_SHAPEKEY, i);
- bm->vdata.layers[j].uid = block->uid;
- }
- }
- else if (actkey) {
- printf("shapekey <-> mesh mismatch!\n");
- }
-
- 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);
- BM_elem_index_set(v, i); /* set_ok */
- vt[i] = v;
-
- /* transfer flag */
- v->head.hflag = BM_vert_flag_from_mflag(mvert->flag);
-
- /* 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);
-
- BM_elem_float_data_set(&bm->vdata, v, CD_BWEIGHT, (float)mvert->bweight / 255.0f);
-
- /* Copy Custom Dat */
- CustomData_to_bmesh_block(&me->vdata, &bm->vdata, i, &v->head.data);
-
- /* set shapekey dat */
- if (me->key) {
- /* set shape key original inde */
- keyi = CustomData_bmesh_get(&bm->vdata, v->head.data, CD_SHAPE_KEYINDEX);
- if (keyi) {
- *keyi = i;
- }
-
- for (block = me->key->block.first, j = 0; block; block = block->next, j++) {
- float *co = CustomData_bmesh_get_n(&bm->vdata, v->head.data, CD_SHAPEKEY, j);
-
- if (co) {
- copy_v3_v3(co, ((float *)block->data) + 3 * i);
- }
- }
- }
- }
-
- bm->elem_index_dirty &= ~BM_VERT; /* added in order, clear dirty flag */
-
- if (!me->totedge) {
- MEM_freeN(vt);
- return;
- }
-
- et = MEM_mallocN(sizeof(void **) * me->totedge, "mesh to bmesh etable");
-
- medge = me->medge;
- for (i = 0; i < me->totedge; i++, medge++) {
- e = BM_edge_create(bm, vt[medge->v1], vt[medge->v2], NULL, FALSE);
- BM_elem_index_set(e, i); /* set_ok */
- et[i] = e;
-
- /* transfer flags */
- e->head.hflag = BM_edge_flag_from_mflag(medge->flag);
-
- /* 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 */
- CustomData_to_bmesh_block(&me->edata, &bm->edata, i, &e->head.data);
-
- BM_elem_float_data_set(&bm->edata, e, CD_CREASE, (float)medge->crease / 255.0f);
- BM_elem_float_data_set(&bm->edata, e, CD_BWEIGHT, (float)medge->bweight / 255.0f);
- }
-
- bm->elem_index_dirty &= ~BM_EDGE; /* added in order, clear dirty flag */
-
- mpoly = me->mpoly;
- for (i = 0; i < me->totpoly; i++, mpoly++) {
- BMIter iter;
-
- BLI_array_empty(fedges);
- BLI_array_empty(verts);
-
- BLI_array_growitems(fedges, mpoly->totloop);
- BLI_array_growitems(verts, mpoly->totloop);
-
- for (j = 0; j < mpoly->totloop; j++) {
- ml = &me->mloop[mpoly->loopstart + j];
- v = vt[ml->v];
- e = et[ml->e];
-
- fedges[j] = e;
- verts[j] = v;
- }
-
- /* not sure what this block is supposed to do,
- * but its unused. so commenting - campbell */
-#if 0
- {
- BMVert *v1, *v2;
- v1 = vt[me->mloop[mpoly->loopstart].v];
- v2 = vt[me->mloop[mpoly->loopstart + 1].v];
-
- if (v1 == fedges[0]->v1) {
- v2 = fedges[0]->v2;
- }
- else {
- v1 = fedges[0]->v2;
- v2 = fedges[0]->v1;
- }
- }
-#endif
-
- f = BM_face_create(bm, verts, fedges, mpoly->totloop, FALSE);
-
- if (!f) {
- printf("%s: Warning! Bad face in mesh"
- " \"%s\" at index %d!, skipping\n",
- __func__, me->id.name + 2, i);
- continue;
- }
-
- /* dont use 'i' since we may have skipped the face */
- BM_elem_index_set(f, bm->totface - 1); /* set_ok */
-
- /* transfer flag */
- f->head.hflag = BM_face_flag_from_mflag(mpoly->flag);
-
- /* 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;
- if (i == me->act_face) bm->act_face = f;
-
- j = 0;
- BM_ITER_INDEX(l, &iter, bm, BM_LOOPS_OF_FACE, f, j) {
- /* Save index of correspsonding MLoop */
- BM_elem_index_set(l, mpoly->loopstart + j); /* set_loop */
- }
-
- /* Copy Custom Dat */
- CustomData_to_bmesh_block(&me->pdata, &bm->pdata, i, &f->head.data);
- }
-
- bm->elem_index_dirty &= ~BM_FACE; /* added in order, clear dirty flag */
-
- {
- BMIter fiter;
- BMIter liter;
-
- /* Copy over loop CustomData. Doing this in a separate loop isn't necessary
- * but is an optimization, to avoid copying a bunch of interpolated customdata
- * for each BMLoop (from previous BMLoops using the same edge), always followed
- * by freeing the interpolated data and overwriting it with data from the Mesh. */
- BM_ITER(f, &fiter, bm, BM_FACES_OF_MESH, NULL) {
- BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
- int li = BM_elem_index_get(l);
- CustomData_to_bmesh_block(&me->ldata, &bm->ldata, li, &l->head.data);
- BM_elem_index_set(l, 0); /* set_loop */
- }
- }
- }
-
- if (me->mselect && me->totselect != 0) {
- BMIter iter;
- BMVert *vertex;
- BMEdge *edge;
- BMFace *face;
- BMVert **vertex_array = MEM_callocN(sizeof(BMVert *) * bm->totvert,
- "Selection Conversion Vertex Pointer Array");
- BMEdge **edge_array = MEM_callocN(sizeof(BMEdge *) * bm->totedge,
- "Selection Conversion Edge Pointer Array");
- BMFace **face_array = MEM_callocN(sizeof(BMFace *) * bm->totface,
- "Selection Conversion Face Pointer Array");
-
- for (i = 0, vertex = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL);
- vertex;
- i++, vertex = BM_iter_step(&iter))
- {
- vertex_array[i] = vertex;
- }
-
- for (i = 0, edge = BM_iter_new(&iter, bm, BM_EDGES_OF_MESH, NULL);
- edge;
- i++, edge = BM_iter_step(&iter))
- {
- edge_array[i] = edge;
- }
-
- for (i = 0, face = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, NULL);
- face;
- i++, face = BM_iter_step(&iter))
- {
- face_array[i] = face;
- }
-
- if (me->mselect) {
- for (i = 0; i < me->totselect; i++) {
- if (me->mselect[i].type == ME_VSEL) {
- BM_select_history_store(bm, (BMElem *)vertex_array[me->mselect[i].index]);
- }
- else if (me->mselect[i].type == ME_ESEL) {
- BM_select_history_store(bm, (BMElem *)edge_array[me->mselect[i].index]);
- }
- else if (me->mselect[i].type == ME_FSEL) {
- BM_select_history_store(bm, (BMElem *)face_array[me->mselect[i].index]);
- }
- }
- }
- else {
- me->totselect = 0;
- }
-
- MEM_freeN(vertex_array);
- MEM_freeN(edge_array);
- MEM_freeN(face_array);
- }
- else {
- me->totselect = 0;
- if (me->mselect) {
- MEM_freeN(me->mselect);
- me->mselect = NULL;
- }
- }
-
- BLI_array_free(fedges);
- BLI_array_free(verts);
-
- MEM_freeN(vt);
- MEM_freeN(et);
}
void bmo_object_load_bmesh_exec(BMesh *bm, BMOperator *op)
@@ -373,544 +73,11 @@ void bmo_object_load_bmesh_exec(BMesh *bm, BMOperator *op)
BMO_op_callf(bm, "bmesh_to_mesh mesh=%p object=%p notessellation=%b", me, ob, TRUE);
}
-
-static BMVert **bm_to_mesh_vertex_map(BMesh *bm, int ototvert)
-{
- BMVert **vertMap = NULL;
- BMVert *eve;
- int index;
- int i = 0;
- BMIter iter;
-
- /* caller needs to ensure this */
- BLI_assert(ototvert > 0);
-
- vertMap = MEM_callocN(sizeof(*vertMap)*ototvert, "vertMap");
- if (CustomData_has_layer(&bm->vdata, CD_SHAPE_KEYINDEX)) {
- int *keyi;
- BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
- keyi = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_SHAPE_KEYINDEX);
- if (keyi) {
- if (((index = *keyi) != ORIGINDEX_NONE) && (index < ototvert)) {
- vertMap[index] = eve;
- }
- }
- else {
- if (i < ototvert) {
- vertMap[i] = eve;
- }
- }
- i++;
- }
- }
- else {
- BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
- if (i < ototvert) {
- vertMap[i] = eve;
- }
- else {
- break;
- }
- i++;
- }
- }
-
- return vertMap;
-}
-
-BM_INLINE void bmesh_quick_edgedraw_flag(MEdge *med, BMEdge *e)
-{
- /* this is a cheap way to set the edge draw, its not precise and will
- * pick the first 2 faces an edge uses */
-
-
- if ( /* (med->flag & ME_EDGEDRAW) && */ /* assume to be true */
- (e->l && (e->l != e->l->radial_next)) &&
- (dot_v3v3(e->l->f->no, e->l->radial_next->f->no) > 0.998f))
- {
- med->flag &= ~ME_EDGEDRAW;
- }
-}
-
-
void bmo_bmesh_to_mesh_exec(BMesh *bm, BMOperator *op)
{
Mesh *me = BMO_slot_ptr_get(op, "mesh");
/* Object *ob = BMO_slot_ptr_get(op, "object"); */
- MLoop *mloop;
- MPoly *mpoly;
- MVert *mvert, *oldverts;
- MEdge *med, *medge;
- BMVert *v, *eve;
- BMEdge *e;
- BMLoop *l;
- BMFace *f;
- BMIter iter, liter;
- int i, j, *keyi, ototvert, totloop;
int dotess = !BMO_slot_bool_get(op, "notessellation");
-
- ototvert = me->totvert;
-
- /* new Vertex block */
- if (bm->totvert == 0) mvert = NULL;
- else mvert = MEM_callocN(bm->totvert * sizeof(MVert), "loadeditbMesh vert");
-
- /* new Edge block */
- if (bm->totedge == 0) medge = NULL;
- else medge = MEM_callocN(bm->totedge * sizeof(MEdge), "loadeditbMesh edge");
-
- /* build ngon dat */
- /* new Ngon Face block */
- if (bm->totface == 0) mpoly = NULL;
- else mpoly = MEM_callocN(bm->totface * sizeof(MPoly), "loadeditbMesh poly");
-
- /* find number of loops to allocat */
- totloop = 0;
- BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
- totloop += f->len;
- }
-
- if (totloop == 0) mloop = NULL;
- else mloop = MEM_callocN(totloop * sizeof(MLoop), "loadeditbMesh loop");
-
- /* lets save the old verts just in case we are actually working on
- * a key ... we now do processing of the keys at the end */
- oldverts = me->mvert;
-
- /* don't free this yet */
- CustomData_set_layer(&me->vdata, CD_MVERT, NULL);
-
- /* free custom data */
- CustomData_free(&me->vdata, me->totvert);
- CustomData_free(&me->edata, me->totedge);
- CustomData_free(&me->fdata, me->totface);
- CustomData_free(&me->ldata, me->totloop);
- CustomData_free(&me->pdata, me->totpoly);
-
- /* add new custom data */
- me->totvert = bm->totvert;
- me->totedge = bm->totedge;
- me->totloop = totloop;
- me->totpoly = bm->totface;
- /* will be overwritten with a valid value if 'dotess' is set, otherwise we
- * end up with 'me->totface' and me->mface == NULL which can crash [#28625]
- */
- me->totface = 0;
-
- CustomData_copy(&bm->vdata, &me->vdata, CD_MASK_MESH, CD_CALLOC, me->totvert);
- CustomData_copy(&bm->edata, &me->edata, CD_MASK_MESH, CD_CALLOC, me->totedge);
- CustomData_copy(&bm->ldata, &me->ldata, CD_MASK_MESH, CD_CALLOC, me->totloop);
- CustomData_copy(&bm->pdata, &me->pdata, CD_MASK_MESH, CD_CALLOC, me->totpoly);
-
- CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, mvert, me->totvert);
- CustomData_add_layer(&me->edata, CD_MEDGE, CD_ASSIGN, medge, me->totedge);
- CustomData_add_layer(&me->ldata, CD_MLOOP, CD_ASSIGN, mloop, me->totloop);
- CustomData_add_layer(&me->pdata, CD_MPOLY, CD_ASSIGN, mpoly, me->totpoly);
-
- /* this is called again, 'dotess' arg is used there */
- mesh_update_customdata_pointers(me, 0);
-
- i = 0;
- BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
- float *bweight = CustomData_bmesh_get(&bm->vdata, v->head.data, CD_BWEIGHT);
-
- mvert->bweight = bweight ? (char)((*bweight) * 255) : 0;
-
- copy_v3_v3(mvert->co, v->co);
- normal_float_to_short_v3(mvert->no, v->no);
-
- mvert->flag = BM_vert_flag_to_mflag(v);
-
- BM_elem_index_set(v, i); /* set_inline */
-
- /* copy over customdat */
- CustomData_from_bmesh_block(&bm->vdata, &me->vdata, v->head.data, i);
-
- i++;
- mvert++;
-
- BM_CHECK_ELEMENT(bm, v);
- }
- bm->elem_index_dirty &= ~BM_VERT;
-
- med = medge;
- i = 0;
- BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
- float *crease = CustomData_bmesh_get(&bm->edata, e->head.data, CD_CREASE);
- float *bweight = CustomData_bmesh_get(&bm->edata, e->head.data, CD_BWEIGHT);
-
- med->v1 = BM_elem_index_get(e->v1);
- med->v2 = BM_elem_index_get(e->v2);
- med->crease = crease ? (char)((*crease) * 255) : 0;
- med->bweight = bweight ? (char)((*bweight) * 255) : 0;
-
- med->flag = BM_edge_flag_to_mflag(e);
-
- BM_elem_index_set(e, i); /* set_inline */
-
- /* copy over customdat */
- CustomData_from_bmesh_block(&bm->edata, &me->edata, e->head.data, i);
-
- bmesh_quick_edgedraw_flag(med, e);
-
- i++;
- med++;
- BM_CHECK_ELEMENT(bm, e);
- }
- bm->elem_index_dirty &= ~BM_EDGE;
-
- i = 0;
- j = 0;
- BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
- mpoly->loopstart = j;
- mpoly->totloop = f->len;
- mpoly->mat_nr = f->mat_nr;
- mpoly->flag = BM_face_flag_to_mflag(f);
-
- l = BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, f);
- for ( ; l; l = BM_iter_step(&liter), j++, mloop++) {
- mloop->e = BM_elem_index_get(l->e);
- mloop->v = BM_elem_index_get(l->v);
-
- /* copy over customdat */
- CustomData_from_bmesh_block(&bm->ldata, &me->ldata, l->head.data, j);
- BM_CHECK_ELEMENT(bm, l);
- BM_CHECK_ELEMENT(bm, l->e);
- BM_CHECK_ELEMENT(bm, l->v);
- }
-
- if (f == bm->act_face) me->act_face = i;
-
- /* copy over customdat */
- CustomData_from_bmesh_block(&bm->pdata, &me->pdata, f->head.data, i);
-
- i++;
- mpoly++;
- BM_CHECK_ELEMENT(bm, f);
- }
-
- /* patch hook indices and vertex parents */
- if (ototvert > 0) {
- Object *ob;
- ModifierData *md;
- BMVert **vertMap = NULL;
- int i, j;
-
- for (ob = G.main->object.first; ob; ob = ob->id.next) {
- if (ob->parent == bm->ob && ELEM(ob->partype, PARVERT1, PARVERT3)) {
-
- if (vertMap == NULL) {
- vertMap = bm_to_mesh_vertex_map(bm, ototvert);
- }
-
- if (ob->par1 < ototvert) {
- eve = vertMap[ob->par1];
- if (eve) ob->par1 = BM_elem_index_get(eve);
- }
- if (ob->par2 < ototvert) {
- eve = vertMap[ob->par2];
- if (eve) ob->par2 = BM_elem_index_get(eve);
- }
- if (ob->par3 < ototvert) {
- eve = vertMap[ob->par3];
- if (eve) ob->par3 = BM_elem_index_get(eve);
- }
-
- }
- if (ob->data == me) {
- for (md = ob->modifiers.first; md; md = md->next) {
- if (md->type == eModifierType_Hook) {
- HookModifierData *hmd = (HookModifierData *) md;
-
- if (vertMap == NULL) {
- vertMap = bm_to_mesh_vertex_map(bm, ototvert);
- }
-
- for (i = j = 0; i < hmd->totindex; i++) {
- if (hmd->indexar[i] < ototvert) {
- eve = vertMap[hmd->indexar[i]];
-
- if (eve) {
- hmd->indexar[j++] = BM_elem_index_get(eve);
- }
- }
- else j++;
- }
-
- hmd->totindex = j;
- }
- }
- }
- }
-
- if (vertMap) MEM_freeN(vertMap);
- }
-
- if (dotess) {
- BKE_mesh_tessface_calc(me);
- }
-
- mesh_update_customdata_pointers(me, dotess);
-
- {
- BMEditSelection *selected;
- me->totselect = BLI_countlist(&(bm->selected));
-
- if (me->mselect) MEM_freeN(me->mselect);
-
- me->mselect = MEM_callocN(sizeof(MSelect) * me->totselect, "Mesh selection history");
-
-
- for (i = 0, selected = bm->selected.first; selected; i++, selected = selected->next) {
- if (selected->htype == BM_VERT) {
- me->mselect[i].type = ME_VSEL;
-
- }
- else if (selected->htype == BM_EDGE) {
- me->mselect[i].type = ME_ESEL;
-
- }
- else if (selected->htype == BM_FACE) {
- me->mselect[i].type = ME_FSEL;
- }
-
- me->mselect[i].index = BM_elem_index_get(selected->ele);
- }
- }
-
- /* see comment below, this logic is in twice */
-
- if (me->key) {
- KeyBlock *currkey;
- KeyBlock *actkey = BLI_findlink(&me->key->block, bm->shapenr - 1);
-
- float (*ofs)[3] = NULL;
-
- /* go through and find any shapekey customdata layers
- * that might not have corresponding KeyBlocks, and add them if
- * necessary */
- j = 0;
- for (i = 0; i < bm->vdata.totlayer; i++) {
- if (bm->vdata.layers[i].type != CD_SHAPEKEY)
- continue;
-
- for (currkey = me->key->block.first; currkey; currkey = currkey->next) {
- if (currkey->uid == bm->vdata.layers[i].uid)
- break;
- }
-
- if (!currkey) {
- currkey = MEM_callocN(sizeof(KeyBlock), "KeyBlock mesh_conv.c");
- currkey->type = KEY_LINEAR;
- currkey->slidermin = 0.0f;
- currkey->slidermax = 1.0f;
-
- BLI_addtail(&me->key->block, currkey);
- me->key->totkey++;
- }
-
- j++;
- }
-
-
- /* editing the base key should update others */
- if (me->key->type == KEY_RELATIVE && oldverts) {
- int act_is_basis = 0;
- /* find if this key is a basis for any others */
- for (currkey = me->key->block.first; currkey; currkey = currkey->next) {
- if (bm->shapenr - 1 == currkey->relative) {
- act_is_basis = 1;
- break;
- }
- }
-
- if (act_is_basis) { /* active key is a base */
- float (*fp)[3] = actkey->data;
- int *keyi;
- i = 0;
- ofs = MEM_callocN(sizeof(float) * 3 * bm->totvert, "currkey->data");
- mvert = me->mvert;
- BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
- keyi = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_SHAPE_KEYINDEX);
- if (keyi && *keyi != ORIGINDEX_NONE) {
- sub_v3_v3v3(ofs[i], mvert->co, fp[*keyi]);
- }
- i++;
- mvert++;
- }
- }
- }
-
-
- for (currkey = me->key->block.first; currkey; currkey = currkey->next) {
- j = 0;
-
- for (i = 0; i < bm->vdata.totlayer; i++) {
- if (bm->vdata.layers[i].type != CD_SHAPEKEY)
- continue;
-
- if (currkey->uid == bm->vdata.layers[i].uid) {
- int apply_offset = (ofs && (currkey != actkey) && (bm->shapenr - 1 == currkey->relative));
- float *fp, *co;
- float (*ofs_pt)[3] = ofs;
-
- if (currkey->data)
- MEM_freeN(currkey->data);
- currkey->data = fp = MEM_mallocN(sizeof(float) * 3 * bm->totvert, "shape key data");
- currkey->totelem = bm->totvert;
-
- mvert = me->mvert;
- BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
- co = (currkey == actkey) ?
- eve->co :
- CustomData_bmesh_get_n(&bm->vdata, eve->head.data, CD_SHAPEKEY, j);
-
- copy_v3_v3(fp, co);
-
- /* propagate edited basis offsets to other shapes */
- if (apply_offset) {
- add_v3_v3(fp, *ofs_pt++);
- }
-
- if (currkey == actkey && oldverts) {
- keyi = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_SHAPE_KEYINDEX);
-
- if (*keyi >= 0 && *keyi < currkey->totelem) // valid old vertex
- copy_v3_v3(mvert->co, oldverts[*keyi].co);
-
- mvert++;
- }
-
- fp += 3;
- }
- break;
- }
-
- j++;
- }
-
- /* if we didn't find a shapekey, tag the block to be reconstructed
- * via the old method below */
- if (j == CustomData_number_of_layers(&bm->vdata, CD_SHAPEKEY)) {
- currkey->flag |= KEYBLOCK_MISSING;
- }
- }
-
- if (ofs) MEM_freeN(ofs);
- }
-
- /* XXX, code below is from trunk and a duplicate functionality
- * to the block above.
- * We should use one or the other, having both means we have to maintain
- * both and keep them working the same way which is a hassle - campbell */
-
- /* old method of reconstructing keys via vertice's original key indices,
- * currently used if the new method above fails (which is theoretically
- * possible in certain cases of undo) */
- if (me->key) {
- float *fp, *newkey, *oldkey;
- KeyBlock *currkey;
- KeyBlock *actkey = BLI_findlink(&me->key->block, bm->shapenr - 1);
-
- float (*ofs)[3] = NULL;
-
- /* editing the base key should update others */
- if (me->key->type == KEY_RELATIVE && oldverts) {
- int act_is_basis = 0;
- /* find if this key is a basis for any others */
- for (currkey = me->key->block.first; currkey; currkey = currkey->next) {
- if (bm->shapenr - 1 == currkey->relative) {
- act_is_basis = 1;
- break;
- }
- }
-
- if (act_is_basis) { /* active key is a base */
- float (*fp)[3] = actkey->data;
- int *keyi;
- i = 0;
- ofs = MEM_callocN(sizeof(float) * 3 * bm->totvert, "currkey->data");
- mvert = me->mvert;
- BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
- keyi = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_SHAPE_KEYINDEX);
- if (keyi && *keyi != ORIGINDEX_NONE) {
- sub_v3_v3v3(ofs[i], mvert->co, fp[*keyi]);
- }
- i++;
- mvert++;
- }
- }
- }
-
- /* Lets reorder the key data so that things line up roughly
- * with the way things were before editmode */
- currkey = me->key->block.first;
- while (currkey) {
- int apply_offset = (ofs && (currkey != actkey) && (bm->shapenr - 1 == currkey->relative));
-
- if (!(currkey->flag & KEYBLOCK_MISSING)) {
- currkey = currkey->next;
- continue;
- }
-
- printf("warning: had to hackishly reconstruct shape key \"%s\","
- " it may not be correct anymore.\n", currkey->name);
-
- currkey->flag &= ~KEYBLOCK_MISSING;
-
- fp = newkey = MEM_callocN(me->key->elemsize * bm->totvert, "currkey->data");
- oldkey = currkey->data;
-
- eve = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL);
-
- i = 0;
- mvert = me->mvert;
- while (eve) {
- keyi = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_SHAPE_KEYINDEX);
- if (!keyi) {
- break;
- }
- if (*keyi >= 0 && *keyi < currkey->totelem) { // valid old vertex
- if (currkey == actkey) {
- if (actkey == me->key->refkey) {
- copy_v3_v3(fp, mvert->co);
- }
- else {
- copy_v3_v3(fp, mvert->co);
- if (oldverts) {
- copy_v3_v3(mvert->co, oldverts[*keyi].co);
- }
- }
- }
- else {
- if (oldkey) {
- copy_v3_v3(fp, oldkey + 3 * *keyi);
- }
- }
- }
- else {
- copy_v3_v3(fp, mvert->co);
- }
-
- /* propagate edited basis offsets to other shapes */
- if (apply_offset) {
- add_v3_v3(fp, ofs[i]);
- }
-
- fp += 3;
- i++;
- mvert++;
- eve = BM_iter_step(&iter);
- }
- currkey->totelem = bm->totvert;
- if (currkey->data) MEM_freeN(currkey->data);
- currkey->data = newkey;
-
- currkey = currkey->next;
- }
-
- if (ofs) MEM_freeN(ofs);
- }
- if (oldverts) MEM_freeN(oldverts);
+ BM_mesh_from_bmesh(bm, me, dotess);
}
diff --git a/source/blender/bmesh/operators/bmo_mirror.c b/source/blender/bmesh/operators/bmo_mirror.c
index 30704e16a92..761222f8714 100644
--- a/source/blender/bmesh/operators/bmo_mirror.c
+++ b/source/blender/bmesh/operators/bmo_mirror.c
@@ -30,7 +30,7 @@
#include "BKE_customdata.h"
#include "bmesh.h"
-#include "bmesh_operators_private.h" /* own include */
+#include "intern/bmesh_operators_private.h" /* own include */
#define ELE_NEW 1
@@ -47,12 +47,13 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op)
float imtx[4][4];
float scale[3] = {1.0f, 1.0f, 1.0f};
float dist = BMO_slot_float_get(op, "mergedist");
- int i, ototvert, ototedge, axis = BMO_slot_int_get(op, "axis");
+ int i, ototvert /*, ototedge */;
+ int axis = BMO_slot_int_get(op, "axis");
int mirroru = BMO_slot_bool_get(op, "mirror_u");
int mirrorv = BMO_slot_bool_get(op, "mirror_v");
ototvert = bm->totvert;
- ototedge = bm->totedge;
+ /* ototedge = bm->totedge; */ /* UNUSED */
BMO_slot_mat4_get(op, "mat", mtx);
invert_m4_m4(imtx, mtx);
diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c
index 54b0805df82..48a25214b54 100644
--- a/source/blender/bmesh/operators/bmo_primitive.c
+++ b/source/blender/bmesh/operators/bmo_primitive.c
@@ -27,7 +27,7 @@
#include "ED_mesh.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
@@ -299,7 +299,7 @@ void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op)
BMO_slot_mat4_get(op, "mat", mat);
phid = 2.0f * (float)M_PI / tot;
- phi = 0.25f * (float)M_PI;
+ /* phi = 0.25f * (float)M_PI; */ /* UNUSED */
/* one segment first */
phi = 0;
diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c
index fe0801592ea..8d657e7b677 100644
--- a/source/blender/bmesh/operators/bmo_removedoubles.c
+++ b/source/blender/bmesh/operators/bmo_removedoubles.c
@@ -28,9 +28,9 @@
#include "BKE_customdata.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
-#include "bmesh_operators_private.h" /* own include */
+#include "intern/bmesh_operators_private.h" /* own include */
static void remdoubles_splitface(BMFace *f, BMesh *bm, BMOperator *op)
{
@@ -55,7 +55,7 @@ static void remdoubles_splitface(BMFace *f, BMesh *bm, BMOperator *op)
if (split && doub != v2) {
BMLoop *nl;
- BMFace *f2 = BM_face_split(bm, f, doub, v2, &nl, NULL);
+ BMFace *f2 = BM_face_split(bm, f, doub, v2, &nl, NULL, FALSE);
remdoubles_splitface(f, bm, op);
remdoubles_splitface(f2, bm, op);
diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c
index 494185be9d4..9a6d9e7b836 100644
--- a/source/blender/bmesh/operators/bmo_subdivide.c
+++ b/source/blender/bmesh/operators/bmo_subdivide.c
@@ -34,9 +34,9 @@
#include "ED_mesh.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
-#include "bmesh_operators_private.h" /* own include */
+#include "intern/bmesh_operators_private.h" /* own include */
#include "bmo_subdivide.h" /* own include */
@@ -85,7 +85,7 @@ static BMEdge *connect_smallest_face(BMesh *bm, BMVert *v1, BMVert *v2, BMFace *
}
if (curf) {
- face = BM_face_split(bm, curf, v1, v2, &nl, NULL);
+ face = BM_face_split(bm, curf, v1, v2, &nl, NULL, FALSE);
if (r_nf) *r_nf = face;
return nl ? nl->e : NULL;
@@ -954,7 +954,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
for (j = 0; j < BLI_array_count(splits) / 2; j++) {
if (splits[j * 2]) {
/* BMFace *nf = */ /* UNUSED */
- BM_face_split(bmesh, face, splits[j * 2]->v, splits[j * 2 + 1]->v, &nl, NULL);
+ BM_face_split(bmesh, face, splits[j * 2]->v, splits[j * 2 + 1]->v, &nl, NULL, FALSE);
}
}
diff --git a/source/blender/bmesh/operators/bmo_triangulate.c b/source/blender/bmesh/operators/bmo_triangulate.c
index 4b7c7c49cc5..42e43494a74 100644
--- a/source/blender/bmesh/operators/bmo_triangulate.c
+++ b/source/blender/bmesh/operators/bmo_triangulate.c
@@ -28,9 +28,9 @@
#include "BLI_smallhash.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
-#include "bmesh_operators_private.h" /* own include */
+#include "intern/bmesh_operators_private.h" /* own include */
#define EDGE_NEW 1
#define FACE_NEW 1
@@ -47,7 +47,8 @@ void bmo_triangulate_exec(BMesh *bm, BMOperator *op)
float (*projectverts)[3] = NULL;
BLI_array_declare(projectverts);
int i, lastlen = 0 /* , count = 0 */;
-
+ const int use_beauty = BMO_slot_bool_get(op, "use_beauty");
+
face = BMO_iter_new(&siter, bm, op, "faces", BM_FACE);
for ( ; face; face = BMO_iter_step(&siter)) {
if (lastlen < face->len) {
@@ -61,7 +62,7 @@ void bmo_triangulate_exec(BMesh *bm, BMOperator *op)
}
}
- BM_face_triangulate(bm, face, projectverts, EDGE_NEW, FACE_NEW, newfaces);
+ BM_face_triangulate(bm, face, projectverts, EDGE_NEW, FACE_NEW, newfaces, use_beauty);
BMO_slot_map_ptr_insert(bm, op, "facemap", face, face);
for (i = 0; newfaces[i]; i++) {
@@ -118,8 +119,8 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op)
if (is_quad_convex_v3(v1->co, v2->co, v3->co, v4->co)) {
float len1, len2, len3, len4, len5, len6, opp1, opp2, fac1, fac2;
/* testing rule:
- * the area divided by the total edge lengths
- */
+ * the area divided by the total edge lengths
+ */
len1 = len_v3v3(v1->co, v2->co);
len2 = len_v3v3(v2->co, v3->co);
len3 = len_v3v3(v3->co, v4->co);
@@ -138,7 +139,7 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op)
fac2 = opp1 / (len2 + len3 + len6) + opp2 / (len4 + len1 + len6);
if (fac1 > fac2) {
- e = BM_edge_rotate(bm, e, 0);
+ e = BM_edge_rotate(bm, e, FALSE, BM_EDGEROT_CHECK_EXISTS);
if (e) {
BMO_elem_flag_enable(bm, e, ELE_NEW);
@@ -159,7 +160,7 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
BMOIter siter;
BMEdge *e;
BMOperator bmop;
- ScanFillEdge *eed;
+ /* ScanFillEdge *eed; */ /* UNUSED */
ScanFillVert *eve, *v1, *v2;
ScanFillFace *efa;
SmallHash hash;
@@ -185,7 +186,7 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
v1 = BLI_smallhash_lookup(&hash, (uintptr_t)e->v1);
v2 = BLI_smallhash_lookup(&hash, (uintptr_t)e->v2);
- eed = BLI_addfilledge(v1, v2);
+ /* eed = */ BLI_addfilledge(v1, v2);
/* eed->tmp.p = e; */ /* UNUSED */
}
diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c
index 6605ef9439f..de82bb4f573 100644
--- a/source/blender/bmesh/operators/bmo_utils.c
+++ b/source/blender/bmesh/operators/bmo_utils.c
@@ -32,7 +32,7 @@
#include "bmesh.h"
-#include "bmesh_operators_private.h" /* own include */
+#include "intern/bmesh_operators_private.h" /* own include */
/*
* UTILS.C
@@ -124,17 +124,50 @@ void bmo_edgerotate_exec(BMesh *bm, BMOperator *op)
BMOIter siter;
BMEdge *e, *e2;
int ccw = BMO_slot_bool_get(op, "ccw");
+ int is_single = BMO_slot_buffer_count(bm, op, "edges") == 1;
+ short check_flag = is_single ?
+ BM_EDGEROT_CHECK_EXISTS :
+ BM_EDGEROT_CHECK_EXISTS | BM_EDGEROT_CHECK_DEGENERATE;
+
+#define EDGE_OUT 1
+#define FACE_TAINT 1
BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) {
- if (!(e2 = BM_edge_rotate(bm, e, ccw))) {
- BMO_error_raise(bm, op, BMERR_INVALID_SELECTION, "Could not rotate edge");
- return;
- }
+ /**
+ * this ends up being called twice, could add option to not to call check in
+ * #BM_edge_rotate to get some extra speed */
+ if (BM_edge_rotate_check(bm, e)) {
+ BMFace *fa, *fb;
+ if (BM_edge_face_pair(e, &fa, &fb)) {
+
+ /* check we're untouched */
+ if (BMO_elem_flag_test(bm, fa, FACE_TAINT) == FALSE &&
+ BMO_elem_flag_test(bm, fb, FACE_TAINT) == FALSE)
+ {
+
+ if (!(e2 = BM_edge_rotate(bm, e, ccw, check_flag))) {
+#if 0
+ BMO_error_raise(bm, op, BMERR_INVALID_SELECTION, "Could not rotate edge");
+ return;
+#endif
+ continue;
+ }
- BMO_elem_flag_enable(bm, e2, 1);
+ BMO_elem_flag_enable(bm, e2, EDGE_OUT);
+
+ /* dont touch again */
+ BMO_elem_flag_enable(bm, fa, FACE_TAINT);
+ BMO_elem_flag_enable(bm, fb, FACE_TAINT);
+ }
+ }
+ }
}
- BMO_slot_buffer_from_flag(bm, op, "edgeout", 1, BM_EDGE);
+ BMO_slot_buffer_from_flag(bm, op, "edgeout", EDGE_OUT, BM_EDGE);
+
+#undef EDGE_OUT
+#undef FACE_TAINT
+
}
#define SEL_FLAG 1
@@ -525,12 +558,12 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op)
num_total = BM_mesh_elem_count(bm, BM_FACE);
/*
- ** The first thing to do is to iterate through all the the selected items and mark them since
- ** they will be in the selection anyway.
- ** This will increase performance, (especially when the number of originaly selected faces is high)
- ** so the overall complexity will be less than $O(mn)$ where is the total number of selected faces,
- ** and n is the total number of faces
- */
+ * The first thing to do is to iterate through all the the selected items and mark them since
+ * they will be in the selection anyway.
+ * This will increase performance, (especially when the number of originaly selected faces is high)
+ * so the overall complexity will be less than $O(mn)$ where is the total number of selected faces,
+ * and n is the total number of faces
+ */
BMO_ITER(fs, &fs_iter, bm, op, "faces", BM_FACE) {
if (!BMO_elem_flag_test(bm, fs, FACE_MARK)) { /* is this really needed ? */
BMO_elem_flag_enable(bm, fs, FACE_MARK);
@@ -553,9 +586,9 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op)
}
/*
- ** Save us some computation burden: In case of perimeter/area/coplanar selection we compute
- ** only once.
- */
+ * Save us some computation burden: In case of perimeter/area/coplanar selection we compute
+ * only once.
+ */
if (type == SIMFACE_PERIMETER || type == SIMFACE_AREA || type == SIMFACE_COPLANAR || type == SIMFACE_IMAGE) {
for (i = 0; i < num_total; i++) {
switch (type) {
@@ -663,9 +696,9 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op)
BMO_slot_buffer_from_flag(bm, op, "faceout", FACE_MARK, BM_FACE);
}
-/******************************************************************************
-** Similar Edges
-**************************************************************************** */
+/**************************************************************************** *
+ * Similar Edges
+ **************************************************************************** */
#define EDGE_MARK 1
/*
@@ -867,9 +900,9 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
BMO_slot_buffer_from_flag(bm, op, "edgeout", EDGE_MARK, BM_EDGE);
}
-/******************************************************************************
-** Similar Vertices
-**************************************************************************** */
+/**************************************************************************** *
+ * Similar Vertices
+ **************************************************************************** */
#define VERT_MARK 1
typedef struct SimSel_VertExt {
@@ -983,9 +1016,9 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op)
BMO_slot_buffer_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT);
}
-/******************************************************************************
-** Cycle UVs for a face
-**************************************************************************** */
+/**************************************************************************** *
+ * Cycle UVs for a face
+ **************************************************************************** */
void bmo_face_rotateuvs_exec(BMesh *bm, BMOperator *op)
{
@@ -1050,9 +1083,9 @@ void bmo_face_rotateuvs_exec(BMesh *bm, BMOperator *op)
}
-/******************************************************************************
-** Reverse UVs for a face
-**************************************************************************** */
+/**************************************************************************** *
+ * Reverse UVs for a face
+ **************************************************************************** */
void bmo_face_reverseuvs_exec(BMesh *bm, BMOperator *op)
{
@@ -1093,9 +1126,9 @@ void bmo_face_reverseuvs_exec(BMesh *bm, BMOperator *op)
BLI_array_free(uvs);
}
-/******************************************************************************
-** Cycle colors for a face
-**************************************************************************** */
+/**************************************************************************** *
+ * Cycle colors for a face
+ **************************************************************************** */
void bmo_rotatecolors_exec(BMesh *bm, BMOperator *op)
{
@@ -1159,9 +1192,9 @@ void bmo_rotatecolors_exec(BMesh *bm, BMOperator *op)
}
}
-/******************************************************************************
-** Reverse colors for a face
-**************************************************************************** */
+/*************************************************************************** *
+ * Reverse colors for a face
+ *************************************************************************** */
void bmo_face_reversecolors_exec(BMesh *bm, BMOperator *op)
{
@@ -1201,9 +1234,9 @@ void bmo_face_reversecolors_exec(BMesh *bm, BMOperator *op)
}
-/******************************************************************************
-** shortest vertex path select
-**************************************************************************** */
+/*************************************************************************** *
+ * shortest vertex path select
+ *************************************************************************** */
typedef struct ElemNode {
BMVert *v; /* vertex */
@@ -1250,8 +1283,8 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
bm->elem_index_dirty &= ~BM_VERT;
/*
- ** we now have everything we need, start Dijkstra path finding algorithm
- */
+ * we now have everything we need, start Dijkstra path finding algorithm
+ */
/* set the distance/weight of the start vertex to 0 */
vert_list[BM_elem_index_get(sv)].weight = 0.0f;
diff --git a/source/blender/bmesh/tools/BME_bevel.c b/source/blender/bmesh/tools/BME_bevel.c
index 04cee14bf21..1bed4898166 100644
--- a/source/blender/bmesh/tools/BME_bevel.c
+++ b/source/blender/bmesh/tools/BME_bevel.c
@@ -42,7 +42,7 @@
#include "BLI_memarena.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
/* BMESH_TODO
*
@@ -544,14 +544,14 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti
se = l->next->e;
jf = NULL;
if (kl->v == kv) {
- BM_face_split(bm, kl->f, kl->prev->v, kl->next->v, &nl, kl->prev->e);
+ BM_face_split(bm, kl->f, kl->prev->v, kl->next->v, &nl, kl->prev->e, FALSE);
ke = kl->e;
/* BMESH-TODO: jfke doesn't handle customdata */
jf = bmesh_jfke(bm, kl->prev->radial_next->f, kl->f, kl->prev->e);
BM_vert_collapse_edge(bm, ke, kv, FALSE);
}
else {
- BM_face_split(bm, kl->f, kl->next->next->v, kl->v, &nl, kl->next->e);
+ BM_face_split(bm, kl->f, kl->next->next->v, kl->v, &nl, kl->next->e, FALSE);
ke = kl->e;
/* BMESH-TODO: jfke doesn't handle customdata */
jf = bmesh_jfke(bm, kl->next->radial_next->f, kl->f, kl->next->e);
@@ -590,14 +590,14 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti
se = l->e;
jf = NULL;
if (kl->v == kv) {
- BM_face_split(bm, kl->f, kl->prev->v, kl->next->v, &nl, kl->prev->e);
+ BM_face_split(bm, kl->f, kl->prev->v, kl->next->v, &nl, kl->prev->e, FALSE);
ke = kl->e;
/* BMESH-TODO: jfke doesn't handle customdata */
jf = bmesh_jfke(bm, kl->prev->radial_next->f, kl->f, kl->prev->e);
BM_vert_collapse_edge(bm, ke, kv, FALSE);
}
else {
- BM_face_split(bm, kl->f, kl->next->next->v, kl->v, &nl, kl->next->e);
+ BM_face_split(bm, kl->f, kl->next->next->v, kl->v, &nl, kl->next->e, FALSE);
ke = kl->e;
/* BMESH-TODO: jfke doesn't handle customdata */
jf = bmesh_jfke(bm, kl->next->radial_next->f, kl->f, kl->next->e);
@@ -612,7 +612,7 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti
}
if (!BMO_elem_flag_test(bm, v1, BME_BEVEL_NONMAN) || !BMO_elem_flag_test(bm, v2, BME_BEVEL_NONMAN)) {
- BM_face_split(bm, f, v2, v1, &l, e);
+ BM_face_split(bm, f, v2, v1, &l, e, FALSE);
BMO_elem_flag_enable(bm, l->e, BME_BEVEL_BEVEL);
l = l->radial_next;
}
@@ -640,7 +640,7 @@ static BMLoop *BME_bevel_vert(BMesh *bm, BMLoop *l, float value, int UNUSED(opti
l = l->next->next;
/* "cut off" this corner */
- f = BM_face_split(bm, l->f, v2, v1, NULL, l->e);
+ f = BM_face_split(bm, l->f, v2, v1, NULL, l->e, FALSE);
return l;
}
@@ -979,9 +979,9 @@ static BMesh *BME_bevel_mesh(BMesh *bm, float value, int UNUSED(res), int option
if(l->v != v) l = l->next;
if(l2->v != v) l2 = l2->next;
if(l->f->len > 3)
- BM_face_split(bm, l->f, l->next->v, l->prev->v, &l, l->e); /* clip this corner off */
+ BM_face_split(bm, l->f, l->next->v, l->prev->v, &l, l->e, FALSE); /* clip this corner off */
if(l2->f->len > 3)
- BM_face_split(bm, l2->f, l2->next->v, l2->prev->v, &l, l2->e); /* clip this corner off */
+ BM_face_split(bm, l2->f, l2->next->v, l2->prev->v, &l, l2->e, FALSE); /* clip this corner off */
curedge = bmesh_disk_edge_next(curedge, v);
} while(curedge != v->e);
BME_Bevel_Dissolve_Disk(bm, v);
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index 4bc0c18551a..11a48fd3cfd 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -410,12 +410,16 @@ void ArmatureImporter::create_armature_bones( )
std::vector<COLLADAFW::Node*>::iterator ri;
//if there is an armature created for root_joint next root_joint
for (ri = root_joints.begin(); ri != root_joints.end(); ri++) {
- if ( get_armature_for_joint(*ri) != NULL ) continue;
+ if ( get_armature_for_joint(*ri) != NULL ) continue;
//add armature object for current joint
//Object *ob_arm = add_object(scene, OB_ARMATURE);
Object *ob_arm = joint_parent_map[(*ri)->getUniqueId()];
+
+ if (!ob_arm)
+ continue;
+
//ob_arm->type = OB_ARMATURE;
ED_armature_to_edit(ob_arm);
@@ -423,24 +427,24 @@ void ArmatureImporter::create_armature_bones( )
// create unskinned bones
/*
- TODO:
- check if bones have already been created for a given joint
+ TODO:
+ check if bones have already been created for a given joint
*/
leaf_bone_length = FLT_MAX;
create_unskinned_bone(*ri, NULL, (*ri)->getChildNodes().getCount(), NULL, ob_arm);
fix_leaf_bones();
- // exit armature edit mode
+ // exit armature edit mode
- unskinned_armature_map[(*ri)->getUniqueId()] = ob_arm;
+ unskinned_armature_map[(*ri)->getUniqueId()] = ob_arm;
- ED_armature_from_edit(ob_arm);
+ ED_armature_from_edit(ob_arm);
- set_pose(ob_arm , *ri, NULL, NULL );
+ set_pose(ob_arm , *ri, NULL, NULL );
- ED_armature_edit_free(ob_arm);
- DAG_id_tag_update(&ob_arm->id, OB_RECALC_OB|OB_RECALC_DATA);
+ ED_armature_edit_free(ob_arm);
+ DAG_id_tag_update(&ob_arm->id, OB_RECALC_OB|OB_RECALC_DATA);
}
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index ebfeb0c6301..10fae7e2c1b 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -964,5 +964,6 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry* geom)
mesh_calc_normals_mapping(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL, NULL, 0, NULL, NULL);
+ convert_mfaces_to_mpolys(me);
return true;
}
diff --git a/source/blender/collada/collada_internal.cpp b/source/blender/collada/collada_internal.cpp
index 5d0e8d957b3..d7263e07eb8 100644
--- a/source/blender/collada/collada_internal.cpp
+++ b/source/blender/collada/collada_internal.cpp
@@ -111,14 +111,14 @@ void TransformBase::decompose(float mat[][4], float *loc, float eul[3], float qu
}
/**
-Translation map.
-Used to translate every COLLADA id to a valid id, no matter what "wrong" letters may be
-included. Look at the IDREF XSD declaration for more.
-Follows strictly the COLLADA XSD declaration which explicitly allows non-english chars,
-like special chars (e.g. micro sign), umlauts and so on.
-The COLLADA spec also allows additional chars for member access ('.'), these
-must obviously be removed too, otherwise they would be heavily misinterpreted.
-*/
+ * Translation map.
+ * Used to translate every COLLADA id to a valid id, no matter what "wrong" letters may be
+ * included. Look at the IDREF XSD declaration for more.
+ * Follows strictly the COLLADA XSD declaration which explicitly allows non-english chars,
+ * like special chars (e.g. micro sign), umlauts and so on.
+ * The COLLADA spec also allows additional chars for member access ('.'), these
+ * must obviously be removed too, otherwise they would be heavily misinterpreted.
+ */
const unsigned char translate_start_name_map[256] = {
95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95,
diff --git a/source/blender/editors/animation/CMakeLists.txt b/source/blender/editors/animation/CMakeLists.txt
index 0386af9776c..2549358f285 100644
--- a/source/blender/editors/animation/CMakeLists.txt
+++ b/source/blender/editors/animation/CMakeLists.txt
@@ -20,6 +20,7 @@
set(INC
../include
+ ../../blenfont
../../blenkernel
../../blenlib
../../blenloader
diff --git a/source/blender/editors/animation/SConscript b/source/blender/editors/animation/SConscript
index 3e5133c1174..120000fedc4 100644
--- a/source/blender/editors/animation/SConscript
+++ b/source/blender/editors/animation/SConscript
@@ -3,7 +3,7 @@ Import ('env')
sources = env.Glob('*.c')
-incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf'
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf ../../blenfont'
incs += ' ../../bmesh ../../windowmanager #/intern/guardedalloc #/extern/glew/include ../../blenloader'
env.BlenderLib ( 'bf_editors_animation', sources, Split(incs), [], libtype=['core'], priority=[125] )
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index d5282249dc3..bdeea9402ba 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -818,7 +818,7 @@ static int acf_group_setting_flag(bAnimContext *ac, int setting, short *neg)
return AGRP_MUTED;
case ACHANNEL_SETTING_PROTECT: /* protected */
- //*neg= 1; - if we change this to edtiability
+ // *neg= 1; - if we change this to edtiability
return AGRP_PROTECTED;
case ACHANNEL_SETTING_VISIBLE: /* visiblity - graph editor */
@@ -906,7 +906,7 @@ static int acf_fcurve_setting_flag(bAnimContext *UNUSED(ac), int setting, short
return FCURVE_MUTED;
case ACHANNEL_SETTING_PROTECT: /* protected */
- //*neg= 1; - if we change this to edtiability
+ // *neg= 1; - if we change this to edtiability
return FCURVE_PROTECTED;
case ACHANNEL_SETTING_VISIBLE: /* visiblity - graph editor */
@@ -2477,7 +2477,7 @@ static bAnimChannelType ACF_GPD =
/* GPencil Layer ------------------------------------------- */
-/* name for grase pencil layer entries */
+/* name for grease pencil layer entries */
static void acf_gpl_name(bAnimListElem *ale, char *name)
{
bGPDlayer *gpl = (bGPDlayer *)ale->data;
@@ -2528,7 +2528,7 @@ static int acf_gpl_setting_flag(bAnimContext *UNUSED(ac), int setting, short *ne
return GP_LAYER_HIDE;
case ACHANNEL_SETTING_PROTECT: /* protected */
- //*neg= 1; - if we change this to edtiability
+ // *neg= 1; - if we change this to edtiability
return GP_LAYER_LOCKED;
default: /* unsupported */
@@ -2679,8 +2679,7 @@ short ANIM_channel_setting_get (bAnimContext *ac, bAnimListElem *ale, int settin
bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
/* 1) check that the setting exists for the current context */
- if ( (acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting)) )
- {
+ if ((acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting))) {
/* 2) get pointer to check for flag in, and the flag to check for */
short negflag, ptrsize;
int flag;
@@ -2757,8 +2756,7 @@ void ANIM_channel_setting_set (bAnimContext *ac, bAnimListElem *ale, int setting
bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
/* 1) check that the setting exists for the current context */
- if ( (acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting)) )
- {
+ if ((acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting))) {
/* 2) get pointer to check for flag in, and the flag to check for */
short negflag, ptrsize;
int flag;
@@ -2910,8 +2908,7 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float
UI_DrawString(offset, ytext, name);
/* draw red underline if channel is disabled */
- if ((ale->type == ANIMTYPE_FCURVE) && (ale->flag & FCURVE_DISABLED))
- {
+ if ((ale->type == ANIMTYPE_FCURVE) && (ale->flag & FCURVE_DISABLED)) {
// FIXME: replace hardcoded color here, and check on extents!
glColor3f(1.0f, 0.0f, 0.0f);
glLineWidth(2.0);
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index 20582e40ce4..83755cbcce3 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -545,8 +545,7 @@ void ANIM_fcurve_delete_from_animdata (bAnimContext *ac, AnimData *adt, FCurve *
/* XXX: there's a problem where many actions could build up in the file if multiple
* full add/delete cycles are performed on the same objects, but assume that this is rare
*/
- if ((adt->action->curves.first == NULL) && (adt->flag & ADT_NLA_EDIT_ON)==0)
- {
+ if ((adt->action->curves.first == NULL) && (adt->flag & ADT_NLA_EDIT_ON)==0) {
id_us_min(&adt->action->id);
adt->action = NULL;
}
@@ -1989,7 +1988,7 @@ static void rename_anim_channels (bAnimContext *ac, int channel_index)
if (acf->name_prop(ale, &ptr, &prop)) {
/* actually showing the rename textfield is done on redraw,
* so here we just store the index of this channel in the
- * dopesheet data, which will get utilised when drawing the
+ * dopesheet data, which will get utilized when drawing the
* channel...
*
* +1 factor is for backwards compat issues
diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c
index 8e91e575db1..be66edb8dc9 100644
--- a/source/blender/editors/animation/anim_deps.c
+++ b/source/blender/editors/animation/anim_deps.c
@@ -81,8 +81,8 @@ void ANIM_list_elem_update(Scene *scene, bAnimListElem *ale)
if (fcu && fcu->rna_path) {
/* if we have an fcurve, call the update for the property we
- are editing, this is then expected to do the proper redraws
- and depsgraph updates */
+ * are editing, this is then expected to do the proper redraws
+ * and depsgraph updates */
PointerRNA id_ptr, ptr;
PropertyRNA *prop;
@@ -93,7 +93,7 @@ void ANIM_list_elem_update(Scene *scene, bAnimListElem *ale)
}
else {
/* in other case we do standard depsgaph update, ideally
- we'd be calling property update functions here too ... */
+ * we'd be calling property update functions here too ... */
DAG_id_tag_update(id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME); // XXX or do we want something more restrictive?
}
}
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index 714c3276769..1ef02f46000 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -367,18 +367,15 @@ void ANIM_nla_mapping_apply_fcurve (AnimData *adt, FCurve *fcu, short restore, s
float ANIM_unit_mapping_get_factor (Scene *scene, ID *id, FCurve *fcu, short restore)
{
/* sanity checks */
- if (id && fcu && fcu->rna_path)
- {
+ if (id && fcu && fcu->rna_path) {
PointerRNA ptr, id_ptr;
PropertyRNA *prop;
/* get RNA property that F-Curve affects */
RNA_id_pointer_create(id, &id_ptr);
- if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop))
- {
+ if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) {
/* rotations: radians <-> degrees? */
- if (RNA_SUBTYPE_UNIT(RNA_property_subtype(prop)) == PROP_UNIT_ROTATION)
- {
+ if (RNA_SUBTYPE_UNIT(RNA_property_subtype(prop)) == PROP_UNIT_ROTATION) {
/* if the radians flag is not set, default to using degrees which need conversions */
if ((scene) && (scene->unit.system_rotation == USER_UNIT_ROT_RADIANS) == 0) {
if (restore)
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 6d4cce0cf83..95cb7dad9a4 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -1052,8 +1052,7 @@ static size_t animfilter_act_group (bAnimContext *ac, ListBase *anim_data, bDope
* but to do this, we need to check that the group doesn't have it's not-visible flag set preventing
* all its sub-curves to be shown
*/
- if ( !(filter_mode & ANIMFILTER_CURVE_VISIBLE) || !(agrp->flag & AGRP_NOTVISIBLE) )
- {
+ if (!(filter_mode & ANIMFILTER_CURVE_VISIBLE) || !(agrp->flag & AGRP_NOTVISIBLE)) {
/* group must be editable for its children to be editable (if we care about this) */
if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) {
/* get first F-Curve which can be used here */
@@ -1243,7 +1242,7 @@ static size_t animdata_filter_shapekey (bAnimContext *ac, ListBase *anim_data, K
/* loop through the channels adding ShapeKeys as appropriate */
for (kb= key->block.first; kb; kb= kb->next) {
- /* skip the first one, since that's the non-animateable basis */
+ /* skip the first one, since that's the non-animatable basis */
// XXX maybe in future this may become handy?
if (kb == key->block.first) continue;
@@ -1299,7 +1298,7 @@ static size_t animdata_filter_gpencil_data (ListBase *anim_data, bGPdata *gpd, i
return items;
}
-/* Grab all Grase Pencil datablocks in file */
+/* Grab all Grease Pencil datablocks in file */
// TODO: should this be amalgamated with the dopesheet filtering code?
static size_t animdata_filter_gpencil (ListBase *anim_data, void *UNUSED(data), int filter_mode)
{
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 7e92c9eb690..803516e211b 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -83,10 +83,10 @@ static ListBase *context_get_markers(Scene *scene, ScrArea *sa)
/* local markers can only be shown when there's only a single active action to grab them from
* - flag only takes effect when there's an action, otherwise it can get too confusing?
*/
- if (ELEM(saction->mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY) && (saction->action))
- {
- if (saction->flag & SACTION_POSEMARKERS_SHOW)
+ if (ELEM(saction->mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY) && (saction->action)) {
+ if (saction->flag & SACTION_POSEMARKERS_SHOW) {
return &saction->action->markers;
+ }
}
}
}
@@ -597,29 +597,28 @@ static void MARKER_OT_add(wmOperatorType *ot)
/* ************************** transform markers *************************** */
-
/* operator state vars used:
- frs: delta movement
-
-functions:
-
- init() check selection, add customdata with old values and some lookups
-
- apply() do the actual movement
-
- exit() cleanup, send notifier
-
- cancel() to escape from modal
-
-callbacks:
-
- exec() calls init, apply, exit
-
- invoke() calls init, adds modal handler
-
- modal() accept modal events while doing it, ends with apply and exit, or cancel
-
-*/
+ * frs: delta movement
+ *
+ * functions:
+ *
+ * init() check selection, add customdata with old values and some lookups
+ *
+ * apply() do the actual movement
+ *
+ * exit() cleanup, send notifier
+ *
+ * cancel() to escape from modal
+ *
+ * callbacks:
+ *
+ * exec() calls init, apply, exit
+ *
+ * invoke() calls init, adds modal handler
+ *
+ * modal() accept modal events while doing it, ends with apply and exit, or cancel
+ *
+ */
typedef struct MarkerMove {
SpaceLink *slink;
@@ -752,7 +751,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
return OPERATOR_CANCELLED;
case RIGHTMOUSE:
- /* press = user manually demands transform to be cancelled */
+ /* press = user manually demands transform to be canceled */
if (evt->val == KM_PRESS) {
ed_marker_move_cancel(C, op);
return OPERATOR_CANCELLED;
@@ -852,8 +851,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
float vec[3];
char str_tx[256];
- if (handleNumInput(&mm->num, evt))
- {
+ if (handleNumInput(&mm->num, evt)) {
applyNumInput(&mm->num, vec);
outputNumInput(&mm->num, str_tx);
@@ -905,23 +903,21 @@ static void MARKER_OT_move(wmOperatorType *ot)
/* ************************** duplicate markers *************************** */
-/* operator state vars used:
- frs: delta movement
-
-functions:
-
- apply() do the actual duplicate
-
-callbacks:
-
- exec() calls apply, move_exec
-
- invoke() calls apply, move_invoke
-
- modal() uses move_modal
-
-*/
-
+/* operator state vars used:
+ * frs: delta movement
+ *
+ * functions:
+ *
+ * apply() do the actual duplicate
+ *
+ * callbacks:
+ *
+ * exec() calls apply, move_exec
+ *
+ * invoke() calls apply, move_invoke
+ *
+ * modal() uses move_modal
+ */
/* duplicate selected TimeMarkers */
static void ed_marker_duplicate_apply(bContext *C)
@@ -1125,23 +1121,23 @@ static void MARKER_OT_select(wmOperatorType *ot)
/* *************************** border select markers **************** */
/* operator state vars used: (added by default WM callbacks)
- xmin, ymin
- xmax, ymax
-
-customdata: the wmGesture pointer, with subwindow
-
-callbacks:
-
- exec() has to be filled in by user
-
- invoke() default WM function
- adds modal handler
-
- modal() default WM function
- accept modal events while doing it, calls exec(), handles ESC and border drawing
-
- poll() has to be filled in by user for context
-*/
+ * xmin, ymin
+ * xmax, ymax
+ *
+ * customdata: the wmGesture pointer, with subwindow
+ *
+ * callbacks:
+ *
+ * exec() has to be filled in by user
+ *
+ * invoke() default WM function
+ * adds modal handler
+ *
+ * modal() default WM function
+ * accept modal events while doing it, calls exec(), handles ESC and border drawing
+ *
+ * poll() has to be filled in by user for context
+ */
static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
{
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index e8f3fc28d74..6af95b35ba8 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -521,7 +521,7 @@ void ANIM_OT_driver_button_add (wmOperatorType *ot)
/* callbacks */
ot->exec= add_driver_button_exec;
- //op->poll= ??? // TODO: need to have some animateable property to do this
+ //op->poll= ??? // TODO: need to have some animatable property to do this
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 0b63a0ad752..de0af2d8f8f 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -45,6 +45,8 @@
#include "MEM_guardedalloc.h"
+#include "BLF_translation.h"
+
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
@@ -141,39 +143,50 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
/* draw polynomial order selector */
row= uiLayoutRow(layout, 0);
block= uiLayoutGetBlock(row);
- but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 10,0,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1");
+ but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 10, 0, width-30, 19,
+ &data->poly_order, 1, 100, 0, 0,
+ TIP_("'Order' of the Polynomial (for a polynomial with n terms, 'order' is n-1)"));
uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL);
/* draw controls for each coefficient and a + sign at end of row */
row= uiLayoutRow(layout, 1);
block= uiLayoutGetBlock(row);
- uiDefBut(block, LABEL, 1, "y = ", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
cp= data->coefficients;
for (i=0; (i < data->arraysize) && (cp); i++, cp++) {
+ /* To align with first line */
+ if (i)
+ uiDefBut(block, LABEL, 1, " ", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
+ else
+ uiDefBut(block, LABEL, 1, "y =", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
/* coefficient */
- uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 150, 20, cp, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient for polynomial");
+ uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 150, 20, cp, -UI_FLT_MAX, UI_FLT_MAX,
+ 10, 3, TIP_("Coefficient for polynomial"));
/* 'x' param (and '+' if necessary) */
- if (i) {
- if (i == 1)
- strcpy(xval, "x");
- else
- sprintf(xval, "x^%u", i);
- uiDefBut(block, LABEL, 1, xval, 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "Power of x");
- }
+ if (i == 0)
+ strcpy(xval, "");
+ else if (i == 1)
+ strcpy(xval, "x");
+ else
+ sprintf(xval, "x^%u", i);
+ uiDefBut(block, LABEL, 1, xval, 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, TIP_("Power of x"));
if ( (i != (data->arraysize - 1)) || ((i==0) && data->arraysize==2) ) {
- uiDefBut(block, LABEL, 1, "+", 0,0 , 30, 20, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefBut(block, LABEL, 1, "+", 0, 0, 30, 20, NULL, 0.0, 0.0, 0, 0, "");
/* next coefficient on a new row */
row= uiLayoutRow(layout, 1);
block= uiLayoutGetBlock(row);
}
+ else {
+ /* For alignement in UI! */
+ uiDefBut(block, LABEL, 1, " ", 0, 0, 30, 20, NULL, 0.0, 0.0, 0, 0, "");
+ }
}
- }
break;
+ }
case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* Factorized polynomial expression */
{
@@ -183,26 +196,34 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
/* draw polynomial order selector */
row= uiLayoutRow(layout, 0);
block= uiLayoutGetBlock(row);
- but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 0,0,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1");
+ but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 0, 0, width-30, 19,
+ &data->poly_order, 1, 100, 0, 0,
+ TIP_("'Order' of the Polynomial (for a polynomial with n terms, 'order' is n-1)"));
uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL);
/* draw controls for each pair of coefficients */
row= uiLayoutRow(layout, 1);
block= uiLayoutGetBlock(row);
- uiDefBut(block, LABEL, 1, "y=", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
cp= data->coefficients;
for (i=0; (i < data->poly_order) && (cp); i++, cp+=2) {
+ /* To align with first line */
+ if (i)
+ uiDefBut(block, LABEL, 1, " ", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
+ else
+ uiDefBut(block, LABEL, 1, "y =", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
/* opening bracket */
uiDefBut(block, LABEL, 1, "(", 0, 0, 20, 20, NULL, 0.0, 0.0, 0, 0, "");
/* coefficients */
- uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient of x");
+ uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp, -UI_FLT_MAX, UI_FLT_MAX,
+ 10, 3, TIP_("Coefficient of x"));
- uiDefBut(block, LABEL, 1, "x+", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefBut(block, LABEL, 1, "x +", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, "");
- uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp+1, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Second coefficient");
+ uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp+1, -UI_FLT_MAX, UI_FLT_MAX,
+ 10, 3, TIP_("Second coefficient"));
/* closing bracket and '+' sign */
if ( (i != (data->poly_order - 1)) || ((i==0) && data->poly_order==2) ) {
@@ -261,13 +282,13 @@ static void draw_modifier__cycles(uiLayout *layout, ID *id, FModifier *fcm, shor
/* before range */
col= uiLayoutColumn(split, 1);
- uiItemL(col, "Before:", ICON_NONE);
+ uiItemL(col, IFACE_("Before:"), ICON_NONE);
uiItemR(col, &ptr, "mode_before", 0, "", ICON_NONE);
uiItemR(col, &ptr, "cycles_before", 0, NULL, ICON_NONE);
/* after range */
col= uiLayoutColumn(split, 1);
- uiItemL(col, "After:", ICON_NONE);
+ uiItemL(col, IFACE_("After:"), ICON_NONE);
uiItemR(col, &ptr, "mode_after", 0, "", ICON_NONE);
uiItemR(col, &ptr, "cycles_after", 0, NULL, ICON_NONE);
}
@@ -479,12 +500,12 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
/* general settings */
col= uiLayoutColumn(layout, 1);
- uiItemL(col, "Envelope:", ICON_NONE);
+ uiItemL(col, IFACE_("Envelope:"), ICON_NONE);
uiItemR(col, &ptr, "reference_value", 0, NULL, ICON_NONE);
row= uiLayoutRow(col, 1);
- uiItemR(row, &ptr, "default_min", 0, "Min", ICON_NONE);
- uiItemR(row, &ptr, "default_max", 0, "Max", ICON_NONE);
+ uiItemR(row, &ptr, "default_min", 0, IFACE_("Min"), ICON_NONE);
+ uiItemR(row, &ptr, "default_max", 0, IFACE_("Max"), ICON_NONE);
/* control points header */
// TODO: move this control-point control stuff to using the new special widgets for lists
@@ -492,9 +513,10 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
row= uiLayoutRow(layout, 0);
block= uiLayoutGetBlock(row);
- uiDefBut(block, LABEL, 1, "Control Points:", 0, 0, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefBut(block, LABEL, 1, IFACE_("Control Points:"), 0, 0, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
- but= uiDefBut(block, BUT, B_FMODIFIER_REDRAW, "Add Point", 0,0,150,19, NULL, 0, 0, 0, 0, "Adds a new control-point to the envelope on the current frame");
+ but= uiDefBut(block, BUT, B_FMODIFIER_REDRAW, IFACE_("Add Point"), 0, 0, 150, 19,
+ NULL, 0, 0, 0, 0, TIP_("Add a new control-point to the envelope on the current frame"));
uiButSetFunc(but, fmod_envelope_addpoint_cb, env, NULL);
/* control points list */
@@ -504,13 +526,17 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
block= uiLayoutGetBlock(row);
uiBlockBeginAlign(block);
- but=uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Fra:", 0, 0, 90, 20, &fed->time, -MAXFRAMEF, MAXFRAMEF, 10, 1, "Frame that envelope point occurs");
+ but=uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Fra:"), 0, 0, 90, 20,
+ &fed->time, -MAXFRAMEF, MAXFRAMEF, 10, 1, TIP_("Frame that envelope point occurs"));
uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL);
- uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Min:", 0, 0, 100, 20, &fed->min, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, "Minimum bound of envelope at this point");
- uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Max:", 0, 0, 100, 20, &fed->max, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, "Maximum bound of envelope at this point");
+ uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Min:"), 0, 0, 100, 20,
+ &fed->min, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, TIP_("Minimum bound of envelope at this point"));
+ uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Max:"), 0, 0, 100, 20,
+ &fed->max, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, TIP_("Maximum bound of envelope at this point"));
- but= uiDefIconBut(block, BUT, B_FMODIFIER_REDRAW, ICON_X, 0, 0, 18, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Delete envelope control point");
+ but= uiDefIconBut(block, BUT, B_FMODIFIER_REDRAW, ICON_X, 0, 0, 18, 20,
+ NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete envelope control point"));
uiButSetFunc(but, fmod_envelope_deletepoint_cb, env, SET_INT_IN_POINTER(i));
uiBlockBeginAlign(block);
}
@@ -648,7 +674,8 @@ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifie
uiBlockSetEmboss(block, UI_EMBOSSN);
/* delete button */
- but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete F-Curve Modifier");
+ but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete F-Curve Modifier"));
uiButSetFunc(but, delete_fmodifier_cb, modifiers, fcm);
uiBlockSetEmboss(block, UI_EMBOSS);
@@ -709,14 +736,14 @@ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifie
/* second row: settings */
row = uiLayoutRow(col, 1);
- uiItemR(row, &ptr, "frame_start", 0, "Start", ICON_NONE);
- uiItemR(row, &ptr, "frame_end", 0, "End", ICON_NONE);
+ uiItemR(row, &ptr, "frame_start", 0, IFACE_("Start"), ICON_NONE);
+ uiItemR(row, &ptr, "frame_end", 0, IFACE_("End"), ICON_NONE);
/* third row: blending influence */
row = uiLayoutRow(col, 1);
- uiItemR(row, &ptr, "blend_in", 0, "In", ICON_NONE);
- uiItemR(row, &ptr, "blend_out", 0, "Out", ICON_NONE);
+ uiItemR(row, &ptr, "blend_in", 0, IFACE_("In"), ICON_NONE);
+ uiItemR(row, &ptr, "blend_out", 0, IFACE_("Out"), ICON_NONE);
}
/* influence -------------------------------------------------------------- */
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index af78fe739cc..f140c408e68 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -70,7 +70,7 @@
* which take the data they operate on, a few callbacks defining what operations to perform.
*
* As operators which work on keyframes usually apply the same operation on all BezTriples in
- * every channel, the code has been optimised providing a set of functions which will get the
+ * every channel, the code has been optimized providing a set of functions which will get the
* appropriate bezier-modify function to set. These functions (ANIM_editkeyframes_*) will need
* to be called before getting any channels.
*
@@ -136,8 +136,8 @@ short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, FCurve *fcu, KeyframeEdi
if (ked) ked->curIndex= i;
/* Exit with return-code '1' if function returns positive
- * This is useful if finding if some BezTriple satisfies a condition.
- */
+ * This is useful if finding if some BezTriple satisfies a condition.
+ */
if (key_cb(ked, bezt)) return 1;
}
}
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index 732f84bb33d..9ce148bc083 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -544,7 +544,7 @@ short copy_animedit_keys (bAnimContext *ac, ListBase *anim_data)
/* add to buffer */
newbuf= MEM_callocN(sizeof(BezTriple)*(aci->totvert+1), "copybuf beztriple");
- /* assume that since we are just resizing the array, just copy all existing data across */
+ /* assume that since we are just re-sizing the array, just copy all existing data across */
if (aci->bezt)
memcpy(newbuf, aci->bezt, sizeof(BezTriple)*(aci->totvert));
@@ -574,7 +574,7 @@ short copy_animedit_keys (bAnimContext *ac, ListBase *anim_data)
if (ELEM(NULL, animcopybuf.first, animcopybuf.last))
return -1;
- /* incase 'relative' paste method is used */
+ /* in case 'relative' paste method is used */
animcopy_cfra= CFRA;
/* everything went fine */
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 5e617979716..e82f234d2b6 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -71,6 +71,7 @@
#include "ED_screen.h"
#include "UI_interface.h"
+#include "UI_resources.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -105,8 +106,7 @@ short ANIM_get_keyframing_flags (Scene *scene, short incl_mode)
}
/* only if including settings from the autokeying mode... */
- if (incl_mode)
- {
+ if (incl_mode) {
/* keyframing mode - only replace existing keyframes */
if (IS_AUTOKEY_MODE(scene, EDITKEYS))
flag |= INSERTKEY_REPLACE;
@@ -375,7 +375,7 @@ enum {
/* This helper function determines whether a new keyframe is needed */
/* Cases where keyframes should not be added:
- * 1. Keyframe to be added bewteen two keyframes with similar values
+ * 1. Keyframe to be added between two keyframes with similar values
* 2. Keyframe to be added on frame where two keyframes are already situated
* 3. Keyframe lies at point that intersects the linear line between two keyframes
*/
@@ -1116,7 +1116,7 @@ static int insert_key_exec (bContext *C, wmOperator *op)
if (type == 0)
type= scene->active_keyingset;
if (type > 0)
- ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1);
+ ks= BLI_findlink(&scene->keyingsets, type-1);
else
ks= BLI_findlink(&builtin_keyingsets, -type-1);
@@ -1194,8 +1194,15 @@ static int insert_key_menu_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(
/* if prompting or no active Keying Set, show the menu */
if ((scene->active_keyingset == 0) || RNA_boolean_get(op->ptr, "always_prompt")) {
- /* call the menu, which will call this operator again, hence the cancelled */
- ANIM_keying_sets_menu_setup(C, op->type->name, "ANIM_OT_keyframe_insert_menu");
+ uiPopupMenu *pup;
+ uiLayout *layout;
+
+ /* call the menu, which will call this operator again, hence the canceled */
+ pup = uiPupMenuBegin(C, op->type->name, ICON_NONE);
+ layout = uiPupMenuLayout(pup);
+ uiItemsEnumO(layout, "ANIM_OT_keyframe_insert_menu", "type");
+ uiPupMenuEnd(C, pup);
+
return OPERATOR_CANCELLED;
}
else {
@@ -1265,7 +1272,7 @@ static int delete_key_exec (bContext *C, wmOperator *op)
if (type == 0)
type= scene->active_keyingset;
if (type > 0)
- ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1);
+ ks= BLI_findlink(&scene->keyingsets, type-1);
else
ks= BLI_findlink(&builtin_keyingsets, -type-1);
@@ -1449,9 +1456,9 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
else if (G.f & G_DEBUG) {
printf("ptr.data = %p, prop = %p,", (void *)ptr.data, (void *)prop);
if (prop)
- printf("animateable = %d \n", RNA_property_animateable(&ptr, prop));
+ printf("animatable = %d \n", RNA_property_animateable(&ptr, prop));
else
- printf("animateable = NULL \n");
+ printf("animatable = NULL \n");
}
if (success) {
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index 5d440bae2bc..bc066b074ea 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -127,7 +127,7 @@ static int add_default_keyingset_exec (bContext *C, wmOperator *UNUSED(op))
keyingflag = ANIM_get_keyframing_flags(scene, 0);
/* call the API func, and set the active keyingset index */
- BKE_keyingset_add(&scene->keyingsets, NULL, flag, keyingflag);
+ BKE_keyingset_add(&scene->keyingsets, NULL, NULL, flag, keyingflag);
scene->active_keyingset= BLI_countlist(&scene->keyingsets);
@@ -317,7 +317,7 @@ static int add_keyingset_button_exec (bContext *C, wmOperator *op)
keyingflag |= INSERTKEY_XYZ2RGB;
/* call the API func, and set the active keyingset index */
- ks= BKE_keyingset_add(&scene->keyingsets, "ButtonKeyingSet", flag, keyingflag);
+ ks= BKE_keyingset_add(&scene->keyingsets, "ButtonKeyingSet", "Button Keying Set", flag, keyingflag);
scene->active_keyingset= BLI_countlist(&scene->keyingsets);
}
@@ -468,22 +468,26 @@ void ANIM_OT_keyingset_button_remove (wmOperatorType *ot)
static int keyingset_active_menu_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- /* call the menu, which will call this operator again, hence the cancelled */
- ANIM_keying_sets_menu_setup(C, op->type->name, "ANIM_OT_keying_set_active_set");
+ uiPopupMenu *pup;
+ uiLayout *layout;
+
+ /* call the menu, which will call this operator again, hence the canceled */
+ pup = uiPupMenuBegin(C, op->type->name, ICON_NONE);
+ layout = uiPupMenuLayout(pup);
+ uiItemsEnumO(layout, "ANIM_OT_keying_set_active_set", "type");
+ uiPupMenuEnd(C, pup);
+
return OPERATOR_CANCELLED;
}
static int keyingset_active_menu_exec (bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- int type= RNA_int_get(op->ptr, "type");
+ Scene *scene = CTX_data_scene(C);
+ int type = RNA_enum_get(op->ptr, "type");
+
+ /* If type == 0, it will deselect any active keying set. */
+ scene->active_keyingset = type;
- /* simply set the scene's active keying set index, unless the type == 0
- * (i.e. which happens if we want the current active to be maintained)
- */
- if (type)
- scene->active_keyingset= type;
-
/* send notifiers */
WM_event_add_notifier(C, NC_SCENE|ND_KEYINGSET, NULL);
@@ -492,6 +496,8 @@ static int keyingset_active_menu_exec (bContext *C, wmOperator *op)
void ANIM_OT_keying_set_active_set (wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
ot->name= "Set Active Keying Set";
ot->idname= "ANIM_OT_keying_set_active_set";
@@ -504,10 +510,10 @@ void ANIM_OT_keying_set_active_set (wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- /* keyingset to use
- * - here the type is int not enum, since many of the indices here are determined dynamically
- */
- RNA_def_int(ot->srna, "type", 0, INT_MIN, INT_MAX, "Keying Set Number", "Index (determined internally) of the Keying Set to use", 0, 1);
+ /* keyingset to use (dynamic enum) */
+ prop= RNA_def_enum(ot->srna, "type", DummyRNA_DEFAULT_items, 0, "Keying Set", "The Keying Set to use");
+ RNA_def_enum_funcs(prop, ANIM_keying_sets_enum_itemf);
+/* RNA_def_property_flag(prop, PROP_HIDDEN);*/
}
/* ******************************************* */
@@ -546,10 +552,10 @@ KeyingSet *ANIM_builtin_keyingset_get_named (KeyingSet *prevKS, const char name[
first= prevKS->next;
else
first= builtin_keyingsets.first;
-
+
/* loop over KeyingSets checking names */
for (ks= first; ks; ks= ks->next) {
- if (strcmp(name, ks->name) == 0)
+ if (strcmp(name, ks->idname) == 0)
return ks;
}
@@ -572,11 +578,14 @@ void ANIM_keyingset_info_register (KeyingSetInfo *ksi)
/* create a new KeyingSet
* - inherit name and keyframing settings from the typeinfo
*/
- ks = BKE_keyingset_add(&builtin_keyingsets, ksi->name, 1, ksi->keyingflag);
+ ks = BKE_keyingset_add(&builtin_keyingsets, ksi->idname, ksi->name, 1, ksi->keyingflag);
/* link this KeyingSet with its typeinfo */
memcpy(&ks->typeinfo, ksi->idname, sizeof(ks->typeinfo));
+ /* Copy description... */
+ BLI_strncpy(ks->description, ksi->description, sizeof(ks->description));
+
/* add type-info to the list */
BLI_addtail(&keyingset_type_infos, ksi);
}
@@ -717,23 +726,26 @@ EnumPropertyItem *ANIM_keying_sets_enum_itemf (bContext *C, PointerRNA *UNUSED(p
*/
if (scene->active_keyingset) {
/* active Keying Set */
- item_tmp.identifier= item_tmp.name= "Active Keying Set";
- item_tmp.value= i++;
+ item_tmp.identifier= "__ACTIVE__";
+ item_tmp.name= "Active Keying Set";
+ item_tmp.value= i;
RNA_enum_item_add(&item, &totitem, &item_tmp);
/* separator */
RNA_enum_item_add_separator(&item, &totitem);
}
- else
- i++;
-
+
+ i++;
+
/* user-defined Keying Sets
* - these are listed in the order in which they were defined for the active scene
*/
if (scene->keyingsets.first) {
for (ks= scene->keyingsets.first; ks; ks= ks->next, i++) {
if (ANIM_keyingset_context_ok_poll(C, ks)) {
- item_tmp.identifier= item_tmp.name= ks->name;
+ item_tmp.identifier = ks->idname;
+ item_tmp.name = ks->name;
+ item_tmp.description = ks->description;
item_tmp.value= i;
RNA_enum_item_add(&item, &totitem, &item_tmp);
}
@@ -748,7 +760,9 @@ EnumPropertyItem *ANIM_keying_sets_enum_itemf (bContext *C, PointerRNA *UNUSED(p
for (ks= builtin_keyingsets.first; ks; ks= ks->next, i--) {
/* only show KeyingSet if context is suitable */
if (ANIM_keyingset_context_ok_poll(C, ks)) {
- item_tmp.identifier= item_tmp.name= ks->name;
+ item_tmp.identifier = ks->idname;
+ item_tmp.name = ks->name;
+ item_tmp.description = ks->description;
item_tmp.value= i;
RNA_enum_item_add(&item, &totitem, &item_tmp);
}
@@ -760,50 +774,6 @@ EnumPropertyItem *ANIM_keying_sets_enum_itemf (bContext *C, PointerRNA *UNUSED(p
return item;
}
-/* Create (and show) a menu containing all the Keying Sets which can be used in the current context */
-void ANIM_keying_sets_menu_setup (bContext *C, const char title[], const char op_name[])
-{
- Scene *scene= CTX_data_scene(C);
- KeyingSet *ks;
- uiPopupMenu *pup;
- uiLayout *layout;
- int i = 0;
-
- pup= uiPupMenuBegin(C, title, ICON_NONE);
- layout= uiPupMenuLayout(pup);
-
- /* active Keying Set
- * - only include entry if it exists
- */
- if (scene->active_keyingset) {
- uiItemEnumO(layout, op_name, "Active Keying Set", ICON_NONE, "type", i++);
- uiItemS(layout);
- }
- else
- i++;
-
- /* user-defined Keying Sets
- * - these are listed in the order in which they were defined for the active scene
- */
- if (scene->keyingsets.first) {
- for (ks= scene->keyingsets.first; ks; ks=ks->next, i++) {
- if (ANIM_keyingset_context_ok_poll(C, ks))
- uiItemEnumO(layout, op_name, ks->name, ICON_NONE, "type", i);
- }
- uiItemS(layout);
- }
-
- /* builtin Keying Sets */
- i= -1;
- for (ks= builtin_keyingsets.first; ks; ks=ks->next, i--) {
- /* only show KeyingSet if context is suitable */
- if (ANIM_keyingset_context_ok_poll(C, ks))
- uiItemEnumO(layout, op_name, ks->name, ICON_NONE, "type", i);
- }
-
- uiPupMenuEnd(C, pup);
-}
-
/* ******************************************* */
/* KEYFRAME MODIFICATION */
diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c
index 7379a278d01..ad52f4e61cb 100644
--- a/source/blender/editors/armature/armature_ops.c
+++ b/source/blender/editors/armature/armature_ops.c
@@ -301,7 +301,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
keymap->poll= ED_operator_posemode;
/* set parent and add object are object-based operators, but we make them
- available here because it's useful to do in pose mode too */
+ * available here because it's useful to do in pose mode too */
WM_keymap_add_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_menu(keymap, "INFO_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 27a18980b34..2a9436fdb41 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -179,7 +179,7 @@ EditBone *ED_armature_bone_get_mirrored(ListBase *edbo, EditBone *ebo)
}
/* helper function for tools to work on mirrored parts.
- it leaves mirrored bones selected then too, which is a good indication of what happened */
+ * it leaves mirrored bones selected then too, which is a good indication of what happened */
static void armature_select_mirrored(bArmature *arm)
{
/* Select mirrored bones */
@@ -284,7 +284,7 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, EditBone *parent, Bone
eBone->flag &= ~BONE_ROOTSEL;
}
- /* probably not selected but just incase */
+ /* probably not selected but just in case */
eBone->flag &= ~BONE_TIPSEL;
}
}
@@ -438,8 +438,8 @@ void ED_armature_from_edit(Object *obedit)
newBone->prop= IDP_CopyProperty(eBone->prop);
}
- /* Fix parenting in a separate pass to ensure ebone->bone connections
- are valid at this point */
+ /* Fix parenting in a separate pass to ensure ebone->bone connections
+ * are valid at this point */
for (eBone=arm->edbo->first;eBone;eBone=eBone->next) {
newBone= (Bone *)eBone->temp;
if (eBone->parent) {
@@ -1770,8 +1770,8 @@ void ED_armature_deselect_all(Object *obedit, int toggle)
int sel=1;
if(toggle==1) {
- /* Determine if there are any selected bones
- And therefore whether we are selecting or deselecting */
+ /* Determine if there are any selected bones
+ * and therefore whether we are selecting or deselecting */
for (eBone=arm->edbo->first;eBone;eBone=eBone->next){
// if(arm->layer & eBone->layer) {
if (eBone->flag & (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL)){
@@ -1858,7 +1858,7 @@ int mouse_armature(bContext *C, const int mval[2], int extend)
ED_armature_deselect_all(obedit, 0);
/* by definition the non-root connected bones have no root point drawn,
- so a root selection needs to be delivered to the parent tip */
+ * so a root selection needs to be delivered to the parent tip */
if(selmask & BONE_SELECTED) {
if(nearBone->parent && (nearBone->flag & BONE_CONNECTED)) {
@@ -2375,7 +2375,7 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *UNUSED(op))
static int armature_click_extrude_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
/* TODO most of this code is copied from set3dcursor_invoke,
- it would be better to reuse code in set3dcursor_invoke */
+ * it would be better to reuse code in set3dcursor_invoke */
/* temporarily change 3d cursor position */
Scene *scene;
@@ -2533,8 +2533,7 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase
curBone->temp = eBone;
eBone->temp = curBone;
- if (name != NULL)
- {
+ if (name != NULL) {
BLI_strncpy(eBone->name, name, sizeof(eBone->name));
}
@@ -3605,7 +3604,7 @@ void ARMATURE_OT_subdivide(wmOperatorType *ot)
/* Switch Direction operator:
* Currently, this does not use context loops, as context loops do not make it
- * easy to retrieve any hierarchial/chain relationships which are necessary for
+ * easy to retrieve any hierarchical/chain relationships which are necessary for
* this to be done easily.
*/
@@ -3783,10 +3782,10 @@ static int armature_parent_set_exec(bContext *C, wmOperator *op)
else if (arm->flag & ARM_MIRROR_EDIT) {
/* For X-Axis Mirror Editing option, we may need a mirror copy of actbone
* - if there's a mirrored copy of selbone, try to find a mirrored copy of actbone
- * (i.e. selbone="child.L" and actbone="parent.L", find "child.R" and "parent.R").
- * This is useful for arm-chains, for example parenting lower arm to upper arm
+ * (i.e. selbone="child.L" and actbone="parent.L", find "child.R" and "parent.R").
+ * This is useful for arm-chains, for example parenting lower arm to upper arm
* - if there's no mirrored copy of actbone (i.e. actbone = "parent.C" or "parent")
- * then just use actbone. Useful when doing upper arm to spine.
+ * then just use actbone. Useful when doing upper arm to spine.
*/
actmirb= ED_armature_bone_get_mirrored(arm->edbo, actbone);
if (actmirb == NULL)
@@ -3812,7 +3811,7 @@ static int armature_parent_set_exec(bContext *C, wmOperator *op)
* - the context iterator contains both selected bones and their mirrored copies,
* so we assume that unselected bones are mirrored copies of some selected bone
* - since the active one (and/or its mirror) will also be selected, we also need
- * to check that we are not trying to opearate on them, since such an operation
+ * to check that we are not trying to operate on them, since such an operation
* would cause errors
*/
@@ -3972,8 +3971,8 @@ static int armature_de_select_all_exec(bContext *C, wmOperator *op)
if (action == SEL_TOGGLE) {
action = SEL_SELECT;
- /* Determine if there are any selected bones
- And therefore whether we are selecting or deselecting */
+ /* Determine if there are any selected bones
+ * And therefore whether we are selecting or deselecting */
if (CTX_DATA_COUNT(C, selected_bones) > 0)
action = SEL_DESELECT;
}
@@ -4158,8 +4157,8 @@ static void bone_align_to_bone(ListBase *edbo, EditBone *selbone, EditBone *actb
selbone->roll = actbone->roll;
/* if the bone being aligned has connected descendants they must be moved
- according to their parent new position, otherwise they would be left
- in an unconsistent state: connected but away from the parent*/
+ * according to their parent new position, otherwise they would be left
+ * in an inconsistent state: connected but away from the parent*/
fix_editbone_connected_children(edbo, selbone);
return;
}
@@ -4179,10 +4178,10 @@ static int armature_align_bones_exec(bContext *C, wmOperator *op)
else if (arm->flag & ARM_MIRROR_EDIT) {
/* For X-Axis Mirror Editing option, we may need a mirror copy of actbone
* - if there's a mirrored copy of selbone, try to find a mirrored copy of actbone
- * (i.e. selbone="child.L" and actbone="parent.L", find "child.R" and "parent.R").
- * This is useful for arm-chains, for example parenting lower arm to upper arm
+ * (i.e. selbone="child.L" and actbone="parent.L", find "child.R" and "parent.R").
+ * This is useful for arm-chains, for example parenting lower arm to upper arm
* - if there's no mirrored copy of actbone (i.e. actbone = "parent.C" or "parent")
- * then just use actbone. Useful when doing upper arm to spine.
+ * then just use actbone. Useful when doing upper arm to spine.
*/
actmirb= ED_armature_bone_get_mirrored(arm->edbo, actbone);
if (actmirb == NULL)
@@ -4208,8 +4207,8 @@ static int armature_align_bones_exec(bContext *C, wmOperator *op)
* - the context iterator contains both selected bones and their mirrored copies,
* so we assume that unselected bones are mirrored copies of some selected bone
* - since the active one (and/or its mirror) will also be selected, we also need
- * to check that we are not trying to opearate on them, since such an operation
- * would cause errors
+ * to check that we are not trying to operate on them, since such an operation
+ * would cause errors
*/
/* align selected bones to the active one */
@@ -4254,11 +4253,11 @@ static int bone_looper(Object *ob, Bone *bone, void *data,
int (*bone_func)(Object *, Bone *, void *))
{
/* We want to apply the function bone_func to every bone
- * in an armature -- feed bone_looper the first bone and
- * a pointer to the bone_func and watch it go!. The int count
- * can be useful for counting bones with a certain property
- * (e.g. skinnable)
- */
+ * in an armature -- feed bone_looper the first bone and
+ * a pointer to the bone_func and watch it go!. The int count
+ * can be useful for counting bones with a certain property
+ * (e.g. skinnable)
+ */
int count = 0;
if (bone) {
@@ -4269,8 +4268,8 @@ static int bone_looper(Object *ob, Bone *bone, void *data,
count += bone_looper(ob, bone->childbase.first, data, bone_func);
/* try to execute bone_func for the next bone at this
- * depth of the recursion.
- */
+ * depth of the recursion.
+ */
count += bone_looper(ob, bone->next, data, bone_func);
}
@@ -4342,10 +4341,10 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor
}
/* test==0: deselect all
- test==1: swap select (apply to all the opposite of current situation)
- test==2: only clear active tag
- test==3: swap select (no test / inverse selection status of all independently)
-*/
+ * test==1: swap select (apply to all the opposite of current situation)
+ * test==2: only clear active tag
+ * test==3: swap select (no test / inverse selection status of all independently)
+ */
void ED_pose_deselectall (Object *ob, int test)
{
bArmature *arm= ob->data;
@@ -4437,9 +4436,9 @@ static int bone_skinnable_cb(Object *ob, Bone *bone, void *datap)
static int vgroup_add_unique_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr))
{
/* This group creates a vertex group to ob that has the
- * same name as bone (provided the bone is skinnable).
+ * same name as bone (provided the bone is skinnable).
* If such a vertex group aleady exist the routine exits.
- */
+ */
if (!(bone->flag & BONE_NO_DEFORM)) {
if (!defgroup_find_name(ob,bone->name)) {
ED_vgroup_add_name(ob, bone->name);
@@ -4688,7 +4687,7 @@ static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob,
}
else if (modifiers_findByType(ob, eModifierType_Subsurf)) {
/* is subsurf on? Lets use the verts on the limit surface then.
- * = same amount of vertices as mesh, but vertices moved to the
+ * = same amount of vertices as mesh, but vertices moved to the
* subsurfed position, like for 'optimal'. */
subsurf_calculate_limit_positions(mesh, verts);
vertsfilled = 1;
@@ -4738,7 +4737,7 @@ void create_vgroups_from_armature(ReportList *reports, Scene *scene, Object *ob,
if(mode == ARM_GROUPS_NAME) {
/* Traverse the bone list, trying to create empty vertex
- * groups cooresponding to the bone.
+ * groups corresponding to the bone.
*/
bone_looper(ob, arm->bonebase.first, NULL, vgroup_add_unique_bone_cb);
@@ -5557,8 +5556,7 @@ void transform_armature_mirror_update(Object *obedit)
eboflip->roll= -ebo->roll;
/* Also move connected parent, in case parent's name isn't mirrored properly */
- if (eboflip->parent && eboflip->flag & BONE_CONNECTED)
- {
+ if (eboflip->parent && eboflip->flag & BONE_CONNECTED) {
EditBone *parent = eboflip->parent;
copy_v3_v3(parent->tail, eboflip->head);
parent->rad_tail = ebo->rad_head;
@@ -5589,8 +5587,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode
bArmature *arm= obedit->data;
EditBone *lastBone = NULL;
- if (scene->toolsettings->skgen_options & SKGEN_CUT_ANGLE)
- {
+ if (scene->toolsettings->skgen_options & SKGEN_CUT_ANGLE) {
ReebArcIterator arc_iter;
BArcIterator *iter = (BArcIterator*)&arc_iter;
float *previous = NULL, *current = NULL;
@@ -5624,8 +5621,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode
len1 = normalize_v3(vec1);
len2 = normalize_v3(vec2);
- if (len1 > 0.0f && len2 > 0.0f && dot_v3v3(vec1, vec2) < angleLimit)
- {
+ if (len1 > 0.0f && len2 > 0.0f && dot_v3v3(vec1, vec2) < angleLimit) {
copy_v3_v3(parent->tail, previous);
child = ED_armature_edit_bone_add(arm, "Bone");
@@ -5641,8 +5637,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode
/* If the bone wasn't subdivided, delete it and return NULL
* to let subsequent subdivision methods do their thing.
* */
- if (parent == root)
- {
+ if (parent == root) {
if(parent==arm->act_edbone) arm->act_edbone= NULL;
ED_armature_edit_bone_remove(arm, parent);
parent = NULL;
@@ -5658,8 +5653,7 @@ EditBone * test_subdivideByCorrelation(Scene *scene, Object *obedit, ReebArc *ar
{
EditBone *lastBone = NULL;
- if (scene->toolsettings->skgen_options & SKGEN_CUT_CORRELATION)
- {
+ if (scene->toolsettings->skgen_options & SKGEN_CUT_CORRELATION) {
float invmat[4][4]= MAT4_UNITY;
float tmat[3][3]= MAT3_UNITY;
ReebArcIterator arc_iter;
@@ -5682,19 +5676,16 @@ float arcLengthRatio(ReebArc *arc)
arcLength = len_v3v3(arc->head->p, arc->tail->p);
- if (arc->bcount > 0)
- {
+ if (arc->bcount > 0) {
/* Add the embedding */
- for ( i = 1; i < arc->bcount; i++)
- {
+ for ( i = 1; i < arc->bcount; i++) {
embedLength += len_v3v3(arc->buckets[i - 1].p, arc->buckets[i].p);
}
/* Add head and tail -> embedding vectors */
embedLength += len_v3v3(arc->head->p, arc->buckets[0].p);
embedLength += len_v3v3(arc->tail->p, arc->buckets[arc->bcount - 1].p);
}
- else
- {
+ else {
embedLength = arcLength;
}
@@ -5734,8 +5725,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
src = scene->basact->object;
- if (obedit != NULL)
- {
+ if (obedit != NULL) {
ED_armature_from_edit(obedit);
ED_armature_edit_free(obedit);
}
@@ -5772,32 +5762,28 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
* Finally, the arc direction is stored in its flag: 1 (low -> high), -1 (high -> low)
*/
- /* if arc is a symmetry axis, internal bones go up the tree */
- if (arc->symmetry_level == 1 && arc->tail->degree != 1)
- {
+ /* if arc is a symmetry axis, internal bones go up the tree */
+ if (arc->symmetry_level == 1 && arc->tail->degree != 1) {
head = arc->tail;
tail = arc->head;
arc->flag = -1; /* mark arc direction */
}
/* Bones point AWAY from the symmetry axis */
- else if (arc->head->symmetry_level == 1)
- {
+ else if (arc->head->symmetry_level == 1) {
head = arc->head;
tail = arc->tail;
arc->flag = 1; /* mark arc direction */
}
- else if (arc->tail->symmetry_level == 1)
- {
+ else if (arc->tail->symmetry_level == 1) {
head = arc->tail;
tail = arc->head;
arc->flag = -1; /* mark arc direction */
}
/* otherwise, always go from low weight to high weight */
- else
- {
+ else {
head = arc->head;
tail = arc->tail;
@@ -5805,10 +5791,8 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
}
/* Loop over subdivision methods */
- for (i = 0; lastBone == NULL && i < SKGEN_SUB_TOTAL; i++)
- {
- switch(scene->toolsettings->skgen_subdivisions[i])
- {
+ for (i = 0; lastBone == NULL && i < SKGEN_SUB_TOTAL; i++) {
+ switch(scene->toolsettings->skgen_subdivisions[i]) {
case SKGEN_SUB_LENGTH:
lastBone = test_subdivideByLength(scene, obedit, arc, head, tail);
break;
@@ -5821,8 +5805,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
}
}
- if (lastBone == NULL)
- {
+ if (lastBone == NULL) {
EditBone *bone;
bone = ED_armature_edit_bone_add(obedit->data, "Bone");
bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
@@ -5843,20 +5826,18 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
ReebArc *incomingArc = NULL;
int i;
- for (i = 0; i < node->degree; i++)
- {
+ for (i = 0; i < node->degree; i++) {
arc = (ReebArc*)node->arcs[i];
/* if arc is incoming into the node */
- if ((arc->head == node && arc->flag == -1) || (arc->tail == node && arc->flag == 1))
+ if ((arc->head == node && arc->flag == -1) ||
+ (arc->tail == node && arc->flag == 1))
{
- if (incomingArc == NULL)
- {
+ if (incomingArc == NULL) {
incomingArc = arc;
/* loop further to make sure there's only one incoming arc */
}
- else
- {
+ else {
/* skip this node if more than one incomingArc */
incomingArc = NULL;
break; /* No need to look further, we are skipping already */
@@ -5864,8 +5845,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
}
}
- if (incomingArc != NULL)
- {
+ if (incomingArc != NULL) {
EditBone *parentBone = BLI_ghash_lookup(arcBoneMap, incomingArc);
/* Look for outgoing arcs and parent their bones */
@@ -5874,8 +5854,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
arc = node->arcs[i];
/* if arc is outgoing from the node */
- if ((arc->head == node && arc->flag == 1) || (arc->tail == node && arc->flag == -1))
- {
+ if ((arc->head == node && arc->flag == 1) || (arc->tail == node && arc->flag == -1)) {
EditBone *childBone = BLI_ghash_lookup(arcBoneMap, arc);
/* find the root bone */
diff --git a/source/blender/editors/armature/editarmature_generate.c b/source/blender/editors/armature/editarmature_generate.c
index 3d020067700..37d095221c9 100644
--- a/source/blender/editors/armature/editarmature_generate.c
+++ b/source/blender/editors/armature/editarmature_generate.c
@@ -161,9 +161,8 @@ int nextFixedSubdivision(ToolSettings *toolsettings, BArcIterator *iter, int sta
current_length += len_v3v3(v1, v2);
- if (current_length >= length_threshold)
- {
- VECCOPY(p, v2);
+ if (current_length >= length_threshold) {
+ copy_v3_v3(p, v2);
return i;
}
@@ -190,10 +189,9 @@ int nextAdaptativeSubdivision(ToolSettings *toolsettings, BArcIterator *iter, in
IT_peek(iter, i);
sub_v3_v3v3(n, iter->p, head);
- if (calcArcCorrelation(iter, start, i, start_p, n) < correlation_threshold)
- {
+ if (calcArcCorrelation(iter, start, i, start_p, n) < correlation_threshold) {
IT_peek(iter, i - 1);
- VECCOPY(p, iter->p);
+ copy_v3_v3(p, iter->p);
return i - 1;
}
}
@@ -240,25 +238,22 @@ int nextLengthSubdivision(ToolSettings *toolsettings, BArcIterator *iter, int st
//printf("a %f, b %f, c %f, f %f\n", a, b, c, f);
- if (isnan(f) == 0 && f < 1.0f)
- {
- VECCOPY(p, dv);
+ if (isnan(f) == 0 && f < 1.0f) {
+ copy_v3_v3(p, dv);
mul_v3_fl(p, f);
add_v3_v3(p, vec0);
}
- else
- {
- VECCOPY(p, vec1);
+ else {
+ copy_v3_v3(p, vec1);
}
}
- else
- {
+ else {
float dv[3];
sub_v3_v3v3(dv, vec1, vec0);
normalize_v3(dv);
- VECCOPY(p, dv);
+ copy_v3_v3(p, dv);
mul_v3_fl(p, lengthLimit);
add_v3_v3(p, head);
}
@@ -289,7 +284,7 @@ EditBone * subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase *
IT_head(iter);
parent = ED_armature_edit_bone_add(arm, "Bone");
- VECCOPY(parent->head, iter->p);
+ copy_v3_v3(parent->head, iter->p);
if (iter->size > 0)
{
@@ -304,7 +299,7 @@ EditBone * subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase *
IT_peek(iter, index);
child = ED_armature_edit_bone_add(arm, "Bone");
- VECCOPY(child->head, parent->tail);
+ copy_v3_v3(child->head, parent->tail);
child->parent = parent;
child->flag |= BONE_CONNECTED;
@@ -329,9 +324,8 @@ EditBone * subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase *
iter->tail(iter);
- VECCOPY(parent->tail, iter->p);
- if (iter->size > 0)
- {
+ copy_v3_v3(parent->tail, iter->p);
+ if (iter->size > 0) {
parent->rad_tail = iter->size * size_buffer;
}
diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c
index f1ea39e45b9..375184d3229 100644
--- a/source/blender/editors/armature/editarmature_retarget.c
+++ b/source/blender/editors/armature/editarmature_retarget.c
@@ -2901,12 +2901,10 @@ void BIF_retargetArc(bContext *C, ReebArc *earc, RigGraph *template_rigg)
char *num_string = scene->toolsettings->skgen_num_string;
int free_template = 0;
- if (template_rigg)
- {
- ob = template_rigg->ob;
+ if (template_rigg) {
+ ob = template_rigg->ob;
}
- else
- {
+ else {
free_template = 1;
ob = obedit;
template_rigg = armatureSelectedToGraph(C, ob, ob->data);
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index a592e727988..eb707119263 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -129,12 +129,12 @@ struct LaplacianSystem {
/* Laplacian matrix construction */
/* Computation of these weights for the laplacian is based on:
- "Discrete Differential-Geometry Operators for Triangulated 2-Manifolds",
- Meyer et al, 2002. Section 3.5, formula (8).
-
- We do it a bit different by going over faces instead of going over each
- vertex and adjacent faces, since we don't store this adjacency. Also, the
- formulas are tweaked a bit to work for non-manifold meshes. */
+ * "Discrete Differential-Geometry Operators for Triangulated 2-Manifolds",
+ * Meyer et al, 2002. Section 3.5, formula (8).
+ *
+ * We do it a bit different by going over faces instead of going over each
+ * vertex and adjacent faces, since we don't store this adjacency. Also, the
+ * formulas are tweaked a bit to work for non-manifold meshes. */
static void laplacian_increase_edge_count(EdgeHash *edgehash, int v1, int v2)
{
@@ -217,7 +217,7 @@ static void laplacian_triangle_weights(LaplacianSystem *sys, int f, int i1, int
v3= sys->verts[i3];
/* instead of *0.5 we divided by the number of faces of the edge, it still
- needs to be verified that this is indeed the correct thing to do! */
+ * needs to be verified that this is indeed the correct thing to do! */
t1= cotan_weight(v1, v2, v3)/laplacian_edge_count(sys->edgehash, i2, i3);
t2= cotan_weight(v2, v3, v1)/laplacian_edge_count(sys->edgehash, i3, i1);
t3= cotan_weight(v3, v1, v2)/laplacian_edge_count(sys->edgehash, i1, i2);
@@ -391,7 +391,7 @@ float laplacian_system_get_solution(int v)
/************************* Heat Bone Weighting ******************************/
/* From "Automatic Rigging and Animation of 3D Characters"
- Ilya Baran and Jovan Popovic, SIGGRAPH 2007 */
+ * Ilya Baran and Jovan Popovic, SIGGRAPH 2007 */
#define C_WEIGHT 1.0f
#define WEIGHT_LIMIT_START 0.05f
@@ -827,13 +827,13 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
#ifdef RIGID_DEFORM
/********************** As-Rigid-As-Possible Deformation ******************/
/* From "As-Rigid-As-Possible Surface Modeling",
- Olga Sorkine and Marc Alexa, ESGP 2007. */
+ * Olga Sorkine and Marc Alexa, ESGP 2007. */
/* investigate:
- - transpose R in orthogonal
- - flipped normals and per face adding
- - move cancelling to transform, make origco pointer
-*/
+ * - transpose R in orthogonal
+ * - flipped normals and per face adding
+ * - move canceling to transform, make origco pointer
+ */
static LaplacianSystem *RigidDeformSystem = NULL;
@@ -1052,8 +1052,8 @@ void rigid_deform_end(int cancel)
/************************** Harmonic Coordinates ****************************/
/* From "Harmonic Coordinates for Character Articulation",
- Pushkar Joshi, Mark Meyer, Tony DeRose, Brian Green and Tom Sanocki,
- SIGGRAPH 2007. */
+ * Pushkar Joshi, Mark Meyer, Tony DeRose, Brian Green and Tom Sanocki,
+ * SIGGRAPH 2007. */
#define EPSILON 0.0001f
diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c
index 8698ac00913..adabf7405d6 100644
--- a/source/blender/editors/armature/poseSlide.c
+++ b/source/blender/editors/armature/poseSlide.c
@@ -239,7 +239,7 @@ static void pose_slide_apply_val (tPoseSlideOp *pso, FCurve *fcu, float *val)
switch (pso->mode) {
case POSESLIDE_PUSH: /* make the current pose more pronounced */
{
- /* perform a weighted average here, favouring the middle pose
+ /* perform a weighted average here, favoring the middle pose
* - numerator should be larger than denominator to 'expand' the result
* - perform this weighting a number of times given by the percentage...
*/
@@ -253,7 +253,7 @@ static void pose_slide_apply_val (tPoseSlideOp *pso, FCurve *fcu, float *val)
case POSESLIDE_RELAX: /* make the current pose more like its surrounding ones */
{
- /* perform a weighted average here, favouring the middle pose
+ /* perform a weighted average here, favoring the middle pose
* - numerator should be smaller than denominator to 'relax' the result
* - perform this weighting a number of times given by the percentage...
*/
@@ -660,14 +660,14 @@ static int pose_slide_modal (bContext *C, wmOperator *op, wmEvent *evt)
/* clean up temp data */
pose_slide_exit(op);
- /* cancelled! */
+ /* canceled! */
return OPERATOR_CANCELLED;
}
case MOUSEMOVE: /* calculate new position */
{
/* calculate percentage based on position of mouse (we only use x-axis for now.
- * since this is more conveninent for users to do), and store new percentage value
+ * since this is more convenient for users to do), and store new percentage value
*/
pso->percentage= (evt->x - pso->ar->winrct.xmin) / ((float)pso->ar->winx);
RNA_float_set(op->ptr, "percentage", pso->percentage);
@@ -939,7 +939,7 @@ static float pose_propagate_get_boneHoldEndFrame (Object *ob, tPChanFCurveLink *
LinkData *ld;
float endFrame = startFrame;
- /* set up optimised data-structures for searching for relevant keyframes + holds */
+ /* set up optimized data-structures for searching for relevant keyframes + holds */
BLI_dlrbTree_init(&keys);
BLI_dlrbTree_init(&blocks);
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index cd3017c0e0f..ef01b895f38 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -1473,7 +1473,7 @@ static void poselib_preview_cleanup (bContext *C, wmOperator *op)
/* this signal does one recalc on pose, then unlocks, so ESC or edit will work */
pose->flag |= POSE_DO_UNLOCK;
- /* clear pose if cancelled */
+ /* clear pose if canceled */
if (pld->state == PL_PREVIEW_CANCEL) {
poselib_backup_restore(pld);
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 0d1a7c7173b..282519896c7 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -755,7 +755,7 @@ static void pose_copy_menu(Scene *scene)
pchanact= pchan;
arm= ob->data;
- /* if proxy-protected bones selected, some things (such as locks + displays) shouldn't be changable,
+ /* if proxy-protected bones selected, some things (such as locks + displays) shouldn't be changeable,
* but for constraints (just add local constraints)
*/
if (pose_has_protected_selected(ob, 0)) {
diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c
index 3c84ee65ac7..97113109981 100644
--- a/source/blender/editors/armature/reeb.c
+++ b/source/blender/editors/armature/reeb.c
@@ -247,7 +247,7 @@ static ReebNode * addNode(ReebGraph *rg, EditVert *eve)
node->degree = 0;
node->weight = weight;
node->index = rg->totnodes;
- VECCOPY(node->p, eve->co);
+ copy_v3_v3(node->p, eve->co);
BLI_addtail(&rg->nodes, node);
rg->totnodes++;
@@ -487,11 +487,11 @@ void repositionNodes(ReebGraph *rg)
{
float p[3];
- VECCOPY(p, ((ReebArc*)arc)->buckets[0].p);
+ copy_v3_v3(p, ((ReebArc*)arc)->buckets[0].p);
mul_v3_fl(p, 1.0f / arc->head->degree);
add_v3_v3(arc->head->p, p);
- VECCOPY(p, ((ReebArc*)arc)->buckets[((ReebArc*)arc)->bcount - 1].p);
+ copy_v3_v3(p, ((ReebArc*)arc)->buckets[((ReebArc*)arc)->bcount - 1].p);
mul_v3_fl(p, 1.0f / arc->tail->degree);
add_v3_v3(arc->tail->p, p);
}
@@ -647,7 +647,7 @@ static void mergeBuckets(EmbedBucket *bDst, EmbedBucket *bSrc)
else if (bSrc->nv > 0)
{
bDst->nv = bSrc->nv;
- VECCOPY(bDst->p, bSrc->p);
+ copy_v3_v3(bDst->p, bSrc->p);
}
}
@@ -963,7 +963,7 @@ void REEB_RadialSymmetry(BNode* root_node, RadialArc* ring, int count)
float axis[3];
int i;
- VECCOPY(axis, root_node->symmetry_axis);
+ copy_v3_v3(axis, root_node->symmetry_axis);
/* first pass, merge incrementally */
for (i = 0; i < count - 1; i++)
@@ -1046,7 +1046,7 @@ void REEB_RadialSymmetry(BNode* root_node, RadialArc* ring, int count)
arc2 = (ReebArc*)ring[j].arc;
/* copy first node than mirror */
- VECCOPY(node2->p, node1->p);
+ copy_v3_v3(node2->p, node1->p);
BLI_mirrorAlongAxis(node2->p, root_node->p, normal);
/* Copy buckets
@@ -1081,7 +1081,7 @@ void REEB_RadialSymmetry(BNode* root_node, RadialArc* ring, int count)
{
/* copy and mirror back to bucket2 */
bucket2->nv = bucket1->nv;
- VECCOPY(bucket2->p, bucket1->p);
+ copy_v3_v3(bucket2->p, bucket1->p);
BLI_mirrorAlongAxis(bucket2->p, node->p, normal);
}
}
@@ -1096,10 +1096,10 @@ void REEB_AxialSymmetry(BNode* root_node, BNode* node1, BNode* node2, struct BAr
arc1 = (ReebArc*)barc1;
arc2 = (ReebArc*)barc2;
- VECCOPY(nor, root_node->symmetry_axis);
+ copy_v3_v3(nor, root_node->symmetry_axis);
/* mirror node2 along axis */
- VECCOPY(p, node2->p);
+ copy_v3_v3(p, node2->p);
BLI_mirrorAlongAxis(p, root_node->p, nor);
/* average with node1 */
@@ -1107,7 +1107,7 @@ void REEB_AxialSymmetry(BNode* root_node, BNode* node1, BNode* node2, struct BAr
mul_v3_fl(node1->p, 0.5f);
/* mirror back on node2 */
- VECCOPY(node2->p, node1->p);
+ copy_v3_v3(node2->p, node1->p);
BLI_mirrorAlongAxis(node2->p, root_node->p, nor);
/* Merge buckets
@@ -1149,7 +1149,7 @@ void REEB_AxialSymmetry(BNode* root_node, BNode* node1, BNode* node2, struct BAr
/* copy and mirror back to bucket2 */
bucket2->nv = bucket1->nv;
- VECCOPY(bucket2->p, bucket1->p);
+ copy_v3_v3(bucket2->p, bucket1->p);
BLI_mirrorAlongAxis(bucket2->p, root_node->p, nor);
}
}
@@ -1798,7 +1798,7 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold))
vec0 = previous->p;
}
- VECCOPY(midpoint, vec1);
+ copy_v3_v3(midpoint, vec1);
distance = len_v3v3(midpoint, efa->cent);
@@ -3479,9 +3479,8 @@ ReebGraph *BIF_ReebGraphMultiFromEditMesh(bContext *C)
MEM_freeN(data);
- /*no need to load the editmesh back into the object, just
- free it (avoids ngon conversion issues too going back the
- other way)*/
+ /* no need to load the editmesh back into the object, just
+ * free it (avoids ngon conversion issues too going back the other way) */
free_editMesh(em);
MEM_freeN(em);
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index c09f4d16936..aa8dad08ac2 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -1116,9 +1116,9 @@ static void curve_rename_fcurves(Object *obedit, ListBase *orig_curves)
nu_index++;
}
- /* remove pathes for removed control points
- need this to make further step with copying non-cv related curves copying
- not touching cv's f-cruves */
+ /* remove paths for removed control points
+ * need this to make further step with copying non-cv related curves copying
+ * not touching cv's f-curves */
for(fcu= orig_curves->first; fcu; fcu= next) {
next= fcu->next;
@@ -1261,8 +1261,8 @@ void make_editNurb(Object *obedit)
if(actkey)
editnurb->shapenr= obedit->shapenr;
- /* animation could be added in editmode even if teher was no animdata i
- object mode hence we always need CVs index be created */
+ /* animation could be added in editmode even if there was no animdata i
+ * object mode hence we always need CVs index be created */
init_editNurb_keyIndex(editnurb, &cu->nurb);
}
}
@@ -1416,7 +1416,7 @@ void CURVE_OT_separate(wmOperatorType *ot)
static short isNurbselUV(Nurb *nu, int *u, int *v, int flag)
{
/* return u!=-1: 1 row in u-direction selected. U has value between 0-pntsv
- * return v!=-1: 1 collumn in v-direction selected. V has value between 0-pntsu
+ * return v!=-1: 1 column in v-direction selected. V has value between 0-pntsu
*/
BPoint *bp;
int a, b, sel;
@@ -1772,7 +1772,7 @@ static short extrudeflagNurb(EditNurb *editnurb, int flag)
nu->pntsv++;
nurbs_knot_calc_v(nu);
}
- else if(v==0 || v== nu->pntsu-1) { /* collumn in v-direction selected */
+ else if(v==0 || v== nu->pntsu-1) { /* column in v-direction selected */
ok= 1;
bpn = newbp =
(BPoint*) MEM_mallocN((nu->pntsu + 1) * nu->pntsv * sizeof(BPoint), "extrudeNurb1");
@@ -2227,7 +2227,7 @@ static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op))
break;
}
}
- /* incase there are no other selected verts */
+ /* in case there are no other selected verts */
end_sel = start_sel;
for(bezt=nu->bezt+(start_sel+1), a=start_sel+1; a<nu->pntsu; a++, bezt++) {
if((bezt->f2 & SELECT)==0) {
@@ -2289,7 +2289,7 @@ static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op))
break;
}
}
- /* incase there are no other selected verts */
+ /* in case there are no other selected verts */
end_sel = start_sel;
for(bp=nu->bp+(start_sel+1), a=start_sel+1; a<nu->pntsu; a++, bp++) {
if((bp->f1 & SELECT)==0) {
@@ -2772,10 +2772,10 @@ static void subdividenurb(Object *obedit, int number_cuts)
amount= 0;
if(nu->type == CU_BEZIER) {
/*
- Insert a point into a 2D Bezier curve.
- Endpoints are preserved. Otherwise, all selected and inserted points are
- newly created. Old points are discarded.
- */
+ * Insert a point into a 2D Bezier curve.
+ * Endpoints are preserved. Otherwise, all selected and inserted points are
+ * newly created. Old points are discarded.
+ */
/* count */
if(nu->flagu & CU_NURB_CYCLIC) {
a= nu->pntsu;
@@ -2867,10 +2867,10 @@ static void subdividenurb(Object *obedit, int number_cuts)
} /* End of 'if(nu->type == CU_BEZIER)' */
else if (nu->pntsv==1) {
/*
- All flat lines (ie. co-planar), except flat Nurbs. Flat NURB curves
- are handled together with the regular NURB plane division, as it
- should be. I split it off just now, let's see if it is
- stable... nzc 30-5-'00
+ * All flat lines (ie. co-planar), except flat Nurbs. Flat NURB curves
+ * are handled together with the regular NURB plane division, as it
+ * should be. I split it off just now, let's see if it is
+ * stable... nzc 30-5-'00
*/
/* count */
if(nu->flagu & CU_NURB_CYCLIC) {
@@ -2941,46 +2941,46 @@ static void subdividenurb(Object *obedit, int number_cuts)
else if(nu->type == CU_NURBS) {
/* This is a very strange test ... */
/**
- Subdivide NURB surfaces - nzc 30-5-'00 -
-
- Subdivision of a NURB curve can be effected by adding a
- control point (insertion of a knot), or by raising the
- degree of the functions used to build the NURB. The
- expression
-
- degree = #knots - #controlpoints + 1 (J Walter piece)
- degree = #knots - #controlpoints (Blender
- implementation)
- ( this is confusing.... what is true? Another concern
- is that the JW piece allows the curve to become
- explicitly 1st order derivative discontinuous, while
- this is not what we want here... )
-
- is an invariant for a single NURB curve. Raising the degree
- of the NURB is done elsewhere; the degree is assumed
- constant during this opration. Degree is a property shared
- by all controlpoints in a curve (even though it is stored
- per control point - this can be misleading).
- Adding a knot is done by searching for the place in the
- knot vector where a certain knot value must be inserted, or
- by picking an appropriate knot value between two existing
- ones. The number of controlpoints that is influenced by the
- insertion depends on the order of the curve. A certain
- minimum number of knots is needed to form high-order
- curves, as can be seen from the equation above. In Blender,
- currently NURBs may be up to 6th order, so we modify at
- most 6 points. One point is added. For an n-degree curve,
- n points are discarded, and n+1 points inserted
- (so effectively, n points are modified). (that holds for
- the JW piece, but it seems not for our NURBs)
- In practice, the knot spacing is copied, but the tail
- (the points following the insertion point) need to be
- offset to keep the knot series ascending. The knot series
- is always a series of monotonically ascending integers in
- Blender. When not enough control points are available to
- fit the order, duplicates of the endpoints are added as
- needed.
- */
+ * Subdivide NURB surfaces - nzc 30-5-'00 -
+ *
+ * Subdivision of a NURB curve can be effected by adding a
+ * control point (insertion of a knot), or by raising the
+ * degree of the functions used to build the NURB. The
+ * expression
+ *
+ * degree = #knots - #controlpoints + 1 (J Walter piece)
+ * degree = #knots - #controlpoints (Blender
+ * implementation)
+ * ( this is confusing.... what is true? Another concern
+ * is that the JW piece allows the curve to become
+ * explicitly 1st order derivative discontinuous, while
+ * this is not what we want here... )
+ *
+ * is an invariant for a single NURB curve. Raising the degree
+ * of the NURB is done elsewhere; the degree is assumed
+ * constant during this operation. Degree is a property shared
+ * by all controlpoints in a curve (even though it is stored
+ * per control point - this can be misleading).
+ * Adding a knot is done by searching for the place in the
+ * knot vector where a certain knot value must be inserted, or
+ * by picking an appropriate knot value between two existing
+ * ones. The number of controlpoints that is influenced by the
+ * insertion depends on the order of the curve. A certain
+ * minimum number of knots is needed to form high-order
+ * curves, as can be seen from the equation above. In Blender,
+ * currently NURBs may be up to 6th order, so we modify at
+ * most 6 points. One point is added. For an n-degree curve,
+ * n points are discarded, and n+1 points inserted
+ * (so effectively, n points are modified). (that holds for
+ * the JW piece, but it seems not for our NURBs)
+ * In practice, the knot spacing is copied, but the tail
+ * (the points following the insertion point) need to be
+ * offset to keep the knot series ascending. The knot series
+ * is always a series of monotonically ascending integers in
+ * Blender. When not enough control points are available to
+ * fit the order, duplicates of the endpoints are added as
+ * needed.
+ */
/* selection-arrays */
usel= MEM_callocN(sizeof(int)*nu->pntsu, "subivideNurb3");
vsel= MEM_callocN(sizeof(int)*nu->pntsv, "subivideNurb3");
@@ -2998,9 +2998,9 @@ static void subdividenurb(Object *obedit, int number_cuts)
bp++;
}
}
- if( sel == (nu->pntsu*nu->pntsv) ) { /* subdivide entire nurb */
- /* Global subdivision is a special case of partial
- subdivision. Strange it is considered separately... */
+ if( sel == (nu->pntsu*nu->pntsv) ) { /* subdivide entire nurb */
+ /* Global subdivision is a special case of partial
+ * subdivision. Strange it is considered separately... */
/* count of nodes (after subdivision) along U axis */
int countu= nu->pntsu + (nu->pntsu - 1) * number_cuts;
@@ -3081,12 +3081,12 @@ static void subdividenurb(Object *obedit, int number_cuts)
prevbp= bp- nu->pntsu;
for(b=0; b<nu->pntsu; b++) {
/*
- This simple bisection must be replaces by a
- subtle resampling of a number of points. Our
- task is made slightly easier because each
- point in our curve is a separate data
- node. (is it?)
- */
+ * This simple bisection must be replaces by a
+ * subtle resampling of a number of points. Our
+ * task is made slightly easier because each
+ * point in our curve is a separate data
+ * node. (is it?)
+ */
*bpn= *prevbp;
interp_v4_v4v4(bpn->vec, prevbp->vec, bp->vec, factor);
bpn++;
@@ -3123,12 +3123,12 @@ static void subdividenurb(Object *obedit, int number_cuts)
bp++;
if( (b<nu->pntsu-1) && usel[b]==nu->pntsv && usel[b+1]==nu->pntsv ) {
/*
- One thing that bugs me here is that the
- orders of things are not the same as in
- the JW piece. Also, this implies that we
- handle at most 3rd order curves? I miss
- some symmetry here...
- */
+ * One thing that bugs me here is that the
+ * orders of things are not the same as in
+ * the JW piece. Also, this implies that we
+ * handle at most 3rd order curves? I miss
+ * some symmetry here...
+ */
for (i = 0; i < number_cuts; i++) {
factor = (float)(i + 1) / (number_cuts + 1);
prevbp= bp- 1;
@@ -3778,7 +3778,7 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
return;
}
- /* ok, now nu1 has the rightmost collumn and nu2 the leftmost collumn selected */
+ /* ok, now nu1 has the rightmost column and nu2 the leftmost column selected */
/* maybe we need a 'v' flip of nu2? */
bp1= nu1->bp+nu1->pntsu-1;
@@ -4353,8 +4353,8 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
newnu= (Nurb*)MEM_callocN(sizeof(Nurb), "addvert_Nurb newnu");
if(!nu) {
/* no selected sement -- create new one which is BEZIER tpye
- type couldn't be determined from Curve bt could be changed
- in the future, so shouldn't make much headache */
+ * type couldn't be determined from Curve bt could be changed
+ * in the future, so shouldn't make much headache */
newnu->type= CU_BEZIER;
newnu->resolu= cu->resolu;
newnu->flag |= CU_SMOOTH;
@@ -5160,7 +5160,7 @@ void CURVE_OT_select_more(wmOperatorType *ot)
/******************** select less operator *****************/
-/* basic method: deselect if control point doesn't have all neighbours selected */
+/* basic method: deselect if control point doesn't have all neighbors selected */
static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit= CTX_data_edit_object(C);
@@ -5181,7 +5181,7 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
if((bp->hide==0) && (bp->f1 & SELECT)) {
sel= 0;
- /* check if neighbours have been selected */
+ /* check if neighbors have been selected */
/* edges of surface are an exception */
if((a+1)%nu->pntsu==0) sel++;
else {
@@ -5236,7 +5236,7 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
if(lastsel==1) sel= 1;
else sel= 0;
- /* check if neighbours have been selected */
+ /* check if neighbors have been selected */
/* first and last are exceptions */
if(a==nu->pntsu-1) sel++;
else {
@@ -5624,12 +5624,12 @@ static int delete_exec(bContext *C, wmOperator *op)
}
/* Never allow the order to exceed the number of points
- - note, this is ok but changes unselected nurbs, disable for now */
- /*
+ * - note, this is ok but changes unselected nurbs, disable for now */
+#if 0
if ((nu!= NULL) && (nu->type == CU_NURBS)) {
clamp_nurb_order_u(nu);
}
- */
+#endif
nu= next;
nuindex++;
}
@@ -5688,12 +5688,13 @@ static int delete_exec(bContext *C, wmOperator *op)
MEM_freeN(nu->bp);
nu->bp= bp1;
- /* Never allow the order to exceed the number of points\
- - note, this is ok but changes unselected nurbs, disable for now */
- /*
+ /* Never allow the order to exceed the number of points
+ * - note, this is ok but changes unselected nurbs, disable for now */
+#if 0
if (nu->type == CU_NURBS) {
clamp_nurb_order_u(nu);
- }*/
+ }
+#endif
}
clamp_nurb_order_u(nu);
nurbs_knot_calc_u(nu);
diff --git a/source/blender/editors/gpencil/CMakeLists.txt b/source/blender/editors/gpencil/CMakeLists.txt
index 15707bfc4d0..ce21d47ae48 100644
--- a/source/blender/editors/gpencil/CMakeLists.txt
+++ b/source/blender/editors/gpencil/CMakeLists.txt
@@ -20,6 +20,7 @@
set(INC
../include
+ ../../blenfont
../../blenkernel
../../blenlib
../../blenloader
diff --git a/source/blender/editors/gpencil/SConscript b/source/blender/editors/gpencil/SConscript
index 6c23e77208a..dca419d2fb7 100644
--- a/source/blender/editors/gpencil/SConscript
+++ b/source/blender/editors/gpencil/SConscript
@@ -5,7 +5,7 @@ sources = env.Glob('*.c')
incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
-incs += ' ../../gpu ../../blenloader ../../bmesh'
+incs += ' ../../gpu ../../blenloader ../../bmesh ../../blenfont'
incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern'
env.BlenderLib ( 'bf_editors_gpencil', sources, Split(incs), [], libtype=['core'], priority=[45] )
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 19dc25dd282..76af016b6c6 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -189,8 +189,7 @@ static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short dfl
glVertex2fv(co);
glEnd();
}
- else
- {
+ else {
/* draw filled circle as is done in circf (but without the matrix push/pops which screwed things up) */
GLUquadricObj *qobj = gluNewQuadric();
@@ -289,8 +288,7 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness_s
/* tessellation code - draw stroke as series of connected quads with connection
* edges rotated to minimise shrinking artifacts, and rounded endcaps
*/
- else
- {
+ else {
bGPDspoint *pt1, *pt2;
float pm[2];
int i;
@@ -384,8 +382,8 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness_s
mt[1]= mb[1] * pthick;
athick= len_v2(mt);
dfac= pthick - (athick * 2);
- if ( ((athick * 2.0f) < pthick) && (IS_EQF(athick, pthick)==0) )
- {
+
+ if (((athick * 2.0f) < pthick) && (IS_EQF(athick, pthick)==0)) {
mt[0] += (mb[0] * dfac);
mt[1] += (mb[1] * dfac);
}
@@ -517,10 +515,10 @@ static void gp_draw_strokes (bGPDframe *gpf, int offsx, int offsy, int winx, int
/* first arg is normally rv3d->dist, but this isnt available here and seems to work quite well without */
bglPolygonOffset(1.0f, 1.0f);
- /*
+#if 0
glEnable(GL_POLYGON_OFFSET_LINE);
glPolygonOffset(-1.0f, -1.0f);
- */
+#endif
}
gp_draw_stroke_3d(gps->points, gps->totpoints, lthick, debug);
@@ -530,10 +528,10 @@ static void gp_draw_strokes (bGPDframe *gpf, int offsx, int offsy, int winx, int
glDisable(GL_DEPTH_TEST);
bglPolygonOffset(0.0, 0.0);
- /*
+#if 0
glDisable(GL_POLYGON_OFFSET_LINE);
glPolygonOffset(0, 0);
- */
+#endif
}
}
else if (gps->totpoints > 1)
diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c
index 46241f3d378..62e2e62b880 100644
--- a/source/blender/editors/gpencil/gpencil_buttons.c
+++ b/source/blender/editors/gpencil/gpencil_buttons.c
@@ -27,16 +27,17 @@
* \ingroup edgpencil
*/
-
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
-
#include "BLI_math.h"
#include "BLI_blenlib.h"
+#include "BLF_translation.h"
+
#include "DNA_gpencil_types.h"
#include "DNA_screen_types.h"
@@ -49,7 +50,6 @@
#include "RNA_access.h"
-
#include "ED_gpencil.h"
#include "UI_interface.h"
@@ -69,34 +69,33 @@
/* These are just 'dummy wrappers' around gpencil api calls */
/* make layer active one after being clicked on */
-static void gp_ui_activelayer_cb (bContext *C, void *gpd, void *gpl)
+static void gp_ui_activelayer_cb(bContext *C, void *gpd, void *gpl)
{
/* make sure the layer we want to remove is the active one */
gpencil_layer_setactive(gpd, gpl);
-
- WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work!
+
+ WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); /* XXX please work! */
}
/* delete 'active' layer */
-static void gp_ui_dellayer_cb (bContext *C, void *gpd, void *gpl)
+static void gp_ui_dellayer_cb(bContext *C, void *gpd, void *gpl)
{
/* make sure the layer we want to remove is the active one */
- gpencil_layer_setactive(gpd, gpl);
+ gpencil_layer_setactive(gpd, gpl);
gpencil_layer_delactive(gpd);
- WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work!
+ WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); /* XXX please work! */
}
-
/* ------- Drawing Code ------- */
/* draw the controls for a given layer */
-static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, const short is_v3d)
+static void gp_drawui_layer(uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, const short is_v3d)
{
- uiLayout *box=NULL, *split=NULL;
- uiLayout *col=NULL;
- uiLayout *row=NULL, *sub=NULL;
+ uiLayout *box = NULL, *split = NULL;
+ uiLayout *col = NULL;
+ uiLayout *row = NULL, *sub = NULL;
uiBlock *block;
uiBut *but;
PointerRNA ptr;
@@ -106,30 +105,31 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
RNA_pointer_create((ID *)gpd, &RNA_GPencilLayer, gpl, &ptr);
/* unless button has own callback, it adds this callback to button */
- block= uiLayoutGetBlock(layout);
+ block = uiLayoutGetBlock(layout);
uiBlockSetFunc(block, gp_ui_activelayer_cb, gpd, gpl);
/* draw header ---------------------------------- */
/* get layout-row + UI-block for header */
- box= uiLayoutBox(layout);
+ box = uiLayoutBox(layout);
- row= uiLayoutRow(box, 0);
+ row = uiLayoutRow(box, 0);
uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_EXPAND);
- block= uiLayoutGetBlock(row); // err...
+ block = uiLayoutGetBlock(row); /* err... */
uiBlockSetEmboss(block, UI_EMBOSSN);
/* left-align ............................... */
- sub= uiLayoutRow(row, 0);
+ sub = uiLayoutRow(row, 0);
/* active */
- block= uiLayoutGetBlock(sub);
- icon= (gpl->flag & GP_LAYER_ACTIVE) ? ICON_RADIOBUT_ON : ICON_RADIOBUT_OFF;
- but= uiDefIconButBitI(block, TOG, GP_LAYER_ACTIVE, 0, icon, 0, 0, UI_UNIT_X, UI_UNIT_Y, &gpd->flag, 0.0, 0.0, 0.0, 0.0, "Set active layer");
+ block = uiLayoutGetBlock(sub);
+ icon = (gpl->flag & GP_LAYER_ACTIVE) ? ICON_RADIOBUT_ON : ICON_RADIOBUT_OFF;
+ but = uiDefIconButBitI(block, TOG, GP_LAYER_ACTIVE, 0, icon, 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ &gpd->flag, 0.0, 0.0, 0.0, 0.0, TIP_("Set active layer"));
uiButSetFunc(but, gp_ui_activelayer_cb, gpd, gpl);
-
+
/* locked */
- icon= (gpl->flag & GP_LAYER_LOCKED) ? ICON_LOCKED : ICON_UNLOCKED;
+ icon = (gpl->flag & GP_LAYER_LOCKED) ? ICON_LOCKED : ICON_UNLOCKED;
uiItemR(sub, &ptr, "lock", 0, "", icon);
/* when layer is locked or hidden, only draw header */
@@ -138,37 +138,37 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
/* visibility button (only if hidden but not locked!) */
if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED))
- uiItemR(sub, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_ON);
-
+ uiItemR(sub, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_ON);
/* name */
if (gpl->flag & GP_LAYER_HIDE)
- BLI_snprintf(name, sizeof(name), "%s (Hidden)", gpl->info);
+ BLI_snprintf(name, sizeof(name), IFACE_("%s (Hidden)"), gpl->info);
else
- BLI_snprintf(name, sizeof(name), "%s (Locked)", gpl->info);
+ BLI_snprintf(name, sizeof(name), IFACE_("%s (Locked)"), gpl->info);
uiItemL(sub, name, ICON_NONE);
-
+
/* delete button (only if hidden but not locked!) */
if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED)) {
/* right-align ............................... */
- sub= uiLayoutRow(row, 1);
+ sub = uiLayoutRow(row, 1);
uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_RIGHT);
- block= uiLayoutGetBlock(sub); // XXX... err...
+ block = uiLayoutGetBlock(sub); /* XXX... err... */
- but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
+ but = uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete layer"));
uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl);
- }
+ }
uiBlockSetEmboss(block, UI_EMBOSS);
}
else {
/* draw rest of header -------------------------------- */
/* visibility button */
- uiItemR(sub, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_OFF);
+ uiItemR(sub, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_OFF);
/* frame locking */
- // TODO: this needs its own icons...
- icon= (gpl->flag & GP_LAYER_FRAMELOCK) ? ICON_RENDER_STILL : ICON_RENDER_ANIMATION;
- uiItemR(sub, &ptr, "lock_frame", 0, "", icon);
+ /* TODO: this needs its own icons... */
+ icon = (gpl->flag & GP_LAYER_FRAMELOCK) ? ICON_RENDER_STILL : ICON_RENDER_ANIMATION;
+ uiItemR(sub, &ptr, "lock_frame", 0, "", icon);
uiBlockSetEmboss(block, UI_EMBOSS);
@@ -177,29 +177,29 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
/* delete 'button' */
uiBlockSetEmboss(block, UI_EMBOSSN);
- /* right-align ............................... */
- sub= uiLayoutRow(row, 1);
- uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_RIGHT);
- block= uiLayoutGetBlock(sub); // XXX... err...
-
- but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
- uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl);
- uiBlockSetEmboss(block, UI_EMBOSS);
+ /* right-align ............................... */
+ sub = uiLayoutRow(row, 1);
+ uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_RIGHT);
+ block = uiLayoutGetBlock(sub); /* XXX... err... */
+ but = uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete layer"));
+ uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl);
+ uiBlockSetEmboss(block, UI_EMBOSS);
/* new backdrop ----------------------------------- */
- box= uiLayoutBox(layout);
- split= uiLayoutSplit(box, 0.5f, 0);
+ box = uiLayoutBox(layout);
+ split = uiLayoutSplit(box, 0.5f, 0);
/* draw settings ---------------------------------- */
/* left column ..................... */
- col= uiLayoutColumn(split, 0);
+ col = uiLayoutColumn(split, 0);
/* color */
- sub= uiLayoutColumn(col, 1);
+ sub = uiLayoutColumn(col, 1);
uiItemR(sub, &ptr, "color", 0, "", ICON_NONE);
uiItemR(sub, &ptr, "alpha", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
-
+
/* stroke thickness */
uiItemR(col, &ptr, "line_width", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
@@ -209,66 +209,65 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
}
/* right column ................... */
- col= uiLayoutColumn(split, 0);
+ col = uiLayoutColumn(split, 0);
/* onion-skinning */
- sub= uiLayoutColumn(col, 1);
- uiItemR(sub, &ptr, "use_onion_skinning", 0, "Onion Skinning", ICON_NONE);
- uiItemR(sub, &ptr, "ghost_range_max", 0, "Frames", ICON_NONE); // XXX shorter name here? i.e. GStep
+ sub = uiLayoutColumn(col, 1);
+ uiItemR(sub, &ptr, "use_onion_skinning", 0, NULL, ICON_NONE);
+ uiItemR(sub, &ptr, "ghost_range_max", 0, IFACE_("Frames"), ICON_NONE);
/* 3d-view specific drawing options */
if (is_v3d) {
- uiItemR(col, &ptr, "show_x_ray", 0, "X-Ray", ICON_NONE);
+ uiItemR(col, &ptr, "show_x_ray", 0, NULL, ICON_NONE);
}
-
}
-}
+}
/* stroke drawing options available */
typedef enum eGP_Stroke_Ops {
- STROKE_OPTS_NORMAL = 0,
- STROKE_OPTS_V3D_OFF,
+ STROKE_OPTS_NORMAL = 0,
+ STROKE_OPTS_V3D_OFF,
STROKE_OPTS_V3D_ON,
} eGP_Stroke_Ops;
/* Draw the contents for a grease-pencil panel*/
-static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, PointerRNA *ctx_ptr)
+static void draw_gpencil_panel(bContext *C, uiLayout *layout, bGPdata *gpd, PointerRNA *ctx_ptr)
{
PointerRNA gpd_ptr;
bGPDlayer *gpl;
uiLayout *col, *row;
short v3d_stroke_opts = STROKE_OPTS_NORMAL;
- const short is_v3d= CTX_wm_view3d(C) != NULL;
+ const short is_v3d = CTX_wm_view3d(C) != NULL;
/* make new PointerRNA for Grease Pencil block */
RNA_id_pointer_create((ID *)gpd, &gpd_ptr);
/* draw gpd settings first ------------------------------------- */
- col= uiLayoutColumn(layout, 0);
- /* current Grease Pencil block */
- // TODO: show some info about who owns this?
- uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_add", NULL, "GPENCIL_OT_data_unlink");
-
- /* add new layer button - can be used even when no data, since it can add a new block too */
- uiItemO(col, "New Layer", ICON_NONE, "GPENCIL_OT_layer_add");
- row= uiLayoutRow(col, 1);
- uiItemO(row, "Delete Frame", ICON_NONE, "GPENCIL_OT_active_frame_delete");
- uiItemO(row, "Convert", ICON_NONE, "GPENCIL_OT_convert");
-
+ col = uiLayoutColumn(layout, 0);
+ /* current Grease Pencil block */
+ /* TODO: show some info about who owns this? */
+ uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_add", NULL, "GPENCIL_OT_data_unlink");
+
+ /* add new layer button - can be used even when no data, since it can add a new block too */
+ uiItemO(col, IFACE_("New Layer"), ICON_NONE, "GPENCIL_OT_layer_add");
+ row = uiLayoutRow(col, 1);
+ uiItemO(row, IFACE_("Delete Frame"), ICON_NONE, "GPENCIL_OT_active_frame_delete");
+ uiItemO(row, IFACE_("Convert"), ICON_NONE, "GPENCIL_OT_convert");
+
/* sanity checks... */
if (gpd == NULL)
return;
/* draw each layer --------------------------------------------- */
- for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
- col= uiLayoutColumn(layout, 1);
- gp_drawui_layer(col, gpd, gpl, is_v3d);
+ for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
+ col = uiLayoutColumn(layout, 1);
+ gp_drawui_layer(col, gpd, gpl, is_v3d);
}
/* draw gpd drawing settings first ------------------------------------- */
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
/* label */
- uiItemL(col, "Drawing Settings:", ICON_NONE);
+ uiItemL(col, IFACE_("Drawing Settings:"), ICON_NONE);
/* check whether advanced 3D-View drawing space options can be used */
if (is_v3d) {
@@ -290,7 +289,7 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi
row= uiLayoutRow(col, 0);
uiLayoutSetActive(row, v3d_stroke_opts==STROKE_OPTS_V3D_ON);
uiItemR(row, &gpd_ptr, "use_stroke_endpoints", 0, NULL, ICON_NONE);
-}
+}
/* Standard panel to be included wherever Grease Pencil is used... */
@@ -299,10 +298,10 @@ void gpencil_panel_standard(const bContext *C, Panel *pa)
bGPdata **gpd_ptr = NULL;
PointerRNA ptr;
- //if (v3d->flag2 & V3D_DISPGP)... etc.
+ /* if (v3d->flag2 & V3D_DISPGP)... etc. */
/* get pointer to Grease Pencil Data */
- gpd_ptr= gpencil_data_get_pointers((bContext *)C, &ptr);
+ gpd_ptr = gpencil_data_get_pointers((bContext *)C, &ptr);
if (gpd_ptr)
draw_gpencil_panel((bContext *)C, pa->layout, *gpd_ptr, &ptr);
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 673d7c637ff..535a0f947f1 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -104,8 +104,8 @@ typedef struct tGPsdata {
short radius; /* radius of influence for eraser */
short flags; /* flags that can get set during runtime */
- float imat[4][4]; /* inverted transformation matrix applying when converting coords from screen-space
- * to region space */
+ float imat[4][4]; /* inverted transformation matrix applying when converting coords from screen-space
+ * to region space */
float custom_color[4]; /* custom color for (?) */
} tGPsdata;
@@ -194,8 +194,7 @@ static void gp_get_3d_reference (tGPsdata *p, float vec[3])
/* the reference point used depends on the owner... */
#if 0 // XXX: disabled for now, since we can't draw relative to the owner yet
- if (p->ownerPtr.type == &RNA_Object)
- {
+ if (p->ownerPtr.type == &RNA_Object) {
Object *ob= (Object *)p->ownerPtr.data;
/* active Object
@@ -517,10 +516,8 @@ static void gp_stroke_simplify (tGPsdata *p)
pressure += old_points[offs].pressure * sfac; \
}
- for (i = 0, j = 0; i < num_points; i++)
- {
- if (i - j == 3)
- {
+ for (i = 0, j = 0; i < num_points; i++) {
+ if (i - j == 3) {
float co[2], pressure;
int mco[2];
@@ -578,8 +575,8 @@ static void gp_stroke_newfrombuffer (tGPsdata *p)
}
/* special case for poly line -- for already added stroke during session
- coordinates are getting added to stroke immediatelly to allow more
- interactive behavior */
+ * coordinates are getting added to stroke immediately to allow more
+ * interactive behavior */
if (p->paintmode == GP_PAINTMODE_DRAW_POLY) {
if (p->flags & GP_PAINTFLAG_STROKEADDED)
return;
@@ -1148,7 +1145,7 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
if (ED_gpencil_session_active()==0) {
/* initialize undo stack,
- also, existing undo stack would make buffer drawn */
+ * also, existing undo stack would make buffer drawn */
gpencil_undo_init(p->gpd);
}
@@ -1369,7 +1366,7 @@ static void gp_paint_strokeend (tGPsdata *p)
static void gp_paint_cleanup (tGPsdata *p)
{
/* p->gpd==NULL happens when stroke failed to initialize,
- for example. when GP is hidden in current space (sergey) */
+ * for example. when GP is hidden in current space (sergey) */
if (p->gpd) {
/* finish off a stroke */
gp_paint_strokeend(p);
@@ -1855,8 +1852,7 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event)
/* handle mode-specific events */
if (p->status == GP_STATUS_PAINTING) {
/* handle painting mouse-movements? */
- if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) || (p->flags & GP_PAINTFLAG_FIRSTRUN))
- {
+ if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) || (p->flags & GP_PAINTFLAG_FIRSTRUN)) {
/* handle drawing event */
//printf("\t\tGP - add point\n");
gpencil_draw_apply_event(op, event);
diff --git a/source/blender/editors/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h
index d34e6f74b4c..e29e0af59b1 100644
--- a/source/blender/editors/include/BIF_gl.h
+++ b/source/blender/editors/include/BIF_gl.h
@@ -43,7 +43,7 @@
*
* This define converts a numerical value to the equivalent 24-bit
* color, while not being endian-sensitive. On little-endians, this
- * is the same as doing a 'naive'indexing, on big-endian, it is not!
+ * is the same as doing a 'naive' indexing, on big-endian, it is not!
* */
#define cpack(x) glColor3ub( ((x)&0xFF), (((x)>>8)&0xFF), (((x)>>16)&0xFF) )
diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h
index 77c50f9ca6d..d75fac18c8c 100644
--- a/source/blender/editors/include/BIF_glutil.h
+++ b/source/blender/editors/include/BIF_glutil.h
@@ -110,13 +110,13 @@ void glaRasterPosSafe2f (float x, float y, float known_good_x, float known_good
* 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
* 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 Furthermore, 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
@@ -131,7 +131,7 @@ void glaDrawPixelsSafe (float x, float y, int img_w, int img_h, int row_w, int
* cards, and also avoids problems with the raster position being
* clipped when offscreen. The routine respects the glPixelZoom values,
* pixel unpacking parameters are _not_ respected.
-
+ *
* \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
diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h
index a073cdddae7..851bd09dd29 100644
--- a/source/blender/editors/include/ED_armature.h
+++ b/source/blender/editors/include/ED_armature.h
@@ -56,32 +56,32 @@ struct wmOperator;
typedef struct EditBone
{
struct EditBone *next, *prev;
- struct IDProperty *prop; /* User-Defined Properties on this Bone */
- struct EditBone *parent;/* Editbones have a one-way link (i.e. children refer
- to parents. This is converted to a two-way link for
- normal bones when leaving editmode. */
- void *temp; /* Used to store temporary data */
-
- char name[64]; /* MAX_NAME */
- float roll; /* Roll along axis. We'll ultimately use the axis/angle method
- for determining the transformation matrix of the bone. The axis
- is tail-head while roll provides the angle. Refer to Graphics
- Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/
-
- float head[3]; /* Orientation and length is implicit during editing */
- float tail[3];
- /* All joints are considered to have zero rotation with respect to
- their parents. Therefore any rotations specified during the
- animation are automatically relative to the bones' rest positions*/
+ struct IDProperty *prop;/* User-Defined Properties on this Bone */
+ struct EditBone *parent;/* Editbones have a one-way link (i.e. children refer
+ * to parents. This is converted to a two-way link for
+ * normal bones when leaving editmode. */
+ void *temp; /* Used to store temporary data */
+
+ char name[64]; /* MAX_NAME */
+ float roll; /* Roll along axis. We'll ultimately use the axis/angle method
+ * for determining the transformation matrix of the bone. The axis
+ * is tail-head while roll provides the angle. Refer to Graphics
+ * Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/
+
+ float head[3]; /* Orientation and length is implicit during editing */
+ float tail[3];
+ /* All joints are considered to have zero rotation with respect to
+ * their parents. Therefore any rotations specified during the
+ * animation are automatically relative to the bones' rest positions*/
int flag;
int layer;
float dist, weight;
- float xwidth, length, zwidth; /* put them in order! transform uses this as scale */
+ float xwidth, length, zwidth; /* put them in order! transform uses this as scale */
float ease1, ease2;
float rad_head, rad_tail;
- float oldlength; /* for envelope scaling */
+ float oldlength; /* for envelope scaling */
short segments;
} EditBone;
diff --git a/source/blender/editors/include/ED_datafiles.h b/source/blender/editors/include/ED_datafiles.h
index 9fe2fe685a0..c725808ec34 100644
--- a/source/blender/editors/include/ED_datafiles.h
+++ b/source/blender/editors/include/ED_datafiles.h
@@ -56,7 +56,7 @@ extern char datatoc_bmonofont_ttf[];
/* Brush icon datafiles */
/* TODO: this could be simplified by putting all
- the brush icons in one file */
+ * the brush icons in one file */
extern int datatoc_add_png_size;
extern char datatoc_add_png[];
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h
index 63c0511e6b3..a70be6dfb54 100644
--- a/source/blender/editors/include/ED_keyframing.h
+++ b/source/blender/editors/include/ED_keyframing.h
@@ -132,10 +132,12 @@ typedef struct KeyingSetInfo {
struct KeyingSetInfo *next, *prev;
/* info */
- /* identifier so that user can hook this up to a KeyingSet */
- char name[64];
/* identifier used for class name, which KeyingSet instances reference as "Typeinfo Name" */
char idname[64];
+ /* identifier so that user can hook this up to a KeyingSet (used as label). */
+ char name[64];
+ /* short help/description. */
+ char description[240]; /* RNA_DYN_DESCR_MAX */
/* keying settings */
short keyingflag;
@@ -208,9 +210,6 @@ int ANIM_scene_get_keyingset_index(struct Scene *scene, struct KeyingSet *ks);
/* Get Keying Set to use for Auto-Keyframing some transforms */
struct KeyingSet *ANIM_get_keyingset_for_autokeying(struct Scene *scene, const char *tranformKSName);
-/* Create (and show) a menu containing all the Keying Sets which can be used in the current context */
-void ANIM_keying_sets_menu_setup(struct bContext *C, const char title[], const char op_name[]);
-
/* Dynamically populate an enum of Keying Sets */
struct EnumPropertyItem *ANIM_keying_sets_enum_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int *free);
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h
index 986c2abad69..17a06bbb9ac 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -96,30 +96,30 @@ int mesh_mirrtopo_table(struct Object *ob, char mode);
/* bmeshutils.c */
-/*
- [note: I've decided to use ideasman's code for non-editmode stuff, but since
- it has a big "not for editmode!" disclaimer, I'm going to keep what I have here
- - joeedh]
-
- x-mirror editing api. usage:
-
- EDBM_CacheMirrorVerts(em);
- ...
- ...
- BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
- mirrorv = EDBM_GetMirrorVert(em, v);
- }
- ...
- ...
- EDBM_EndMirrorCache(em);
-
- note: why do we only allow x axis mirror editing?
- */
+/**
+ * [note: I've decided to use ideasman's code for non-editmode stuff, but since
+ * it has a big "not for editmode!" disclaimer, I'm going to keep what I have here
+ * - joeedh]
+ *
+ * x-mirror editing api. usage:
+ *
+ * EDBM_CacheMirrorVerts(em);
+ * ...
+ * ...
+ * BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
+ * mirrorv = EDBM_GetMirrorVert(em, v);
+ * }
+ * ...
+ * ...
+ * EDBM_EndMirrorCache(em);
+ *
+ * \note why do we only allow x axis mirror editing?
+ */
void EDBM_CacheMirrorVerts(struct BMEditMesh *em, const short use_select); /* note, replaces EM_cache_x_mirror_vert in trunk */
-/*retrieves mirrored cache vert, or NULL if there isn't one.
- note: calling this without ensuring the mirror cache state
- is bad.*/
+/* retrieves mirrored cache vert, or NULL if there isn't one.
+ * note: calling this without ensuring the mirror cache state
+ * is bad.*/
struct BMVert *EDBM_GetMirrorVert(struct BMEditMesh *em, struct BMVert *v);
void EDBM_ClearMirrorVert(struct BMEditMesh *em, struct BMVert *v);
void EDBM_EndMirrorCache(struct BMEditMesh *em);
@@ -263,16 +263,6 @@ void ED_vgroup_vert_add(struct Object *ob, struct bDeformGroup *dg, int vertnum
void ED_vgroup_vert_remove(struct Object *ob, struct bDeformGroup *dg, int vertnum);
float ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg, int vertnum);
-/**
- * findnearestvert
- *
- * dist (in/out): minimal distance to the nearest and at the end, actual distance
- * sel: selection bias
- * if SELECT, selected vertice are given a 5 pixel bias to make them farter than unselect verts
- * if 0, unselected vertice are given the bias
- * strict: if 1, the vertice corresponding to the sel parameter are ignored and not just biased
- */
-
struct BMVert *EDBM_findnearestvert(struct ViewContext *vc, int *dist, short sel, short strict);
struct BMEdge *EDBM_findnearestedge(struct ViewContext *vc, int *dist);
struct BMFace *EDBM_findnearestface(struct ViewContext *vc, int *dist);
diff --git a/source/blender/editors/include/ED_render.h b/source/blender/editors/include/ED_render.h
index c9e00b0296a..73bbd5ffef8 100644
--- a/source/blender/editors/include/ED_render.h
+++ b/source/blender/editors/include/ED_render.h
@@ -67,12 +67,12 @@ typedef struct RenderInfo {
#define PR_ROTATED 8
/* Render the preview
-
-pr_method:
-- PR_BUTS_RENDER: preview is rendered for buttons window
-- PR_ICON_RENDER: preview is rendered for icons. hopefully fast enough for at least 32x32
-- PR_NODE_RENDER: preview is rendered for node editor.
-*/
+ *
+ * pr_method:
+ * - PR_BUTS_RENDER: preview is rendered for buttons window
+ * - PR_ICON_RENDER: preview is rendered for icons. hopefully fast enough for at least 32x32
+ * - PR_NODE_RENDER: preview is rendered for node editor
+ */
#define PR_BUTS_RENDER 0
#define PR_ICON_RENDER 1
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
index fa13cbf73b7..f0fffb34b73 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -100,7 +100,7 @@ bScreen *ED_screen_duplicate(struct wmWindow *win, struct bScreen *sc);
bScreen *ED_screen_add(struct wmWindow *win, struct Scene *scene, const char *name);
void ED_screen_set(struct bContext *C, struct bScreen *sc);
void ED_screen_delete(struct bContext *C, struct bScreen *sc);
-void ED_screen_set_scene(struct bContext *C, struct Scene *scene);
+void ED_screen_set_scene(struct bContext *C, struct bScreen *screen, struct Scene *scene);
void ED_screen_delete_scene(struct bContext *C, struct Scene *scene);
void ED_screen_set_subwinactive(struct bContext *C, struct wmEvent *event);
void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h
index 0d6e640c7bf..8023eef8370 100644
--- a/source/blender/editors/include/ED_space_api.h
+++ b/source/blender/editors/include/ED_space_api.h
@@ -57,7 +57,7 @@ void ED_spacetype_userpref(void);
void ED_spacetype_clip(void);
/* calls for instancing and freeing spacetype static data
- called in WM_init_exit */
+ * called in WM_init_exit */
/* in space_file.c */
void ED_file_init(void);
void ED_file_exit(void);
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 23321e0e48f..98220ff324e 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -219,9 +219,9 @@ void project_float_noclip(struct ARegion *ar, const float vec[3], float adr[2]);
int ED_view3d_clip_range_get(struct View3D *v3d, struct RegionView3D *rv3d, float *clipsta, float *clipend);
int ED_view3d_viewplane_get(struct View3D *v3d, struct RegionView3D *rv3d, int winxi, int winyi, struct rctf *viewplane, float *clipsta, float *clipend);
void ED_view3d_ob_project_mat_get(struct RegionView3D *v3d, struct Object *ob, float pmat[4][4]);
-void ED_view3d_project_float(const struct ARegion *a, const float vec[3], float adr[2], float mat[4][4]);
void ED_view3d_calc_camera_border(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct RegionView3D *rv3d, struct rctf *viewborder_r, short no_shift);
-void ED_view3d_project_float_v3(struct ARegion *a, const float vec[3], float *adr, float mat[4][4]);
+void ED_view3d_project_float_v2(const struct ARegion *a, const float vec[3], float adr[2], float mat[4][4]);
+void ED_view3d_project_float_v3(struct ARegion *a, const float vec[3], float adr[3], float mat[4][4]);
void ED_view3d_calc_camera_border_size(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct RegionView3D *rv3d, float size_r[2]);
/* drawobject.c iterators */
@@ -284,14 +284,15 @@ int ED_view3d_scene_layer_set(int lay, const int *values, int *active);
int ED_view3d_context_activate(struct bContext *C);
void ED_view3d_draw_offscreen(struct Scene *scene, struct View3D *v3d, struct ARegion *ar,
- int winx, int winy, float viewmat[][4], float winmat[][4]);
+ int winx, int winy, float viewmat[][4], float winmat[][4], int draw_background);
-struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey, unsigned int flag, char err_out[256]);
-struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(struct Scene *scene, struct Object *camera, int width, int height, unsigned int flag, int drawtype, char err_out[256]);
+struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey, unsigned int flag, int draw_background, char err_out[256]);
+struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(struct Scene *scene, struct Object *camera, int width, int height, unsigned int flag, int drawtype, int draw_background, char err_out[256]);
struct Base *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]);
void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar, short do_clip);
+void ED_view3d_update_viewmat(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, float viewmat[][4], float winmat[][4]);
int ED_view3d_lock(struct RegionView3D *rv3d);
uint64_t ED_view3d_datamask(struct Scene *scene, struct View3D *v3d);
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index fafd35bf911..18e2af939fd 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -178,11 +178,11 @@ typedef struct uiLayout uiLayout;
#define UI_DPI_ICON_SIZE ((float)16 * UI_DPI_ICON_FAC)
/* Button types, bits stored in 1 value... and a short even!
-- bits 0-4: bitnr (0-31)
-- bits 5-7: pointer type
-- bit 8: for 'bit'
-- bit 9-15: button type (now 6 bits, 64 types)
-*/
+ * - bits 0-4: bitnr (0-31)
+ * - bits 5-7: pointer type
+ * - bit 8: for 'bit'
+ * - bit 9-15: button type (now 6 bits, 64 types)
+ * */
#define CHA 32
#define SHO 64
diff --git a/source/blender/editors/include/UI_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h
index a1b42ac39c2..c2bc2cf6af1 100644
--- a/source/blender/editors/include/UI_interface_icons.h
+++ b/source/blender/editors/include/UI_interface_icons.h
@@ -54,8 +54,8 @@ typedef struct IconFile {
#define PREVIEW_DEFAULT_HEIGHT 96
/*
- Resizable Icons for Blender
-*/
+ * Resizable Icons for Blender
+ */
void UI_icons_init(int first_dyn_id);
int UI_icon_get_width(int icon_id);
int UI_icon_get_height(int icon_id);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 1944f81ec2d..edddd9bf407 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -456,7 +456,7 @@ static int ui_but_float_precision(uiBut *but, double value)
prec= (but->hardmax < 10.001f) ? 3 : 2;
}
- /* check on the number of decimal places neede to display
+ /* check on the number of decimal places need to display
* the number, this is so 0.00001 is not displayed as 0.00,
* _but_, this is only for small values si 10.0001 will not get
* the same treatment */
@@ -669,7 +669,7 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
return found;
}
-/* needed for temporarily rename buttons, such as in outliner or fileselect,
+/* needed for temporarily rename buttons, such as in outliner or file-select,
* they should keep calling uiDefButs to keep them alive */
/* returns 0 when button removed */
int uiButActiveOnly(const bContext *C, uiBlock *block, uiBut *but)
@@ -764,7 +764,7 @@ static void ui_menu_block_set_keyaccels(uiBlock *block)
}
if(pass==0) {
- /* Skip to next delimeter on first pass (be picky) */
+ /* Skip to next delimiter on first pass (be picky) */
while(isalpha(*str_pt))
str_pt++;
@@ -1514,7 +1514,7 @@ void ui_set_but_val(uiBut *but, double value)
/* gcc 3.2.1 seems to have problems
* casting a double like 32772.0 to
* a short so we cast to an int, then
- to a short */
+ * to a short */
int gcckludge;
gcckludge = (int) floor(value+0.5);
value= (short)gcckludge;
@@ -1745,9 +1745,12 @@ int ui_set_but_string_eval_num(bContext *C, uiBut *but, const char *str, double
#else /* WITH_PYTHON */
- value= atof(str);
+ *value = atof(str);
ok = TRUE;
+ (void)C;
+ (void)but;
+
#endif /* WITH_PYTHON */
return ok;
@@ -1875,7 +1878,7 @@ static double soft_range_round_down(double value, double max)
void ui_set_but_soft_range(uiBut *but, double value)
{
- /* ideally we would not limit this but practially, its more then
+ /* ideally we would not limit this but practically, its more then
* enough worst case is very long vectors wont use a smart soft-range
* which isnt so bad. */
@@ -2373,7 +2376,7 @@ static void ui_block_do_align_but(uiBut *first, short nr)
}
}
- /* rows==0: 1 row, cols==0: 1 collumn */
+ /* rows==0: 1 row, cols==0: 1 column */
/* note; how it uses 'flag' in loop below (either set it, or OR it) is confusing */
for(but=first, prev=NULL; but && but->alignnr == nr; prev=but, but=but->next) {
@@ -2515,13 +2518,13 @@ void ui_block_do_align(uiBlock *block)
}
}
-/*
- * ui_def_but is the function that draws many button types
-
+/**
+ * \brief ui_def_but is the function that draws many button types
+ *
* for float buttons:
- * "a1" Click Step (how much to change the value each click)
- * "a2" Number of decimal point values to display. 0 defaults to 3 (0.000)
- * 1,2,3, and a maximum of 4, all greater values will be clamped to 4.
+ * - \a a1 Click Step (how much to change the value each click)
+ * - \a a2 Number of decimal point values to display. 0 defaults to 3 (0.000)
+ * 1,2,3, and a maximum of 4, all greater values will be clamped to 4.
*/
static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip)
{
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 93cb0f8ae97..01700e1c52a 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -432,7 +432,8 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUSED(w
if (!ibuf) return;
- /* scissor doesn't seem to be doing the right thing...?
+ /* scissor doesn't seem to be doing the right thing...? */
+#if 0
//glColor4f(1.0, 0.f, 0.f, 1.f);
//fdrawbox(rect->xmin, rect->ymin, rect->xmax, rect->ymax)
@@ -441,7 +442,7 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUSED(w
// prevent drawing outside widget area
glGetIntegerv(GL_SCISSOR_BOX, scissor);
glScissor(ar->winrct.xmin + rect->xmin, ar->winrct.ymin + rect->ymin, w, h);
- */
+#endif
glEnable(GL_BLEND);
glColor4f(0.0, 0.0, 0.0, 0.0);
@@ -451,10 +452,10 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUSED(w
glDisable(GL_BLEND);
- /*
+#if 0
// restore scissortest
glScissor(scissor[0], scissor[1], scissor[2], scissor[3]);
- */
+#endif
#endif
}
@@ -556,24 +557,21 @@ static void ui_draw_but_CHARTAB(uiBut *but)
// Set the font to be either unicode or FO_BUILTIN_NAME
wstr[0] = cs;
- if(strcmp(G.selfont->name, FO_BUILTIN_NAME))
- {
+ if (strcmp(G.selfont->name, FO_BUILTIN_NAME)) {
BLI_strncpy_wchar_as_utf8((char *)ustr, (wchar_t *)wstr, sizeof(ustr));
}
- else
- {
- if(G.ui_international == TRUE)
- {
+ else {
+ if (G.ui_international == TRUE) {
BLI_strncpy_wchar_as_utf8((char *)ustr, (wchar_t *)wstr, sizeof(ustr));
}
- else
- {
+ else {
ustr[0] = cs;
ustr[1] = 0;
}
}
- if((G.selfont && strcmp(G.selfont->name, FO_BUILTIN_NAME)) || (G.selfont && !strcmp(G.selfont->name, FO_BUILTIN_NAME) && G.ui_international == TRUE))
+ if ((G.selfont && strcmp(G.selfont->name, FO_BUILTIN_NAME)) ||
+ (G.selfont && !strcmp(G.selfont->name, FO_BUILTIN_NAME) && G.ui_international == TRUE))
{
float wid;
float llx, lly, llz, urx, ury, urz;
@@ -594,8 +592,7 @@ static void ui_draw_but_CHARTAB(uiBut *but)
ui_rasterpos_safe(px, py, but->aspect);
FTF_DrawString((char *) ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
}
- else
- {
+ else {
ui_rasterpos_safe(sx + butw/2, sy + buth/2, but->aspect);
UI_DrawString(but->font, (char *) ustr, 0);
}
@@ -1055,7 +1052,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect)
float x1, y1, sizex, sizey;
float v3[2], v1[2], v2[2], v1a[2], v2a[2];
int a;
- float pos, colf[4]= {0,0,0,0}; /* initialize incase the colorband isnt valid */
+ float pos, colf[4]= {0,0,0,0}; /* initialize in case the colorband isnt valid */
coba= (ColorBand *)(but->editcoba? but->editcoba: but->poin);
if(coba==NULL) return;
@@ -1138,7 +1135,8 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect)
setlinestyle(0);
glBegin(GL_LINES);
- /* glColor3ub(0, 0, 0);
+#if 0
+ glColor3ub(0, 0, 0);
glVertex2fv(v1);
glVertex2fv(v1a);
glColor3ub(255, 255, 255);
@@ -1150,7 +1148,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect)
glColor3ub(255, 255, 255);
glVertex2fv(v2a);
glVertex2fv(v3);
- */
+#endif
}
else {
glColor3ub(0, 0, 0);
@@ -1367,17 +1365,21 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
/* cfra option */
- /* XXX 2.48
+ /* XXX 2.48 */
+#if 0
if(cumap->flag & CUMA_DRAW_CFRA) {
glColor3ub(0x60, 0xc0, 0x40);
glBegin(GL_LINES);
glVertex2f(rect->xmin + zoomx*(cumap->sample[0]-offsx), rect->ymin);
glVertex2f(rect->xmin + zoomx*(cumap->sample[0]-offsx), rect->ymax);
glEnd();
- }*/
+ }
+#endif
/* sample option */
- /* XXX 2.48
- * if(cumap->flag & CUMA_DRAW_SAMPLE) {
+
+ /* XXX 2.48 */
+#if 0
+ if(cumap->flag & CUMA_DRAW_SAMPLE) {
if(cumap->cur==3) {
float lum= cumap->sample[0]*0.35f + cumap->sample[1]*0.45f + cumap->sample[2]*0.2f;
glColor3ub(240, 240, 240);
@@ -1400,8 +1402,9 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
glVertex2f(rect->xmin + zoomx*(cumap->sample[cumap->cur]-offsx), rect->ymax);
glEnd();
}
- }*/
-
+ }
+#endif
+
/* the curve */
glColor3ubv((unsigned char*)wcol->item);
glEnable(GL_LINE_SMOOTH);
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 41385292707..cae6f61d269 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -48,6 +48,7 @@
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
+#include "BLI_string_cursor_utf8.h"
#include "PIL_time.h"
@@ -108,23 +109,6 @@ typedef enum uiHandleButtonState {
BUTTON_STATE_EXIT
} uiHandleButtonState;
-typedef enum uiButtonJumpType {
- BUTTON_EDIT_JUMP_NONE,
- BUTTON_EDIT_JUMP_DELIM,
- BUTTON_EDIT_JUMP_ALL
-} uiButtonJumpType;
-
-typedef enum uiButtonDelimType {
- BUTTON_DELIM_NONE,
- BUTTON_DELIM_ALPHA,
- BUTTON_DELIM_PUNCT,
- BUTTON_DELIM_BRACE,
- BUTTON_DELIM_OPERATOR,
- BUTTON_DELIM_QUOTE,
- BUTTON_DELIM_WHITESPACE,
- BUTTON_DELIM_OTHER
-} uiButtonDelimType;
-
typedef struct uiHandleButtonData {
wmWindowManager *wm;
wmWindow *window;
@@ -1238,144 +1222,6 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
/* ************* in-button text selection/editing ************* */
-/* return 1 if char ch is special character, otherwise return 0 */
-static uiButtonDelimType test_special_char(const char ch)
-{
- if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) {
- return BUTTON_DELIM_ALPHA;
- }
-
- switch(ch) {
- case ',':
- case '.':
- return BUTTON_DELIM_PUNCT;
-
- case '{':
- case '}':
- case '[':
- case ']':
- case '(':
- case ')':
- return BUTTON_DELIM_BRACE;
-
- case '+':
- case '-':
- case '=':
- case '~':
- case '%':
- case '/':
- case '<':
- case '>':
- case '^':
- case '*':
- case '&':
- return BUTTON_DELIM_OPERATOR;
-
- case '\'':
- case '\"': // " - an extra closing one for Aligorith's text editor
- return BUTTON_DELIM_QUOTE;
-
- case ' ':
- return BUTTON_DELIM_WHITESPACE;
-
- case '\\':
- case '!':
- case '@':
- case '#':
- case '$':
- case ':':
- case ';':
- case '?':
- case '_':
- return BUTTON_DELIM_OTHER;
-
- default:
- break;
- }
- return BUTTON_DELIM_NONE;
-}
-
-static int ui_textedit_step_next_utf8(const char *str, size_t maxlen, short *pos)
-{
- const char *str_end= str + (maxlen + 1);
- const char *str_pos= str + (*pos);
- const char *str_next= BLI_str_find_next_char_utf8(str_pos, str_end);
- if (str_next) {
- (*pos) += (str_next - str_pos);
- if((*pos) > maxlen) (*pos)= maxlen;
- return TRUE;
- }
-
- return FALSE;
-}
-
-static int ui_textedit_step_prev_utf8(const char *str, size_t UNUSED(maxlen), short *pos)
-{
- if((*pos) > 0) {
- const char *str_pos= str + (*pos);
- const char *str_prev= BLI_str_find_prev_char_utf8(str, str_pos);
- if (str_prev) {
- (*pos) -= (str_pos - str_prev);
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-static void ui_textedit_step_utf8(const char *str, size_t maxlen,
- short *pos, const char direction,
- uiButtonJumpType jump)
-{
- const short pos_prev= *pos;
-
- if(direction) { /* right*/
- if(jump != BUTTON_EDIT_JUMP_NONE) {
- const uiButtonDelimType is_special= (*pos) < maxlen ? test_special_char(str[(*pos)]) : BUTTON_DELIM_NONE;
- /* jump between special characters (/,\,_,-, etc.),
- * look at function test_special_char() for complete
- * list of special character, ctr -> */
- while((*pos) < maxlen) {
- if (ui_textedit_step_next_utf8(str, maxlen, pos)) {
- if((jump != BUTTON_EDIT_JUMP_ALL) && (is_special != test_special_char(str[(*pos)]))) break;
- }
- else {
- break; /* unlikely but just incase */
- }
- }
- }
- else {
- ui_textedit_step_next_utf8(str, maxlen, pos);
- }
- }
- else { /* left */
- if(jump != BUTTON_EDIT_JUMP_NONE) {
- const uiButtonDelimType is_special= (*pos) > 1 ? test_special_char(str[(*pos) - 1]) : BUTTON_DELIM_NONE;
- /* left only: compensate for index/change in direction */
- ui_textedit_step_prev_utf8(str, maxlen, pos);
-
- /* jump between special characters (/,\,_,-, etc.),
- * look at function test_special_char() for complete
- * list of special character, ctr -> */
- while ((*pos) > 0) {
- if (ui_textedit_step_prev_utf8(str, maxlen, pos)) {
- if((jump != BUTTON_EDIT_JUMP_ALL) && (is_special != test_special_char(str[(*pos)]))) break;
- }
- else {
- break;
- }
- }
-
- /* left only: compensate for index/change in direction */
- if(((*pos) != 0) && ABS(pos_prev - (*pos)) > 1) {
- ui_textedit_step_next_utf8(str, maxlen, pos);
- }
- }
- else {
- ui_textedit_step_prev_utf8(str, maxlen, pos);
- }
- }
-}
static int ui_textedit_delete_selection(uiBut *but, uiHandleButtonData *data)
{
@@ -1419,12 +1265,12 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho
/* mouse dragged outside the widget to the left */
if (x < startx && but->ofs > 0) {
- short i= but->ofs;
+ int i = but->ofs;
origstr[but->ofs] = 0;
while (i > 0) {
- if (ui_textedit_step_prev_utf8(origstr, but->ofs, &i)) {
+ if (BLI_str_cursor_step_prev_utf8(origstr, but->ofs, &i)) {
if (BLF_width(fstyle->uifont_id, origstr+i) > (startx - x)*0.25f) break; // 0.25 == scale factor for less sensitivity
}
else {
@@ -1436,15 +1282,37 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho
}
/* mouse inside the widget */
else if (x >= startx) {
+ int pos_i;
+
+ /* keep track of previous distance from the cursor to the char */
+ float cdist, cdist_prev = 0.0f;
+ short pos_prev;
+
const float aspect_sqrt= sqrtf(but->block->aspect);
- but->pos= strlen(origstr)-but->ofs;
-
- /* XXX does not take zoom level into account */
- while (startx + aspect_sqrt * BLF_width(fstyle->uifont_id, origstr+but->ofs) > x) {
+ but->pos = pos_prev = strlen(origstr) - but->ofs;
+
+ while (TRUE) {
+ /* XXX does not take zoom level into account */
+ cdist = startx + aspect_sqrt * BLF_width(fstyle->uifont_id, origstr + but->ofs);
+
+ /* check if position is found */
+ if (cdist < x) {
+ /* check is previous location was infact closer */
+ if (((float)x - cdist) > (cdist_prev - (float)x)) {
+ but->pos = pos_prev;
+ }
+ break;
+ }
+ cdist_prev = cdist;
+ pos_prev = but->pos;
+ /* done with tricky distance checks */
+
+ pos_i = but->pos;
if (but->pos <= 0) break;
- if (ui_textedit_step_prev_utf8(origstr, but->ofs, &but->pos)) {
- origstr[but->pos+but->ofs] = 0;
+ if (BLI_str_cursor_step_prev_utf8(origstr, but->ofs, &pos_i)) {
+ but->pos = pos_i;
+ origstr[but->pos + but->ofs] = 0;
}
else {
break; /* unlikely but possible */
@@ -1520,7 +1388,7 @@ static int ui_textedit_type_ascii(uiBut *but, uiHandleButtonData *data, char asc
return ui_textedit_type_buf(but, data, buf, 1);
}
-static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, uiButtonJumpType jump)
+static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, strCursorJumpDirection direction, int select, strCursorJumpType jump)
{
const char *str= data->str;
const int len= strlen(str);
@@ -1531,7 +1399,7 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction
/* special case, quit selection and set cursor */
if (has_sel && !select) {
- if (jump == BUTTON_EDIT_JUMP_ALL) {
+ if (jump == STRCUR_JUMP_ALL) {
but->selsta = but->selend= but->pos = direction ? len : 0;
}
else {
@@ -1545,7 +1413,9 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction
data->selextend = 0;
}
else {
- ui_textedit_step_utf8(str, len, &but->pos, direction, jump);
+ int pos_i = but->pos;
+ BLI_str_cursor_step_utf8(str, len, &pos_i, direction, jump);
+ but->pos = pos_i;
if(select) {
/* existing selection */
@@ -1594,14 +1464,14 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction
}
}
-static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int direction, uiButtonJumpType jump)
+static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int direction, strCursorJumpType jump)
{
char *str= data->str;
const int len= strlen(str);
int changed= 0;
- if(jump == BUTTON_EDIT_JUMP_ALL) {
+ if (jump == STRCUR_JUMP_ALL) {
if(len) changed=1;
str[0]= '\0';
but->pos= 0;
@@ -1611,10 +1481,10 @@ static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int directio
changed= ui_textedit_delete_selection(but, data);
}
else if (but->pos>=0 && but->pos<len) {
- short pos= but->pos;
+ int pos = but->pos;
int step;
- ui_textedit_step_utf8(str, len, &pos, direction, jump);
- step= pos - but->pos;
+ BLI_str_cursor_step_utf8(str, len, &pos, direction, jump);
+ step = pos - but->pos;
memmove(&str[but->pos], &str[but->pos + step], (len + 1) - but->pos);
changed= 1;
}
@@ -1625,10 +1495,10 @@ static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int directio
changed= ui_textedit_delete_selection(but, data);
}
else if(but->pos>0) {
- short pos= but->pos;
+ int pos = but->pos;
int step;
- ui_textedit_step_utf8(str, len, &pos, direction, jump);
+ BLI_str_cursor_step_utf8(str, len, &pos, direction, jump);
step= but->pos - pos;
memmove(&str[but->pos - step], &str[but->pos], (len + 1) - but->pos);
but->pos -= step;
@@ -1730,6 +1600,8 @@ static int ui_textedit_copypaste(uiBut *but, uiHandleButtonData *data, int paste
static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
{
+ int len;
+
if(data->str) {
MEM_freeN(data->str);
data->str= NULL;
@@ -1744,15 +1616,18 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
ui_convert_to_unit_alt_name(but, data->str, data->maxlen);
}
- data->origstr= BLI_strdup(data->str);
- data->selextend= 0;
- data->selstartx= 0;
+ /* won't change from now on */
+ len = strlen(data->str);
+
+ data->origstr = BLI_strdupn(data->str, len);
+ data->selextend = 0;
+ data->selstartx = 0;
/* set cursor pos to the end of the text */
- but->editstr= data->str;
- but->pos= strlen(data->str);
- but->selsta= 0;
- but->selend= strlen(data->str);
+ but->editstr = data->str;
+ but->pos = len;
+ but->selsta = 0;
+ but->selend = len;
/* optional searchbox */
if(but->type==SEARCH_MENU) {
@@ -1920,11 +1795,11 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
}
break;
case RIGHTARROWKEY:
- ui_textedit_move(but, data, 1, event->shift, event->ctrl ? BUTTON_EDIT_JUMP_DELIM : BUTTON_EDIT_JUMP_NONE);
+ ui_textedit_move(but, data, STRCUR_DIR_NEXT, event->shift, event->ctrl ? STRCUR_JUMP_DELIM : STRCUR_JUMP_NONE);
retval= WM_UI_HANDLER_BREAK;
break;
case LEFTARROWKEY:
- ui_textedit_move(but, data, 0, event->shift, event->ctrl ? BUTTON_EDIT_JUMP_DELIM : BUTTON_EDIT_JUMP_NONE);
+ ui_textedit_move(but, data, STRCUR_DIR_PREV, event->shift, event->ctrl ? STRCUR_JUMP_DELIM : STRCUR_JUMP_NONE);
retval= WM_UI_HANDLER_BREAK;
break;
case DOWNARROWKEY:
@@ -1934,7 +1809,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
}
/* pass on purposedly */
case ENDKEY:
- ui_textedit_move(but, data, 1, event->shift, BUTTON_EDIT_JUMP_ALL);
+ ui_textedit_move(but, data, STRCUR_DIR_NEXT, event->shift, STRCUR_JUMP_ALL);
retval= WM_UI_HANDLER_BREAK;
break;
case UPARROWKEY:
@@ -1944,7 +1819,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
}
/* pass on purposedly */
case HOMEKEY:
- ui_textedit_move(but, data, 0, event->shift, BUTTON_EDIT_JUMP_ALL);
+ ui_textedit_move(but, data, STRCUR_DIR_PREV, event->shift, STRCUR_JUMP_ALL);
retval= WM_UI_HANDLER_BREAK;
break;
case PADENTER:
@@ -1953,12 +1828,12 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
retval= WM_UI_HANDLER_BREAK;
break;
case DELKEY:
- changed= ui_textedit_delete(but, data, 1, event->ctrl ? BUTTON_EDIT_JUMP_DELIM : BUTTON_EDIT_JUMP_NONE);
+ changed= ui_textedit_delete(but, data, 1, event->ctrl ? STRCUR_JUMP_DELIM : STRCUR_JUMP_NONE);
retval= WM_UI_HANDLER_BREAK;
break;
case BACKSPACEKEY:
- changed= ui_textedit_delete(but, data, 0, event->shift ? BUTTON_EDIT_JUMP_ALL : (event->ctrl ? BUTTON_EDIT_JUMP_DELIM : BUTTON_EDIT_JUMP_NONE));
+ changed= ui_textedit_delete(but, data, 0, event->shift ? STRCUR_JUMP_ALL : (event->ctrl ? STRCUR_JUMP_DELIM : STRCUR_JUMP_NONE));
retval= WM_UI_HANDLER_BREAK;
break;
@@ -1986,7 +1861,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
const char *utf8_buf= event->utf8_buf;
/* exception that's useful for number buttons, some keyboard
- numpads have a comma instead of a period */
+ * numpads have a comma instead of a period */
if(ELEM3(but->type, NUM, NUMABS, NUMSLI)) { /* could use data->min*/
if(event->type == PADPERIOD && ascii == ',') {
ascii = '.';
@@ -2980,9 +2855,10 @@ static int ui_do_but_SCROLL(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
retval= WM_UI_HANDLER_BREAK;
}
/* UNUSED - otherwise code is ok, add back if needed */
- /* else if(ELEM(event->type, PADENTER, RETKEY) && event->val==KM_PRESS)
+#if 0
+ else if(ELEM(event->type, PADENTER, RETKEY) && event->val==KM_PRESS)
click= 1;
- */
+#endif
}
}
else if(data->state == BUTTON_STATE_NUM_EDITING) {
@@ -3037,7 +2913,7 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wm
* 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.
+ * all that mouse leave and cancel stuff, so quick scroll wouldn't be an issue anymore.
* same goes for scrolling wheel in another direction below (sergey)
*/
data->postbut= but;
@@ -3112,7 +2988,7 @@ static int ui_numedit_but_NORMAL(uiBut *but, uiHandleButtonData *data, int mx, i
/* if mouse moves outside of sphere, it does negative normal */
/* note that both data->vec and data->origvec should be normalized
- * else we'll get a hamrless but annoying jump when first clicking */
+ * else we'll get a harmless but annoying jump when first clicking */
fp= data->origvec;
rad= (but->x2 - but->x1);
@@ -4192,8 +4068,7 @@ static int ui_do_but_CHARTAB(bContext *UNUSED(C), uiBlock *UNUSED(block), uiBut
if(che > G.charmax)
che = 0;
- if(G.obedit)
- {
+ if(G.obedit) {
do_textedit(0,0,che);
}
@@ -4226,10 +4101,8 @@ static int ui_do_but_CHARTAB(bContext *UNUSED(C), uiBlock *UNUSED(block), uiBut
return WM_UI_HANDLER_BREAK;
}
else if(ELEM(event->type, WHEELDOWNMOUSE, PAGEDOWNKEY)) {
- for(but= block->buttons.first; but; but= but->next)
- {
- if(but->type == CHARTAB)
- {
+ for(but= block->buttons.first; but; but= but->next) {
+ if(but->type == CHARTAB) {
G.charstart = G.charstart + (12*6);
if(G.charstart > (0xffff - 12*6))
G.charstart = 0xffff - (12*6);
@@ -4674,12 +4547,13 @@ static int ui_but_menu(bContext *C, uiBut *but)
uiItemFullO(layout, "WM_OT_doc_view", "View Docs", ICON_NONE, ptr_props.data, WM_OP_EXEC_DEFAULT, 0);
/* XXX inactive option, not for public! */
-/* WM_operator_properties_create(&ptr_props, "WM_OT_doc_edit");
+#if 0
+ WM_operator_properties_create(&ptr_props, "WM_OT_doc_edit");
RNA_string_set(&ptr_props, "doc_id", buf);
RNA_string_set(&ptr_props, "doc_new", RNA_property_description(but->rnaprop));
uiItemFullO(layout, "WM_OT_doc_edit", "Submit Description", ICON_NONE, ptr_props.data, WM_OP_INVOKE_DEFAULT, 0);
- */
+ #endif
}
else if (but->optype) {
WM_operator_py_idname(buf, but->optype->idname);
@@ -5252,10 +5126,10 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
if(state != BUTTON_STATE_EXIT) {
/* When objects for eg. are removed, running ui_check_but() can access
- the removed data - so disable update on exit. Also in case of
- highlight when not in a popup menu, we remove because data used in
- button below popup might have been removed by action of popup. Needs
- a more reliable solution... */
+ * the removed data - so disable update on exit. Also in case of
+ * highlight when not in a popup menu, we remove because data used in
+ * button below popup might have been removed by action of popup. Needs
+ * a more reliable solution... */
if(state != BUTTON_STATE_HIGHLIGHT || (but->block->flag & UI_BLOCK_LOOP))
ui_check_but(but);
}
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 3e6d4f31479..552d5b0d221 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -607,7 +607,7 @@ static void init_iconfile_list(struct ListBase *list)
return;
/* since BLI_dir_contents changes the current working directory, restore it
- back to old value afterwards */
+ * back to old value afterwards */
if(!BLI_current_working_dir(olddir, sizeof(olddir)))
restoredir = 0;
totfile = BLI_dir_contents(icondir, &dir);
@@ -626,7 +626,7 @@ static void init_iconfile_list(struct ListBase *list)
ImBuf *bbuf= NULL;
/* check to see if the image is the right size, continue if not */
/* copying strings here should go ok, assuming that we never get back
- a complete path to file longer than 256 chars */
+ * a complete path to file longer than 256 chars */
BLI_join_dirfile(iconfilestr, sizeof(iconfilestr), icondir, filename);
bbuf= IMB_loadiffname(iconfilestr, IB_rect);
@@ -983,7 +983,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
if(di->type == ICON_TYPE_VECTOR) {
/* vector icons use the uiBlock transformation, they are not drawn
- with untransformed coordinates like the other icons */
+ * with untransformed coordinates like the other icons */
di->data.vector.func((int)x, (int)y, ICON_DEFAULT_HEIGHT, ICON_DEFAULT_HEIGHT, 1.0f);
}
else if(di->type == ICON_TYPE_TEXTURE) {
@@ -1015,8 +1015,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
static void ui_id_preview_image_render_size(bContext *C, ID *id, PreviewImage *pi, int size)
{
- if ((pi->changed[size] ||!pi->rect[size])) /* changed only ever set by dynamic icons */
- {
+ if ((pi->changed[size] ||!pi->rect[size])) { /* changed only ever set by dynamic icons */
/* create the rect if necessary */
icon_set_image(C, id, pi, size);
@@ -1046,7 +1045,7 @@ static void ui_id_brush_render(bContext *C, ID *id)
for(i = 0; i < NUM_ICON_SIZES; i++) {
/* check if rect needs to be created; changed
- only set by dynamic icons */
+ * only set by dynamic icons */
if((pi->changed[i] || !pi->rect[i])) {
icon_set_image(C, id, pi, i);
pi->changed[i] = 0;
@@ -1070,8 +1069,8 @@ static int ui_id_brush_get_icon(bContext *C, ID *id)
int tool, mode = 0;
/* XXX: this is not nice, should probably make brushes
- be strictly in one paint mode only to avoid
- checking various context stuff here */
+ * be strictly in one paint mode only to avoid
+ * checking various context stuff here */
if(CTX_wm_view3d(C) && ob) {
if(ob->mode & OB_MODE_SCULPT)
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index d324018e4ba..dd4bbc75249 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -176,10 +176,10 @@ struct uiBut {
struct bContextStore *context;
/* not ysed yet, was used in 2.4x for ui_draw_pulldown_round & friends */
- /*
+#if 0
void (*embossfunc)(int , int , float, float, float, float, float, int);
void (*sliderfunc)(int , float, float, float, float, float, float, int);
- */
+#endif
uiButCompleteFunc autocomplete_func;
void *autofunc_arg;
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index b3b187f92a2..a0dbecbd4a6 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -536,9 +536,11 @@ static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, const char *n
uiBlockSetCurLayout(block, sub);
if(name[0]) {
- /* XXX UI_GetStringWidth is not accurate
- labelw= UI_GetStringWidth(name);
- CLAMP(labelw, w/4, 3*w/4);*/
+ /* XXX UI_GetStringWidth is not accurate */
+#if 0
+ labelw = UI_GetStringWidth(name);
+ CLAMP(labelw, w/4, 3*w/4);
+#endif
labelw= w/3;
uiDefBut(block, LABEL, 0, name, x, y, labelw, h, NULL, 0.0, 0.0, 0, 0, "");
w= w-labelw;
@@ -2882,8 +2884,8 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,in
col= uiLayoutColumn(layout, 0);
block= uiLayoutGetBlock(col);
- but = uiDefIconTextBut(block , BUT, 0, ICON_FILE_REFRESH, "Reset", 0, 0, 18, 20, NULL, 0.0, 0.0, 0.0, 0.0,
- "Reset operator defaults");
+ but = uiDefIconTextBut(block , BUT, 0, ICON_FILE_REFRESH, IFACE_("Reset"), 0, 0, 18, 20,
+ NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Reset operator defaults"));
uiButSetFunc(but, ui_layout_operator_buts__reset_cb, op, NULL);
}
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index 0521ecbf0d0..5ca3f730006 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -487,7 +487,7 @@ static void UI_OT_reports_to_textblock(wmOperatorType *ot)
/* ------------------------------------------------------------------------- */
/* EditSource Utility funcs and operator,
- * note, this includes itility functions and button matching checks */
+ * note, this includes utility functions and button matching checks */
struct uiEditSourceStore {
uiBut but_orig;
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index d802c8640b8..b1099576505 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -543,8 +543,8 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
}
/* if the panel is minimized vertically:
- * (------)
- */
+ * (------)
+ */
if(panel->flag & PNL_CLOSEDY) {
}
@@ -618,7 +618,7 @@ static int get_panel_size_y(Panel *pa)
}
/* this function is needed because uiBlock and Panel itself dont
-change sizey or location when closed */
+ * change sizey or location when closed */
static int get_panel_real_ofsy(Panel *pa)
{
if(pa->flag & PNL_CLOSEDY) return pa->ofsy+pa->sizey;
@@ -639,10 +639,10 @@ typedef struct PanelSort {
} PanelSort;
/* note about sorting;
- the sortorder has a lower value for new panels being added.
- however, that only works to insert a single panel, when more new panels get
- added the coordinates of existing panels and the previously stored to-be-insterted
- panels do not match for sorting */
+ * the sortorder has a lower value for new panels being added.
+ * however, that only works to insert a single panel, when more new panels get
+ * added the coordinates of existing panels and the previously stored to-be-inserted
+ * panels do not match for sorting */
static int find_leftmost_panel(const void *a1, const void *a2)
{
@@ -837,7 +837,7 @@ void uiBeginPanels(const bContext *UNUSED(C), ARegion *ar)
{
Panel *pa;
- /* set all panels as inactive, so that at the end we know
+ /* set all panels as inactive, so that at the end we know
* which ones were used */
for(pa=ar->panels.first; pa; pa=pa->next) {
if(pa->runtime_flag & PNL_ACTIVE)
@@ -1150,11 +1150,14 @@ int ui_handler_panel_region(bContext *C, wmEvent *event)
}
}
else if(event->type == ESCKEY) {
- /*XXX 2.50 if(block->handler) {
+ /*XXX 2.50*/
+#if 0
+ if(block->handler) {
rem_blockhandler(sa, block->handler);
ED_region_tag_redraw(ar);
retval= WM_UI_HANDLER_BREAK;
- }*/
+ }
+#endif
}
else if(event->type==PADPLUSKEY || event->type==PADMINUS) {
#if 0 // XXX make float panel exception?
@@ -1297,13 +1300,17 @@ static void panel_activate_state(const bContext *C, Panel *pa, uiHandlePanelStat
ED_region_tag_redraw(ar);
/* XXX exception handling, 3d window preview panel */
- /* if(block->drawextra==BIF_view3d_previewdraw)
- BIF_view3d_previewrender_clear(curarea);*/
-
+#if 0
+ if(block->drawextra==BIF_view3d_previewdraw)
+ BIF_view3d_previewrender_clear(curarea);
+#endif
+
/* XXX exception handling, 3d window preview panel */
- /* if(block->drawextra==BIF_view3d_previewdraw)
+#if 0
+ if(block->drawextra==BIF_view3d_previewdraw)
BIF_view3d_previewrender_signal(curarea, PR_DISPRECT);
else if(strcmp(block->name, "image_panel_preview")==0)
- image_preview_event(2); */
+ image_preview_event(2);
+#endif
}
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 32f284826a7..f971410672c 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -1025,7 +1025,7 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
ar->regiondata= data;
/* special case, hardcoded feature, not draw backdrop when called from menus,
- assume for design that popup already added it */
+ * assume for design that popup already added it */
if(but->block->flag & UI_BLOCK_LOOP)
data->noback= 1;
@@ -1664,7 +1664,7 @@ static void ui_block_func_MENUSTR(bContext *UNUSED(C), uiLayout *layout, void *a
for(a=0; a<md->nitems; a++) {
if(a == column_end) {
/* start new column, and find out where it ends in advance, so we
- can flip the order of items properly per column */
+ * can flip the order of items properly per column */
column_start= a;
column_end= md->nitems;
@@ -1755,11 +1755,11 @@ void ui_block_func_ICONTEXTROW(bContext *UNUSED(C), uiLayout *layout, void *arg_
static void ui_warp_pointer(int x, int y)
{
/* XXX 2.50 which function to use for this? */
- /* OSX has very poor mousewarp support, it sends events;
- this causes a menu being pressed immediately ... */
- #ifndef __APPLE__
+ /* OSX has very poor mouse-warp support, it sends events;
+ * this causes a menu being pressed immediately ... */
+# ifndef __APPLE__
warp_pointer(x, y);
- #endif
+# endif
}
#endif
@@ -2252,7 +2252,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
block= pup->block;
/* in some cases we create the block before the region,
- so we set it delayed here if necessary */
+ * so we set it delayed here if necessary */
if(BLI_findindex(&handle->region->uiblocks, block) == -1)
uiBlockSetRegion(block, handle->region);
@@ -2270,15 +2270,15 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
if((block->flag & UI_BLOCK_POPUP_MEMORY) &&
(bt= ui_popup_menu_memory(block, NULL))) {
/* position mouse on last clicked item, at 0.8*width of the
- button, so it doesn't overlap the text too much, also note
- the offset is negative because we are inverse moving the
- block to be under the mouse */
+ * button, so it doesn't overlap the text too much, also note
+ * the offset is negative because we are inverse moving the
+ * block to be under the mouse */
offset[0]= -(bt->x1 + 0.8f*(bt->x2 - bt->x1));
offset[1]= -(bt->y1 + 0.5f*UI_UNIT_Y);
}
else {
/* position mouse at 0.8*width of the button and below the tile
- on the first item */
+ * on the first item */
offset[0]= 0;
for(bt=block->buttons.first; bt; bt=bt->next)
offset[0]= MIN2(offset[0], -(bt->x1 + 0.8f*(bt->x2 - bt->x1)));
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 16b543737d0..65e2b98f4b9 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -60,20 +60,19 @@
/* style + theme + layout-engine = UI */
/*
- This is a complete set of layout rules, the 'state' of the Layout
- Engine. Multiple styles are possible, defined via C or Python. Styles
- get a name, and will typically get activated per region type, like
- "Header", or "Listview" or "Toolbar". Properties of Style definitions
- are:
-
- - default collumn properties, internal spacing, aligning, min/max width
- - button alignment rules (for groups)
- - label placement rules
- - internal labeling or external labeling default
- - default minimum widths for buttons/labels (in amount of characters)
- - font types, styles and relative sizes for Panel titles, labels, etc.
-
-*/
+ * This is a complete set of layout rules, the 'state' of the Layout
+ * Engine. Multiple styles are possible, defined via C or Python. Styles
+ * get a name, and will typically get activated per region type, like
+ * "Header", or "Listview" or "Toolbar". Properties of Style definitions
+ * are:
+ *
+ * - default column properties, internal spacing, aligning, min/max width
+ * - button alignment rules (for groups)
+ * - label placement rules
+ * - internal labeling or external labeling default
+ * - default minimum widths for buttons/labels (in amount of characters)
+ * - font types, styles and relative sizes for Panel titles, labels, etc.
+ */
/* ********************************************** */
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 805acff0a77..a9aa3368a28 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -775,8 +775,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
}
if (ob->type==OB_MESH) {
- if (modifier_couldBeCage(scene, md) && (index <= lastCageIndex))
- {
+ if (modifier_couldBeCage(scene, md) && (index <= lastCageIndex)) {
/* -- convert to rna ? */
but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0,
TIP_("Apply modifier to editing cage during Editmode"));
@@ -798,12 +797,12 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
/* some modifiers could work with pre-tesselated curves only */
if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
/* add disabled pre-tesselated button, so users could have
- message for this modifiers */
+ * message for this modifiers */
but = uiDefIconButBitI(block, TOG, eModifierMode_ApplyOnSpline, 0, ICON_SURFACE_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0,
TIP_("This modifier could be applied on splines' points only"));
uiButSetFlag(but, UI_BUT_DISABLED);
} else if (mti->type != eModifierTypeType_Constructive) {
- /* constructive modifiers tesselates curve before applying */
+ /* constructive modifiers tessellates curve before applying */
uiItemR(row, &ptr, "use_apply_on_spline", 0, "", ICON_NONE);
}
}
@@ -1252,8 +1251,8 @@ static void rna_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg))
RNAUpdateCb *cb= (RNAUpdateCb*)arg_cb;
/* we call update here on the pointer property, this way the
- owner of the curve mapping can still define it's own update
- and notifier, even if the CurveMapping struct is shared. */
+ * owner of the curve mapping can still define it's own update
+ * and notifier, even if the CurveMapping struct is shared. */
RNA_property_update(C, &cb->ptr, cb->prop);
}
@@ -1314,7 +1313,7 @@ static void colorband_update_cb(bContext *UNUSED(C), void *bt_v, void *coba_v)
ColorBand *coba= coba_v;
/* sneaky update here, we need to sort the colorband points to be in order,
- however the RNA pointer then is wrong, so we update it */
+ * however the RNA pointer then is wrong, so we update it */
colorband_update_sort(coba);
bt->rnapoin.data = coba->data + coba->cur;
}
@@ -1946,7 +1945,7 @@ void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, const char *propnam
}
if(lock_luminosity) {
- float color[4]; /* incase of alpha */
+ float color[4]; /* in case of alpha */
but->flag |= UI_BUT_VEC_SIZE_LOCK;
RNA_property_float_get_array(ptr, prop, color);
but->a2= len_v3(color);
@@ -2248,11 +2247,11 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
* integer = IntProperty()
* string = StringProperty()
*
- * # A string of all identifiers (colon-separated) which property’s controls should be
+ * # A string of all identifiers (colon-separated) which property's controls should be
* # displayed in a template_list.
* template_list_controls = StringProperty(default="integer:bool:string", options={"HIDDEN"})
*
- * … you’ll get a numfield for the integer prop, a check box for the bool prop, and a textfield
+ * ... you'll get a numfield for the integer prop, a check box for the bool prop, and a textfield
* for the string prop, after the name of each item of the collection.
*/
else if (prop_list_id) {
@@ -2261,9 +2260,9 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
/* XXX: Check, as sometimes we get an itemptr looking like
* {id = {data = 0x0}, type = 0x0, data = 0x0}
- * which would obviously produce a sigsev… */
+ * which would obviously produce a sigsev... */
if (itemptr->type) {
- /* If the special property is set for the item, and it is a collection… */
+ /* If the special property is set for the item, and it is a collection... */
PropertyRNA *prop_list= RNA_struct_find_property(itemptr, prop_list_id);
if(prop_list && RNA_property_type(prop_list) == PROP_STRING) {
@@ -2733,7 +2732,7 @@ void uiTemplateKeymapItemProperties(uiLayout *layout, PointerRNA *ptr)
template_keymap_item_properties(layout, NULL, &propptr);
/* attach callbacks to compensate for missing properties update,
- we don't know which keymap (item) is being modified there */
+ * we don't know which keymap (item) is being modified there */
for(; but; but=but->next)
uiButSetFunc(but, keymap_item_modified, ptr->data, NULL);
}
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index 8335668a624..610e9f8762d 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -210,7 +210,7 @@ int uiIconFromID(ID *id)
}
/* otherwise get it through RNA, creating the pointer
- will set the right type, also with subclassing */
+ * will set the right type, also with subclassing */
RNA_id_pointer_create(id, &ptr);
return (ptr.type)? RNA_struct_ui_icon(ptr.type) : ICON_NONE;
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 419f13254e6..0e51932df90 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -62,17 +62,16 @@
/* ************** widget base functions ************** */
/*
- - in: roundbox codes for corner types and radius
- - return: array of [size][2][x,y] points, the edges of the roundbox, + UV coords
-
- - draw black box with alpha 0 on exact button boundbox
- - for ever AA step:
- - draw the inner part for a round filled box, with color blend codes or texture coords
- - draw outline in outline color
- - draw outer part, bottom half, extruded 1 pixel to bottom, for emboss shadow
- - draw extra decorations
- - draw background color box with alpha 1 on exact button boundbox
-
+ * - in: roundbox codes for corner types and radius
+ * - return: array of [size][2][x,y] points, the edges of the roundbox, + UV coords
+ *
+ * - draw black box with alpha 0 on exact button boundbox
+ * - for ever AA step:
+ * - draw the inner part for a round filled box, with color blend codes or texture coords
+ * - draw outline in outline color
+ * - draw outer part, bottom half, extruded 1 pixel to bottom, for emboss shadow
+ * - draw extra decorations
+ * - draw background color box with alpha 1 on exact button boundbox
*/
/* fill this struct with polygon info to draw AA'ed */
@@ -106,8 +105,8 @@ typedef struct uiWidgetBase {
} uiWidgetBase;
/* uiWidgetType: for time being only for visual appearance,
- later, a handling callback can be added too
-*/
+ * later, a handling callback can be added too
+ */
typedef struct uiWidgetType {
/* pointer to theme color definition */
@@ -1227,7 +1226,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
}
/* If there's an icon too (made with uiDefIconTextBut) then draw the icon
- and offset the text label to accommodate it */
+ * and offset the text label to accommodate it */
if (but->flag & UI_HAS_ICON) {
widget_draw_icon(but, but->icon+but->iconadd, 1.0f, rect);
@@ -1251,16 +1250,15 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
/* *********************** widget types ************************************* */
-/* uiWidgetStateColors
- char inner_anim[4];
- char inner_anim_sel[4];
- char inner_key[4];
- char inner_key_sel[4];
- char inner_driven[4];
- char inner_driven_sel[4];
- float blend;
-
-*/
+/* uiWidgetStateColors
+ * char inner_anim[4];
+ * char inner_anim_sel[4];
+ * char inner_key[4];
+ * char inner_key_sel[4];
+ * char inner_driven[4];
+ * char inner_driven_sel[4];
+ * float blend;
+ */
static struct uiWidgetStateColors wcol_state_colors= {
{115, 190, 76, 255},
@@ -1272,17 +1270,17 @@ static struct uiWidgetStateColors wcol_state_colors= {
0.5f, 0.0f
};
-/* uiWidgetColors
- float outline[3];
- float inner[4];
- float inner_sel[4];
- float item[3];
- float text[3];
- float text_sel[3];
-
- short shaded;
- float shadetop, shadedown;
-*/
+/* uiWidgetColors
+ * float outline[3];
+ * float inner[4];
+ * float inner_sel[4];
+ * float item[3];
+ * float text[3];
+ * float text_sel[3];
+ *
+ * short shaded;
+ * float shadetop, shadedown;
+ */
static struct uiWidgetColors wcol_num= {
{25, 25, 25, 255},
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 1c85c4cb8db..3d609fd6b7a 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1212,7 +1212,7 @@ void init_userdef_do_versions(void)
U.pad_rot_angle= 15;
/* signal for derivedmesh to use colorband */
- /* run incase this was on and is now off in the user prefs [#28096] */
+ /* run in case this was on and is now off in the user prefs [#28096] */
vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
if (bmain->versionfile <= 191) {
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index e8d4cba81c8..2feccf7a4e8 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -981,7 +981,7 @@ void UI_view2d_view_ortho(View2D *v2d)
float xofs, yofs;
/* pixel offsets (-0.375f) are needed to get 1:1 correspondence with pixels for smooth UI drawing,
- * but only applied where requsted
+ * but only applied where requested
*/
/* XXX brecht: instead of zero at least use a tiny offset, otherwise
* pixel rounding is effectively random due to float inaccuracy */
@@ -1020,7 +1020,7 @@ void UI_view2d_view_orthoSpecial(ARegion *ar, View2D *v2d, short xaxis)
float xofs, yofs;
/* pixel offsets (-0.375f) are needed to get 1:1 correspondence with pixels for smooth UI drawing,
- * but only applied where requsted
+ * but only applied where requested
*/
/* XXX temp (ton) */
xofs= 0.0f; // (v2d->flag & V2D_PIXELOFS_X) ? 0.375f : 0.0f;
@@ -1105,7 +1105,7 @@ static void step_to_grid(float *step, int *power, int unit)
}
}
-/* Intialise settings necessary for drawing gridlines in a 2d-view
+/* Initialize settings necessary for drawing gridlines in a 2d-view
* - Currently, will return pointer to View2DGrid struct that needs to
* be freed with UI_view2d_grid_free()
* - Is used for scrollbar drawing too (for units drawing)
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 6632cfc62ac..49dae81d985 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -249,7 +249,8 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event)
}
break;
/* XXX - Mode switching isn't implemented. See comments in 36818.
- * switch to zoom *
+ * switch to zoom */
+#if 0
case LEFTMOUSE:
if (event->val==KM_PRESS) {
* calculate overall delta mouse-movement for redo *
@@ -260,8 +261,8 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event)
WM_cursor_restore(CTX_wm_window(C));
WM_operator_name_call(C, "VIEW2D_OT_zoom", WM_OP_INVOKE_DEFAULT, NULL);
return OPERATOR_FINISHED;
- }*/
-
+ }
+#endif
default:
if (event->type == vpd->invoke_event || event->type==ESCKEY) {
if (event->val==KM_RELEASE) {
@@ -801,7 +802,7 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op)
dx= RNA_float_get(op->ptr, "deltax");
dy= RNA_float_get(op->ptr, "deltay");
- /* continous zoom shouldn't move that fast... */
+ /* continuous zoom shouldn't move that fast... */
if (U.viewzoom == USER_ZOOM_CONT) { // XXX store this setting as RNA prop?
double time= PIL_check_seconds_timer();
float time_step= (float)(time - vzd->timer_lastdraw);
@@ -1004,7 +1005,7 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event)
fac= 0.01f * (event->y - vzd->lasty);
dy= fac * (v2d->cur.ymax - v2d->cur.ymin);
#if 0
- /* continous zoom shouldn't move that fast... */
+ /* continuous zoom shouldn't move that fast... */
if (U.viewzoom == USER_ZOOM_CONT) { // XXX store this setting as RNA prop?
double time= PIL_check_seconds_timer();
float time_step= (float)(time - vzd->timer_lastdraw);
@@ -1125,7 +1126,7 @@ static int view_borderzoom_exec(bContext *C, wmOperator *op)
}
else /* if (gesture_mode == GESTURE_MODAL_OUT) */ {
/* zoom out:
- * - the current 'cur' rect coordinates are going to end upwhere the 'rect' ones are,
+ * - the current 'cur' rect coordinates are going to end up where the 'rect' ones are,
* but the 'cur' rect coordinates will need to be adjusted to take in more of the view
* - calculate zoom factor, and adjust using center-point
*/
diff --git a/source/blender/editors/mesh/bmesh_select.c b/source/blender/editors/mesh/bmesh_select.c
index 19802d7f667..0f402def70b 100644
--- a/source/blender/editors/mesh/bmesh_select.c
+++ b/source/blender/editors/mesh/bmesh_select.c
@@ -214,11 +214,11 @@ void EDBM_free_backbuf(void)
}
/* mcords is a polygon mask
- - grab backbuffer,
- - draw with black in backbuffer,
- - grab again and compare
- returns 'OK'
-*/
+ * - grab backbuffer,
+ * - draw with black in backbuffer,
+ * - grab again and compare
+ * returns 'OK'
+ */
int EDBM_mask_init_backbuf_border(ViewContext *vc, int mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax)
{
unsigned int *dr, *drm;
@@ -335,10 +335,12 @@ static void findnearestvert__doClosest(void *userData, BMVert *eve, int x, int y
if (data->dist > 3) {
int temp = abs(data->mval[0] - x) + abs(data->mval[1]- y);
if (BM_elem_flag_test(eve, BM_ELEM_SELECT) == data->select) {
- if (data->strict == 1)
+ if (data->strict == 1) {
return;
- else
+ }
+ else {
temp += 5;
+ }
}
if (temp < data->dist) {
@@ -365,7 +367,7 @@ static unsigned int findnearestvert__backbufIndextest(void *handle, unsigned int
*
* dist (in/out): minimal distance to the nearest and at the end, actual distance
* sel: selection bias
- * if SELECT, selected vertice are given a 5 pixel bias to make them farter than unselect verts
+ * if SELECT, selected vertice are given a 5 pixel bias to make them further than unselect verts
* if 0, unselected vertice are given the bias
* strict: if 1, the vertice corresponding to the sel parameter are ignored and not just biased
*/
@@ -626,10 +628,10 @@ BMFace *EDBM_findnearestface(ViewContext *vc, int *dist)
}
/* best distance based on screen coords.
- use em->selectmode to define how to use
- selected vertices and edges get disadvantage
- return 1 if found one
-*/
+ * use em->selectmode to define how to use
+ * selected vertices and edges get disadvantage
+ * return 1 if found one
+ */
static int unified_findnearest(ViewContext *vc, BMVert **r_eve, BMEdge **r_eed, BMFace **r_efa)
{
BMEditMesh *em = vc->em;
@@ -772,13 +774,11 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
/* ********************************* */
/*
-VERT GROUP
- mode 1: same normal
- mode 2: same number of face users
- mode 3: same vertex groups
-*/
-
-
+ * VERT GROUP
+ * mode 1: same normal
+ * mode 2: same number of face users
+ * mode 3: same vertex groups
+ */
static int similar_vert_select_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_edit_object(C);
@@ -1269,7 +1269,7 @@ static int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, B
/*
* Arrays are now filled as follows:
*
- * nedges[n] = sum of the # of edges incident to all vertices numbered 0 thru n - 1
+ * nedges[n] = sum of the # of edges incident to all vertices numbered 0 through n - 1
* edges[edges[n]..edges[n - 1]] = the indices of of the edges incident to vertex n
*
* As the search continues, prevedge[n] will be the previous edge on the shortest
@@ -1278,7 +1278,7 @@ static int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, B
* path to edge n found so far, Finally, heap is a priority heap which is built on the
* the same data as the cost arry, but inverted: it is a worklist of edges prioritized
* by the shortest path found so far to the edge.
- */
+ */
#if 0 /* UNUSED */ /* this block does nothing, not sure why its here? - campbell */
for (i = 0; i < totvert; i++) {
@@ -2005,8 +2005,8 @@ void MESH_OT_select_less(wmOperatorType *ot)
}
/* Walk all reachable elements of the same type as h_act in breadth-first
- order, starting from h_act. Deselects elements if the depth when they
- are reached is not a multiple of "nth". */
+ * order, starting from h_act. Deselects elements if the depth when they
+ * are reached is not a multiple of "nth". */
static void walker_deselect_nth(BMEditMesh *em, int nth, int offset, BMHeader *h_act)
{
BMElem *ele;
@@ -2213,9 +2213,9 @@ int EM_view3d_poll(bContext *C)
static int select_sharp_edges_exec(bContext *C, wmOperator *op)
{
/* Find edges that have exactly two neighboring faces,
- * check the angle between those faces, and if angle is
- * small enough, select the edge
- */
+ * check the angle between those faces, and if angle is
+ * small enough, select the edge
+ */
Object *obedit = CTX_data_edit_object(C);
BMEditMesh *em = BMEdit_FromObject(obedit);
BMIter iter;
@@ -2553,7 +2553,7 @@ static int region_to_loop(bContext *C, wmOperator *UNUSED(op))
}
/* If in face-only select mode, switch to edge select mode so that
- an edge-only selection is not inconsistent state */
+ * an edge-only selection is not inconsistent state */
if (em->selectmode == SCE_SELECT_FACE) {
em->selectmode = SCE_SELECT_EDGE;
EDBM_selectmode_set(em);
diff --git a/source/blender/editors/mesh/bmesh_selecthistory.c b/source/blender/editors/mesh/bmesh_selecthistory.c
index f0c00d0ff07..c912813ac63 100644
--- a/source/blender/editors/mesh/bmesh_selecthistory.c
+++ b/source/blender/editors/mesh/bmesh_selecthistory.c
@@ -46,8 +46,8 @@ void EDBM_editselection_normal(float *normal, BMEditSelection *ese)
}
/* Calculate a plane that is rightangles to the edge/vert/faces normal
-also make the plane run along an axis that is related to the geometry,
-because this is used for the manipulators Y axis.*/
+ * also make the plane run along an axis that is related to the geometry,
+ * because this is used for the manipulators Y axis. */
void EDBM_editselection_plane(BMEditMesh *em, float *plane, BMEditSelection *ese)
{
BM_editselection_plane(em->bm, plane, ese);
diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c
index 1d40f61bef5..4e4a9d5630b 100644
--- a/source/blender/editors/mesh/bmesh_tools.c
+++ b/source/blender/editors/mesh/bmesh_tools.c
@@ -66,10 +66,12 @@
static void add_normal_aligned(float nor[3], const float add[3])
{
- if (dot_v3v3(nor, add) < -0.9999f)
+ if (dot_v3v3(nor, add) < -0.9999f) {
sub_v3_v3(nor, add);
- else
+ }
+ else {
sub_v3_v3(nor, add);
+ }
}
@@ -411,7 +413,7 @@ void MESH_OT_extrude_repeat(wmOperatorType *ot)
/* api callbacks */
ot->exec = extrude_repeat_mesh;
- ot->poll = ED_operator_editmesh;
+ ot->poll = ED_operator_editmesh_view3d;
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -445,13 +447,14 @@ static int EDBM_Extrude_Mesh(Scene *scene, Object *obedit, BMEditMesh *em, wmOpe
if (em->bm->totedgesel == 0) nr = 0;
nr = 1;
- /* else if (em->totedgesel == 1) nr = 3;
+#if 0
+ else if (em->totedgesel == 1) nr = 3;
else if (em->totfacesel == 0) nr = 3;
else if (em->totfacesel == 1)
nr = 1; // pupmenu("Extrude %t|Region %x1|Only Edges%x3");
else
nr = 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3");
- */
+#endif
}
else {
if (em->bm->totfacesel == 0) nr = 0;
@@ -475,11 +478,11 @@ static int EDBM_Extrude_Mesh(Scene *scene, Object *obedit, BMEditMesh *em, wmOpe
else {
/* We need to force immediate calculation here because
- * transform may use derived objects (which are now stale).
- *
- * This shouldn't be necessary, derived queries should be
- * automatically building this data if invalid. Or something.
- */
+ * transform may use derived objects (which are now stale).
+ *
+ * This shouldn't be necessary, derived queries should be
+ * automatically building this data if invalid. Or something.
+ */
// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
object_handle_update(scene, obedit);
@@ -1345,51 +1348,37 @@ static int edge_rotate_selected(bContext *C, wmOperator *op)
BMEdge *eed;
BMIter iter;
const int do_ccw = RNA_enum_get(op->ptr, "direction") == 1;
- int do_deselect = FALSE; /* do we deselect */
-
- if (!(em->bm->totfacesel == 2 || em->bm->totedgesel == 1)) {
- BKE_report(op->reports, RPT_ERROR, "Select one edge or two adjacent faces");
+ int tot = 0;
+
+ if (em->bm->totedgesel == 0) {
+ BKE_report(op->reports, RPT_ERROR, "Select edges or face pairs for edge loops to rotate about");
return OPERATOR_CANCELLED;
}
/* first see if we have two adjacent faces */
BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
- if (BM_edge_face_count(eed) == 2) {
- if ((BM_elem_flag_test(eed->l->f, BM_ELEM_SELECT) && BM_elem_flag_test(eed->l->radial_next->f, BM_ELEM_SELECT))
- && !(BM_elem_flag_test(eed->l->f, BM_ELEM_HIDDEN) || BM_elem_flag_test(eed->l->radial_next->f, BM_ELEM_HIDDEN)))
- {
- break;
+ BM_elem_flag_disable(eed, BM_ELEM_TAG);
+ if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
+ BMFace *fa, *fb;
+ if (BM_edge_face_pair(eed, &fa, &fb)) {
+ /* if both faces are selected we rotate between them,
+ * otherwise - rotate between 2 unselected - but not mixed */
+ if (BM_elem_flag_test(fa, BM_ELEM_SELECT) == BM_elem_flag_test(fb, BM_ELEM_SELECT)) {
+ BM_elem_flag_enable(eed, BM_ELEM_TAG);
+ tot++;
+ }
}
}
}
/* ok, we don't have two adjacent faces, but we do have two selected ones.
* that's an error condition.*/
- if (!eed && em->bm->totfacesel == 2) {
- BKE_report(op->reports, RPT_ERROR, "Select one edge or two adjacent faces");
+ if (tot == 0) {
+ BKE_report(op->reports, RPT_ERROR, "Could not find any selected edges that can be rotated");
return OPERATOR_CANCELLED;
}
-
- if (!eed) {
- BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
- if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
- /* de-select the edge before */
- do_deselect = TRUE;
- break;
- }
- }
- }
-
- /* this should never happen */
- if (!eed)
- return OPERATOR_CANCELLED;
- EDBM_InitOpf(em, &bmop, op, "edgerotate edges=%e ccw=%b", eed, do_ccw);
-
- /* avoid adding to the selection if we start off with only a selected edge,
- * we could also just deselect the single edge easily but use the BMO api
- * since it seems this is more 'correct' */
- if (do_deselect) BMO_slot_buffer_hflag_disable(em->bm, &bmop, "edges", BM_ELEM_SELECT, BM_EDGE, TRUE);
+ EDBM_InitOpf(em, &bmop, op, "edgerotate edges=%he ccw=%b", BM_ELEM_TAG, do_ccw);
BMO_op_exec(em->bm, &bmop);
BMO_slot_buffer_hflag_enable(em->bm, &bmop, "edgeout", BM_ELEM_SELECT, BM_EDGE, TRUE);
@@ -1447,11 +1436,11 @@ void EDBM_hide_mesh(BMEditMesh *em, int swap)
/* original hide flushing comment (OUTDATED):
* hide happens on least dominant select mode, and flushes up, not down! (helps preventing errors in subsurf) */
- /* - vertex hidden, always means edge is hidden too
- - edge hidden, always means face is hidden too
- - face hidden, only set face hide
- - then only flush back down what's absolute hidden
- */
+ /* - vertex hidden, always means edge is hidden too
+ * - edge hidden, always means face is hidden too
+ * - face hidden, only set face hide
+ * - then only flush back down what's absolute hidden
+ */
}
@@ -1903,9 +1892,9 @@ static int mesh_rotate_colors(bContext *C, wmOperator *op)
/* dependencies graph and notification stuff */
DAG_id_tag_update(ob->data, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
-/* DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT | ND_GEOM_SELECT, ob);
-*/
+/* DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
+ * WM_event_add_notifier(C, NC_OBJECT | ND_GEOM_SELECT, ob);
+ */
/* we succeeded */
return OPERATOR_FINISHED;
}
@@ -2291,9 +2280,9 @@ static int select_vertex_path_exec(bContext *C, wmOperator *op)
EDBM_selectmode_flush(em);
/* dependencies graph and notification stuff */
-/* DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT | ND_GEOM_SELECT, ob);
-*/
+/* DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
+ * WM_event_add_notifier(C, NC_OBJECT | ND_GEOM_SELECT, ob);
+ */
DAG_id_tag_update(ob->data, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
@@ -2326,14 +2315,12 @@ void MESH_OT_select_vertex_path(wmOperatorType *ot)
/********************** Rip Operator *************************/
/* helper to find edge for edge_rip */
-static float mesh_rip_edgedist(ARegion *ar, float mat[][4], float *co1, float *co2, const int mval[2])
+static float mesh_rip_edgedist(ARegion *ar, float mat[][4], float *co1, float *co2, const float mvalf[2])
{
- float vec1[3], vec2[3], mvalf[2];
+ float vec1[3], vec2[3];
- ED_view3d_project_float(ar, co1, vec1, mat);
- ED_view3d_project_float(ar, co2, vec2, mat);
- mvalf[0] = (float)mval[0];
- mvalf[1] = (float)mval[1];
+ ED_view3d_project_float_v2(ar, co1, vec1, mat);
+ ED_view3d_project_float_v2(ar, co2, vec2, mat);
return dist_to_line_segment_v2(mvalf, vec1, vec2);
}
@@ -2343,20 +2330,29 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
Object *obedit = CTX_data_edit_object(C);
ARegion *ar = CTX_wm_region(C);
- View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d = CTX_wm_region_view3d(C);
BMEditMesh *em = BMEdit_FromObject(obedit);
BMesh *bm = em->bm;
BMOperator bmop;
- BMBVHTree *bvhtree;
BMOIter siter;
BMIter iter, eiter, liter;
BMLoop *l;
- BMEdge *e, *e2, *closest = NULL;
+ BMEdge *e, *e2;
BMVert *v, *ripvert = NULL;
- int side = 0, i, singlesel = 0;
+ int i, singlesel = FALSE;
float projectMat[4][4], fmval[3] = {event->mval[0], event->mval[1]};
- float dist = FLT_MAX, d;
+ float dist = FLT_MAX;
+ float d;
+
+ /* note on selection:
+ * When calling edge split we operate on tagged edges rather then selected
+ * this is important because the edges to operate on are extended by one,
+ * but the selection is left alone.
+ *
+ * After calling edge split - the duplicated edges have the same selection state as the
+ * original, so all we do is de-select the far side from the mouse and we have a
+ * useful selection for grabbing.
+ */
ED_view3d_ob_project_mat_get(rv3d, obedit, projectMat);
@@ -2369,12 +2365,18 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
* closest edge around that vert to mouse cursor,
* then rip two adjacent edges in the vert fan. */
if (bm->totvertsel == 1 && bm->totedgesel == 0 && bm->totfacesel == 0) {
- singlesel = 1;
+ BMEditSelection ese;
+ singlesel = TRUE;
- /* find selected vert */
- BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
- if (BM_elem_flag_test(v, BM_ELEM_SELECT))
- break;
+ /* find selected vert - same some time and check history first */
+ if (EDBM_get_actSelection(em, &ese) && ese.htype == BM_VERT) {
+ v = (BMVert *)ese.ele;
+ }
+ else {
+ BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ if (BM_elem_flag_test(v, BM_ELEM_SELECT))
+ break;
+ }
}
/* this should be impossible, but sanity checks are a good thing */
@@ -2389,7 +2391,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* find closest edge to mouse cursor */
e2 = NULL;
BM_ITER(e, &iter, bm, BM_EDGES_OF_VERT, v) {
- d = mesh_rip_edgedist(ar, projectMat, e->v1->co, e->v2->co, event->mval);
+ d = mesh_rip_edgedist(ar, projectMat, e->v1->co, e->v2->co, fmval);
if (d < dist) {
dist = d;
e2 = e;
@@ -2402,7 +2404,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* rip two adjacent edges */
if (BM_edge_face_count(e2) == 1 || BM_vert_face_count(v) == 2) {
l = e2->l;
- ripvert = BM_vert_rip(bm, l->f, v);
+ ripvert = BM_face_vert_separate(bm, l->f, v);
BLI_assert(ripvert);
if (!ripvert) {
@@ -2411,14 +2413,12 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
else if (BM_edge_face_count(e2) == 2) {
l = e2->l;
- e = BM_face_other_loop(e2, l->f, v)->e;
+ e = BM_face_other_edge_loop(l->f, e2, v)->e;
BM_elem_flag_enable(e, BM_ELEM_TAG);
- BM_elem_select_set(bm, e, TRUE);
l = e2->l->radial_next;
- e = BM_face_other_loop(e2, l->f, v)->e;
+ e = BM_face_other_edge_loop(l->f, e2, v)->e;
BM_elem_flag_enable(e, BM_ELEM_TAG);
- BM_elem_select_set(bm, e, TRUE);
}
dist = FLT_MAX;
@@ -2429,99 +2429,118 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
e2 = NULL;
i = 0;
BM_ITER(e, &eiter, bm, BM_EDGES_OF_VERT, v) {
- if (BM_elem_flag_test(e, BM_ELEM_TAG)) {
+ /* important to check selection rather then tag here
+ * else we get feedback loop */
+ if (BM_elem_flag_test(e, BM_ELEM_SELECT)) {
e2 = e;
i++;
}
}
if (i == 1 && e2->l) {
- l = BM_face_other_loop(e2, e2->l->f, v);
+ l = BM_face_other_edge_loop(e2->l->f, e2, v);
l = l->radial_next;
- l = BM_face_other_loop(l->e, l->f, v);
+ l = BM_face_other_edge_loop(l->f, l->e, v);
if (l) {
- BM_elem_select_set(bm, l->e, TRUE);
+ BM_elem_flag_enable(l->e, BM_ELEM_TAG);
}
}
}
}
- if (!EDBM_InitOpf(em, &bmop, op, "edgesplit edges=%he", BM_ELEM_SELECT)) {
+ if (!EDBM_InitOpf(em, &bmop, op, "edgesplit edges=%he", BM_ELEM_TAG)) {
return OPERATOR_CANCELLED;
}
BMO_op_exec(bm, &bmop);
- /* build bvh tree for edge visibility tests */
- bvhtree = BMBVH_NewBVH(em, 0, NULL, NULL);
+ BMO_ITER(e, &siter, bm, &bmop, "edgeout", BM_EDGE) {
+ float cent[3] = {0, 0, 0}, mid[3];
- for (i = 0; i < 2; i++) {
- BMO_ITER(e, &siter, bm, &bmop, i ? "edgeout2":"edgeout1", BM_EDGE) {
- float cent[3] = {0, 0, 0}, mid[3], vec[3];
+ float vec[2];
+ float fmval_tweak[2];
+ float e_v1_co[2], e_v2_co[2];
- if (!BMBVH_EdgeVisible(bvhtree, e, ar, v3d, obedit) || !e->l)
- continue;
+ BMVert *v1_other;
+ BMVert *v2_other;
- /* method for calculating distance:
- *
- * for each edge: calculate face center, then made a vector
- * from edge midpoint to face center. offset edge midpoint
- * by a small amount along this vector. */
- BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, e->l->f) {
- add_v3_v3(cent, l->v->co);
- }
- mul_v3_fl(cent, 1.0f/(float)e->l->f->len);
+ /* method for calculating distance:
+ *
+ * for each edge: calculate face center, then made a vector
+ * from edge midpoint to face center. offset edge midpoint
+ * by a small amount along this vector. */
- mid_v3_v3v3(mid, e->v1->co, e->v2->co);
- sub_v3_v3v3(vec, cent, mid);
- normalize_v3(vec);
- mul_v3_fl(vec, 0.01f);
- add_v3_v3v3(mid, mid, vec);
+ /* rather then the face center, get the middle of
+ * both edge verts connected to this one */
+ v1_other = BM_face_other_vert_loop(e->l->f, e->v2, e->v1)->v;
+ v2_other = BM_face_other_vert_loop(e->l->f, e->v1, e->v2)->v;
+ mid_v3_v3v3(cent, v1_other->co, v2_other->co);
+ mid_v3_v3v3(mid, e->v1->co, e->v2->co);
- /* yay we have our comparison point, now project it */
- ED_view3d_project_float(ar, mid, mid, projectMat);
+ ED_view3d_project_float_v2(ar, cent, cent, projectMat);
+ ED_view3d_project_float_v2(ar, mid, mid, projectMat);
- d = len_squared_v2v2(fmval, mid);
+ ED_view3d_project_float_v2(ar, e->v1->co, e_v1_co, projectMat);
+ ED_view3d_project_float_v2(ar, e->v2->co, e_v2_co, projectMat);
- if (d < dist) {
- side = i;
- closest = e;
- dist = d;
- }
+ sub_v2_v2v2(vec, cent, mid);
+ normalize_v2(vec);
+ mul_v2_fl(vec, 0.01f);
+
+ /* rather then adding to both verts, subtract from the mouse */
+ sub_v2_v2v2(fmval_tweak, fmval, vec);
+
+ if (dist_to_line_segment_v2(fmval_tweak, e_v1_co, e_v2_co) >
+ dist_to_line_segment_v2(fmval, e_v1_co, e_v2_co))
+ {
+ BM_elem_select_set(bm, e, FALSE);
}
}
-
- BMBVH_FreeBVH(bvhtree);
- EDBM_flag_disable_all(em, BM_ELEM_SELECT);
- BMO_slot_buffer_hflag_enable(bm, &bmop, side?"edgeout2":"edgeout1", BM_ELEM_SELECT, BM_EDGE, TRUE);
+ if (singlesel) {
+ BMVert *v_best = NULL;
+ float l_prev_co[3], l_next_co[3], l_corner_co[3];
+ float scale;
- BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
- BM_elem_flag_set(e, BM_ELEM_TAG, BM_elem_flag_test(e, BM_ELEM_SELECT));
- }
+ /* not good enough! - original vert may not be attached to the closest edge */
+#if 0
+ EDBM_flag_disable_all(em, BM_ELEM_SELECT);
+ BM_elem_select_set(bm, ripvert, TRUE);
+#else
- /* constrict edge selection again */
- BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
- e2 = NULL;
- i = 0;
- BM_ITER(e, &eiter, bm, BM_EDGES_OF_VERT, v) {
- if (BM_elem_flag_test(e, BM_ELEM_TAG)) {
- e2 = e;
- i++;
- }
- }
-
- if (i == 1) {
- if (singlesel)
+ dist = FLT_MAX;
+ BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
+ if (BM_elem_flag_test(v, BM_ELEM_SELECT)) {
+ /* disable by default, re-enable winner at end */
BM_elem_select_set(bm, v, FALSE);
- else
- BM_elem_select_set(bm, e2, FALSE);
+
+ BM_ITER(l, &liter, bm, BM_LOOPS_OF_VERT, v) {
+ /* calculate a point in the face, rather then calculate the middle,
+ * make a vector pointing between the 2 edges attached to this loop */
+ sub_v3_v3v3(l_prev_co, l->prev->v->co, l->v->co);
+ sub_v3_v3v3(l_next_co, l->next->v->co, l->v->co);
+
+ scale = normalize_v3(l_prev_co) + normalize_v3(l_next_co);
+ mul_v3_fl(l_prev_co, scale);
+ mul_v3_fl(l_next_co, scale);
+
+ add_v3_v3v3(l_corner_co, l_prev_co, l_next_co);
+ add_v3_v3(l_corner_co, l->v->co);
+
+ d = mesh_rip_edgedist(ar, projectMat, l->v->co, l_corner_co, fmval);
+ if (d < dist) {
+ v_best = v;
+ dist = d;
+ }
+ }
+ }
}
- }
- if (ripvert) {
- BM_elem_select_set(bm, ripvert, TRUE);
+ if (v_best) {
+ BM_elem_select_set(bm, v_best, TRUE);
+ }
+#endif
}
EDBM_selectmode_flush(em);
@@ -2659,8 +2678,9 @@ static int blend_from_shape_exec(bContext *C, wmOperator *op)
mul_v3_fl(co, blend);
add_v3_v3v3(eve->co, eve->co, co);
}
- else
+ else {
interp_v3_v3v3(eve->co, eve->co, co, blend);
+ }
copy_v3_v3(sco, co);
}
@@ -2674,12 +2694,14 @@ static int blend_from_shape_exec(bContext *C, wmOperator *op)
static EnumPropertyItem *shape_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
{
Object *obedit = CTX_data_edit_object(C);
- Mesh *me = (obedit) ? obedit->data : NULL;
- BMEditMesh *em = (me) ? me->edit_btmesh : NULL;
+ BMEditMesh *em;
EnumPropertyItem *item = NULL;
int totitem = 0;
- if (obedit && obedit->type == OB_MESH && CustomData_has_layer(&em->bm->vdata, CD_SHAPEKEY)) {
+ if ((obedit && obedit->type == OB_MESH) &&
+ (em = BMEdit_FromObject(obedit)) &&
+ CustomData_has_layer(&em->bm->vdata, CD_SHAPEKEY))
+ {
EnumPropertyItem tmp = {0, "", 0, "", ""};
int a;
@@ -2823,8 +2845,8 @@ static int solidify_exec(bContext *C, wmOperator *op)
}
/* deselect only the faces in the region to be solidified (leave wire
- edges and loose verts selected, as there will be no corresponding
- geometry selected below) */
+ * edges and loose verts selected, as there will be no corresponding
+ * geometry selected below) */
BMO_slot_buffer_hflag_disable(bm, &bmop, "geom", BM_ELEM_SELECT, BM_FACE, TRUE);
/* run the solidify operator */
@@ -2972,7 +2994,7 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode,
}
}
- /* now check for edge interesect (may produce vertex intersection as well)*/
+ /* now check for edge intersect (may produce vertex intersection as well) */
for (i = 0; i < len; i++) {
if (i > 0) {
x11 = x12;
@@ -3463,8 +3485,9 @@ static int quads_convert_to_tris_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
BMEditMesh *em = BMEdit_FromObject(obedit);
+ int use_beauty = RNA_boolean_get(op->ptr, "use_beauty");
- if (!EDBM_CallOpf(em, op, "triangulate faces=%hf", BM_ELEM_SELECT))
+ if (!EDBM_CallOpf(em, op, "triangulate faces=%hf use_beauty=%b", BM_ELEM_SELECT, use_beauty))
return OPERATOR_CANCELLED;
DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
@@ -3485,6 +3508,8 @@ void MESH_OT_quads_convert_to_tris(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_boolean(ot->srna, "use_beauty", 1, "Beauty", "Use best triangulation division (currently quads only)");
}
static int tris_convert_to_quads_exec(bContext *C, wmOperator *op)
@@ -3843,6 +3868,8 @@ static int select_by_number_vertices_exec(bContext *C, wmOperator *op)
select = 1;
}else if (type == 2 && efa->len > numverts) {
select = 1;
+ }else if (type == 3 && efa->len != numverts) {
+ select = 1;
}
if (select) {
@@ -3862,6 +3889,7 @@ void MESH_OT_select_by_number_vertices(wmOperatorType *ot)
{0, "LESS", 0, "Less Than", ""},
{1, "EQUAL", 0, "Equal To", ""},
{2, "GREATER", 0, "Greater Than", ""},
+ {3, "NOTEQUAL", 0, "Not Equal To", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -3959,10 +3987,10 @@ void MESH_OT_select_mirror(wmOperatorType *ot)
}
#if 0 /* UNUSED */
-/********* qsort routines. not sure how to make these
- work, since we aren't using linked lists for
- geometry anymore. might need a sortof "swap"
- function for bmesh elements. *********/
+/* qsort routines. not sure how to make these
+ * work, since we aren't using linked lists for
+ * geometry anymore. might need a sortof "swap"
+ * function for bmesh elements. */
typedef struct xvertsort {
float x;
diff --git a/source/blender/editors/mesh/bmesh_utils.c b/source/blender/editors/mesh/bmesh_utils.c
index 0f9bc29a16d..bee4d4283f6 100644
--- a/source/blender/editors/mesh/bmesh_utils.c
+++ b/source/blender/editors/mesh/bmesh_utils.c
@@ -277,7 +277,7 @@ void EDBM_MakeEditBMesh(ToolSettings *ts, Scene *UNUSED(scene), Object *ob)
MEM_freeN(me->edit_btmesh);
}
- /* currently executing operators re-tesselates, so we can avoid doing here
+ /* currently executing operators re-tessellates, so we can avoid doing here
* but at some point it may need to be added back. */
#if 0
me->edit_btmesh = BMEdit_Create(bm, TRUE);
@@ -686,8 +686,9 @@ UvVertMap *EDBM_make_uv_vert_map(BMEditMesh *em, int selected, int do_face_idx_a
iterv->next = newvlist;
newvlist = iterv;
}
- else
+ else {
lastv = iterv;
+ }
iterv = next;
}
@@ -960,7 +961,7 @@ void EDBM_free_uv_element_map(UvElementMap *element_map)
}
/* last_sel, use em->act_face otherwise get the last selected face in the editselections
- * at the moment, last_sel is mainly useful for gaking sure the space image dosnt flicker */
+ * at the moment, last_sel is mainly useful for making sure the space image dosnt flicker */
MTexPoly *EDBM_get_active_mtexpoly(BMEditMesh *em, BMFace **r_act_efa, int sloppy)
{
BMFace *efa = NULL;
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index 58b5154cdff..a7f72481456 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -144,7 +144,7 @@ static int facesel_face_pick(struct bContext *C, Mesh *me, Object *ob, const int
if (rect) {
/* sample rect to increase changes of selecting, so that when clicking
- on an edge in the backbuf, we can still select a face */
+ * on an edge in the backbuf, we can still select a face */
int dist;
*index = view3d_sample_backbuf_rect(&vc, mval, 3, 1, me->totpoly+1, &dist,0,NULL, NULL);
@@ -332,10 +332,10 @@ void paintface_select_linked(bContext *UNUSED(C), Object *ob, int UNUSED(mval[2]
if (mode==0 || mode==1) {
// XXX - Causes glitches, not sure why
- /*
+#if 0
if (!facesel_face_pick(C, me, mval, &index, 1))
return;
- */
+#endif
}
select_linked_tfaces_with_seams(mode, me, index);
@@ -576,10 +576,9 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend)
selar= MEM_callocN(me->totpoly+1, "selar");
- if (extend == 0 && select)
+ if (extend == 0 && select) {
paintface_deselect_all_visible(vc->obact, SEL_DESELECT, FALSE);
- if (extend == 0 && select) {
mface= me->mpoly;
for(a=1; a<=me->totpoly; a++, mface++) {
if((mface->flag & ME_HIDE) == 0)
diff --git a/source/blender/editors/mesh/editmesh_bvh.c b/source/blender/editors/mesh/editmesh_bvh.c
index fc7818183bb..44d4d554ac8 100644
--- a/source/blender/editors/mesh/editmesh_bvh.c
+++ b/source/blender/editors/mesh/editmesh_bvh.c
@@ -86,8 +86,8 @@ BMBVHTree *BMBVH_NewBVH(BMEditMesh *em, int flag, Scene *scene, Object *obedit)
float cos[3][3], (*cagecos)[3] = NULL;
int i;
- /*when initializing cage verts, we only want the first cage coordinate for each vertex,
- so that e.g. mirror or array use original vertex coordiantes and not mirrored or duplicate*/
+ /* when initializing cage verts, we only want the first cage coordinate for each vertex,
+ * so that e.g. mirror or array use original vertex coordinates and not mirrored or duplicate */
BLI_smallhash_init(&shash);
BMEdit_RecalcTessellation(em);
@@ -381,8 +381,8 @@ int BMBVH_EdgeVisible(BMBVHTree *tree, BMEdge *e, ARegion *ar, View3D *v3d, Obje
scale_point(co1, co2, 0.99);
scale_point(co3, co2, 0.99);
- /*ok, idea is to generate rays going from the camera origin to the
- three points on the edge (v1, mid, v2)*/
+ /* ok, idea is to generate rays going from the camera origin to the
+ * three points on the edge (v1, mid, v2)*/
sub_v3_v3v3(dir1, origin, co1);
sub_v3_v3v3(dir2, origin, co2);
sub_v3_v3v3(dir3, origin, co3);
@@ -395,8 +395,8 @@ int BMBVH_EdgeVisible(BMBVHTree *tree, BMEdge *e, ARegion *ar, View3D *v3d, Obje
mul_v3_fl(dir2, epsilon);
mul_v3_fl(dir3, epsilon);
- /*offset coordinates slightly along view vectors, to avoid
- hitting the faces that own the edge.*/
+ /* offset coordinates slightly along view vectors, to avoid
+ * hitting the faces that own the edge.*/
add_v3_v3v3(co1, co1, dir1);
add_v3_v3v3(co2, co2, dir2);
add_v3_v3v3(co3, co3, dir3);
diff --git a/source/blender/editors/mesh/knifetool.c b/source/blender/editors/mesh/knifetool.c
index 3b78ceada98..e1380e6f1e1 100644
--- a/source/blender/editors/mesh/knifetool.c
+++ b/source/blender/editors/mesh/knifetool.c
@@ -177,7 +177,7 @@ static void knife_input_ray_cast(knifetool_opdata *kcd, const int mval_i[2],
static void knife_project_v3(knifetool_opdata *kcd, const float co[3], float sco[3])
{
- ED_view3d_project_float(kcd->ar, co, sco, kcd->projmat);
+ ED_view3d_project_float_v3(kcd->ar, co, sco, kcd->projmat);
}
static ListBase *knife_empty_list(knifetool_opdata *kcd)
@@ -198,13 +198,25 @@ static void knife_append_list(knifetool_opdata *kcd, ListBase *lst, void *elem)
BLI_addtail(lst, ref);
}
+static Ref *find_ref(ListBase *lb, void *ref)
+{
+ Ref *ref1;
+
+ for (ref1 = lb->first; ref1; ref1 = ref1->next) {
+ if (ref1->ref == ref)
+ return ref1;
+ }
+
+ return NULL;
+}
+
static KnifeEdge *new_knife_edge(knifetool_opdata *kcd)
{
kcd->totkedge++;
return BLI_mempool_calloc(kcd->kedges);
}
-static void knife_add_to_vert_edges(knifetool_opdata *kcd, KnifeEdge* kfe)
+static void knife_add_to_vert_edges(knifetool_opdata *kcd, KnifeEdge *kfe)
{
knife_append_list(kcd, &kfe->v1->edges, kfe);
knife_append_list(kcd, &kfe->v2->edges, kfe);
@@ -213,9 +225,9 @@ static void knife_add_to_vert_edges(knifetool_opdata *kcd, KnifeEdge* kfe)
static KnifeVert *new_knife_vert(knifetool_opdata *kcd, float *co, float *cageco)
{
KnifeVert *kfv = BLI_mempool_calloc(kcd->kverts);
-
+
kcd->totkvert++;
-
+
copy_v3_v3(kfv->co, co);
copy_v3_v3(kfv->cageco, cageco);
copy_v3_v3(kfv->sco, co);
@@ -229,13 +241,13 @@ static KnifeVert *new_knife_vert(knifetool_opdata *kcd, float *co, float *cageco
static KnifeVert *get_bm_knife_vert(knifetool_opdata *kcd, BMVert *v)
{
KnifeVert *kfv = BLI_ghash_lookup(kcd->origvertmap, v);
-
+
if (!kfv) {
kfv = new_knife_vert(kcd, v->co, kcd->cagecos[BM_elem_index_get(v)]);
kfv->v = v;
BLI_ghash_insert(kcd->origvertmap, v, kfv);
}
-
+
return kfv;
}
@@ -246,7 +258,7 @@ static KnifeEdge *get_bm_knife_edge(knifetool_opdata *kcd, BMEdge *e)
if (!kfe) {
BMIter iter;
BMFace *f;
-
+
kfe = new_knife_edge(kcd);
kfe->e = e;
kfe->v1 = get_bm_knife_vert(kcd, e->v1);
@@ -264,7 +276,7 @@ static KnifeEdge *get_bm_knife_edge(knifetool_opdata *kcd, BMEdge *e)
knife_get_face_kedges(kcd, f);
}
}
-
+
return kfe;
}
@@ -278,7 +290,7 @@ static void knife_start_cut(knifetool_opdata *kcd)
kcd->is_space = 0;
kcd->prevmval[0] = kcd->vc.mval[0];
kcd->prevmval[1] = kcd->vc.mval[1];
-
+
copy_v3_v3(kcd->prevco, kcd->vertco);
copy_v3_v3(kcd->prevcage, kcd->vertcage);
@@ -299,35 +311,23 @@ static void knife_start_cut(knifetool_opdata *kcd)
}
}
-static Ref *find_ref(ListBase *lb, void *ref)
-{
- Ref *ref1;
-
- for (ref1 = lb->first; ref1; ref1 = ref1->next) {
- if (ref1->ref == ref)
- return ref1;
- }
-
- return NULL;
-}
-
static ListBase *knife_get_face_kedges(knifetool_opdata *kcd, BMFace *f)
{
ListBase *lst = BLI_ghash_lookup(kcd->kedgefacemap, f);
-
+
if (!lst) {
BMIter iter;
BMEdge *e;
-
+
lst = knife_empty_list(kcd);
BM_ITER(e, &iter, kcd->em->bm, BM_EDGES_OF_FACE, f) {
knife_append_list(kcd, lst, get_bm_knife_edge(kcd, e));
}
-
+
BLI_ghash_insert(kcd->kedgefacemap, f, lst);
}
-
+
return lst;
}
@@ -336,7 +336,7 @@ static void knife_find_basef(knifetool_opdata *kcd, KnifeEdge *kfe)
{
if (!kfe->basef) {
Ref *r1, *r2, *r3, *r4;
-
+
if (kfe->v1->isface || kfe->v2->isface) {
if (kfe->v2->isface)
kfe->basef = kcd->curbmface;
@@ -373,44 +373,50 @@ static KnifeVert *knife_split_edge(knifetool_opdata *kcd, KnifeEdge *kfe, float
{
KnifeEdge *newkfe = new_knife_edge(kcd);
Ref *ref;
- float perc, cageco[3];
-
- perc = len_v3v3(co, kfe->v1->co) / len_v3v3(kfe->v1->co, kfe->v2->co);
- interp_v3_v3v3(cageco, kfe->v1->cageco, kfe->v2->cageco, perc);
-
+ float perc, cageco[3], l12;
+
+ l12 = len_v3v3(kfe->v1->co, kfe->v2->co);
+ if (l12 < FLT_EPSILON * 80) {
+ copy_v3_v3(cageco, kfe->v1->cageco);
+ }
+ else {
+ perc = len_v3v3(co, kfe->v1->co) / l12;
+ interp_v3_v3v3(cageco, kfe->v1->cageco, kfe->v2->cageco, perc);
+ }
+
newkfe->v1 = kfe->v1;
newkfe->v2 = new_knife_vert(kcd, co, cageco);
newkfe->v2->draw = 1;
newkfe->basef = kfe->basef;
-
+
ref = find_ref(&kfe->v1->edges, kfe);
BLI_remlink(&kfe->v1->edges, ref);
-
+
kfe->v1 = newkfe->v2;
BLI_addtail(&kfe->v1->edges, ref);
-
+
for (ref = kfe->faces.first; ref; ref = ref->next)
knife_edge_append_face(kcd, newkfe, ref->ref);
knife_add_to_vert_edges(kcd, newkfe);
-
+
newkfe->draw = kfe->draw;
newkfe->e = kfe->e;
-
+
*newkfe_out = newkfe;
-
+
return newkfe->v2;
}
static void knife_add_single_cut(knifetool_opdata *kcd)
{
KnifeEdge *kfe = new_knife_edge(kcd), *kfe2 = NULL, *kfe3 = NULL;
-
+
if (kcd->prevvert && kcd->prevvert == kcd->curvert)
return;
if (kcd->prevedge && kcd->prevedge == kcd->curedge)
return;
-
+
kfe->draw = 1;
if (kcd->prevvert) {
@@ -426,13 +432,12 @@ static void knife_add_single_cut(knifetool_opdata *kcd)
kfe->draw = !kcd->prev_is_space;
kfe->v1->isface = 1;
}
-
+
if (kcd->curvert) {
kfe->v2 = kcd->curvert;
}
else if (kcd->curedge) {
kfe->v2 = knife_split_edge(kcd, kcd->curedge, kcd->vertco, &kfe3);
-
kcd->curvert = kfe->v2;
}
else {
@@ -446,11 +451,11 @@ static void knife_add_single_cut(knifetool_opdata *kcd)
kcd->curvert = kfe->v2;
}
-
+
knife_find_basef(kcd, kfe);
-
+
knife_add_to_vert_edges(kcd, kfe);
-
+
if (kfe->basef && !find_ref(&kfe->faces, kfe->basef))
knife_edge_append_face(kcd, kfe, kfe->basef);
@@ -466,7 +471,7 @@ static void knife_add_single_cut(knifetool_opdata *kcd)
}
}
}
-
+
/* set up for next cut */
kcd->prevbmface = kcd->curbmface;
kcd->prevvert = kcd->curvert;
@@ -505,7 +510,7 @@ static void knife_add_single_cut_through(knifetool_opdata *kcd,
knife_edge_append_face(kcd, kfenew, f);
}
-static void knife_get_vert_faces(knifetool_opdata *kcd, KnifeVert* kfv, BMFace *facef, ListBase *lst)
+static void knife_get_vert_faces(knifetool_opdata *kcd, KnifeVert *kfv, BMFace *facef, ListBase *lst)
{
BMIter bmiter;
BMFace *f;
@@ -521,7 +526,7 @@ static void knife_get_vert_faces(knifetool_opdata *kcd, KnifeVert* kfv, BMFace *
}
}
-static void knife_get_edge_faces(knifetool_opdata *kcd, KnifeEdge* kfe, ListBase *lst)
+static void knife_get_edge_faces(knifetool_opdata *kcd, KnifeEdge *kfe, ListBase *lst)
{
BMIter bmiter;
BMFace *f;
@@ -657,23 +662,22 @@ static void knife_cut_through(knifetool_opdata *kcd)
static void knife_add_cut(knifetool_opdata *kcd)
{
- /* BMEditMesh *em = kcd->em;*/ /* UNUSED */
knifetool_opdata oldkcd = *kcd;
-
+
if (kcd->cut_through) {
knife_cut_through(kcd);
}
else if (kcd->linehits) {
BMEdgeHit *lh, *lastlh, *firstlh;
int i;
-
+
qsort(kcd->linehits, kcd->totlinehit, sizeof(BMEdgeHit), verge_linehit);
-
+
lh = kcd->linehits;
lastlh = firstlh = NULL;
for (i = 0; i < kcd->totlinehit; i++, (lastlh = lh), lh++) {
BMFace *f = lastlh ? lastlh->f : lh->f;
-
+
if (lastlh && len_v3v3(lastlh->hit, lh->hit) == 0.0f) {
if (!firstlh)
firstlh = lastlh;
@@ -691,21 +695,22 @@ static void knife_add_cut(knifetool_opdata *kcd)
}
lastlh = firstlh = NULL;
}
-
+
if (len_v3v3(kcd->prevcage, lh->realhit) < FLT_EPSILON * 80)
continue;
if (len_v3v3(kcd->vertcage, lh->realhit) < FLT_EPSILON * 80)
continue;
-
- if (kcd->prev_is_space || kcd->is_space) {
- kcd->prev_is_space = kcd->is_space = 0;
+
+ if (kcd->prev_is_space) {
+ kcd->prev_is_space = 0;
copy_v3_v3(kcd->prevco, lh->hit);
copy_v3_v3(kcd->prevcage, lh->cagehit);
+ kcd->prevvert = NULL;
kcd->prevedge = lh->kfe;
- kcd->curbmface = lh->f;
+ kcd->prevbmface = lh->f;
continue;
}
-
+
kcd->is_space = 0;
kcd->curedge = lh->kfe;
kcd->curbmface = lh->f;
@@ -715,16 +720,26 @@ static void knife_add_cut(knifetool_opdata *kcd)
knife_add_single_cut(kcd);
}
+
+ if (oldkcd.is_space) {
+ kcd->prevbmface = oldkcd.curbmface;
+ kcd->prevvert = oldkcd.curvert;
+ kcd->prevedge = oldkcd.curedge;
+ copy_v3_v3(kcd->prevco, oldkcd.vertco);
+ copy_v3_v3(kcd->prevcage, oldkcd.vertcage);
+ kcd->prev_is_space = oldkcd.is_space;
+ }
+ else {
+ kcd->curbmface = oldkcd.curbmface;
+ kcd->curvert = oldkcd.curvert;
+ kcd->curedge = oldkcd.curedge;
+ kcd->is_space = oldkcd.is_space;
+ copy_v3_v3(kcd->vertco, oldkcd.vertco);
+ copy_v3_v3(kcd->vertcage, oldkcd.vertcage);
- kcd->curbmface = oldkcd.curbmface;
- kcd->curvert = oldkcd.curvert;
- kcd->curedge = oldkcd.curedge;
- kcd->is_space = oldkcd.is_space;
- copy_v3_v3(kcd->vertco, oldkcd.vertco);
- copy_v3_v3(kcd->vertcage, oldkcd.vertcage);
-
- knife_add_single_cut(kcd);
-
+ knife_add_single_cut(kcd);
+ }
+
MEM_freeN(kcd->linehits);
kcd->linehits = NULL;
kcd->totlinehit = 0;
@@ -748,8 +763,8 @@ static void knifetool_draw_angle_snapping(knifetool_opdata *kcd)
/* make u the window coords of prevcage */
view3d_get_transformation(kcd->ar, kcd->vc.rv3d, kcd->ob, &mats);
gluProject(kcd->prevcage[0], kcd->prevcage[1], kcd->prevcage[2],
- mats.modelview, mats.projection, mats.viewport,
- &u[0], &u[1], &u[2]);
+ mats.modelview, mats.projection, mats.viewport,
+ &u[0], &u[1], &u[2]);
/* make u1, u2 the points on window going through u at snap angle */
wminx = kcd->ar->winrct.xmin;
@@ -822,11 +837,11 @@ static void knifetool_draw_angle_snapping(knifetool_opdata *kcd)
/* unproject u1 and u2 back into object space */
gluUnProject(u1[0], u1[1], 0.0,
- mats.modelview, mats.projection, mats.viewport,
- &v1[0], &v1[1], &v1[2]);
+ mats.modelview, mats.projection, mats.viewport,
+ &v1[0], &v1[1], &v1[2]);
gluUnProject(u2[0], u2[1], 0.0,
- mats.modelview, mats.projection, mats.viewport,
- &v2[0], &v2[1], &v2[2]);
+ mats.modelview, mats.projection, mats.viewport,
+ &v2[0], &v2[1], &v2[2]);
glColor3f(0.6, 0.6, 0.6);
glLineWidth(2.0);
@@ -982,30 +997,6 @@ static void knifetool_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void
glEnable(GL_DEPTH_TEST);
}
-/* do we need to keep these functions? - campbell */
-
-static int UNUSED_FUNCTION(kfe_vert_in_edge)(KnifeEdge *e, KnifeVert *v)
-{
- return e->v1 == v || e->v2 == v;
-}
-
-static int UNUSED_FUNCTION(point_on_line)(float p[3], float v1[3], float v2[3])
-{
- float d = dist_to_line_segment_v3(p, v1, v2);
- if (d < 0.01) {
- d = len_v3v3(v1, v2);
- if (d == 0.0)
- return 0;
-
- d = len_v3v3(p, v1) / d;
-
- if (d >= -FLT_EPSILON * 10 || d <= 1.0 + FLT_EPSILON * 10)
- return 1;
- }
-
- return 0;
-}
-
static float len_v3_tri_side_max(const float v1[3], const float v2[3], const float v3[3])
{
const float s1 = len_v3v3(v1, v2);
@@ -1172,36 +1163,36 @@ static void knife_find_line_hits(knifetool_opdata *kcd)
SmallHash hash, *ehash = &hash;
float v1[3], v2[3], v3[3], v4[4], s1[3], s2[3];
int i, c1, c2;
-
- knife_bgl_get_mats(kcd, &mats);
+ knife_bgl_get_mats(kcd, &mats);
+
if (kcd->linehits) {
MEM_freeN(kcd->linehits);
kcd->linehits = NULL;
kcd->totlinehit = 0;
}
-
+
copy_v3_v3(v1, kcd->prevcage);
copy_v3_v3(v2, kcd->vertcage);
-
+
/* project screen line's 3d coordinates back into 2d */
knife_project_v3(kcd, v1, s1);
knife_project_v3(kcd, v2, s2);
-
+
if (len_v2v2(s1, s2) < 1)
return;
/* unproject screen line */
ED_view3d_win_to_segment_clip(kcd->ar, kcd->vc.v3d, s1, v1, v3);
ED_view3d_win_to_segment_clip(kcd->ar, kcd->vc.v3d, s2, v2, v4);
-
+
mul_m4_v3(kcd->ob->imat, v1);
mul_m4_v3(kcd->ob->imat, v2);
mul_m4_v3(kcd->ob->imat, v3);
mul_m4_v3(kcd->ob->imat, v4);
-
+
BLI_smallhash_init(ehash);
-
+
/* test two triangles of sceen line's plane */
e1 = knife_edge_tri_isect(kcd, kcd->bmbvh, v1, v2, v3, ehash, &mats, &c1);
e2 = knife_edge_tri_isect(kcd, kcd->bmbvh, v2, v3, v4, ehash, &mats, &c2);
@@ -1213,17 +1204,17 @@ static void knife_find_line_hits(knifetool_opdata *kcd)
else if (c2) {
e1 = e2;
}
-
+
kcd->linehits = e1;
kcd->totlinehit = c1 + c2;
/* find position along screen line, used for sorting */
for (i = 0; i < kcd->totlinehit; i++) {
BMEdgeHit *lh = e1 + i;
-
+
lh->l = len_v2v2(lh->schit, s1) / len_v2v2(s2, s1);
}
-
+
BLI_smallhash_release(ehash);
}
@@ -1393,9 +1384,9 @@ static KnifeEdge *knife_find_closest_edge(knifetool_opdata *kcd, float p[3], flo
float labda = labda_PdistVL2Dfl(sco, kfe->v1->sco, kfe->v2->sco);
float vec[3];
- vec[0] = kfe->v1->cageco[0] + labda*(kfe->v2->cageco[0] - kfe->v1->cageco[0]);
- vec[1] = kfe->v1->cageco[1] + labda*(kfe->v2->cageco[1] - kfe->v1->cageco[1]);
- vec[2] = kfe->v1->cageco[2] + labda*(kfe->v2->cageco[2] - kfe->v1->cageco[2]);
+ vec[0] = kfe->v1->cageco[0] + labda * (kfe->v2->cageco[0] - kfe->v1->cageco[0]);
+ vec[1] = kfe->v1->cageco[1] + labda * (kfe->v2->cageco[1] - kfe->v1->cageco[1]);
+ vec[2] = kfe->v1->cageco[2] + labda * (kfe->v2->cageco[2] - kfe->v1->cageco[2]);
mul_m4_v3(kcd->vc.obedit->obmat, vec);
if (ED_view3d_clipping_test(kcd->vc.rv3d, vec, TRUE) == 0) {
@@ -1560,16 +1551,16 @@ static int knife_update_active(knifetool_opdata *kcd)
knife_snap_angle(kcd);
kcd->curvert = NULL; kcd->curedge = NULL; kcd->curbmface = NULL;
-
+
kcd->curvert = knife_find_closest_vert(kcd, kcd->vertco, kcd->vertcage, &kcd->curbmface, &kcd->is_space);
if (!kcd->curvert) {
kcd->curedge = knife_find_closest_edge(kcd, kcd->vertco, kcd->vertcage, &kcd->curbmface, &kcd->is_space);
}
-
+
/* if no hits are found this would normally default to (0,0,0) so instead
* get a point at the mouse ray closest to the previous point.
* Note that drawing lines in `free-space` isn't properly supported
- * but theres no guarantee (0,0,0) has any geometry either - campell */
+ * but theres no guarantee (0,0,0) has any geometry either - campbell */
if (kcd->curvert == NULL && kcd->curedge == NULL) {
float origin[3], ray[3], co[3];
@@ -1593,6 +1584,9 @@ static int knife_update_active(knifetool_opdata *kcd)
#define BOUNDARY 128
#define FACE_NEW 256
+#define SCANFILL_CUTS 0
+#if SCANFILL_CUTS
+
typedef struct facenet_entry {
struct facenet_entry *next, *prev;
KnifeEdge *kfe;
@@ -1943,12 +1937,620 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
BMO_pop(bm);
}
+#else /* use direct (non-scanfill) method for cuts */
+
+/* assuming v is on line ab, what fraction of the way is v from a to b? */
+static float frac_along(const float a[3], const float b[3], const float v[3]) {
+ float lab;
+
+ lab = len_v3v3(a, b);
+ if (lab == 0.0f) {
+ return 0.0f;
+ }
+ else {
+ return len_v3v3(a, v) / lab;
+ }
+}
+
+/* sort list of kverts by fraction along edge e */
+static void sort_by_frac_along(ListBase *lst, BMEdge *e) {
+ KnifeVert *vcur, *vprev;
+ float *v1co, *v2co;
+ Ref *cur = NULL, *prev = NULL, *next = NULL;
+
+ if (lst->first == lst->last)
+ return;
+
+ v1co = e->v1->co;
+ v2co = e->v2->co;
+
+ for (cur = ((Ref *)lst->first)->next; cur; cur = next) {
+ next = cur->next;
+ prev = cur->prev;
+
+ BLI_remlink(lst, cur);
+
+ vcur = cur->ref;
+ while (prev) {
+ vprev = prev->ref;
+ if (frac_along(v1co, v2co, vprev->co) <= frac_along(v1co, v2co, vcur->co))
+ break;
+ prev = prev->prev;
+ }
+
+ BLI_insertlinkafter(lst, prev, cur);
+ }
+}
+
+/* The chain so far goes from an instantiated vertex to kfv (some may be reversed).
+ * If possible, complete the chain to another instantiated vertex and return 1, else return 0.
+ * The visited hash says which KnifeVert's have already been tried, not including kfv. */
+static int find_chain_search(knifetool_opdata *kcd, KnifeVert *kfv,
+ ListBase *fedges, SmallHash *visited, ListBase *chain) {
+ Ref *r;
+ KnifeEdge *kfe;
+ KnifeVert *kfv_other;
+
+ if (kfv->v)
+ return TRUE;
+
+ BLI_smallhash_insert(visited, (uintptr_t)kfv, NULL);
+ /* Try all possible next edges. Could either go through fedges
+ * (all the KnifeEdges for the face being cut) or could go through
+ * kve->edges and restrict to cutting face and uninstantiated edges.
+ * Not clear which is better. Let's do the first. */
+ for (r = fedges->first; r; r = r->next) {
+ kfe = r->ref;
+ kfv_other = NULL;
+ if (kfe->v1 == kfv)
+ kfv_other = kfe->v2;
+ else if (kfe->v2 == kfv)
+ kfv_other = kfe->v1;
+ if (kfv_other && !BLI_smallhash_haskey(visited, (uintptr_t)kfv_other)) {
+ knife_append_list(kcd, chain, kfe);
+ if (find_chain_search(kcd, kfv_other, fedges, visited, chain))
+ return TRUE;
+ BLI_remlink(chain, chain->last);
+ }
+ }
+ return FALSE;
+}
+
+static ListBase * find_chain_from_vertex(knifetool_opdata *kcd, KnifeEdge *kfe,
+ BMVert *v, ListBase *fedges) {
+ SmallHash visited_, *visited = &visited_;
+ ListBase *ans;
+ int found;
+
+ ans = knife_empty_list(kcd);
+ knife_append_list(kcd, ans, kfe);
+ found = 0;
+ BLI_smallhash_init(visited);
+ if (kfe->v1->v == v) {
+ BLI_smallhash_insert(visited, (uintptr_t)(kfe->v1), NULL);
+ found = find_chain_search(kcd, kfe->v2, fedges, visited, ans);
+ }
+ else {
+ BLI_assert(kfe->v2->v == v);
+ BLI_smallhash_insert(visited, (uintptr_t)(kfe->v2), NULL);
+ found = find_chain_search(kcd, kfe->v1, fedges, visited, ans);
+ }
+
+ BLI_smallhash_release(visited);
+
+ if (found)
+ return ans;
+ else
+ return NULL;
+}
+
+/* Find a chain in fedges from one instantiated vertex to another.
+ * Remove the edges in the chain from fedges and return a separate list of the chain. */
+static ListBase * find_chain(knifetool_opdata *kcd, ListBase *fedges) {
+ Ref *r, *ref;
+ KnifeEdge *kfe;
+ BMVert *v1, *v2;
+ ListBase *ans;
+
+ ans = NULL;
+
+ for (r = fedges->first; r; r = r->next) {
+ kfe = r->ref;
+ v1 = kfe->v1->v;
+ v2 = kfe->v2->v;
+ if (v1 && v2) {
+ ans = knife_empty_list(kcd);
+ knife_append_list(kcd, ans, kfe);
+ break;
+ }
+ if (v1)
+ ans = find_chain_from_vertex(kcd, kfe, v1, fedges);
+ else if (v2)
+ ans = find_chain_from_vertex(kcd, kfe, v2, fedges);
+ if (ans)
+ break;
+ }
+ if (ans) {
+ BLI_assert(BLI_countlist(ans) > 0);
+ for (r = ans->first; r; r = r->next) {
+ ref = find_ref(fedges, r->ref);
+ BLI_assert(ref != NULL);
+ BLI_remlink(fedges, ref);
+ }
+ }
+ return ans;
+}
+
+/* The hole so far goes from kfvfirst to kfv (some may be reversed).
+ * If possible, complete the hole back to kfvfirst and return 1, else return 0.
+ * The visited hash says which KnifeVert's have already been tried, not including kfv or kfvfirst. */
+static int find_hole_search(knifetool_opdata *kcd, KnifeVert *kfvfirst, KnifeVert *kfv,
+ ListBase *fedges, SmallHash *visited, ListBase *hole) {
+ Ref *r;
+ KnifeEdge *kfe, *kfelast;
+ KnifeVert *kfv_other;
+
+ if (kfv == kfvfirst)
+ return TRUE;
+
+ BLI_smallhash_insert(visited, (uintptr_t)kfv, NULL);
+ kfelast = ((Ref *)hole->last)->ref;
+ for (r = fedges->first; r; r = r->next) {
+ kfe = r->ref;
+ if (kfe == kfelast)
+ continue;
+ kfv_other = NULL;
+ if (kfe->v1 == kfv)
+ kfv_other = kfe->v2;
+ else if (kfe->v2 == kfv)
+ kfv_other = kfe->v1;
+ if (kfv_other && !BLI_smallhash_haskey(visited, (uintptr_t)kfv_other)) {
+ knife_append_list(kcd, hole, kfe);
+ if (find_hole_search(kcd, kfvfirst, kfv_other, fedges, visited, hole))
+ return TRUE;
+ BLI_remlink(hole, hole->last);
+ }
+ }
+ return FALSE;
+}
+
+/* Find a hole (simple cycle with no instantiated vertices).
+ * Remove the edges in the cycle from fedges and return a separate list of the cycle */
+static ListBase *find_hole(knifetool_opdata *kcd, ListBase *fedges) {
+ ListBase *ans;
+ Ref *r, *ref;
+ KnifeEdge *kfe;
+ SmallHash visited_, *visited = &visited_;
+ int found;
+
+ ans = NULL;
+ found = FALSE;
+
+ for (r = fedges->first; r && !found; r = r->next) {
+ kfe = r->ref;
+ if (kfe->v1->v || kfe->v2->v || kfe->v1 == kfe->v2)
+ continue;
+
+ BLI_smallhash_init(visited);
+ ans = knife_empty_list(kcd);
+ knife_append_list(kcd, ans, kfe);
+
+ found = find_hole_search(kcd, kfe->v1, kfe->v2, fedges, visited, ans);
+
+ BLI_smallhash_release(visited);
+ }
+
+ if (found) {
+ for (r = ans->first; r; r = r->next) {
+ kfe = r->ref;
+ ref = find_ref(fedges, r->ref);
+ if (ref)
+ BLI_remlink(fedges, ref);
+ }
+ return ans;
+ }
+ else {
+ return NULL;
+ }
+}
+
+/* Try to find "nice" diagonals - short, and far apart from each other.
+ * If found, return TRUE and make a 'main chain' going across f which uses
+ * the two diagonals and one part of the hole, and a 'side chain' that
+ * completes the hole. */
+static int find_hole_chains(knifetool_opdata *kcd, ListBase *hole, BMFace *f,
+ ListBase **mainchain, ListBase **sidechain) {
+ float **fco, **hco;
+ BMVert **fv;
+ KnifeVert **hv;
+ KnifeEdge **he;
+ Ref *r;
+ KnifeVert *kfv;
+ KnifeEdge *kfe;
+ ListBase *chain;
+ BMVert *v;
+ BMIter iter;
+ int nh, nf, i, j, k, m, ax, ay, ok, sep, bestsep;
+ int besti[2], bestj[2];
+ float d, bestd;
+
+ nh = BLI_countlist(hole);
+ nf = f->len;
+ if (nh < 2 || nf < 3)
+ return 0;
+
+ /* Gather 2d projections of hole and face vertex coordinates.
+ * Use best-axis projection - not completely accurate, maybe revisit */
+ axis_dominant_v3(&ax, &ay, f->no);
+ hco = BLI_memarena_alloc(kcd->arena, nh * sizeof(float *));
+ fco = BLI_memarena_alloc(kcd->arena, nf * sizeof(float *));
+ hv = BLI_memarena_alloc(kcd->arena, nh * sizeof(KnifeVert *));
+ fv = BLI_memarena_alloc(kcd->arena, nf * sizeof(BMVert *));
+ he = BLI_memarena_alloc(kcd->arena, nh * sizeof(KnifeEdge *));
+
+ i = 0;
+ kfv = NULL;
+ for (r = hole->first; r; r = r->next) {
+ kfe = r->ref;
+ he[i] = kfe;
+ kfv = (kfv == kfe->v1)? kfe->v2 : kfe->v1;
+ hco[i] = BLI_memarena_alloc(kcd->arena, 2*sizeof(float));
+ hco[i][0] = kfv->co[ax];
+ hco[i][1] = kfv->co[ay];
+ hv[i] = kfv;
+ i++;
+ }
+
+ j = 0;
+ BM_ITER(v, &iter, kcd->em->bm, BM_VERTS_OF_FACE, f) {
+ fco[j] = BLI_memarena_alloc(kcd->arena, 2*sizeof(float));
+ fco[j][0] = v->co[ax];
+ fco[j][1] = v->co[ay];
+ fv[j] = v;
+ j++;
+ }
+
+ /* For first diagonal (m==0), want shortest length.
+ * For second diagonal (m==1), want max separation of index of hole
+ * vertex from the hole vertex used in the first diagonal, and from there
+ * want the one with shortest length. */
+ for (m = 0; m < 2; m++) {
+ besti[m] = -1;
+ bestj[m] = -1;
+ bestd = FLT_MAX;
+ bestsep = 0;
+ for (i = 0; i < nh; i++) {
+ if (m == 1) {
+ if (i == besti[0])
+ continue;
+ sep = (i + nh - besti[0]) % nh;
+ sep = MIN2(sep, nh - sep);
+ if (sep < bestsep)
+ continue;
+ bestd = FLT_MAX;
+ }
+ for (j = 0; j < nf; j++) {
+ d = len_squared_v2v2(hco[i], fco[j]);
+ if (d > bestd)
+ continue;
+
+ ok = TRUE;
+ for (k = 0; k < nh && ok; k++) {
+ if (k == i || (k+1) % nh == i)
+ continue;
+ if (isect_line_line_v2(hco[i], fco[j], hco[k], hco[(k+1) % nh]))
+ ok = FALSE;
+ }
+ if (!ok)
+ continue;
+ for (k = 0; k < nf && ok; k++) {
+ if (k == j || (k+1) % nf == j)
+ continue;
+ if (isect_line_line_v2(hco[i], fco[j], fco[k], fco[(k+1) % nf]))
+ ok = FALSE;
+ }
+ if (ok) {
+ besti[m] = i;
+ bestj[m] = j;
+ if (m == 1)
+ bestsep = sep;
+ bestd = d;
+ }
+ }
+ }
+ }
+
+ if (besti[0] != -1 && besti[1] != -1) {
+ kfe = new_knife_edge(kcd);
+ kfe->v1 = get_bm_knife_vert(kcd, fv[bestj[0]]);
+ kfe->v2 = hv[besti[0]];
+ chain = knife_empty_list(kcd);
+ knife_append_list(kcd, chain, kfe);
+ for (i = besti[0]; i != besti[1]; i = (i+1) % nh) {
+ knife_append_list(kcd, chain, he[i]);
+ }
+ kfe = new_knife_edge(kcd);
+ kfe->v1 = hv[besti[1]];
+ kfe->v2 = get_bm_knife_vert(kcd, fv[bestj[1]]);
+ knife_append_list(kcd, chain, kfe);
+ *mainchain = chain;
+
+ chain = knife_empty_list(kcd);
+ for (i = besti[1]; i != besti[0]; i = (i+1) % nh) {
+ knife_append_list(kcd, chain, he[i]);
+ }
+ *sidechain = chain;
+
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
+
+static int knife_edge_in_face(knifetool_opdata *kcd, KnifeEdge *kfe, BMFace *f) {
+ BMesh *bm = kcd->em->bm;
+ BMVert *v1, *v2;
+ BMLoop *l1, *l2, *l, *loops[2];
+ BMIter iter;
+ int v1inside, v2inside;
+
+ v1 = kfe->v1->v;
+ v2 = kfe->v2->v;
+ l1 = NULL;
+ l2 = NULL;
+
+ /* find out if v1 and v2, if set, are part of the face */
+ BM_ITER(l, &iter, bm, BM_LOOPS_OF_FACE, f) {
+ if (v1 && l->v == v1)
+ l1 = l;
+ if (v2 && l->v == v2)
+ l2 = l;
+ }
+
+ /* BM_face_point_inside_test uses best-axis projection so this isn't most accurate test... */
+ v1inside = l1 ? 0 : BM_face_point_inside_test(bm, f, kfe->v1->co);
+ v2inside = l2 ? 0 : BM_face_point_inside_test(bm, f, kfe->v2->co);
+ if ((l1 && v2inside) || (l2 && v1inside) || (v1inside && v2inside))
+ return TRUE;
+ if (l1 && l2) {
+ /* Can have case where v1 and v2 are on shared chain between two faces.
+ * BM_face_legal_splits does visibility and self-intersection tests. */
+ loops[0] = l1;
+ loops[1] = l2;
+ BM_face_legal_splits(bm, f, (BMLoop *(*)[2])loops, 1);
+ return (loops[0] != NULL);
+ }
+ return FALSE;
+}
+
+/* Split face f with KnifeEdges on chain. f remains as one side, the face formed is put in *newface.
+ * The new face will be on the left side of the chain as viewed from the normal-out side of f. */
+static void knife_make_chain_cut(knifetool_opdata *kcd, BMFace *f, ListBase *chain, BMFace **newface) {
+ BMesh *bm = kcd->em->bm;
+ KnifeEdge *kfe, *kfelast;
+ BMVert *v1, *v2;
+ BMFace *fnew;
+ Ref *ref;
+ KnifeVert *kfv, *kfvprev;
+ BMLoop *lnew, *l_iter;
+ int i;
+ int nco = BLI_countlist(chain) - 1;
+ float (*cos)[3] = NULL;
+ KnifeVert **kverts;
+ BLI_array_fixedstack_declare(cos, BM_NGON_STACK_SIZE, nco, __func__);
+ BLI_array_fixedstack_declare(kverts, BM_NGON_STACK_SIZE, nco, __func__);
+
+ kfe = ((Ref *)chain->first)->ref;
+ v1 = kfe->v1->v ? kfe->v1->v : kfe->v2->v;
+ kfelast = ((Ref *)chain->last)->ref;
+ v2 = kfelast->v2->v ? kfelast->v2->v : kfelast->v1->v;
+ BLI_assert(v1 != NULL && v2 != NULL);
+ kfvprev = kfe->v1->v == v1 ? kfe->v1 : kfe->v2;
+ for (ref = chain->first, i=0; i < nco && ref != chain->last; ref = ref->next, i++) {
+ kfe = ref->ref;
+ BLI_assert(kfvprev == kfe->v1 || kfvprev == kfe->v2);
+ kfv = kfe->v1 == kfvprev? kfe->v2 : kfe->v1;
+ copy_v3_v3(cos[i], kfv->co);
+ kverts[i] = kfv;
+ kfvprev = kfv;
+ }
+ BLI_assert(i == nco);
+ fnew = BM_face_split_n(bm, f, v1, v2, cos, nco, &lnew, NULL);
+ *newface = fnew;
+
+ /* Now go through lnew chain matching up chain kv's and assign real v's to them */
+ for (l_iter = lnew->next, i = 0; i < nco; l_iter = l_iter->next, i++) {
+ BLI_assert(equals_v3v3(cos[i], l_iter->v->co));
+ kverts[i]->v = l_iter->v;
+ }
+
+ BLI_array_fixedstack_free(cos);
+ BLI_array_fixedstack_free(kverts);
+}
+
+static void knife_make_face_cuts(knifetool_opdata *kcd, BMFace *f, ListBase *kfedges) {
+ BMesh *bm = kcd->em->bm;
+ KnifeEdge *kfe;
+ BMFace *fnew, *fnew2, *fhole;
+ ListBase *chain, *hole, *sidechain;
+ ListBase *fnew_kfedges, *fnew2_kfedges;
+ Ref *ref, *refnext;
+ int count, oldcount;
+
+ oldcount = BLI_countlist(kfedges);
+ while ((chain = find_chain(kcd, kfedges)) != NULL) {
+ knife_make_chain_cut(kcd, f, chain, &fnew);
+
+ /* Move kfedges to fnew_kfedges if they are now in fnew.
+ * The chain edges were removed already */
+ fnew_kfedges = knife_empty_list(kcd);
+ for (ref = kfedges->first; ref; ref = refnext) {
+ kfe = ref->ref;
+ refnext = ref->next;
+ if (knife_edge_in_face(kcd, kfe, fnew)) {
+ BLI_remlink(kfedges, ref);
+ kfe->basef = fnew;
+ knife_append_list(kcd, fnew_kfedges, kfe);
+ }
+ }
+ if (fnew_kfedges->first)
+ knife_make_face_cuts(kcd, fnew, fnew_kfedges);
+
+ /* find_chain should always remove edges if it returns TRUE,
+ * but guard against infinite loop anyway */
+ count = BLI_countlist(kfedges);
+ if (count >= oldcount) {
+ BLI_assert(!"knife find_chain infinite loop");
+ return;
+ }
+ oldcount = count;
+ }
+
+ while ((hole = find_hole(kcd, kfedges)) != NULL) {
+ if (find_hole_chains(kcd, hole, f, &chain, &sidechain)) {
+ /* chain goes across f and sidechain comes back
+ * from the second last vertex to the second vertex.
+ */
+ knife_make_chain_cut(kcd, f, chain, &fnew);
+ kfe = ((Ref *)sidechain->first)->ref;
+ if (knife_edge_in_face(kcd, kfe, f)) {
+ knife_make_chain_cut(kcd, f, sidechain, &fnew2);
+ fhole = f;
+ }
+ else if (knife_edge_in_face(kcd, kfe, fnew)) {
+ knife_make_chain_cut(kcd, fnew, sidechain, &fnew2);
+ fhole = fnew2;
+ }
+ else {
+ /* shouldn't happen */
+ BLI_assert(0);
+ }
+ BM_face_kill(bm, fhole);
+ /* Move kfedges to either fnew or fnew2 if appropriate.
+ * The hole edges were removed already */
+ fnew_kfedges = knife_empty_list(kcd);
+ fnew2_kfedges = knife_empty_list(kcd);
+ for (ref = kfedges->first; ref; ref = refnext) {
+ kfe = ref->ref;
+ refnext = ref->next;
+ if (knife_edge_in_face(kcd, kfe, fnew)) {
+ BLI_remlink(kfedges, ref);
+ kfe->basef = fnew;
+ knife_append_list(kcd, fnew_kfedges, kfe);
+ }
+ else if (knife_edge_in_face(kcd, kfe, fnew2)) {
+ BLI_remlink(kfedges, ref);
+ kfe->basef = fnew2;
+ knife_append_list(kcd, fnew2_kfedges, kfe);
+ }
+ }
+ /* We'll skip knife edges that are in the newly formed hole.
+ * (Maybe we shouldn't have made a hole in the first place?) */
+ if (fnew != fhole && fnew_kfedges->first)
+ knife_make_face_cuts(kcd, fnew, fnew_kfedges);
+ if (fnew2 != fhole && fnew2_kfedges->first)
+ knife_make_face_cuts(kcd, fnew2, fnew2_kfedges);
+ if (f == fhole)
+ break;
+ /* find_hole should always remove edges if it returns TRUE,
+ * but guard against infinite loop anyway */
+ count = BLI_countlist(kfedges);
+ if (count >= oldcount) {
+ BLI_assert(!"knife find_hole infinite loop");
+ return;
+ }
+ oldcount = count;
+ }
+ }
+}
+
+/* Use the network of KnifeEdges and KnifeVerts accumulated to make real BMVerts and BMEdedges */
+static void knife_make_cuts(knifetool_opdata *kcd)
+{
+ BMesh *bm = kcd->em->bm;
+ KnifeEdge *kfe;
+ KnifeVert *kfv;
+ BMFace *f;
+ BMEdge *e, *enew;
+ ListBase *lst;
+ Ref *ref;
+ float pct;
+ SmallHashIter hiter;
+ BLI_mempool_iter iter;
+ SmallHash fhash_, *fhash = &fhash_;
+ SmallHash ehash_, *ehash = &ehash_;
+
+ BLI_smallhash_init(fhash);
+ BLI_smallhash_init(ehash);
+
+ /* put list of cutting edges for a face into fhash, keyed by face */
+ BLI_mempool_iternew(kcd->kedges, &iter);
+ for (kfe = BLI_mempool_iterstep(&iter); kfe; kfe = BLI_mempool_iterstep(&iter)) {
+ f = kfe->basef;
+ if (!f || kfe->e)
+ continue;
+ lst = BLI_smallhash_lookup(fhash, (uintptr_t)f);
+ if (!lst) {
+ lst = knife_empty_list(kcd);
+ BLI_smallhash_insert(fhash, (uintptr_t)f, lst);
+ }
+ knife_append_list(kcd, lst, kfe);
+ }
+
+ /* put list of splitting vertices for an edge into ehash, keyed by edge */
+ BLI_mempool_iternew(kcd->kverts, &iter);
+ for (kfv = BLI_mempool_iterstep(&iter); kfv; kfv = BLI_mempool_iterstep(&iter)) {
+ if (kfv->v)
+ continue; /* already have a BMVert */
+ for (ref = kfv->edges.first; ref; ref = ref->next) {
+ kfe = ref->ref;
+ e = kfe->e;
+ if (!e)
+ continue;
+ lst = BLI_smallhash_lookup(ehash, (uintptr_t)e);
+ if (!lst) {
+ lst = knife_empty_list(kcd);
+ BLI_smallhash_insert(ehash, (uintptr_t)e, lst);
+ }
+ /* there can be more than one kfe in kfv's list with same e */
+ if (!find_ref(lst, kfv))
+ knife_append_list(kcd, lst, kfv);
+ }
+ }
+
+ /* split bmesh edges where needed */
+ for (lst = BLI_smallhash_iternew(ehash, &hiter, (uintptr_t *)&e); lst;
+ lst = BLI_smallhash_iternext(&hiter, (uintptr_t *)&e)) {
+ sort_by_frac_along(lst, e);
+ for (ref = lst->first; ref; ref = ref->next) {
+ kfv = ref->ref;
+ pct = frac_along(e->v1->co, e->v2->co, kfv->co);
+ kfv->v = BM_edge_split(bm, e, e->v1, &enew, pct);
+ }
+ }
+
+ /* do cuts for each face */
+ for (lst = BLI_smallhash_iternew(fhash, &hiter, (uintptr_t *)&f); lst;
+ lst = BLI_smallhash_iternext(&hiter, (uintptr_t *)&f)) {
+ knife_make_face_cuts(kcd, f, lst);
+ }
+
+ BLI_smallhash_release(fhash);
+ BLI_smallhash_release(ehash);
+}
+#endif
+
/* called on tool confirmation */
static void knifetool_finish(bContext *C, wmOperator *op)
{
knifetool_opdata *kcd = op->customdata;
+#if SCANFILL_CUTS
knifenet_fill_faces(kcd);
+#else
+ knife_make_cuts(kcd);
+#endif
DAG_id_tag_update(kcd->ob->data, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, kcd->ob->data);
@@ -2128,7 +2730,7 @@ enum {
KNF_MODAL_ANGLE_SNAP_TOGGLE
};
-wmKeyMap* knifetool_modal_keymap(wmKeyConfig *keyconf)
+wmKeyMap *knifetool_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
{KNF_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
@@ -2151,7 +2753,7 @@ wmKeyMap* knifetool_modal_keymap(wmKeyConfig *keyconf)
keymap = WM_modalkeymap_add(keyconf, "Knife Tool Modal Map", modal_items);
/* items for modal map */
- WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, KNF_MODAL_CONFIRM);
+ WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, KNF_MODAL_CANCEL);
WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_PRESS, KM_ANY, 0, KNF_MODAL_ADD_CUT);
WM_modalkeymap_add_item(keymap, RIGHTMOUSE, KM_PRESS, KM_ANY, 0, KNF_MODAL_CONFIRM);
WM_modalkeymap_add_item(keymap, RETKEY, KM_PRESS, KM_ANY, 0, KNF_MODAL_CONFIRM);
diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c
index a82310be926..86469ae5461 100644
--- a/source/blender/editors/mesh/loopcut.c
+++ b/source/blender/editors/mesh/loopcut.c
@@ -133,8 +133,8 @@ static void ringsel_draw(const bContext *C, ARegion *UNUSED(ar), void *arg)
}
}
-/*given two opposite edges in a face, finds the ordering of their vertices so
- that cut preview lines won't cross each other*/
+/* given two opposite edges in a face, finds the ordering of their vertices so
+ * that cut preview lines won't cross each other*/
static void edgering_find_order(BMEditMesh *em, BMEdge *lasteed, BMEdge *eed,
BMVert *lastv1, BMVert *v[2][2])
{
@@ -161,7 +161,7 @@ static void edgering_find_order(BMEditMesh *em, BMEdge *lasteed, BMEdge *eed,
return;
}
- l2 = BM_face_other_loop(l->e, l->f, eed->v1);
+ l2 = BM_face_other_edge_loop(l->f, l->e, eed->v1);
rev = (l2 == l->prev);
while (l2->v != lasteed->v1 && l2->v != lasteed->v2) {
l2 = rev ? l2->prev : l2->next;
@@ -289,9 +289,9 @@ static void ringsel_find_edge(tringselOpData *lcd, int cuts)
{
if (lcd->eed) {
edgering_sel(lcd, cuts, 0);
- } else if(lcd->edges) {
- if (lcd->edges)
- MEM_freeN(lcd->edges);
+ }
+ else if (lcd->edges) {
+ MEM_freeN(lcd->edges);
lcd->edges = NULL;
lcd->totedge = 0;
}
@@ -431,6 +431,7 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
{
int cuts= RNA_int_get(op->ptr,"number_cuts");
tringselOpData *lcd= op->customdata;
+ int show_cuts = 0;
view3d_operator_needs_opengl(C);
@@ -477,6 +478,7 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
cuts++;
RNA_int_set(op->ptr,"number_cuts",cuts);
ringsel_find_edge(lcd, cuts);
+ show_cuts = TRUE;
ED_region_tag_redraw(lcd->ar);
break;
@@ -489,6 +491,7 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
cuts=MAX2(cuts-1,1);
RNA_int_set(op->ptr,"number_cuts",cuts);
ringsel_find_edge(lcd, cuts);
+ show_cuts = TRUE;
ED_region_tag_redraw(lcd->ar);
break;
@@ -514,19 +517,25 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
if (event->val==KM_PRESS) {
float value;
- if (handleNumInput(&lcd->num, event))
- {
+ if (handleNumInput(&lcd->num, event)) {
applyNumInput(&lcd->num, &value);
- cuts= CLAMPIS(value, 1, 32);
+ cuts= CLAMPIS(value, 1, 130);
RNA_int_set(op->ptr,"number_cuts",cuts);
ringsel_find_edge(lcd, cuts);
+ show_cuts = TRUE;
ED_region_tag_redraw(lcd->ar);
}
}
+ if (show_cuts) {
+ char buf[64];
+ BLI_snprintf(buf, sizeof(buf), "Number of Cuts: %d", cuts);
+ ED_area_headerprint(CTX_wm_area(C), buf);
+ }
+
/* keep going until the user confirms */
return OPERATOR_RUNNING_MODAL;
}
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index 4259f7fc558..428406ee3ee 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -95,13 +95,12 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
index = CustomData_get_layer_index(data, type);
/* ok, deleting a non-active layer needs to preserve the active layer indices.
- to do this, we store a pointer to the .data member of both layer and the active layer,
- (to detect if we're deleting the active layer or not), then use the active
- layer data pointer to find where the active layer has ended up.
-
-
- this is necessary because the deletion functions only support deleting the active
- layer. */
+ * to do this, we store a pointer to the .data member of both layer and the active layer,
+ * (to detect if we're deleting the active layer or not), then use the active
+ * layer data pointer to find where the active layer has ended up.
+ *
+ * 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;
clonelayerdata = data->layers[CustomData_get_clone_layer_index(data, type)].data;
@@ -691,8 +690,11 @@ static int sticky_add_exec(bContext *C, wmOperator *UNUSED(op))
Object *ob= ED_object_context(C);
Mesh *me= ob->data;
- /*if(me->msticky)
- return OPERATOR_CANCELLED;*/
+ /* why is this commented out? */
+#if 0
+ if(me->msticky)
+ return OPERATOR_CANCELLED;
+#endif
RE_make_sticky(scene, v3d);
@@ -761,6 +763,9 @@ void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges, int calc_tessface)
/* would only be converting back again, dont bother */
calc_tessface = FALSE;
+
+ /* it also happens that converting the faces calculates edges, skip this */
+ calc_edges = FALSE;
}
if(calc_edges || (mesh->totpoly && mesh->totedge == 0))
@@ -769,24 +774,33 @@ void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges, int calc_tessface)
if (calc_tessface) {
BKE_mesh_tessface_calc(mesh);
}
+ else {
+ /* default state is not to have tessface's so make sure this is the case */
+ BKE_mesh_tessface_clear(mesh);
+ }
+ /* note on this if/else - looks like these layers are not needed
+ * so rather then add poly-index layer and calculate normals for it
+ * calculate normals only for the mvert's. - campbell */
+#ifdef USE_BMESH_MPOLY_NORMALS
polyindex = CustomData_get_layer(&mesh->fdata, CD_POLYINDEX);
/* add a normals layer for tesselated faces, a tessface normal will
- contain the normal of the poly the face was tesselated from. */
+ * contain the normal of the poly the face was tesselated from. */
face_nors = CustomData_add_layer(&mesh->fdata, CD_NORMAL, CD_CALLOC, NULL, mesh->totface);
- mesh_calc_normals_mapping(
- mesh->mvert,
- mesh->totvert,
- mesh->mloop,
- mesh->mpoly,
- mesh->totloop,
- mesh->totpoly,
- NULL /* polyNors_r */,
- mesh->mface,
- mesh->totface,
- polyindex,
- face_nors);
+ mesh_calc_normals_mapping_ex(mesh->mvert, mesh->totvert,
+ mesh->mloop, mesh->mpoly,
+ mesh->totloop, mesh->totpoly,
+ NULL /* polyNors_r */,
+ mesh->mface, mesh->totface,
+ polyindex, face_nors, FALSE);
+#else
+ mesh_calc_normals(mesh->mvert, mesh->totvert,
+ mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
+ NULL);
+ (void)polyindex;
+ (void)face_nors;
+#endif
DAG_id_tag_update(&mesh->id, 0);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, mesh);
@@ -987,7 +1001,7 @@ static void mesh_remove_faces(Mesh *mesh, int len)
mesh->totface= totface;
}
-/*
+#if 0
void ED_mesh_geometry_add(Mesh *mesh, ReportList *reports, int verts, int edges, int faces)
{
if(mesh->edit_btmesh) {
@@ -1002,7 +1016,7 @@ void ED_mesh_geometry_add(Mesh *mesh, ReportList *reports, int verts, int edges,
if(faces)
mesh_add_faces(mesh, faces);
}
-*/
+#endif
void ED_mesh_faces_add(Mesh *mesh, ReportList *reports, int count)
{
@@ -1098,5 +1112,13 @@ void ED_mesh_polys_add(Mesh *mesh, ReportList *reports, int count)
void ED_mesh_calc_normals(Mesh *mesh)
{
- mesh_calc_normals_mapping(mesh->mvert, mesh->totvert, mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly, NULL, NULL, 0, NULL, NULL);
+#ifdef USE_BMESH_MPOLY_NORMALS
+ mesh_calc_normals_mapping_ex(mesh->mvert, mesh->totvert,
+ mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
+ NULL, NULL, 0, NULL, NULL, FALSE);
+#else
+ mesh_calc_normals(mesh->mvert, mesh->totvert,
+ mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
+ NULL);
+#endif
}
diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h
index a9d8c3a5931..4d3aec1757e 100644
--- a/source/blender/editors/mesh/mesh_intern.h
+++ b/source/blender/editors/mesh/mesh_intern.h
@@ -51,22 +51,22 @@ struct EnumPropertyItem;
/* ******************** bmeshutils.c */
/*
-ok: the EDBM module is for editmode bmesh stuff. in contrast, the
- BMEdit module is for code shared with blenkernel that concerns
- the BMEditMesh structure.
-*/
+ * ok: the EDBM module is for editmode bmesh stuff. in contrast, the
+ * BMEdit module is for code shared with blenkernel that concerns
+ * the BMEditMesh structure.
+ */
/*calls a bmesh op, reporting errors to the user, etc*/
int EDBM_CallOpf(struct BMEditMesh *em, struct wmOperator *op, const char *fmt, ...);
-/*same as above, but doesn't report errors.*/
+/* same as above, but doesn't report errors.*/
int EDBM_CallOpfSilent(struct BMEditMesh *em, const char *fmt, ...);
-/*these next two functions are the split version of EDBM_CallOpf, so you can
- do stuff with a bmesh operator, after initializing it but before executing
- it.
-
- execute the operator with BM_Exec_Op*/
+/* these next two functions are the split version of EDBM_CallOpf, so you can
+ * do stuff with a bmesh operator, after initializing it but before executing
+ * it.
+ *
+ * execute the operator with BM_Exec_Op */
int EDBM_InitOpf(struct BMEditMesh *em, struct BMOperator *bmop,
struct wmOperator *op, const char *fmt, ...);
/*cleans up after a bmesh operator*/
diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c
index 08cd3d7cd94..dd5b278b16a 100644
--- a/source/blender/editors/mesh/mesh_ops.c
+++ b/source/blender/editors/mesh/mesh_ops.c
@@ -311,6 +311,9 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "MESH_OT_beautify_fill", FKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
+ RNA_boolean_set(kmi->ptr, "use_beauty", FALSE);
+
WM_keymap_add_item(keymap, "MESH_OT_tris_convert_to_quads", JKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "MESH_OT_rip_move",VKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index 7bf41bdce00..44d923a009b 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -31,8 +31,8 @@
/*
- meshtools.c: no editmode (violated already :), tools operating on meshes
-*/
+ * meshtools.c: no editmode (violated already :), tools operating on meshes
+ */
#include <stddef.h>
#include <stdlib.h>
@@ -87,7 +87,7 @@
/*********************** JOIN ***************************/
/* join selected meshes into the active mesh, context sensitive
-return 0 if no join is made (error) and 1 if the join is done */
+ * return 0 if no join is made (error) and 1 if the join is done */
int join_mesh_exec(bContext *C, wmOperator *op)
{
@@ -357,7 +357,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
/* copy this mesh's shapekey to the destination shapekey (need to transform first) */
fp2= ((float *)(okb->data));
for(a=0; a < me->totvert; a++, fp1+=3, fp2+=3) {
- VECCOPY(fp1, fp2);
+ copy_v3_v3(fp1, fp2);
mul_m4_v3(cmat, fp1);
}
}
@@ -365,7 +365,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
/* copy this mesh's vertex coordinates to the destination shapekey */
mv= mvert;
for(a=0; a < me->totvert; a++, fp1+=3, mv++) {
- VECCOPY(fp1, mv->co);
+ copy_v3_v3(fp1, mv->co);
}
}
}
@@ -387,14 +387,14 @@ int join_mesh_exec(bContext *C, wmOperator *op)
/* copy this mesh's shapekey to the destination shapekey */
fp2= ((float *)(okb->data));
for(a=0; a < me->totvert; a++, fp1+=3, fp2+=3) {
- VECCOPY(fp1, fp2);
+ copy_v3_v3(fp1, fp2);
}
}
else {
/* copy base-coordinates to the destination shapekey */
mv= mvert;
for(a=0; a < me->totvert; a++, fp1+=3, mv++) {
- VECCOPY(fp1, mv->co);
+ copy_v3_v3(fp1, mv->co);
}
}
}
@@ -555,7 +555,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
/*********************** JOIN AS SHAPES ***************************/
/* Append selected meshes vertex locations as shapes of the active mesh,
- return 0 if no join is made (error) and 1 of the join is done */
+ * return 0 if no join is made (error) and 1 of the join is done */
int join_mesh_shapes_exec(bContext *C, wmOperator *op)
{
@@ -813,7 +813,7 @@ intptr_t mesh_octree_table(Object *ob, BMEditMesh *em, float *co, char mode)
}
/* for quick unit coordinate calculus */
- VECCOPY(MeshOctree.offs, min);
+ copy_v3_v3(MeshOctree.offs, min);
MeshOctree.offs[0]-= MOC_THRESH; /* we offset it 1 threshold unit extra */
MeshOctree.offs[1]-= MOC_THRESH;
MeshOctree.offs[2]-= MOC_THRESH;
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c
index e9c1bd4047e..1287d903020 100644
--- a/source/blender/editors/metaball/mball_edit.c
+++ b/source/blender/editors/metaball/mball_edit.c
@@ -465,7 +465,7 @@ int mouse_mball(bContext *C, const int mval[2], int extend)
}
/* When some metaelem was found, then it is necessary to select or
- * deselet it. */
+ * deselect it. */
if(act) {
if(extend==0) {
/* Deselect all existing metaelems */
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 29526825736..996dd4ca59f 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -278,7 +278,7 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc,
}
/* in local view we additionally add local view layers,
- not part of operator properties */
+ * not part of operator properties */
if(v3d && v3d->localvd)
*layer |= v3d->lay;
@@ -1073,8 +1073,8 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
Base *basen;
Object *ob= copy_object(dob->ob);
/* font duplis can have a totcol without material, we get them from parent
- * should be implemented better...
- */
+ * should be implemented better...
+ */
if(ob->mat==NULL) ob->totcol= 0;
basen= MEM_dupallocN(base);
@@ -1143,7 +1143,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
* still work out ok */
object_apply_mat4(ob_dst, dob->mat, FALSE, TRUE);
- /* to set ob_dst->orig and incase theres any other discrepicies */
+ /* to set ob_dst->orig and in case theres any other discrepicies */
DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB);
}
}
@@ -1600,10 +1600,10 @@ void OBJECT_OT_convert(wmOperatorType *ot)
/**************************** Duplicate ************************/
/*
- dupflag: a flag made from constants declared in DNA_userdef_types.h
- The flag tells adduplicate() weather to copy data linked to the object, or to reference the existing data.
- U.dupflag for default operations or you can construct a flag as python does
- if the dupflag is 0 then no data will be copied (linked duplicate) */
+ * dupflag: a flag made from constants declared in DNA_userdef_types.h
+ * The flag tells adduplicate() weather to copy data linked to the object, or to reference the existing data.
+ * U.dupflag for default operations or you can construct a flag as python does
+ * if the dupflag is 0 then no data will be copied (linked duplicate) */
/* used below, assumes id.new is correct */
/* leaves selection of base/object unaltered */
@@ -1878,7 +1878,7 @@ static int duplicate_exec(bContext *C, wmOperator *op)
Base *basen= object_add_duplicate_internal(bmain, scene, base, dupflag);
/* note that this is safe to do with this context iterator,
- the list is made in advance */
+ * the list is made in advance */
ED_base_object_select(base, BA_DESELECT);
if (basen == NULL) {
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index 340a6df8bf6..b3629abc4e6 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -30,11 +30,6 @@
* \ingroup edobj
*/
-
-/*
- meshtools.c: no editmode (violated already :), tools operating on meshes
-*/
-
#include <string.h>
#include "MEM_guardedalloc.h"
@@ -86,7 +81,7 @@
/* ****************** multires BAKING ********************** */
/* holder of per-object data needed for bake job
- needed to make job totally thread-safe */
+ * needed to make job totally thread-safe */
typedef struct MultiresBakerJobData {
struct MultiresBakerJobData *next, *prev;
DerivedMesh *lores_dm, *hires_dm;
@@ -239,11 +234,11 @@ static void flush_pixel(const MResolvePixelData *data, const int x, const int y)
w= 1-u-v;
/* the sign is the same at all face vertices for any non degenerate face.
- Just in case we clamp the interpolated value though. */
+ * Just in case we clamp the interpolated value though. */
sign= (tang0[3]*u + tang1[3]*v + tang2[3]*w)<0 ? (-1.0f) : 1.0f;
/* this sequence of math is designed specifically as is with great care
- to be compatible with our shader. Please don't change without good reason. */
+ * to be compatible with our shader. Please don't change without good reason. */
for(r= 0; r<3; r++) {
from_tang[0][r]= tang0[r]*u + tang1[r]*v + tang2[r]*w;
from_tang[2][r]= no0[r]*u + no1[r]*v + no2[r]*w;
@@ -413,7 +408,7 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image* ima, MPassKnownData
data.face_index= f;
/* might support other forms of diagonal splits later on such as
- split by shortest diagonal.*/
+ * split by shortest diagonal.*/
verts[0][0]=0;
verts[1][0]=1;
verts[2][0]=2;
@@ -475,7 +470,7 @@ static void interp_barycentric_tri_data(float data[3][3], float u, float v, floa
}
/* mode = 0: interpolate normals,
- mode = 1: interpolate coord */
+ * mode = 1: interpolate coord */
static void interp_bilinear_grid(DMGridData *grid, int grid_size, float crn_x, float crn_y, int mode, float res[3])
{
int x0, x1, y0, y1;
@@ -552,7 +547,7 @@ static void get_ccgdm_data(DerivedMesh *lodm, DerivedMesh *hidm, const int *orig
}
/* mode = 0: interpolate normals,
- mode = 1: interpolate coord */
+ * mode = 1: interpolate coord */
static void interp_bilinear_mface(DerivedMesh *dm, MFace *mface, const float u, const float v, const int mode, float res[3])
{
float data[4][3];
@@ -573,7 +568,7 @@ static void interp_bilinear_mface(DerivedMesh *dm, MFace *mface, const float u,
}
/* mode = 0: interpolate normals,
- mode = 1: interpolate coord */
+ * mode = 1: interpolate coord */
static void interp_barycentric_mface(DerivedMesh *dm, MFace *mface, const float u, const float v, const int mode, float res[3])
{
float data[3][3];
@@ -691,11 +686,11 @@ static void free_heights_data(void *bake_data)
}
/* MultiresBake callback for heights baking
- general idea:
- - find coord of point with specified UV in hi-res mesh (let's call it p1)
- - find coord of point and normal with specified UV in lo-res mesh (or subdivided lo-res
- mesh to make texture smoother) let's call this point p0 and n.
- - height wound be dot(n, p1-p0) */
+ * general idea:
+ * - find coord of point with specified UV in hi-res mesh (let's call it p1)
+ * - find coord of point and normal with specified UV in lo-res mesh (or subdivided lo-res
+ * mesh to make texture smoother) let's call this point p0 and n.
+ * - height wound be dot(n, p1-p0) */
static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, const void *bake_data,
const int face_index, const int lvl, const float st[2],
float UNUSED(tangmat[3][3]), const int x, const int y)
@@ -759,10 +754,10 @@ static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
}
/* MultiresBake callback for normals' baking
- general idea:
- - find coord and normal of point with specified UV in hi-res mesh
- - multiply it by tangmat
- - vector in color space would be norm(vec) /2 + (0.5, 0.5, 0.5) */
+ * general idea:
+ * - find coord and normal of point with specified UV in hi-res mesh
+ * - multiply it by tangmat
+ * - vector in color space would be norm(vec) /2 + (0.5, 0.5, 0.5) */
static void apply_tangmat_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, const void *bake_data,
const int face_index, const int lvl, const float st[2],
float tangmat[3][3], const int x, const int y)
@@ -1389,7 +1384,7 @@ static void bake_update(void *bkv)
{
BakeRender *bkr= bkv;
- if(bkr->sa && bkr->sa->spacetype==SPACE_IMAGE) { /* incase the user changed while baking */
+ if(bkr->sa && bkr->sa->spacetype==SPACE_IMAGE) { /* in case the user changed while baking */
SpaceImage *sima= bkr->sa->spacedata.first;
if(sima)
sima->image= RE_bake_shade_get_image();
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index a90edb29c29..774eec0e0a8 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -391,8 +391,7 @@ static void test_constraints (Object *owner, bPoseChannel *pchan)
/* if the number of points does not match the amount required by the chain length,
* free the points array and request a rebind...
*/
- if ((data->points == NULL) || (data->numpoints != data->chainlen+1))
- {
+ if ((data->points == NULL) || (data->numpoints != data->chainlen+1)) {
/* free the points array */
if (data->points) {
MEM_freeN(data->points);
@@ -1501,7 +1500,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
/* get the target objects, adding them as need be */
if (get_new_constraint_target(C, type, &tar_ob, &tar_pchan, 1)) {
/* method of setting target depends on the type of target we've got
- * - by default, just set the first target (distinction here is only for multiple-targetted constraints)
+ * - by default, just set the first target (distinction here is only for multiple-targeted constraints)
*/
if (tar_pchan)
set_constraint_nth_target(con, tar_ob, tar_pchan->name, 0);
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 11ceda8a61f..e456e6f0796 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -453,7 +453,7 @@ void ED_object_enter_editmode(bContext *C, int flag)
/*
* The function object_data_is_libdata make a problem here, the
* check for ob->proxy return 0 and let blender enter to edit mode
- * this causa a crash when you try leave the edit mode.
+ * this causes a crash when you try leave the edit mode.
* The problem is that i can't remove the ob->proxy check from
* object_data_is_libdata that prevent the bugfix #6614, so
* i add this little hack here.
@@ -741,7 +741,7 @@ static void copy_texture_space(Object *to, Object *ob)
}
-/* UNUSED, keep incase we want to copy functionality for use elsewhere */
+/* UNUSED, keep in case we want to copy functionality for use elsewhere */
static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
{
Object *ob;
diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c
index 1b8c0fd0840..d5dfbda8696 100644
--- a/source/blender/editors/object/object_group.c
+++ b/source/blender/editors/object/object_group.c
@@ -70,7 +70,7 @@ static int objects_add_active_exec(bContext *C, wmOperator *op)
if(!ob) return OPERATOR_CANCELLED;
/* linking to same group requires its own loop so we can avoid
- looking up the active objects groups each time */
+ * looking up the active objects groups each time */
for(group= bmain->group.first; group; group=group->id.next) {
if(object_in_group(ob, group)) {
@@ -117,7 +117,7 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op)
if(!ob) return OPERATOR_CANCELLED;
/* linking to same group requires its own loop so we can avoid
- looking up the active objects groups each time */
+ * looking up the active objects groups each time */
for(group= bmain->group.first; group; group=group->id.next) {
if(object_in_group(ob, group)) {
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index 8b5a9ae6c9b..eb128ad3025 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -613,7 +613,7 @@ void OBJECT_OT_hook_remove(wmOperatorType *ot)
/* flags */
/* this operator removes modifier which isn't stored in local undo stack,
- so redoing it from redo panel gives totally weird results */
+ * so redoing it from redo panel gives totally weird results */
ot->flag= /*OPTYPE_REGISTER|*/OPTYPE_UNDO;
/* properties */
@@ -802,7 +802,7 @@ void OBJECT_OT_hook_assign(wmOperatorType *ot)
/* flags */
/* this operator changes data stored in modifier which doesn't get pushed to undo stack,
- so redoing it from redo panel gives totally weird results */
+ * so redoing it from redo panel gives totally weird results */
ot->flag= /*OPTYPE_REGISTER|*/OPTYPE_UNDO;
/* properties */
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index 526706b566d..73c5c50f448 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -159,7 +159,6 @@ void OBJECT_OT_multires_external_pack(struct wmOperatorType *ot);
void OBJECT_OT_meshdeform_bind(struct wmOperatorType *ot);
void OBJECT_OT_explode_refresh(struct wmOperatorType *ot);
void OBJECT_OT_ocean_bake(struct wmOperatorType *ot);
-void OBJECT_OT_test_multires(struct wmOperatorType *ot);
/* object_constraint.c */
void OBJECT_OT_constraint_add(struct wmOperatorType *ot);
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index c5d81969098..de9e3db25b8 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -217,7 +217,7 @@ static int object_modifier_remove(Object *ob, ModifierData *md, int *sort_depsgr
if(me->edit_btmesh) {
BMEditMesh *em= me->edit_btmesh;
/* CustomData_external_remove is used here only to mark layer as non-external
- for further free-ing, so zero element count looks safer than em->totface */
+ * for further free-ing, so zero element count looks safer than em->totface */
CustomData_external_remove(&em->bm->ldata, &me->id, CD_MDISPS, 0);
BM_data_layer_free(em->bm, &em->bm->ldata, CD_MDISPS);
} else {
@@ -447,15 +447,15 @@ static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, M
}
/*
- It should be ridiculously easy to extract the original verts that we want
- and form the shape data. We can probably use the CD KEYINDEX layer (or
- whatever I ended up calling it, too tired to check now), though this would
- by necassity have to make some potentially ugly assumptions about the order
- of the mesh data :-/ you can probably assume in 99% of cases that the first
- element of a given index is the original, and any subsequent duplicates are
- copies/interpolates, but that's an assumption that would need to be tested
- and then predominantly stated in comments in a half dozen headers.
- */
+ * It should be ridiculously easy to extract the original verts that we want
+ * and form the shape data. We can probably use the CD KEYINDEX layer (or
+ * whatever I ended up calling it, too tired to check now), though this would
+ * by necessity have to make some potentially ugly assumptions about the order
+ * of the mesh data :-/ you can probably assume in 99% of cases that the first
+ * element of a given index is the original, and any subsequent duplicates are
+ * copies/interpolates, but that's an assumption that would need to be tested
+ * and then predominantly stated in comments in a half dozen headers.
+ */
if (ob->type==OB_MESH) {
DerivedMesh *dm;
@@ -1176,64 +1176,6 @@ void OBJECT_OT_multires_reshape(wmOperatorType *ot)
edit_modifier_properties(ot);
}
-static int multires_test_exec(bContext *C, wmOperator *op)
-{
- Object *ob= ED_object_active_context(C);
- Mesh *me = ob->data;
- MPoly *mp;
- MDisps *mdisps;
- int i, x = RNA_int_get(op->ptr, "x"), y = RNA_int_get(op->ptr, "y");
-
- if (ob->type != OB_MESH || !me)
- return OPERATOR_CANCELLED;
-
- mdisps = CustomData_get_layer(&me->ldata, CD_MDISPS);
- if (!mdisps)
- return OPERATOR_CANCELLED;
-
- mp = me->mpoly;
- for (i=0; i<me->totpoly; i++, mp++) {
- MLoop *ml;
- int j;
-
- ml = me->mloop + mp->loopstart;
- for (j=0; j<mp->totloop; j++, ml++) {
- MLoop *ml_prev = ME_POLY_LOOP_PREV(me->mloop, mp, j);
- MLoop *ml_next = ME_POLY_LOOP_NEXT(me->mloop, mp, j);
-
- if ((me->mvert[ml->v].flag&SELECT) && (me->mvert[ml_prev->v].flag&SELECT) && (me->mvert[ml_next->v].flag&SELECT)) {
- MDisps *md = mdisps + mp->loopstart + j;
- int res = sqrt(md->totdisp);
-
- if (x >= res) x = res-1;
- if (y >= res) y = res-1;
-
- md->disps[y*res + x][2] += 1.0;
- }
- }
- }
-
- DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
-
- return OPERATOR_FINISHED;
-}
-
-void OBJECT_OT_test_multires(wmOperatorType *ot)
-{
- ot->name= "Multires Object Mode Test";
- ot->description= "";
- ot->idname= "OBJECT_OT_test_multires";
-
- ot->poll= multires_poll;
- ot->exec= multires_test_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_int(ot->srna, "x", 0, 0, 100, "x", "x", 0, 100);
- RNA_def_int(ot->srna, "y", 0, 0, 100, "y", "y", 0, 100);
-}
-
/****************** multires save external operator *********************/
@@ -1654,7 +1596,7 @@ static int ocean_bake_exec(bContext *C, wmOperator *op)
/* precalculate time variable before baking */
for (f=omd->bakestart; f<=omd->bakeend; f++) {
/* from physics_fluid.c:
-
+ *
* 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);
@@ -1680,7 +1622,7 @@ static int ocean_bake_exec(bContext *C, wmOperator *op)
ocean = BKE_add_ocean();
init_ocean_modifier_bake(ocean, omd);
- /*
+#if 0
BKE_bake_ocean(ocean, och);
omd->oceancache = och;
@@ -1690,7 +1632,7 @@ static int ocean_bake_exec(bContext *C, wmOperator *op)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
- */
+#endif
/* job stuff */
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index 542b75e1f19..2b6707de42b 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -214,8 +214,6 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_bake_image);
WM_operatortype_append(OBJECT_OT_drop_named_material);
-
- WM_operatortype_append(OBJECT_OT_test_multires);
}
void ED_operatormacros_object(void)
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 2281d7a26d8..a388e465a21 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -134,7 +134,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
em= me->edit_btmesh;
/* derivedMesh might be needed for solving parenting,
- so re-create it here */
+ * so re-create it here */
makeDerivedMesh(scene, obedit, em, CD_MASK_BAREMESH, 0);
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
@@ -319,13 +319,11 @@ static int make_proxy_exec (bContext *C, wmOperator *op)
GroupObject *go;
Scene *scene= CTX_data_scene(C);
- if (gob->dup_group != NULL)
- {
+ if (gob->dup_group != NULL) {
go= BLI_findlink(&gob->dup_group->gobject, RNA_enum_get(op->ptr, "object"));
ob= go->ob;
}
- else
- {
+ else {
ob= gob;
gob = NULL;
}
@@ -588,8 +586,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
if (partype == PAR_PATH_CONST) {
/* don't do anything here, since this is not technically "parenting" */
}
- else if (ELEM(partype, PAR_CURVE, PAR_LATTICE) || (pararm))
- {
+ else if (ELEM(partype, PAR_CURVE, PAR_LATTICE) || (pararm)) {
/* partype is now set to PAROBJECT so that invisible 'virtual' modifiers don't need to be created
* NOTE: the old (2.4x) method was to set ob->partype = PARSKEL, creating the virtual modifiers
*/
@@ -598,8 +595,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
/* BUT, to keep the deforms, we need a modifier, and then we need to set the object that it uses */
// XXX currently this should only happen for meshes, curves, surfaces, and lattices - this stuff isn't available for metas yet
- if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE))
- {
+ if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
ModifierData *md;
switch (partype) {
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c
index 69372ac1a90..9e11146db70 100644
--- a/source/blender/editors/object/object_select.c
+++ b/source/blender/editors/object/object_select.c
@@ -123,7 +123,7 @@ void ED_base_object_activate(bContext *C, Base *base)
static int objects_selectable_poll(bContext *C)
{
/* we don't check for linked scenes here, selection is
- still allowed then for inspection of scene */
+ * still allowed then for inspection of scene */
Object *obact= CTX_data_active_object(C);
if(CTX_data_edit_object(C))
@@ -492,7 +492,7 @@ static short select_grouped_object_hooks(bContext *C, Object *ob)
return changed;
}
-/* Select objects woth the same parent as the active (siblings),
+/* Select objects with the same parent as the active (siblings),
* parent can be NULL also */
static short select_grouped_siblings(bContext *C, Object *ob)
{
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 45db21749a5..d66f16b0adb 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -118,7 +118,7 @@ static void object_clear_rot(Object *ob)
if ((ob->protectflag & OB_LOCK_ROTZ) == 0)
ob->quat[3]= ob->dquat[3]= 0.0f;
- // TODO: does this quat need normalising now?
+ // TODO: does this quat need normalizing now?
}
else {
/* the flag may have been set for the other modes, so just ignore the extra flag... */
@@ -815,8 +815,10 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
bArmature *arm = ob->data;
if(ID_REAL_USERS(arm) > 1) {
- /*BKE_report(op->reports, RPT_ERROR, "Can't apply to a multi user armature");
- return;*/
+#if 0
+ BKE_report(op->reports, RPT_ERROR, "Can't apply to a multi user armature");
+ return;
+#endif
tot_multiuser_arm_error++;
}
else {
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index f610d758243..7328cbb2e7a 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -702,8 +702,7 @@ static void vgroup_normalize(Object *ob)
int i, dvert_tot=0;
const int def_nr= ob->actdef-1;
- Mesh *me = ob->data;
- const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
+ const int use_vert_sel = (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) != 0;
if (!BLI_findlink(&ob->defbase, def_nr)) {
return;
@@ -716,7 +715,7 @@ static void vgroup_normalize(Object *ob)
for(i = 0; i < dvert_tot; i++) {
- /* incase its not selected */
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
@@ -730,7 +729,7 @@ static void vgroup_normalize(Object *ob)
if(weight_max > 0.0f) {
for(i = 0; i < dvert_tot; i++) {
- /* incase its not selected */
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
@@ -739,7 +738,7 @@ static void vgroup_normalize(Object *ob)
if(dw) {
dw->weight /= weight_max;
- /* incase of division errors with very low weights */
+ /* in case of division errors with very low weights */
CLAMP(dw->weight, 0.0f, 1.0f);
}
}
@@ -815,8 +814,8 @@ static int* getSurroundingVerts(Mesh *me, int vert, int *count)
}
/* get a single point in space by averaging a point cloud (vectors of size 3)
-coord is the place the average is stored, points is the point cloud, count is the number of points in the cloud
-*/
+ * coord is the place the average is stored, points is the point cloud, count is the number of points in the cloud
+ */
static void getSingleCoordinate(MVert *points, int count, float coord[3])
{
int i;
@@ -828,9 +827,9 @@ static void getSingleCoordinate(MVert *points, int count, float coord[3])
}
/* given a plane and a start and end position,
-compute the amount of vertical distance relative to the plane and store it in dists,
-then get the horizontal and vertical change and store them in changes
-*/
+ * compute the amount of vertical distance relative to the plane and store it in dists,
+ * then get the horizontal and vertical change and store them in changes
+ */
static void getVerticalAndHorizontalChange(const float norm[3], float d, const float coord[3],
const float start[3], float distToStart,
float *end, float (*changes)[2], float *dists, int index)
@@ -865,21 +864,21 @@ static void dm_deform_clear(DerivedMesh *dm, Object *ob)
}
}
-// recalculate the deformation
+/* recalculate the deformation */
static DerivedMesh* dm_deform_recalc(Scene *scene, Object *ob)
{
return mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
}
/* by changing nonzero weights, try to move a vertex in me->mverts with index 'index' to
-distToBe distance away from the provided plane strength can change distToBe so that it moves
-towards distToBe by that percentage cp changes how much the weights are adjusted
-to check the distance
-
-index is the index of the vertex being moved
-norm and d are the plane's properties for the equation: ax + by + cz + d = 0
-coord is a point on the plane
-*/
+ * distToBe distance away from the provided plane strength can change distToBe so that it moves
+ * towards distToBe by that percentage cp changes how much the weights are adjusted
+ * to check the distance
+ *
+ * index is the index of the vertex being moved
+ * norm and d are the plane's properties for the equation: ax + by + cz + d = 0
+ * coord is a point on the plane
+ */
static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, int index, float norm[3],
float coord[3], float d, float distToBe, float strength, float cp)
{
@@ -1049,7 +1048,7 @@ static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, in
}
/* this is used to try to smooth a surface by only adjusting the nonzero weights of a vertex
-but it could be used to raise or lower an existing 'bump.' */
+ * but it could be used to raise or lower an existing 'bump.' */
static void vgroup_fix(Scene *scene, Object *ob, float distToBe, float strength, float cp)
{
int i;
@@ -1103,8 +1102,7 @@ static void vgroup_levels(Object *ob, float offset, float gain)
int i, dvert_tot=0;
const int def_nr= ob->actdef-1;
- Mesh *me = ob->data;
- const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
+ const int use_vert_sel = (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) != 0;
if (!BLI_findlink(&ob->defbase, def_nr)) {
return;
@@ -1115,7 +1113,7 @@ static void vgroup_levels(Object *ob, float offset, float gain)
if (dvert_array) {
for(i = 0; i < dvert_tot; i++) {
- /* incase its not selected */
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
@@ -1139,8 +1137,7 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
int i, dvert_tot=0;
const int def_nr= ob->actdef-1;
- Mesh *me = ob->data;
- const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
+ const int use_vert_sel = (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) != 0;
if (lock_active && !BLI_findlink(&ob->defbase, def_nr)) {
return;
@@ -1152,7 +1149,7 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
if(lock_active) {
for(i = 0; i < dvert_tot; i++) {
- /* incase its not selected */
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
@@ -1163,7 +1160,7 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
else {
for(i = 0; i < dvert_tot; i++) {
- /* incase its not selected */
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
@@ -1212,9 +1209,7 @@ static void vgroup_invert(Object *ob, const short auto_assign, const short auto_
MDeformVert *dv, **dvert_array=NULL;
int i, dvert_tot=0;
const int def_nr= ob->actdef-1;
-
- Mesh *me = ob->data;
- const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
+ const int use_vert_sel = (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) != 0;
if (!BLI_findlink(&ob->defbase, def_nr)) {
return;
@@ -1225,7 +1220,7 @@ static void vgroup_invert(Object *ob, const short auto_assign, const short auto_
if (dvert_array) {
for(i = 0; i < dvert_tot; i++) {
- /* incase its not selected */
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
@@ -1257,10 +1252,9 @@ static void vgroup_blend(Object *ob)
int i, dvert_tot=0;
const int def_nr= ob->actdef-1;
- BMEditMesh *em = BMEdit_FromObject(ob);
- // ED_vgroup_give_array(ob->data, &dvert_array, &dvert_tot);
+ BMEditMesh *em;
- if (em == NULL) {
+ if (ob->type != OB_MESH || ((em = BMEdit_FromObject(ob)) == NULL)) {
return;
}
@@ -1302,10 +1296,17 @@ static void vgroup_blend(Object *ob)
vg_users[i1]++;
/* TODO, we may want object mode blending */
- if(em) dvert= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
- else dvert= dvert_array+i2;
+#if 0
+ if (em) {
+ dvert = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
+ }
+ else
+#endif
+ {
+ dvert= dvert_array+i2;
+ }
- dw= defvert_find_index(dvert, def_nr);
+ dw = defvert_find_index(dvert, def_nr);
if(dw) {
vg_weights[i1] += dw->weight;
@@ -1323,7 +1324,7 @@ static void vgroup_blend(Object *ob)
dw= defvert_verify_index(dvert, def_nr);
dw->weight= vg_weights[i] / (float)vg_users[i];
- /* incase of division errors */
+ /* in case of division errors */
CLAMP(dw->weight, 0.0f, 1.0f);
}
@@ -1340,9 +1341,7 @@ static void vgroup_clean(Object *ob, const float epsilon, int keep_single)
MDeformVert *dv, **dvert_array=NULL;
int i, dvert_tot=0;
const int def_nr= ob->actdef-1;
-
- Mesh *me = ob->data;
- const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
+ const int use_vert_sel = (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) != 0;
if (!BLI_findlink(&ob->defbase, def_nr)) {
return;
@@ -1354,7 +1353,7 @@ static void vgroup_clean(Object *ob, const float epsilon, int keep_single)
/* only the active group */
for(i = 0; i < dvert_tot; i++) {
- /* incase its not selected */
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
@@ -1377,10 +1376,8 @@ static void vgroup_clean(Object *ob, const float epsilon, int keep_single)
static void vgroup_clean_all(Object *ob, const float epsilon, const int keep_single)
{
MDeformVert **dvert_array=NULL;
- int i, dvert_tot=0;
-
- Mesh *me = ob->data;
- const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
+ int i, dvert_tot = 0;
+ const int use_vert_sel = (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) != 0;
ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot, use_vert_sel);
@@ -1391,7 +1388,7 @@ static void vgroup_clean_all(Object *ob, const float epsilon, const int keep_sin
for(i = 0; i < dvert_tot; i++) {
int j;
- /* incase its not selected */
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
@@ -1553,7 +1550,7 @@ void ED_vgroup_mirror(Object *ob, const short mirror_weights, const short flip_v
/* object mode / weight paint */
MVert *mv, *mv_mirr;
int vidx, vidx_mirr;
- const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
+ const int use_vert_sel = (me->editflag & ME_EDIT_VERT_SEL) != 0;
if (me->dvert == NULL) {
goto cleanup;
@@ -1604,7 +1601,7 @@ void ED_vgroup_mirror(Object *ob, const short mirror_weights, const short flip_v
goto cleanup;
}
- /* unlike editmesh we know that by only looping over the first hald of
+ /* unlike editmesh we know that by only looping over the first half of
* the 'u' indices it will cover all points except the middle which is
* ok in this case */
pntsu_half= lt->pntsu / 2;
@@ -2037,7 +2034,7 @@ static int vertex_group_poll(bContext *C)
return (ob && !ob->id.lib && OB_TYPE_SUPPORT_VGROUP(ob->type) && data && !data->lib);
}
-static int UNUSED_FUNCTION(vertex_group_poll_edit)(bContext *C)
+static int vertex_group_poll_edit(bContext *C)
{
Object *ob= ED_object_context(C);
ID *data= (ob)? ob->data: NULL;
@@ -2115,8 +2112,8 @@ void OBJECT_OT_vertex_group_remove(wmOperatorType *ot)
/* flags */
/* redo operator will fail in this case because vertex groups aren't stored
- in local edit mode stack and toggling "all" property will lead to
- all groups deleted without way to restore them (see [#29527], sergey) */
+ * in local edit mode stack and toggling "all" property will lead to
+ * all groups deleted without way to restore them (see [#29527], sergey) */
ot->flag= /*OPTYPE_REGISTER|*/OPTYPE_UNDO;
/* properties */
@@ -2150,8 +2147,8 @@ void OBJECT_OT_vertex_group_assign(wmOperatorType *ot)
/* flags */
/* redo operator will fail in this case because vertex group assignment
- isn't stored in local edit mode stack and toggling "new" property will
- lead to creating plenty of new veretx groups (see [#29527], sergey) */
+ * isn't stored in local edit mode stack and toggling "new" property will
+ * lead to creating plenty of new vertex groups (see [#29527], sergey) */
ot->flag= /*OPTYPE_REGISTER|*/OPTYPE_UNDO;
/* properties */
@@ -2191,9 +2188,9 @@ void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot)
ot->exec= vertex_group_remove_from_exec;
/* flags */
- /* redo operator will fail in this case because vertex groups ssignment
- isn't stored in local edit mode stack and toggling "all" property will lead to
- removing vertices from all groups (see [#29527], sergey) */
+ /* redo operator will fail in this case because vertex groups assignment
+ * isn't stored in local edit mode stack and toggling "all" property will lead to
+ * removing vertices from all groups (see [#29527], sergey) */
ot->flag= /*OPTYPE_REGISTER|*/OPTYPE_UNDO;
/* properties */
@@ -2502,7 +2499,7 @@ void OBJECT_OT_vertex_group_blend(wmOperatorType *ot)
ot->description= "";
/* api callbacks */
- ot->poll= vertex_group_poll;
+ ot->poll= vertex_group_poll_edit; /* TODO - add object mode support */
ot->exec= vertex_group_blend_exec;
/* flags */
@@ -2733,8 +2730,8 @@ void OBJECT_OT_vertex_group_set_active(wmOperatorType *ot)
ot->prop= prop;
}
-/*creates the name_array parameter for vgroup_do_remap, call this before fiddling
- with the order of vgroups then call vgroup_do_remap after*/
+/* creates the name_array parameter for vgroup_do_remap, call this before fiddling
+ * with the order of vgroups then call vgroup_do_remap after*/
static char *vgroup_init_remap(Object *ob)
{
bDeformGroup *def;
diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c
index 7f568833866..abb596e450f 100644
--- a/source/blender/editors/physics/dynamicpaint_ops.c
+++ b/source/blender/editors/physics/dynamicpaint_ops.c
@@ -268,9 +268,9 @@ void DPAINT_OT_output_toggle(wmOperatorType *ot)
/***************************** Image Sequence Baking ******************************/
/*
-* Do actual bake operation. Loop through to-be-baked frames.
-* Returns 0 on failture.
-*/
+ * Do actual bake operation. Loop through to-be-baked frames.
+ * Returns 0 on failure.
+ */
static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surface, Object *cObject)
{
DynamicPaintCanvasSettings *canvas = surface->canvas;
@@ -308,8 +308,8 @@ static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surf
if (!dynamicPaint_calculateFrame(surface, scene, cObject, frame)) return 0;
/*
- * Save output images
- */
+ * Save output images
+ */
{
char filename[FILE_MAX];
@@ -351,8 +351,8 @@ static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
DynamicPaintSurface *surface;
/*
- * Get modifier data
- */
+ * Get modifier data
+ */
pmd = (DynamicPaintModifierData *)modifiers_findByType(ob, eModifierType_DynamicPaint);
if (!pmd) {
BKE_report(op->reports, RPT_ERROR, "Bake Failed: No Dynamic Paint modifier found.");
@@ -380,7 +380,7 @@ static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
dynamicPaint_freeSurfaceData(surface);
/* Bake was successful:
- * Report for ended bake and how long it took */
+ * Report for ended bake and how long it took */
if (status) {
/* Format time string */
char time_str[30];
@@ -396,7 +396,7 @@ static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
BLI_snprintf(result_str, sizeof(result_str), "Bake Failed: %s", canvas->error);
BKE_report(op->reports, RPT_ERROR, result_str);
}
- else { /* User cancelled the bake */
+ else { /* User canceled the bake */
BLI_strncpy(result_str, "Baking Cancelled!", sizeof(result_str));
BKE_report(op->reports, RPT_WARNING, result_str);
}
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 2a7f9b2a626..e08139e9a78 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -191,7 +191,7 @@ ParticleEditSettings *PE_settings(Scene *scene)
return scene->toolsettings ? &scene->toolsettings->particle : NULL;
}
-/* always gets atleast the first particlesystem even if PSYS_CURRENT flag is not set
+/* always gets at least the first particlesystem even if PSYS_CURRENT flag is not set
*
* note: this function runs on poll, therefor it can runs many times a second
* keep it fast! */
@@ -252,9 +252,8 @@ static PTCacheEdit *pe_get_current(Scene *scene, Object *ob, int create)
break;
}
}
- else if(pset->edittype == PE_TYPE_SOFTBODY && pid->type == PTCACHE_TYPE_SOFTBODY) {
- if(create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit)
- {
+ else if (pset->edittype == PE_TYPE_SOFTBODY && pid->type == PTCACHE_TYPE_SOFTBODY) {
+ if (create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) {
pset->flag |= PE_FADE_TIME;
// NICE TO HAVE but doesn't work: pset->brushtype = PE_BRUSH_COMB;
PE_create_particle_edit(scene, ob, pid->cache, NULL);
@@ -262,9 +261,8 @@ static PTCacheEdit *pe_get_current(Scene *scene, Object *ob, int create)
edit = pid->cache->edit;
break;
}
- else if(pset->edittype == PE_TYPE_CLOTH && pid->type == PTCACHE_TYPE_CLOTH) {
- if(create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit)
- {
+ else if (pset->edittype == PE_TYPE_CLOTH && pid->type == PTCACHE_TYPE_CLOTH) {
+ if (create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) {
pset->flag |= PE_FADE_TIME;
// NICE TO HAVE but doesn't work: pset->brushtype = PE_BRUSH_COMB;
PE_create_particle_edit(scene, ob, pid->cache, NULL);
@@ -1218,7 +1216,7 @@ static void update_velocities(PTCacheEdit *edit)
void PE_update_object(Scene *scene, Object *ob, int useflag)
{
/* use this to do partial particle updates, not usable when adding or
- removing, then a full redo is necessary and calling this may crash */
+ * removing, then a full redo is necessary and calling this may crash */
ParticleEditSettings *pset= PE_settings(scene);
PTCacheEdit *edit = PE_get_current(scene, ob);
POINT_P;
@@ -3632,10 +3630,10 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
PE_update_object(scene, ob, 1);
}
- if(edit->psys)
+ if (edit->psys) {
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
- else
- {
+ }
+ else {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
}
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index d3af007d2e6..96a59ee4542 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -860,8 +860,7 @@ static void fluidsim_delete_until_lastframe(FluidsimSettings *fss, const char *r
curFrame++;
- if((exists = BLI_exists(targetFile)))
- {
+ if ((exists = BLI_exists(targetFile))) {
BLI_delete(targetFile, 0, 0);
BLI_delete(targetFileVel, 0, 0);
BLI_delete(previewFile, 0, 0);
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index d018a8d03d3..4fbc5085b2d 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -155,7 +155,7 @@ void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volat
/* ****************************** render invoking ***************** */
/* set callbacks, exported to sequence render too.
- Only call in foreground (UI) renders. */
+ * Only call in foreground (UI) renders. */
static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **scene, SceneRenderLayer **srl)
{
@@ -221,9 +221,9 @@ static int screen_render_exec(bContext *C, wmOperator *op)
BKE_image_backup_render(scene, ima);
/* cleanup sequencer caches before starting user triggered render.
- otherwise, invalidated cache entries can make their way into
- the output rendering. We can't put that into RE_BlenderFrame,
- since sequence rendering can call that recursively... (peter) */
+ * otherwise, invalidated cache entries can make their way into
+ * the output rendering. We can't put that into RE_BlenderFrame,
+ * since sequence rendering can call that recursively... (peter) */
seq_stripelem_cache_cleanup();
RE_SetReports(re, op->reports);
@@ -517,9 +517,9 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
multires_force_render_update(CTX_data_active_object(C));
/* cleanup sequencer caches before starting user triggered render.
- otherwise, invalidated cache entries can make their way into
- the output rendering. We can't put that into RE_BlenderFrame,
- since sequence rendering can call that recursively... (peter) */
+ * otherwise, invalidated cache entries can make their way into
+ * the output rendering. We can't put that into RE_BlenderFrame,
+ * since sequence rendering can call that recursively... (peter) */
seq_stripelem_cache_cleanup();
/* get editmode results */
@@ -586,8 +586,8 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
WM_event_add_notifier(C, NC_SCENE|ND_RENDER_RESULT, scene);
/* we set G.rendering here already instead of only in the job, this ensure
- main loop or other scene updates are disabled in time, since they may
- have started before the job thread */
+ * main loop or other scene updates are disabled in time, since they may
+ * have started before the job thread */
G.rendering = 1;
/* add modal handler for ESC */
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 4b4d7354898..79832e2a9d1 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -149,7 +149,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
}
if((scene->r.mode & R_OSA) == 0) {
- ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat);
+ ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat, TRUE);
GPU_offscreen_read_pixels(oglrender->ofs, GL_FLOAT, rr->rectf);
}
else {
@@ -163,7 +163,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
BLI_initjit(jit_ofs[0], scene->r.osa);
/* first sample buffer, also initializes 'rv3d->persmat' */
- ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat);
+ ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat, TRUE);
GPU_offscreen_read_pixels(oglrender->ofs, GL_FLOAT, accum_buffer);
/* skip the first sample */
@@ -173,7 +173,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
(jit_ofs[j][0] * 2.0f) / sizex,
(jit_ofs[j][1] * 2.0f) / sizey);
- ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat_jitter);
+ ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat_jitter, TRUE);
GPU_offscreen_read_pixels(oglrender->ofs, GL_FLOAT, accum_tmp);
add_vn_vn(accum_buffer, accum_tmp, sizex*sizey*sizeof(float));
}
@@ -189,7 +189,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
else {
/* shouldnt suddenly give errors mid-render but possible */
char err_out[256]= "unknown";
- ImBuf *ibuf_view= ED_view3d_draw_offscreen_imbuf_simple(scene, scene->camera, oglrender->sizex, oglrender->sizey, IB_rectfloat, OB_SOLID, err_out);
+ ImBuf *ibuf_view= ED_view3d_draw_offscreen_imbuf_simple(scene, scene->camera, oglrender->sizex, oglrender->sizey, IB_rectfloat, OB_SOLID, TRUE, err_out);
camera= scene->camera;
if(ibuf_view) {
@@ -316,6 +316,7 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
oglrender->sizey= sizey;
oglrender->bmain= CTX_data_main(C);
oglrender->scene= scene;
+ oglrender->cfrao= scene->r.cfra;
oglrender->write_still= is_write_still && !is_animation;
@@ -333,7 +334,7 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
oglrender->scene->customdata_mask_modal = (ED_view3d_datamask(oglrender->scene, oglrender->v3d) |
ED_view3d_object_datamask(oglrender->scene) );
- /* apply immediately incase we're rendeing from a script,
+ /* apply immediately in case we're rendering from a script,
* running notifiers again will overwrite */
oglrender->scene->customdata_mask |= oglrender->scene->customdata_mask_modal;
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index 3eda30e1554..f0ef7c633cb 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -902,8 +902,8 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat
iuser.scene= sp->scene;
/* elubie: this needs to be changed: here image is always loaded if not
- already there. Very expensive for large images. Need to find a way to
- only get existing ibuf */
+ * already there. Very expensive for large images. Need to find a way to
+ * only get existing ibuf */
ibuf = BKE_image_get_ibuf(ima, &iuser);
if(ibuf==NULL || ibuf->rect==NULL)
return;
@@ -931,7 +931,7 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat
shader_preview_startjob(customdata, stop, do_update);
/* world is rendered with alpha=0, so it wasn't displayed
- this could be render option for sky to, for later */
+ * this could be render option for sky to, for later */
if(idtype == ID_WO) {
set_alpha((char*)sp->pr_rect, sp->sizex, sp->sizey, 255);
}
@@ -945,7 +945,7 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat
}
/* use same function for icon & shader, so the job manager
- does not run two of them at the same time. */
+ * does not run two of them at the same time. */
static void common_preview_startjob(void *customdata, short *stop, short *do_update, float *UNUSED(progress))
{
diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c
index d921308aad5..4483d7d8ba1 100644
--- a/source/blender/editors/render/render_update.c
+++ b/source/blender/editors/render/render_update.c
@@ -76,7 +76,7 @@ void ED_render_scene_update(Main *bmain, Scene *scene, int updated)
ARegion *ar;
/* don't do this render engine update if we're updating the scene from
- other threads doing e.g. rendering or baking jobs */
+ * other threads doing e.g. rendering or baking jobs */
if(!BLI_thread_is_main())
return;
diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c
index d8719c7d7cd..8850bef286d 100644
--- a/source/blender/editors/render/render_view.c
+++ b/source/blender/editors/render/render_view.c
@@ -309,7 +309,7 @@ static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
}
else if(sima->next) {
/* workaround for case of double prevspace, render window
- with a file browser on top of it (same as in ED_area_prevspace) */
+ * with a file browser on top of it (same as in ED_area_prevspace) */
if(sima->next->spacetype == SPACE_FILE && sima->next->next)
ED_area_newspace(C, sa, sima->next->next->spacetype);
else
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index e4088fe10c4..57b65ad5223 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -466,9 +466,6 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
/* note; this sets state, so we can use wmOrtho and friends */
wmSubWindowScissorSet(win, ar->swinid, &ar->drawrct);
-
- ar->do_draw= 0;
- memset(&ar->drawrct, 0, sizeof(ar->drawrct));
UI_SetTheme(sa?sa->spacetype:0, ar->type?ar->type->regionid:0);
@@ -488,6 +485,9 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
ED_region_pixelspace(ar);
ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_PIXEL);
+
+ ar->do_draw= 0;
+ memset(&ar->drawrct, 0, sizeof(ar->drawrct));
uiFreeInactiveBlocks(C, &ar->uiblocks);
@@ -496,9 +496,9 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
}
/* **********************************
- maybe silly, but let's try for now
- to keep these tags protected
- ********************************** */
+ * maybe silly, but let's try for now
+ * to keep these tags protected
+ * ********************************** */
void ED_region_tag_redraw(ARegion *ar)
{
@@ -658,8 +658,8 @@ static void region_azone_icon(ScrArea *sa, AZone *az, ARegion *ar)
int tot=0;
/* count how many actionzones with along same edge are available.
- This allows for adding more action zones in the future without
- having to worry about correct offset */
+ * This allows for adding more action zones in the future without
+ * having to worry about correct offset */
for(azt= sa->actionzones.first; azt; azt= azt->next) {
if(azt->edge == az->edge) tot++;
}
@@ -1432,7 +1432,7 @@ void ED_area_prevspace(bContext *C, ScrArea *sa)
if(sl->next) {
/* workaround for case of double prevspace, render window
- with a file browser on top of it */
+ * with a file browser on top of it */
if(sl->next->spacetype == SPACE_FILE && sl->next->next)
ED_area_newspace(C, sa, sl->next->next->spacetype);
else
@@ -1659,7 +1659,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
y= -y;
}
else {
- /* for now, allow scrolling in both directions (since layouts are optimised for vertical,
+ /* for now, allow scrolling in both directions (since layouts are optimized for vertical,
* they often don't fit in horizontal layout)
*/
v2d->keepofs &= ~(V2D_LOCKOFS_X|V2D_LOCKOFS_Y|V2D_KEEPOFS_X|V2D_KEEPOFS_Y);
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index 918df2f90e0..2608e9e3482 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -73,10 +73,11 @@ GLubyte stipple_halftone[128] = {
/* repeat this pattern
- X000X000
- 00000000
- 00X000X0
- 00000000 */
+ *
+ * X000X000
+ * 00000000
+ * 00X000X0
+ * 00000000 */
GLubyte stipple_quarttone[128] = {
@@ -148,8 +149,10 @@ void fdrawbezier(float vec[4][3])
glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, vec[0]);
glBegin(GL_LINE_STRIP);
while (spline_step < 1.000001f) {
- /*if(do_shaded)
- UI_ThemeColorBlend(th_col1, th_col2, spline_step);*/
+#if 0
+ if(do_shaded)
+ UI_ThemeColorBlend(th_col1, th_col2, spline_step);
+#endif
glEvalCoord1f(spline_step);
spline_step += dist;
}
@@ -201,14 +204,12 @@ void sdrawline(short x1, short y1, short x2, short y2)
}
/*
-
- x1,y2
- | \
- | \
- | \
- x1,y1-- x2,y1
-
-*/
+ * x1,y2
+ * | \
+ * | \
+ * | \
+ * x1,y1-- x2,y1
+ */
static void sdrawtripoints(short x1, short y1, short x2, short y2)
{
@@ -847,7 +848,7 @@ void bgl_get_mats(bglMats *mats)
glGetIntegerv(GL_VIEWPORT, (GLint *)mats->viewport);
/* Very strange code here - it seems that certain bad values in the
- modelview matrix can cause gluUnProject to give bad results. */
+ * modelview matrix can cause gluUnProject to give bad results. */
if(mats->modelview[0] < badvalue &&
mats->modelview[0] > -badvalue)
mats->modelview[0]= 0;
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 25b8b8415d9..6288f39367e 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -524,8 +524,8 @@ int area_getorientation(ScrArea *sa, ScrArea *sb)
}
/* Helper function to join 2 areas, it has a return value, 0=failed 1=success
-* used by the split, join operators
-*/
+ * used by the split, join operators
+ */
int screen_area_join(bContext *C, bScreen* scr, ScrArea *sa1, ScrArea *sa2)
{
int dir;
@@ -649,7 +649,7 @@ static void screen_test_scale(bScreen *sc, int winsizex, int winsizey)
/* make sure it fits! */
for(sv= sc->vertbase.first; sv; sv= sv->next) {
- /* FIXME, this resizing logic is no good when resizing the window + redrawing [#24428]
+ /* FIXME, this re-sizing logic is no good when re-sizing the window + redrawing [#24428]
* need some way to store these as floats internally and re-apply from there. */
tempf= ((float)sv->vec.x)*facx;
sv->vec.x= (short)(tempf+0.5f);
@@ -704,7 +704,7 @@ static void screen_test_scale(bScreen *sc, int winsizex, int winsizey)
#define SCR_BACK 0.55
#define SCR_ROUND 12
-/* draw vertical shape visualising future joining (left as well
+/* draw vertical shape visualizing future joining (left as well
* right direction of future joining) */
static void draw_horizontal_join_shape(ScrArea *sa, char dir)
{
@@ -777,7 +777,7 @@ static void draw_horizontal_join_shape(ScrArea *sa, char dir)
glRectf(points[6].x, points[6].y, points[9].x, points[9].y);
}
-/* draw vertical shape visualising future joining (up/down direction) */
+/* draw vertical shape visualizing future joining (up/down direction) */
static void draw_vertical_join_shape(ScrArea *sa, char dir)
{
vec2f points[10];
@@ -1401,8 +1401,8 @@ void ED_screen_delete(bContext *C, bScreen *sc)
/* screen can only be in use by one window at a time, so as
- long as we are able to find a screen that is unused, we
- can safely assume ours is not in use anywhere an delete it */
+ * long as we are able to find a screen that is unused, we
+ * can safely assume ours is not in use anywhere an delete it */
for(newsc= sc->id.prev; newsc; newsc=newsc->id.prev)
if(!ed_screen_used(wm, newsc))
@@ -1424,16 +1424,19 @@ void ED_screen_delete(bContext *C, bScreen *sc)
}
/* only call outside of area/region loops */
-void ED_screen_set_scene(bContext *C, Scene *scene)
+void ED_screen_set_scene(bContext *C, bScreen *screen, Scene *scene)
{
Main *bmain= CTX_data_main(C);
bScreen *sc;
- bScreen *curscreen= CTX_wm_screen(C);
+
+ if(screen == NULL)
+ return;
- ED_object_exit_editmode(C, EM_FREEDATA|EM_DO_UNDO);
+ if(ed_screen_used(CTX_wm_manager(C), screen))
+ ED_object_exit_editmode(C, EM_FREEDATA|EM_DO_UNDO);
for(sc= CTX_data_main(C)->screen.first; sc; sc= sc->id.next) {
- if((U.flag & USER_SCENEGLOBAL) || sc==curscreen) {
+ if((U.flag & USER_SCENEGLOBAL) || sc==screen) {
if(scene != sc->scene) {
/* all areas endlocalview */
@@ -1452,7 +1455,7 @@ void ED_screen_set_scene(bContext *C, Scene *scene)
/* are there cameras in the views that are not in the scene? */
for(sc= CTX_data_main(C)->screen.first; sc; sc= sc->id.next) {
- if( (U.flag & USER_SCENEGLOBAL) || sc==curscreen) {
+ if( (U.flag & USER_SCENEGLOBAL) || sc==screen) {
ScrArea *sa= sc->areabase.first;
while(sa) {
SpaceLink *sl= sa->spacedata.first;
@@ -1489,7 +1492,7 @@ void ED_screen_set_scene(bContext *C, Scene *scene)
set_scene_bg(bmain, scene);
ED_render_engine_changed(bmain);
- ED_update_for_newframe(bmain, scene, curscreen, 1);
+ ED_update_for_newframe(bmain, scene, screen, 1);
/* complete redraw */
WM_event_add_notifier(C, NC_WINDOW, NULL);
@@ -1509,7 +1512,7 @@ void ED_screen_delete_scene(bContext *C, Scene *scene)
else
return;
- ED_screen_set_scene(C, newscene);
+ ED_screen_set_scene(C, CTX_wm_screen(C), newscene);
unlink_scene(bmain, scene, newscene);
}
@@ -1600,8 +1603,8 @@ ScrArea *ED_screen_full_toggle(bContext *C, wmWindow *win, ScrArea *sa)
if(sa) {
/* ensure we don't have a button active anymore, can crash when
- switching screens with tooltip open because region and tooltip
- are no longer in the same screen */
+ * switching screens with tooltip open because region and tooltip
+ * are no longer in the same screen */
for(ar=sa->regionbase.first; ar; ar=ar->next)
uiFreeBlocks(C, &ar->uiblocks);
@@ -1651,10 +1654,11 @@ ScrArea *ED_screen_full_toggle(bContext *C, wmWindow *win, ScrArea *sa)
oldscreen= win->screen;
/* nothing wrong with having only 1 area, as far as I can see...
- // is there only 1 area?
+ * is there only 1 area? */
+#if 0
if(oldscreen->areabase.first==oldscreen->areabase.last)
return NULL;
- */
+#endif
oldscreen->full = SCREENFULL;
BLI_snprintf(newname, sizeof(newname), "%s-%s", oldscreen->id.name+2, "full");
@@ -1670,7 +1674,7 @@ ScrArea *ED_screen_full_toggle(bContext *C, wmWindow *win, ScrArea *sa)
ED_area_newspace(C, newa, SPACE_INFO);
/* use random area when we have no active one, e.g. when the
- mouse is outside of the window and we open a file browser */
+ * mouse is outside of the window and we open a file browser */
if(!sa)
sa= oldscreen->areabase.first;
@@ -1738,7 +1742,14 @@ void ED_screen_animation_timer(bContext *C, int redraws, int refresh, int sync,
screen->animtimer= WM_event_add_timer(wm, win, TIMER0, (1.0/FPS));
sad->ar= CTX_wm_region(C);
- sad->sfra = scene->r.cfra;
+ /* if startframe is larger than current frame, we put currentframe on startframe.
+ * note: first frame then is not drawn! (ton) */
+ if(scene->r.sfra > scene->r.cfra) {
+ sad->sfra= scene->r.cfra;
+ scene->r.cfra= scene->r.sfra;
+ }
+ else
+ sad->sfra = scene->r.cfra;
sad->redraws= redraws;
sad->refresh= refresh;
sad->flag |= (enable < 0)? ANIMPLAY_FLAG_REVERSE: 0;
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 8818bd66b23..b1d718f08b5 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -452,26 +452,25 @@ int ED_operator_editmball(bContext *C)
/* *************************** action zone operator ************************** */
/* operator state vars used:
- none
-
- functions:
-
- apply() set actionzone event
-
- exit() free customdata
-
- callbacks:
-
- exec() never used
-
- invoke() check if in zone
- add customdata, put mouseco and area in it
- add modal handler
-
- modal() accept modal events while doing it
- call apply() with gesture info, active window, nonactive window
- call exit() and remove handler when LMB confirm
-
+ * none
+ *
+ * functions:
+ *
+ * apply() set actionzone event
+ *
+ * exit() free customdata
+ *
+ * callbacks:
+ *
+ * exec() never used
+ *
+ * invoke() check if in zone
+ * add customdata, put mouseco and area in it
+ * add modal handler
+ *
+ * modal() accept modal events while doing it
+ * call apply() with gesture info, active window, nonactive window
+ * call exit() and remove handler when LMB confirm
*/
typedef struct sActionzoneData {
@@ -664,24 +663,23 @@ static void SCREEN_OT_actionzone(wmOperatorType *ot)
/* ************** swap area operator *********************************** */
/* operator state vars used:
- sa1 start area
- sa2 area to swap with
-
- functions:
-
- init() set custom data for operator, based on actionzone event custom data
-
- cancel() cancel the operator
-
- exit() cleanup, send notifier
-
- callbacks:
-
- invoke() gets called on shift+lmb drag in actionzone
- call init(), add handler
-
- modal() accept modal events while doing it
-
+ * sa1 start area
+ * sa2 area to swap with
+ *
+ * functions:
+ *
+ * init() set custom data for operator, based on actionzone event custom data
+ *
+ * cancel() cancel the operator
+ *
+ * exit() cleanup, send notifier
+ *
+ * callbacks:
+ *
+ * invoke() gets called on shift+lmb drag in actionzone
+ * call init(), add handler
+ *
+ * modal() accept modal events while doing it
*/
typedef struct sAreaSwapData {
@@ -850,32 +848,31 @@ static void SCREEN_OT_area_dupli(wmOperatorType *ot)
/* ************** move area edge operator *********************************** */
/* operator state vars used:
- x, y mouse coord near edge
- delta movement of edge
-
- functions:
-
- init() set default property values, find edge based on mouse coords, test
- if the edge can be moved, select edges, calculate min and max movement
-
- apply() apply delta on selection
-
- exit() cleanup, send notifier
-
- cancel() cancel moving
-
- callbacks:
-
- exec() execute without any user interaction, based on properties
- call init(), apply(), exit()
-
- invoke() gets called on mouse click near edge
- call init(), add handler
-
- modal() accept modal events while doing it
- call apply() with delta motion
- call exit() and remove handler
-
+ * x, y mouse coord near edge
+ * delta movement of edge
+ *
+ * functions:
+ *
+ * init() set default property values, find edge based on mouse coords, test
+ * if the edge can be moved, select edges, calculate min and max movement
+ *
+ * apply() apply delta on selection
+ *
+ * exit() cleanup, send notifier
+ *
+ * cancel() cancel moving
+ *
+ * callbacks:
+ *
+ * exec() execute without any user interaction, based on properties
+ * call init(), apply(), exit()
+ *
+ * invoke() gets called on mouse click near edge
+ * call init(), add handler
+ *
+ * modal() accept modal events while doing it
+ * call apply() with delta motion
+ * call exit() and remove handler
*/
typedef struct sAreaMoveData {
@@ -1107,38 +1104,37 @@ static void SCREEN_OT_area_move(wmOperatorType *ot)
/* ************** split area operator *********************************** */
/*
- operator state vars:
- fac spit point
- dir direction 'v' or 'h'
-
- operator customdata:
- area pointer to (active) area
- x, y last used mouse pos
- (more, see below)
-
- functions:
-
- init() set default property values, find area based on context
-
- apply() split area based on state vars
-
- exit() cleanup, send notifier
-
- cancel() remove duplicated area
-
- callbacks:
-
- exec() execute without any user interaction, based on state vars
- call init(), apply(), exit()
-
- invoke() gets called on mouse click in action-widget
- call init(), add modal handler
- call apply() with initial motion
-
- modal() accept modal events while doing it
- call move-areas code with delta motion
- call exit() or cancel() and remove handler
-
+ * operator state vars:
+ * fac spit point
+ * dir direction 'v' or 'h'
+ *
+ * operator customdata:
+ * area pointer to (active) area
+ * x, y last used mouse pos
+ * (more, see below)
+ *
+ * functions:
+ *
+ * init() set default property values, find area based on context
+ *
+ * apply() split area based on state vars
+ *
+ * exit() cleanup, send notifier
+ *
+ * cancel() remove duplicated area
+ *
+ * callbacks:
+ *
+ * exec() execute without any user interaction, based on state vars
+ * call init(), apply(), exit()
+ *
+ * invoke() gets called on mouse click in action-widget
+ * call init(), add modal handler
+ * call apply() with initial motion
+ *
+ * modal() accept modal events while doing it
+ * call move-areas code with delta motion
+ * call exit() or cancel() and remove handler
*/
#define SPLIT_STARTED 1
@@ -2080,31 +2076,30 @@ static void SCREEN_OT_screen_full_area(wmOperatorType *ot)
/* ************** join area operator ********************************************** */
/* operator state vars used:
- x1, y1 mouse coord in first area, which will disappear
- x2, y2 mouse coord in 2nd area, which will become joined
-
- functions:
-
- init() find edge based on state vars
- test if the edge divides two areas,
- store active and nonactive area,
-
- apply() do the actual join
-
- exit() cleanup, send notifier
-
- callbacks:
-
- exec() calls init, apply, exit
-
- invoke() sets mouse coords in x,y
- call init()
- add modal handler
-
- modal() accept modal events while doing it
- call apply() with active window and nonactive window
- call exit() and remove handler when LMB confirm
-
+ * x1, y1 mouse coord in first area, which will disappear
+ * x2, y2 mouse coord in 2nd area, which will become joined
+ *
+ * functions:
+ *
+ * init() find edge based on state vars
+ * test if the edge divides two areas,
+ * store active and nonactive area,
+ *
+ * apply() do the actual join
+ *
+ * exit() cleanup, send notifier
+ *
+ * callbacks:
+ *
+ * exec() calls init, apply, exit
+ *
+ * invoke() sets mouse coords in x,y
+ * call init()
+ * add modal handler
+ *
+ * modal() accept modal events while doing it
+ * call apply() with active window and nonactive window
+ * call exit() and remove handler when LMB confirm
*/
typedef struct sAreaJoinData
@@ -2282,8 +2277,8 @@ static int area_join_modal(bContext *C, wmOperator *op, wmEvent *event)
}
else {
/* we are not bordering on the previously selected area
- we check if area has common border with the one marked for removal
- in this case we can swap areas.
+ * we check if area has common border with the one marked for removal
+ * in this case we can swap areas.
*/
dir = area_getorientation(sa, jd->sa2);
if (dir >= 0) {
@@ -2867,10 +2862,10 @@ static int match_region_with_redraws(int spacetype, int regiontype, int redraws)
else if(regiontype==RGN_TYPE_UI) {
if(spacetype==SPACE_CLIP) {
/* Track Preview button is on Properties Editor in SpaceClip,
- and it's very common case when users want it be refreshing
- during playback, so asking people to enable special option
- for this is a bit ticky, so add exception here for refreshing
- Properties Editor for SpaceClip always */
+ * and it's very common case when users want it be refreshing
+ * during playback, so asking people to enable special option
+ * for this is a bit tricky, so add exception here for refreshing
+ * Properties Editor for SpaceClip always */
return 1;
}
@@ -2912,10 +2907,13 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e
else if (sad->flag & ANIMPLAY_FLAG_NO_SYNC) sync= 0;
else sync= (scene->flag & SCE_FRAME_DROP);
- if((scene->audio.flag & AUDIO_SYNC) && !(sad->flag & ANIMPLAY_FLAG_REVERSE) && finite(time = sound_sync_scene(scene)))
- scene->r.cfra = (double)time * FPS + 0.5;
- else
+ if ((scene->audio.flag & AUDIO_SYNC) &&
+ (sad->flag & ANIMPLAY_FLAG_REVERSE) == FALSE &&
+ finite(time = sound_sync_scene(scene)))
{
+ scene->r.cfra = (double)time * FPS + 0.5;
+ }
+ else {
if (sync) {
int step = floor(wt->duration * FPS);
/* skip frames */
@@ -3127,22 +3125,22 @@ static void SCREEN_OT_animation_cancel(wmOperatorType *ot)
/* ************** border select operator (template) ***************************** */
/* operator state vars used: (added by default WM callbacks)
- xmin, ymin
- xmax, ymax
-
- customdata: the wmGesture pointer
-
- callbacks:
-
- exec() has to be filled in by user
-
- invoke() default WM function
- adds modal handler
-
- modal() default WM function
- accept modal events while doing it, calls exec(), handles ESC and border drawing
-
- poll() has to be filled in by user for context
+ * xmin, ymin
+ * xmax, ymax
+ *
+ * customdata: the wmGesture pointer
+ *
+ * callbacks:
+ *
+ * exec() has to be filled in by user
+ *
+ * invoke() default WM function
+ * adds modal handler
+ *
+ * modal() default WM function
+ * accept modal events while doing it, calls exec(), handles ESC and border drawing
+ *
+ * poll() has to be filled in by user for context
*/
#if 0
static int border_select_do(bContext *C, wmOperator *op)
@@ -3328,7 +3326,7 @@ static int scene_new_exec(bContext *C, wmOperator *op)
}
}
- ED_screen_set_scene(C, newscene);
+ ED_screen_set_scene(C, CTX_wm_screen(C), newscene);
WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, newscene);
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 0148f11b930..ea1e3eb47af 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -53,16 +53,16 @@
#include "paint_intern.h"
/* still needed for sculpt_stroke_get_location, should be
- removed eventually (TODO) */
+ * removed eventually (TODO) */
#include "sculpt_intern.h"
/* TODOs:
-
- Some of the cursor drawing code is doing non-draw stuff
- (e.g. updating the brush rake angle). This should be cleaned up
- still.
-
- There is also some ugliness with sculpt-specific code.
+ *
+ * Some of the cursor drawing code is doing non-draw stuff
+ * (e.g. updating the brush rake angle). This should be cleaned up
+ * still.
+ *
+ * There is also some ugliness with sculpt-specific code.
*/
typedef struct Snapshot {
@@ -220,8 +220,8 @@ static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
if ((br->mtex.brush_map_mode == MTEX_MAP_MODE_TILED) || len <= 1) {
/* it is probably worth optimizing for those cases where
- the texture is not rotated by skipping the calls to
- atan2, sqrtf, sin, and cos. */
+ * the texture is not rotated by skipping the calls to
+ * atan2, sqrtf, sin, and cos. */
if (br->mtex.tex && (rotation > 0.001f || rotation < -0.001f)) {
const float angle = atan2f(y, x) + rotation;
@@ -367,7 +367,7 @@ static int sculpt_get_brush_geometry(bContext* C, ViewContext *vc,
}
/* Draw an overlay that shows what effect the brush's texture will
- have on brush strength */
+ * have on brush strength */
/* TODO: sculpt only for now */
static void paint_draw_alpha_overlay(Sculpt *sd, Brush *brush,
ViewContext *vc, int x, int y)
@@ -380,7 +380,7 @@ static void paint_draw_alpha_overlay(Sculpt *sd, Brush *brush,
return;
/* save lots of GL state
- TODO: check on whether all of these are needed? */
+ * TODO: check on whether all of these are needed? */
glPushAttrib(GL_COLOR_BUFFER_BIT|
GL_CURRENT_BIT|
GL_DEPTH_BUFFER_BIT|
@@ -519,20 +519,20 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
return;
/* can't use stroke vc here because this will be called during
- mouse over too, not just during a stroke */
+ * mouse over too, not just during a stroke */
view3d_set_viewcontext(C, &vc);
/* TODO: as sculpt and other paint modes are unified, this
- special mode of drawing will go away */
+ * special mode of drawing will go away */
if(vc.obact->sculpt) {
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
float location[3];
int pixel_radius, hit;
/* this is probably here so that rake takes into
- account the brush movements before the stroke
- starts, but this doesn't really belong in draw code
- (TODO) */
+ * account the brush movements before the stroke
+ * starts, but this doesn't really belong in draw code
+ * TODO) */
{
const float u = 0.5f;
const float v = 1 - u;
@@ -560,7 +560,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
/* check if brush is subtracting, use different color then */
/* TODO: no way currently to know state of pen flip or
- invert key modifier without starting a stroke */
+ * invert key modifier without starting a stroke */
if((!(brush->flag & BRUSH_INVERTED) ^
!(brush->flag & BRUSH_DIR_IN)) &&
ELEM5(brush->sculpt_tool, SCULPT_TOOL_DRAW,
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 63e976693e3..f8a9516c97e 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -478,9 +478,9 @@ static void image_undo_restore(bContext *C, ListBase *lb)
if(ima && ibuf && strcmp(tile->ibufname, ibuf->name)!=0) {
/* current ImBuf filename was changed, probably current frame
- was changed when paiting on image sequence, rather than storing
- full image user (which isn't so obvious, btw) try to find ImBuf with
- matched file name in list of already loaded images */
+ * was changed when paiting on image sequence, rather than storing
+ * full image user (which isn't so obvious, btw) try to find ImBuf with
+ * matched file name in list of already loaded images */
ibuf= BLI_findstring(&ima->ibufs, tile->ibufname, offsetof(ImBuf, name));
}
@@ -810,7 +810,7 @@ static int project_paint_PickColor(const ProjPaintState *ps, float pt[2], float
* 0 : no occlusion
* -1 : no occlusion but 2D intersection is true (avoid testing the other half of a quad)
* 1 : occluded
- 2 : occluded with w[3] weights set (need to know in some cases) */
+ * 2 : occluded with w[3] weights set (need to know in some cases) */
static int project_paint_occlude_ptv(float pt[3], float v1[4], float v2[4], float v3[4], float w[3], int is_ortho)
{
@@ -1810,10 +1810,11 @@ static int project_bucket_isect_circle(const float cent[2], const float radius_s
/* Would normally to a simple intersection test, however we know the bounds of these 2 already intersect
* so we only need to test if the center is inside the vertical or horizontal bounds on either axis,
* this is even less work then an intersection test
- *
+ */
+#if 0
if (BLI_in_rctf(bucket_bounds, cent[0], cent[1]))
return 1;
- */
+#endif
if ( (bucket_bounds->xmin <= cent[0] && bucket_bounds->xmax >= cent[0]) ||
(bucket_bounds->ymin <= cent[1] && bucket_bounds->ymax >= cent[1]) )
@@ -2199,51 +2200,51 @@ static void project_bucket_clip_face(
#endif
}
- /*
-# This script creates faces in a blender scene from printed data above.
-
-project_ls = [
-...(output from above block)...
-]
-
-from Blender import Scene, Mesh, Window, sys, Mathutils
-
-import bpy
-
-V = Mathutils.Vector
-
-def main():
- sce = bpy.data.scenes.active
-
- for item in project_ls:
- bb = item[0]
- uv = item[1]
- poly = item[2]
-
- me = bpy.data.meshes.new()
- ob = sce.objects.new(me)
-
- me.verts.extend([V(bb[0]).resize3D(), V(bb[1]).resize3D(), V(bb[2]).resize3D(), V(bb[3]).resize3D()])
- me.faces.extend([(0,1,2,3),])
- me.verts.extend([V(uv[0]).resize3D(), V(uv[1]).resize3D(), V(uv[2]).resize3D()])
- me.faces.extend([(4,5,6),])
-
- vs = [V(p).resize3D() for p in poly]
- print len(vs)
- l = len(me.verts)
- me.verts.extend(vs)
-
- i = l
- while i < len(me.verts):
- ii = i+1
- if ii==len(me.verts):
- ii = l
- me.edges.extend([i, ii])
- i+=1
-
-if __name__ == '__main__':
- main()
- */
+/*
+ * # This script creates faces in a blender scene from printed data above.
+ *
+ * project_ls = [
+ * ...(output from above block)...
+ * ]
+ *
+ * from Blender import Scene, Mesh, Window, sys, Mathutils
+ *
+ * import bpy
+ *
+ * V = Mathutils.Vector
+ *
+ * def main():
+ * sce = bpy.data.scenes.active
+ *
+ * for item in project_ls:
+ * bb = item[0]
+ * uv = item[1]
+ * poly = item[2]
+ *
+ * me = bpy.data.meshes.new()
+ * ob = sce.objects.new(me)
+ *
+ * me.verts.extend([V(bb[0]).xyz, V(bb[1]).xyz, V(bb[2]).xyz, V(bb[3]).xyz])
+ * me.faces.extend([(0,1,2,3),])
+ * me.verts.extend([V(uv[0]).xyz, V(uv[1]).xyz, V(uv[2]).xyz])
+ * me.faces.extend([(4,5,6),])
+ *
+ * vs = [V(p).xyz for p in poly]
+ * print len(vs)
+ * l = len(me.verts)
+ * me.verts.extend(vs)
+ *
+ * i = l
+ * while i < len(me.verts):
+ * ii = i+1
+ * if ii==len(me.verts):
+ * ii = l
+ * me.edges.extend([i, ii])
+ * i+=1
+ *
+ * if __name__ == '__main__':
+ * main()
+ */
#undef ISECT_1
@@ -2341,12 +2342,12 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
yhalfpx = (0.5f+ (PROJ_GEOM_TOLERANCE/4.0f) ) / ibuf_yf;
/* Note about (PROJ_GEOM_TOLERANCE/x) above...
- Needed to add this offset since UV coords are often quads aligned to pixels.
- In this case pixels can be exactly between 2 triangles causing nasty
- artifacts.
-
- This workaround can be removed and painting will still work on most cases
- but since the first thing most people try is painting onto a quad- better make it work.
+ * Needed to add this offset since UV coords are often quads aligned to pixels.
+ * In this case pixels can be exactly between 2 triangles causing nasty
+ * artifacts.
+ *
+ * This workaround can be removed and painting will still work on most cases
+ * but since the first thing most people try is painting onto a quad- better make it work.
*/
@@ -2396,11 +2397,11 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
);
/* sometimes this happens, better just allow for 8 intersectiosn even though there should be max 6 */
- /*
+#if 0
if (uv_clip_tot>6) {
printf("this should never happen! %d\n", uv_clip_tot);
- }*/
-
+ }
+#endif
if (pixel_bounds_array(uv_clip, &bounds_px, ibuf->x, ibuf->y, uv_clip_tot)) {
@@ -2600,12 +2601,12 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
/* We need to find the closest point along the face edge,
* getting the screen_px_from_*** wont work because our actual location
- * is not relevent, since we are outside the face, Use VecLerpf to find
+ * is not relevant, since we are outside the face, Use VecLerpf to find
* our location on the side of the face's UV */
- /*
+#if 0
if (is_ortho) screen_px_from_ortho(ps, uv, v1co, v2co, v3co, uv1co, uv2co, uv3co, pixelScreenCo);
else screen_px_from_persp(ps, uv, v1co, v2co, v3co, uv1co, uv2co, uv3co, pixelScreenCo);
- */
+#endif
/* Since this is a seam we need to work out where on the line this pixel is */
//fac = line_point_factor_v2(uv, uv_seam_quad[0], uv_seam_quad[1]);
@@ -2713,7 +2714,7 @@ static void project_paint_bucket_bounds(const ProjPaintState *ps, const float mi
bucketMax[0] = (int)((int)(((float)(max[0] - ps->screenMin[0]) / ps->screen_width) * ps->buckets_x) + 1.5f);
bucketMax[1] = (int)((int)(((float)(max[1] - ps->screenMin[1]) / ps->screen_height) * ps->buckets_y) + 1.5f);
- /* incase the rect is outside the mesh 2d bounds */
+ /* in case the rect is outside the mesh 2d bounds */
CLAMP(bucketMin[0], 0, ps->buckets_x);
CLAMP(bucketMin[1], 0, ps->buckets_y);
@@ -3022,11 +3023,11 @@ static void project_paint_begin(ProjPaintState *ps)
ps->dm_mvert= MEM_dupallocN(ps->dm_mvert);
ps->dm_mface= MEM_dupallocN(ps->dm_mface);
/* looks like these are ok for now.*/
- /*
+#if 0
ps->dm_mtface= MEM_dupallocN(ps->dm_mtface);
ps->dm_mtface_clone= MEM_dupallocN(ps->dm_mtface_clone);
ps->dm_mtface_stencil= MEM_dupallocN(ps->dm_mtface_stencil);
- */
+#endif
}
ps->viewDir[0] = 0.0f;
@@ -3052,7 +3053,7 @@ static void project_paint_begin(ProjPaintState *ps)
ps->is_ortho= project_paint_view_clip(ps->v3d, ps->rv3d, &ps->clipsta, &ps->clipend);
}
else {
- /* reprojection */
+ /* re-projection */
float winmat[4][4];
float vmat[4][4];
@@ -3177,7 +3178,7 @@ static void project_paint_begin(ProjPaintState *ps)
CLAMP(ps->screenMax[1], (float)(-diameter), (float)(ps->winy + diameter));
#endif
}
- else { /* reprojection, use bounds */
+ else { /* re-projection, use bounds */
ps->screenMin[0]= 0;
ps->screenMax[0]= (float)(ps->winx);
@@ -3509,11 +3510,11 @@ static void project_paint_end(ProjPaintState *ps)
if(ps->dm_mvert) MEM_freeN(ps->dm_mvert);
if(ps->dm_mface) MEM_freeN(ps->dm_mface);
/* looks like these dont need copying */
- /*
+#if 0
if(ps->dm_mtface) MEM_freeN(ps->dm_mtface);
if(ps->dm_mtface_clone) MEM_freeN(ps->dm_mtface_clone);
if(ps->dm_mtface_stencil) MEM_freeN(ps->dm_mtface_stencil);
- */
+#endif
}
if(ps->dm_release)
@@ -3678,8 +3679,8 @@ typedef struct ProjectHandle {
static void blend_color_mix(unsigned char *cp, const unsigned char *cp1, const unsigned char *cp2, const int fac)
{
/* this and other blending modes previously used >>8 instead of /255. both
- are not equivalent (>>8 is /256), and the former results in rounding
- errors that can turn colors black fast after repeated blending */
+ * are not equivalent (>>8 is /256), and the former results in rounding
+ * errors that can turn colors black fast after repeated blending */
const int mfac= 255-fac;
cp[0]= (mfac*cp1[0]+fac*cp2[0])/255;
@@ -3700,8 +3701,8 @@ static void blend_color_mix_float(float *cp, const float *cp1, const float *cp2,
static void blend_color_mix_accum(unsigned char *cp, const unsigned char *cp1, const unsigned char *cp2, const int fac)
{
/* this and other blending modes previously used >>8 instead of /255. both
- are not equivalent (>>8 is /256), and the former results in rounding
- errors that can turn colors black fast after repeated blending */
+ * are not equivalent (>>8 is /256), and the former results in rounding
+ * errors that can turn colors black fast after repeated blending */
const int mfac= 255-fac;
const int alpha= cp1[3] + ((fac * cp2[3]) / 255);
@@ -4312,7 +4313,7 @@ static int imapaint_torus_split_region(ImagePaintRegion region[4], ImBuf *dbuf,
if (srcy < 0) srcy += sbuf->y;
/* clip width of blending area to destination imbuf, to avoid writing the
- same pixel twice */
+ * same pixel twice */
origw = w = (width > dbuf->x)? dbuf->x: width;
origh = h = (height > dbuf->y)? dbuf->y: height;
@@ -4348,7 +4349,7 @@ static void imapaint_lift_smear(ImBuf *ibuf, ImBuf *ibufb, int *pos)
static ImBuf *imapaint_lift_clone(ImBuf *ibuf, ImBuf *ibufb, int *pos)
{
/* note: allocImbuf returns zero'd memory, so regions outside image will
- have zero alpha, and hence not be blended onto the image */
+ * have zero alpha, and hence not be blended onto the image */
int w=ibufb->x, h=ibufb->y, destx=0, desty=0, srcx=pos[0], srcy=pos[1];
ImBuf *clonebuf= IMB_allocImBuf(w, h, ibufb->planes, ibufb->flags);
@@ -4816,7 +4817,7 @@ static int texture_paint_init(bContext *C, wmOperator *op)
op->customdata= pop;
/* XXX: Soften tool does not support projection painting atm, so just disable
- projection for this brush */
+ * projection for this brush */
if(brush->imagepaint_tool == PAINT_TOOL_SOFTEN) {
settings->imapaint.flag |= IMAGEPAINT_PROJECT_DISABLE;
pop->restore_projection = 1;
@@ -5032,13 +5033,13 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
pop->starttime= time;
/* special exception here for too high pressure values on first touch in
- windows for some tablets, then we just skip first touch .. */
+ * windows for some tablets, then we just skip first touch .. */
if (tablet && (pressure >= 0.99f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || brush_use_alpha_pressure(scene, pop->s.brush) || brush_use_size_pressure(scene, pop->s.brush)))
return;
/* This can be removed once fixed properly in
- brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, double time, float pressure, void *user)
- at zero pressure we should do nothing 1/2^12 is .0002 which is the sensitivity of the most sensitive pen tablet available*/
+ * brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, double time, float pressure, void *user)
+ * at zero pressure we should do nothing 1/2^12 is .0002 which is the sensitivity of the most sensitive pen tablet available */
if (tablet && (pressure < .0002f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || brush_use_alpha_pressure(scene, pop->s.brush) || brush_use_size_pressure(scene, pop->s.brush)))
return;
@@ -5220,10 +5221,10 @@ static void toggle_paint_cursor(bContext *C, int enable)
}
/* enable the paint cursor if it isn't already.
-
- purpose is to make sure the paint cursor is shown if paint
- mode is enabled in the image editor. the paint poll will
- ensure that the cursor is hidden when not in paint mode */
+ *
+ * purpose is to make sure the paint cursor is shown if paint
+ * mode is enabled in the image editor. the paint poll will
+ * ensure that the cursor is hidden when not in paint mode */
void ED_space_image_paint_update(wmWindowManager *wm, ToolSettings *settings)
{
ImagePaintSettings *imapaint = &settings->imapaint;
@@ -5738,7 +5739,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
if(w > maxsize) w= maxsize;
if(h > maxsize) h= maxsize;
- ibuf= ED_view3d_draw_offscreen_imbuf(CTX_data_scene(C), CTX_wm_view3d(C), CTX_wm_region(C), w, h, IB_rect, err_out);
+ ibuf= ED_view3d_draw_offscreen_imbuf(CTX_data_scene(C), CTX_wm_view3d(C), CTX_wm_region(C), w, h, IB_rect, FALSE, err_out);
if(!ibuf) {
/* Mostly happens when OpenGL offscreen buffer was failed to create, */
/* but could be other reasons. Should be handled in the future. nazgul */
@@ -5750,7 +5751,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
if(image) {
/* now for the trickyness. store the view projection here!
- * reprojection will reuse this */
+ * re-projection will reuse this */
View3D *v3d= CTX_wm_view3d(C);
RegionView3D *rv3d= CTX_wm_region_view3d(C);
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index b4315c2847d..bae433bdb55 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -111,8 +111,8 @@ void SCULPT_OT_uv_sculpt_stroke(struct wmOperatorType *ot);
/* paint_utils.c */
/* Convert the object-space axis-aligned bounding box (expressed as
- its minimum and maximum corners) into a screen-space rectangle,
- returns zero if the result is empty */
+ * its minimum and maximum corners) into a screen-space rectangle,
+ * returns zero if the result is empty */
int paint_convert_bb_to_rect(struct rcti *rect,
const float bb_min[3],
const float bb_max[3],
@@ -121,8 +121,8 @@ int paint_convert_bb_to_rect(struct rcti *rect,
struct Object *ob);
/* Get four planes in object-space that describe the projection of
- screen_rect from screen into object-space (essentially converting a
- 2D screens-space bounding box into four 3D planes) */
+ * screen_rect from screen into object-space (essentially converting a
+ * 2D screens-space bounding box into four 3D planes) */
void paint_calc_redraw_planes(float planes[4][4],
const struct ARegion *ar,
struct RegionView3D *rv3d,
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index cd8262f06bd..d306abef9d0 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -73,8 +73,8 @@ typedef struct PaintStroke {
float last_mouse_position[2];
/* Set whether any stroke step has yet occurred
- e.g. in sculpt mode, stroke doesn't start until cursor
- passes over the mesh */
+ * e.g. in sculpt mode, stroke doesn't start until cursor
+ * passes over the mesh */
int stroke_started;
/* event that started stroke, for modal() return */
int event_type;
@@ -106,7 +106,7 @@ static void paint_draw_smooth_stroke(bContext *C, int x, int y, void *customdata
}
/* if this is a tablet event, return tablet pressure and set *pen_flip
- to 1 if the eraser tool is being used, 0 otherwise */
+ * to 1 if the eraser tool is being used, 0 otherwise */
static float event_tablet_data(wmEvent *event, int *pen_flip)
{
int erasor = 0;
@@ -142,15 +142,15 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *ev
pressure = event_tablet_data(event, &pen_flip);
/* TODO: as sculpt and other paint modes are unified, this
- separation will go away */
+ * separation will go away */
if(stroke->vc.obact->sculpt) {
float delta[2];
brush_jitter_pos(scene, brush, mouse_in, mouse);
/* XXX: meh, this is round about because
- brush_jitter_pos isn't written in the best way to
- be reused here */
+ * brush_jitter_pos isn't written in the best way to
+ * be reused here */
if(brush->flag & BRUSH_JITTER_PRESSURE) {
sub_v2_v2v2(delta, mouse, mouse_in);
mul_v2_fl(delta, pressure);
@@ -196,7 +196,7 @@ static int paint_smooth_stroke(PaintStroke *stroke, float output[2], wmEvent *ev
float dx = stroke->last_mouse_position[0] - event->x, dy = stroke->last_mouse_position[1] - event->y;
/* If the mouse is moving within the radius of the last move,
- don't update the mouse position. This allows sharp turns. */
+ * don't update the mouse position. This allows sharp turns. */
if(dx*dx + dy*dy < stroke->brush->smooth_stroke_radius * stroke->brush->smooth_stroke_radius)
return 0;
@@ -208,7 +208,7 @@ static int paint_smooth_stroke(PaintStroke *stroke, float output[2], wmEvent *ev
}
/* For brushes with stroke spacing enabled, moves mouse in steps
- towards the final mouse location. */
+ * towards the final mouse location. */
static int paint_space_stroke(bContext *C, wmOperator *op, wmEvent *event, const float final_mouse[2])
{
PaintStroke *stroke = op->customdata;
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index 0d9c0f2e38e..dcd7554b7b8 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -68,8 +68,8 @@
#include "paint_intern.h"
/* Convert the object-space axis-aligned bounding box (expressed as
- its minimum and maximum corners) into a screen-space rectangle,
- returns zero if the result is empty */
+ * its minimum and maximum corners) into a screen-space rectangle,
+ * returns zero if the result is empty */
int paint_convert_bb_to_rect(rcti *rect,
const float bb_min[3],
const float bb_max[3],
@@ -97,8 +97,7 @@ int paint_convert_bb_to_rect(rcti *rect,
vec[1] = j ? bb_min[1] : bb_max[1];
vec[2] = k ? bb_min[2] : bb_max[2];
/* convert corner to screen space */
- ED_view3d_project_float(ar, vec, proj,
- projection_mat);
+ ED_view3d_project_float_v2(ar, vec, proj, projection_mat);
/* expand 2D rectangle */
rect->xmin = MIN2(rect->xmin, proj[0]);
rect->xmax = MAX2(rect->xmax, proj[0]);
@@ -113,8 +112,8 @@ int paint_convert_bb_to_rect(rcti *rect,
}
/* Get four planes in object-space that describe the projection of
- screen_rect from screen into object-space (essentially converting a
- 2D screens-space bounding box into four 3D planes) */
+ * screen_rect from screen into object-space (essentially converting a
+ * 2D screens-space bounding box into four 3D planes) */
void paint_calc_redraw_planes(float planes[4][4],
const ARegion *ar,
RegionView3D *rv3d,
@@ -141,7 +140,7 @@ void paint_calc_redraw_planes(float planes[4][4],
/* convert a point in model coordinates to 2D screen coordinates */
/* TODO: can be deleted once all calls are replaced with
- view3d_project_float() */
+ * view3d_project_float() */
void projectf(bglMats *mats, const float v[3], float p[2])
{
double ux, uy, uz;
@@ -231,7 +230,7 @@ static void imapaint_tri_weights(Object *ob,
h[2]= 1.0f;
/* solve for(w1,w2,w3)/perspdiv in:
- h*perspdiv = Project*Model*(w1*v1 + w2*v2 + w3*v3) */
+ * h * perspdiv = Project * Model * (w1 * v1 + w2 * v2 + w3 * v3) */
wmat[0][0]= pv1[0]; wmat[1][0]= pv2[0]; wmat[2][0]= pv3[0];
wmat[0][1]= pv1[1]; wmat[1][1]= pv2[1]; wmat[2][1]= pv3[1];
@@ -283,7 +282,7 @@ void imapaint_pick_uv(Scene *scene, Object *ob, unsigned int faceindex, const in
if(mf.v4) {
/* the triangle with the largest absolute values is the one
- with the most negative weights */
+ * with the most negative weights */
imapaint_tri_weights(ob, mv[0].co, mv[1].co, mv[3].co, p, w);
absw= fabs(w[0]) + fabs(w[1]) + fabs(w[2]);
if(absw < minabsw) {
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 1937cb7b05c..dcd89a52a80 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -186,7 +186,7 @@ static int *get_indexarray(Mesh *me)
/* in contradiction to cpack drawing colors, the MCOL colors (vpaint colors) are per byte!
- so not endian sensitive. Mcol = ABGR!!! so be cautious with cpack calls */
+ * so not endian sensitive. Mcol = ABGR!!! so be cautious with cpack calls */
static unsigned int rgba_to_mcol(float r, float g, float b, float a)
{
@@ -573,8 +573,8 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight)
DAG_id_tag_update(&me->id, 0);
}
-/* XXX: should be re-implemented as a vertex/weight paint 'color correct' operator
-
+/* XXX: should be re-implemented as a vertex/weight paint 'color correct' operator */
+#if 0
void vpaint_dogamma(Scene *scene)
{
VPaint *vp= scene->toolsettings->vpaint;
@@ -614,7 +614,7 @@ void vpaint_dogamma(Scene *scene)
cp+= 4;
}
}
- */
+#endif
BM_INLINE unsigned int mcol_blend(unsigned int col1, unsigned int col2, int fac)
{
@@ -725,7 +725,7 @@ BM_INLINE unsigned int mcol_lighten(unsigned int col1, unsigned int col2, int fa
cp= (char *)&col;
/* See if are lighter, if so mix, else dont do anything.
- if the paint col is darker then the original, then ignore */
+ * if the paint col is darker then the original, then ignore */
if (cp1[1]+cp1[2]+cp1[3] > cp2[1]+cp2[2]+cp2[3])
return col1;
@@ -753,7 +753,7 @@ BM_INLINE unsigned int mcol_darken(unsigned int col1, unsigned int col2, int fac
cp= (char *)&col;
/* See if were darker, if so mix, else dont do anything.
- if the paint col is brighter then the original, then ignore */
+ * if the paint col is brighter then the original, then ignore */
if (cp1[1]+cp1[2]+cp1[3] < cp2[1]+cp2[2]+cp2[3])
return col1;
@@ -825,8 +825,8 @@ static int sample_backbuf_area(ViewContext *vc, int *indexar, int totface, int x
struct ImBuf *ibuf;
int a, tot=0, index;
- /* brecht: disabled this because it obviously failes for
- brushes with size > 64, why is this here? */
+ /* brecht: disabled this because it obviously fails for
+ * brushes with size > 64, why is this here? */
/*if(size>64.0) size= 64.0;*/
ibuf= view3d_read_backbuf(vc, x-size, y-size, x+size, y+size);
@@ -1302,8 +1302,8 @@ static void do_weight_paint_normalize_all_active(MDeformVert *dvert, const int d
}
/*
-See if the current deform vertex has a locked group
-*/
+ * See if the current deform vertex has a locked group
+ */
static char has_locked_group(MDeformVert *dvert, const int defbase_tot,
const char *bone_groups, const char *lock_flags)
{
@@ -1845,7 +1845,7 @@ static void do_weight_paint_vertex(/* vars which remain the same for every vert
if (wpi->do_auto_normalize) {
/* note on normalize - this used to be applied after painting and normalize all weights,
* in some ways this is good because there is feedback where the more weights involved would
- * 'risist' so you couldn't instantly zero out other weights by painting 1.0 on the active.
+ * 'resist' so you couldn't instantly zero out other weights by painting 1.0 on the active.
*
* However this gave a problem since applying mirror, then normalize both verts
* the resulting weight wont match on both sides.
@@ -1869,7 +1869,7 @@ static void do_weight_paint_vertex(/* vars which remain the same for every vert
* - auto normalize is enabled
* - the group you are painting onto has a L / R version
*
- * We wan't L/R vgroups to have the same weight but this cant be if both are over 0.5,
+ * We want L/R vgroups to have the same weight but this cant be if both are over 0.5,
* We _could_ have special check for that, but this would need its own normalize function which
* holds 2 groups from changing at once.
*
@@ -1993,10 +1993,10 @@ static int set_wpaint(bContext *C, wmOperator *UNUSED(op)) /* toggle */
/* Weightpaint works by overriding colors in mesh,
- * so need to make sure we recalc on enter and
- * exit (exit needs doing regardless because we
- * should redeform).
- */
+ * so need to make sure we recalc on enter and
+ * exit (exit needs doing regardless because we
+ * should redeform).
+ */
DAG_id_tag_update(&me->id, 0);
if(ob->mode & OB_MODE_WEIGHT_PAINT) {
@@ -2605,23 +2605,22 @@ void PAINT_OT_vertex_paint_toggle(wmOperatorType *ot)
/* ********************** vertex paint operator ******************* */
/* Implementation notes:
-
-Operator->invoke()
- - validate context (add mcol)
- - create customdata storage
- - call paint once (mouse click)
- - add modal handler
-
-Operator->modal()
- - for every mousemove, apply vertex paint
- - exit on mouse release, free customdata
- (return OPERATOR_FINISHED also removes handler and operator)
-
-For future:
- - implement a stroke event (or mousemove with past positons)
- - revise whether op->customdata should be added in object, in set_vpaint
-
-*/
+ *
+ * Operator->invoke()
+ * - validate context (add mcol)
+ * - create customdata storage
+ * - call paint once (mouse click)
+ * - add modal handler
+ *
+ * Operator->modal()
+ * - for every mousemove, apply vertex paint
+ * - exit on mouse release, free customdata
+ * (return OPERATOR_FINISHED also removes handler and operator)
+ *
+ * For future:
+ * - implement a stroke event (or mousemove with past positons)
+ * - revise whether op->customdata should be added in object, in set_vpaint
+ */
typedef struct polyfacemap_e {
struct polyfacemap_e *next, *prev;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index dc25f2964e0..c7b27742969 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -101,7 +101,7 @@ void ED_sculpt_force_update(bContext *C)
}
/* Sculpt mode handles multires differently from regular meshes, but only if
- it's the last modifier on the stack and it is not on the first level */
+ * it's the last modifier on the stack and it is not on the first level */
struct MultiresModifierData *sculpt_multires_active(Scene *scene, Object *ob)
{
Mesh *me= (Mesh*)ob->data;
@@ -178,10 +178,10 @@ typedef enum StrokeFlags {
} StrokeFlags;
/* Cache stroke properties. Used because
- RNA property lookup isn't particularly fast.
-
- For descriptions of these settings, check the operator properties.
-*/
+ * RNA property lookup isn't particularly fast.
+ *
+ * For descriptions of these settings, check the operator properties.
+ */
typedef struct StrokeCache {
/* Invariants */
float initial_radius;
@@ -222,7 +222,7 @@ typedef struct StrokeCache {
float old_grab_location[3], orig_grab_location[3];
int symmetry; /* Symmetry index between 0 and 7 bit combo 0 is Brush only;
- 1 is X mirror; 2 is Y mirror; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
+ * 1 is X mirror; 2 is Y mirror; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
int mirror_symmetry_pass; /* the symmetry pass we are currently on between 0 and 7*/
float true_view_normal[3];
float view_normal[3];
@@ -270,11 +270,11 @@ static int sculpt_get_redraw_rect(ARegion *ar, RegionView3D *rv3d,
}
/* expand redraw rect with redraw rect from previous step to
- prevent partial-redraw issues caused by fast strokes. This is
- needed here (not in sculpt_flush_update) as it was before
- because redraw rectangle should be the same in both of
- optimized PBVH draw function and 3d view redraw (if not -- some
- mesh parts could disapper from screen (sergey) */
+ * prevent partial-redraw issues caused by fast strokes. This is
+ * needed here (not in sculpt_flush_update) as it was before
+ * because redraw rectangle should be the same in both of
+ * optimized PBVH draw function and 3d view redraw (if not -- some
+ * mesh parts could disappear from screen (sergey) */
ss = ob->sculpt;
if(ss->cache) {
if(!BLI_rcti_is_empty(&ss->cache->previous_r))
@@ -539,8 +539,8 @@ static float calc_symmetry_feather(Sculpt *sd, StrokeCache* cache)
}
/* Return modified brush strength. Includes the direction of the brush, positive
- values pull vertices, negative values push. Uses tablet pressure and a
- special multiplier found experimentally to scale the strength factor. */
+ * values pull vertices, negative values push. Uses tablet pressure and a
+ * special multiplier found experimentally to scale the strength factor. */
static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather)
{
const Scene *scene = cache->vc->scene;
@@ -555,7 +555,7 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather)
float invert = cache->invert ? -1 : 1;
float accum = integrate_overlap(brush);
/* spacing is integer percentage of radius, divide by 50 to get
- normalized diameter */
+ * normalized diameter */
float overlap = (brush->flag & BRUSH_SPACE_ATTEN &&
brush->flag & BRUSH_SPACE &&
!(brush->flag & BRUSH_ANCHORED) &&
@@ -642,7 +642,7 @@ static float tex_strength(SculptSession *ss, Brush *br, float point[3],
float jnk;
/* Get strength by feeding the vertex
- location directly into a texture */
+ * location directly into a texture */
externtex(mtex, point, &avg,
&jnk, &jnk, &jnk, &jnk, 0);
}
@@ -653,17 +653,16 @@ static float tex_strength(SculptSession *ss, Brush *br, float point[3],
float radius;
/* if the active area is being applied for symmetry, flip it
- across the symmetry axis and rotate it back to the orignal
- position in order to project it. This insures that the
- brush texture will be oriented correctly. */
+ * across the symmetry axis and rotate it back to the original
+ * position in order to project it. This insures that the
+ * brush texture will be oriented correctly. */
flip_coord(symm_point, point, ss->cache->mirror_symmetry_pass);
if (ss->cache->radial_symmetry_pass)
mul_m4_v3(ss->cache->symm_rot_mat_inv, symm_point);
- ED_view3d_project_float(ss->cache->vc->ar, symm_point, point_2d,
- ss->cache->projection_mat);
+ ED_view3d_project_float_v2(ss->cache->vc->ar, symm_point, point_2d, ss->cache->projection_mat);
/* if fixed mode, keep coordinates relative to mouse */
if(mtex->brush_map_mode == MTEX_MAP_MODE_FIXED) {
@@ -677,8 +676,8 @@ static float tex_strength(SculptSession *ss, Brush *br, float point[3],
x = point_2d[0] + ss->cache->vc->ar->winrct.xmin;
y = point_2d[1] + ss->cache->vc->ar->winrct.ymin;
}
- else /* else (mtex->brush_map_mode == MTEX_MAP_MODE_TILED),
- leave the coordinates relative to the screen */
+ else /* else (mtex->brush_map_mode == MTEX_MAP_MODE_TILED) */
+ /* leave the coordinates relative to the screen */
{
radius = brush_size(ss->cache->vc->scene, br); // use unadjusted size for tiled mode
@@ -698,8 +697,8 @@ static float tex_strength(SculptSession *ss, Brush *br, float point[3],
y *= ss->cache->vc->ar->winy / radius;
/* it is probably worth optimizing for those cases where
- the texture is not rotated by skipping the calls to
- atan2, sqrtf, sin, and cos. */
+ * the texture is not rotated by skipping the calls to
+ * atan2, sqrtf, sin, and cos. */
if (rotation > 0.001f || rotation < -0.001f) {
const float angle = atan2f(y, x) + rotation;
const float flen = sqrtf(x*x + y*y);
@@ -850,7 +849,7 @@ static void calc_area_normal(Sculpt *sd, Object *ob, float an[3], PBVHNode **nod
}
/* This initializes the faces to be moved for this sculpt for draw/layer/flatten; then it
- finds average normal for all active vertices - note that this is called once for each mirroring direction */
+ * finds average normal for all active vertices - note that this is called once for each mirroring direction */
static void calc_sculpt_normal(Sculpt *sd, Object *ob, float an[3], PBVHNode **nodes, int totnode)
{
SculptSession *ss = ob->sculpt;
@@ -900,8 +899,8 @@ static void calc_sculpt_normal(Sculpt *sd, Object *ob, float an[3], PBVHNode **n
}
/* For the smooth brush, uses the neighboring vertices around vert to calculate
- a smoothed location for vert. Skips corner vertices (used by only one
- polygon.) */
+ * a smoothed location for vert. Skips corner vertices (used by only one
+ * polygon.) */
static void neighbor_average(SculptSession *ss, float avg[3], unsigned vert)
{
const int ncount = BLI_countlist(&ss->pmap[vert]);
@@ -1543,11 +1542,10 @@ static void do_layer_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
unode= sculpt_undo_push_node(ob, nodes[n]);
origco=unode->co;
- if(!unode->layer_disp)
- {
- #pragma omp critical
- unode->layer_disp= MEM_callocN(sizeof(float)*unode->totvert, "layer disp");
- }
+ if (!unode->layer_disp) {
+ #pragma omp critical
+ unode->layer_disp= MEM_callocN(sizeof(float)*unode->totvert, "layer disp");
+ }
layer_disp= unode->layer_disp;
@@ -1677,7 +1675,7 @@ static void calc_flatten_center(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
}
/* this calculates flatten center and area normal together,
-amortizing the memory bandwidth and loop overhead to calculate both at the same time */
+ * amortizing the memory bandwidth and loop overhead to calculate both at the same time */
static void calc_area_normal_and_flatten_center(Sculpt *sd, Object *ob,
PBVHNode **nodes, int totnode,
float an[3], float fc[3])
@@ -2471,7 +2469,7 @@ static void sculpt_update_keyblock(Object *ob)
float (*vertCos)[3];
/* Keyblock update happens after hadning deformation caused by modifiers,
- so ss->orig_cos would be updated with new stroke */
+ * so ss->orig_cos would be updated with new stroke */
if(ss->orig_cos) vertCos = ss->orig_cos;
else vertCos = BLI_pbvh_get_vertCos(ss->pbvh);
@@ -2491,7 +2489,7 @@ static void sculpt_flush_stroke_deform(Sculpt *sd, Object *ob)
if(ELEM(brush->sculpt_tool, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_LAYER)) {
/* this brushes aren't using proxies, so sculpt_combine_proxies() wouldn't
- propagate needed deformation to original base */
+ * propagate needed deformation to original base */
int n, totnode;
Mesh *me= (Mesh*)ob->data;
@@ -2526,8 +2524,8 @@ static void sculpt_flush_stroke_deform(Sculpt *sd, Object *ob)
MEM_freeN(nodes);
/* Modifiers could depend on mesh normals, so we should update them/
- Note, then if sculpting happens on locked key, normals should be re-calculated
- after applying coords from keyblock on base mesh */
+ * Note, then if sculpting happens on locked key, normals should be re-calculated
+ * after applying coords from keyblock on base mesh */
mesh_calc_normals(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL);
} else if (ss->kb)
sculpt_update_keyblock(ob);
@@ -2551,7 +2549,7 @@ static void sculpt_flush_stroke_deform(Sculpt *sd, Object *ob)
//}
/* Flip all the editdata across the axis/axes specified by symm. Used to
- calculate multiple modifications to the mesh when symmetry is enabled. */
+ * calculate multiple modifications to the mesh when symmetry is enabled. */
static void calc_brushdata_symm(Sculpt *sd, StrokeCache *cache, const char symm,
const char axis, const float angle,
const float UNUSED(feather))
@@ -2602,8 +2600,8 @@ static void do_radial_symmetry(Sculpt *sd, Object *ob, Brush *brush,
}
/* noise texture gives different values for the same input coord; this
- can tear a multires mesh during sculpting so do a stitch in this
- case */
+ * can tear a multires mesh during sculpting so do a stitch in this
+ * case */
static void sculpt_fix_noise_tear(Sculpt *sd, Object *ob)
{
SculptSession *ss = ob->sculpt;
@@ -2789,8 +2787,9 @@ static const char *sculpt_tool_name(Sculpt *sd)
}
}
-/**** Operator for applying a stroke (various attributes including mouse path)
- using the current brush. ****/
+/**
+ * Operator for applying a stroke (various attributes including mouse path)
+ * using the current brush. */
static void sculpt_cache_free(StrokeCache *cache)
{
@@ -2867,7 +2866,7 @@ static void sculpt_update_cache_invariants(bContext* C, Sculpt *sd, SculptSessio
cache->alt_smooth = mode == BRUSH_STROKE_SMOOTH;
/* not very nice, but with current events system implementation
- we can't handle brush appearance inversion hotkey separately (sergey) */
+ * we can't handle brush appearance inversion hotkey separately (sergey) */
if(cache->invert) brush->flag |= BRUSH_INVERTED;
else brush->flag &= ~BRUSH_INVERTED;
@@ -3040,10 +3039,10 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
RNA_float_get_array(ptr, "mouse", cache->mouse);
/* XXX: Use preassure value from first brush step for brushes which don't
- support strokes (grab, thumb). They depends on initial state and
- brush coord/pressure/etc.
- It's more an events design issue, which doesn't split coordinate/pressure/angle
- changing events. We should avoid this after events system re-design */
+ * support strokes (grab, thumb). They depends on initial state and
+ * brush coord/pressure/etc.
+ * It's more an events design issue, which doesn't split coordinate/pressure/angle
+ * changing events. We should avoid this after events system re-design */
if(paint_space_stroke_enabled(brush) || cache->first_time)
cache->pressure = RNA_float_get(ptr, "pressure");
@@ -3203,8 +3202,8 @@ static void sculpt_raycast_cb(PBVHNode *node, void *data_v, float* tmin)
}
/* Do a raycast in the tree to find the 3d brush location
- (This allows us to ignore the GL depth buffer)
- Returns 0 if the ray doesn't hit the mesh, non-zero otherwise
+ * (This allows us to ignore the GL depth buffer)
+ * Returns 0 if the ray doesn't hit the mesh, non-zero otherwise
*/
int sculpt_stroke_get_location(bContext *C, float out[3], float mouse[2])
{
@@ -3263,8 +3262,8 @@ static void sculpt_brush_init_tex(const Scene *scene, Sculpt *sd, SculptSession
ntreeTexBeginExecTree(mtex->tex->nodetree, 1); /* has internal flag to detect it only does it once */
/* TODO: Shouldn't really have to do this at the start of every
- stroke, but sculpt would need some sort of notification when
- changes are made to the texture. */
+ * stroke, but sculpt would need some sort of notification when
+ * changes are made to the texture. */
sculpt_update_tex(scene, sd, ss);
}
@@ -3375,7 +3374,7 @@ static void sculpt_flush_update(bContext *C)
}
/* Returns whether the mouse/stylus is over the mesh (1)
- or over the background (0) */
+ * or over the background (0) */
static int over_mesh(bContext *C, struct wmOperator *UNUSED(op), float x, float y)
{
float mouse[2], co[3];
@@ -3404,9 +3403,9 @@ static int sculpt_stroke_test_start(bContext *C, struct wmOperator *op,
#ifdef _OPENMP
/* If using OpenMP then create a number of threads two times the
- number of processor cores.
- Justification: Empirically I've found that two threads per
- processor gives higher throughput. */
+ * number of processor cores.
+ * Justification: Empirically I've found that two threads per
+ * processor gives higher throughput. */
if (sd->flags & SCULPT_USE_OPENMP) {
int num_procs;
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 46a75d3b722..84b8b5a8bce 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -182,7 +182,7 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
continue;
/* check if undo data matches current data well enough to
- continue */
+ * continue */
if(unode->maxvert) {
if(ss->totvert != unode->maxvert)
continue;
@@ -203,8 +203,8 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
if(update) {
int tag_update= 0;
/* we update all nodes still, should be more clever, but also
- needs to work correct when exiting/entering sculpt mode and
- the nodes get recreated, though in that case it could do all */
+ * needs to work correct when exiting/entering sculpt mode and
+ * the nodes get recreated, though in that case it could do all */
BLI_pbvh_search_callback(ss->pbvh, NULL, NULL, update_cb, NULL);
BLI_pbvh_update(ss->pbvh, PBVH_UpdateBB|PBVH_UpdateOriginalBB|PBVH_UpdateRedraw, NULL);
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c
index f0aedae88ac..72e9f861aa9 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -414,8 +414,7 @@ static void uv_sculpt_stroke_exit(bContext *C, wmOperator *op)
if (data->timer) {
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), data->timer);
}
- if (data->elementMap)
- {
+ if (data->elementMap) {
EDBM_free_uv_element_map(data->elementMap);
}
if (data->uv) {
diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c
index 4f145a617f7..8f6a01dc6cd 100644
--- a/source/blender/editors/sound/sound_ops.c
+++ b/source/blender/editors/sound/sound_ops.c
@@ -254,11 +254,11 @@ static int sound_update_animation_flags_exec(bContext *C, wmOperator *UNUSED(op)
static void SOUND_OT_update_animation_flags(wmOperatorType *ot)
{
/*
- This operator is needed to set a correct state of the sound animation
- System. Unfortunately there's no really correct place to call the exec
- function, that's why I made it an operator that's only visible in the
- search menu. Apart from that the bake animation operator calls it too.
- */
+ * This operator is needed to set a correct state of the sound animation
+ * System. Unfortunately there's no really correct place to call the exec
+ * function, that's why I made it an operator that's only visible in the
+ * search menu. Apart from that the bake animation operator calls it too.
+ */
/* identifiers */
ot->name= "Update animation";
@@ -345,8 +345,7 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op)
result = AUD_mixdown(scene->sound_scene, SFRA * specs.rate / FPS, (EFRA - SFRA) * specs.rate / FPS,
accuracy, filename, specs, container, codec, bitrate);
- if(result)
- {
+ if (result) {
BKE_report(op->reports, RPT_ERROR, result);
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index 4baaa469127..7bda0c9a510 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -458,7 +458,7 @@ static void action_refresh(const bContext *C, ScrArea *sa)
}
/* region updates? */
- // XXX resizing y-extents of tot should go here?
+ // XXX re-sizing y-extents of tot should go here?
}
/* only called once, from space/spacetypes.c */
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index 7c5361c8af0..b876003c059 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -145,7 +145,7 @@ void ED_spacetypes_init(void)
/* called in wm.c */
/* keymap definitions are registered only once per WM initialize, usually on file read,
- using the keymap the actual areas/regions add the handlers */
+ * using the keymap the actual areas/regions add the handlers */
void ED_spacetypes_keymap(wmKeyConfig *keyconf)
{
const ListBase *spacetypes;
diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c
index 6927a78332f..fb46dd55a12 100644
--- a/source/blender/editors/space_buttons/buttons_texture.c
+++ b/source/blender/editors/space_buttons/buttons_texture.c
@@ -249,7 +249,7 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext *
void buttons_texture_context_compute(const bContext *C, SpaceButs *sbuts)
{
/* gatheravailable texture users in context. runs on every draw of
- properties editor, before the buttons are created. */
+ * properties editor, before the buttons are created. */
ButsContextTexture *ct= sbuts->texuser;
Scene *scene= CTX_data_scene(C);
@@ -295,7 +295,7 @@ void buttons_texture_context_compute(const bContext *C, SpaceButs *sbuts)
ButsTextureUser *user;
/* detect change of active texture node in same node tree, in that
- case we also automatically switch to the other node */
+ * case we also automatically switch to the other node */
for(user=ct->users.first; user; user=user->next) {
if(user->ntree == ct->user->ntree && user->node != ct->user->node) {
if(user->node->flag & NODE_ACTIVE_TEXTURE) {
@@ -371,8 +371,8 @@ static void template_texture_user_menu(bContext *C, uiLayout *layout, void *UNUS
void uiTemplateTextureUser(uiLayout *layout, bContext *C)
{
/* texture user selection dropdown menu. the available users have been
- gathered before drawing in ButsContextTexture, we merely need to
- display the current item. */
+ * gathered before drawing in ButsContextTexture, we merely need to
+ * display the current item. */
SpaceButs *sbuts = CTX_wm_space_buts(C);
ButsContextTexture *ct= (sbuts)? sbuts->texuser: NULL;
uiBlock *block = uiLayoutGetBlock(layout);
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c
index 42c127df016..920b8dc3ccb 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -686,7 +686,7 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo
glVertex3f(x-tdx, y-tdy, 0);
glEnd();
- /* search resizing triangle */
+ /* search re-sizing triangle */
x= track->search_max[0];
y= track->search_min[1];
@@ -730,7 +730,7 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo
glVertex3f(x-tdx, y-tdy, 0);
glEnd();
- /* pattern resizing triangle */
+ /* pattern re-sizing triangle */
x= track->pat_max[0];
y= track->pat_min[1];
@@ -849,9 +849,9 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
/* ** find window pixel coordinates of origin ** */
/* UI_view2d_to_region_no_clip return integer values, this could
- lead to 1px flickering when view is locked to selection during playbeck.
- to avoid this flickering, calclate base point in the same way as it happens
- in UI_view2d_to_region_no_clip, but do it in floats here */
+ * lead to 1px flickering when view is locked to selection during playbeck.
+ * to avoid this flickering, calculate base point in the same way as it happens
+ * in UI_view2d_to_region_no_clip, but do it in floats here */
view2d_to_region_float(&ar->v2d, 0.0f, 0.0f, &x, &y);
@@ -940,7 +940,7 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
}
/* selected areas only, so selection wouldn't be overlapped by
- non-selected areas */
+ * non-selected areas */
track= tracksbase->first;
fp= marker_pos;
while(track) {
@@ -1317,8 +1317,8 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d)
return;
if(onlyv2d) {
- /* if manual calibration is used then grase pencil data is already
- drawed in draw_distortion */
+ /* if manual calibration is used then grease pencil data is already
+ * drawed in draw_distortion */
if((sc->flag&SC_MANUAL_CALIBRATION)==0 || sc->mode!=SC_MODE_DISTORTION) {
ibuf= ED_space_clip_get_buffer(sc);
diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c
index f902422ab43..aecce3b1ba1 100644
--- a/source/blender/editors/space_clip/clip_graph_ops.c
+++ b/source/blender/editors/space_clip/clip_graph_ops.c
@@ -37,10 +37,12 @@
#include "BLI_utildefines.h"
#include "BLI_math.h"
#include "BLI_listbase.h"
+#include "BLI_rect.h"
#include "BKE_context.h"
#include "BKE_movieclip.h"
#include "BKE_tracking.h"
+#include "BKE_depsgraph.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -82,13 +84,13 @@ static void toggle_selection_cb(void *userdata, MovieTrackingMarker *marker)
switch(data->action) {
case SEL_SELECT:
- marker->flag|= (MARKER_GRAPH_SEL_X|MARKER_GRAPH_SEL_Y);
+ marker->flag|= MARKER_GRAPH_SEL;
break;
case SEL_DESELECT:
- marker->flag&= ~(MARKER_GRAPH_SEL_X|MARKER_GRAPH_SEL_Y);
+ marker->flag&= ~MARKER_GRAPH_SEL;
break;
case SEL_INVERT:
- marker->flag^= (MARKER_GRAPH_SEL_X|MARKER_GRAPH_SEL_Y);
+ marker->flag^= MARKER_GRAPH_SEL;
break;
}
}
@@ -304,6 +306,158 @@ void CLIP_OT_graph_select(wmOperatorType *ot)
"Extend", "Extend selection rather than clearing the existing selection");
}
+/********************** border select operator *********************/
+
+typedef struct BorderSelectuserData {
+ rctf rect;
+ int change, mode, extend;
+} BorderSelectuserData;
+
+static void border_select_cb(void *userdata, MovieTrackingTrack *UNUSED(track),
+ MovieTrackingMarker *marker, int coord, float val)
+{
+ BorderSelectuserData *data = (BorderSelectuserData *) userdata;
+
+ if (BLI_in_rctf(&data->rect, marker->framenr, val)) {
+ int flag = 0;
+
+ if (coord == 0)
+ flag = MARKER_GRAPH_SEL_X;
+ else
+ flag = MARKER_GRAPH_SEL_Y;
+
+ if (data->mode == GESTURE_MODAL_SELECT)
+ marker->flag |= flag;
+ else
+ marker->flag &= ~flag;
+
+ data->change = TRUE;
+ }
+ else if (!data->extend) {
+ marker->flag&= ~MARKER_GRAPH_SEL;
+ }
+}
+
+static int border_select_graph_exec(bContext *C, wmOperator *op)
+{
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ ARegion *ar = CTX_wm_region(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking= &clip->tracking;
+ MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking);
+ BorderSelectuserData userdata;
+ rcti rect;
+
+ /* get rectangle from operator */
+ rect.xmin = RNA_int_get(op->ptr, "xmin");
+ rect.ymin = RNA_int_get(op->ptr, "ymin");
+ rect.xmax = RNA_int_get(op->ptr, "xmax");
+ rect.ymax = RNA_int_get(op->ptr, "ymax");
+
+ UI_view2d_region_to_view(&ar->v2d, rect.xmin, rect.ymin, &userdata.rect.xmin, &userdata.rect.ymin);
+ UI_view2d_region_to_view(&ar->v2d, rect.xmax, rect.ymax, &userdata.rect.xmax, &userdata.rect.ymax);
+
+ userdata.change = FALSE;
+ userdata.mode = RNA_int_get(op->ptr, "gesture_mode");
+ userdata.extend = RNA_boolean_get(op->ptr, "extend");
+
+ clip_graph_tracking_values_iterate_track(sc, act_track, &userdata, border_select_cb, NULL, NULL);
+
+ if (userdata.change) {
+ WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
+
+ return OPERATOR_FINISHED;
+ }
+
+ return OPERATOR_CANCELLED;
+}
+
+void CLIP_OT_graph_select_border(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Border Select";
+ ot->description = "Select curve points using border selection";
+ ot->idname = "CLIP_OT_graph_select_border";
+
+ /* api callbacks */
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = border_select_graph_exec;
+ ot->modal = WM_border_select_modal;
+ ot->poll = ED_space_clip_graph_poll;
+
+ /* flags */
+ ot->flag = OPTYPE_UNDO;
+
+ /* properties */
+ WM_operator_properties_gesture_border(ot, TRUE);
+}
+
+/********************** select all operator *********************/
+
+static int graph_select_all_markers_exec(bContext *C, wmOperator *op)
+{
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking);
+ MovieTrackingMarker *marker;
+ int action = RNA_enum_get(op->ptr, "action");
+ int a;
+
+ if (!act_track)
+ return OPERATOR_CANCELLED;
+
+ if (action == SEL_TOGGLE) {
+ action = SEL_SELECT;
+
+ for (a = 0; a < act_track->markersnr; a++) {
+ marker = &act_track->markers[a];
+
+ if (marker->flag & MARKER_GRAPH_SEL) {
+ action = SEL_DESELECT;
+ break;
+ }
+ }
+ }
+
+ for (a = 0; a < act_track->markersnr; a++) {
+ marker = &act_track->markers[a];
+
+ switch (action) {
+ case SEL_SELECT:
+ marker->flag |= MARKER_GRAPH_SEL;
+ break;
+ case SEL_DESELECT:
+ marker->flag &= ~MARKER_GRAPH_SEL;
+ break;
+ case SEL_INVERT:
+ marker->flag ^= MARKER_GRAPH_SEL;
+ break;
+ }
+ }
+
+ WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
+
+ return OPERATOR_FINISHED;
+}
+
+void CLIP_OT_graph_select_all_markers(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Select or Deselect All Markers";
+ ot->description = "Change selection of all markers of active track";
+ ot->idname = "CLIP_OT_graph_select_all_markers";
+
+ /* api callbacks */
+ ot->exec = graph_select_all_markers_exec;
+ ot->poll = ED_space_clip_graph_poll;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ WM_operator_properties_select_all(ot);
+}
+
/******************** delete curve operator ********************/
static int delete_curve_exec(bContext *C, wmOperator *UNUSED(op))
@@ -352,7 +506,7 @@ static int delete_knot_exec(bContext *C, wmOperator *UNUSED(op))
while(a<act_track->markersnr) {
MovieTrackingMarker *marker= &act_track->markers[a];
- if(marker->flag & (MARKER_GRAPH_SEL_X|MARKER_GRAPH_SEL_Y))
+ if(marker->flag & MARKER_GRAPH_SEL)
clip_delete_marker(C, clip, tracksbase, act_track, marker);
else
a++;
@@ -480,3 +634,63 @@ void CLIP_OT_graph_center_current_frame(wmOperatorType *ot)
ot->exec = center_current_frame_exec;
ot->poll = ED_space_clip_graph_poll;
}
+
+/********************** disable markers operator *********************/
+
+static int graph_disable_markers_exec(bContext *C, wmOperator *op)
+{
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingTrack *act_track = BKE_tracking_active_track(tracking);
+ MovieTrackingMarker *marker;
+ int action = RNA_enum_get(op->ptr, "action");
+ int a;
+
+ if (!act_track || (act_track->flag & TRACK_LOCKED))
+ return OPERATOR_CANCELLED;
+
+ for (a = 0; a < act_track->markersnr; a++) {
+ marker = &act_track->markers[a];
+
+ if (marker->flag & MARKER_GRAPH_SEL) {
+ if (action==0)
+ marker->flag |= MARKER_DISABLED;
+ else if(action==1)
+ marker->flag &= ~MARKER_DISABLED;
+ else
+ marker->flag ^= MARKER_DISABLED;
+ }
+ }
+
+ DAG_id_tag_update(&clip->id, 0);
+
+ WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip);
+
+ return OPERATOR_FINISHED;
+}
+
+void CLIP_OT_graph_disable_markers(wmOperatorType *ot)
+{
+ static EnumPropertyItem actions_items[] = {
+ {0, "DISABLE", 0, "Disable", "Disable selected markers"},
+ {1, "ENABLE", 0, "Enable", "Enable selected markers"},
+ {2, "TOGGLE", 0, "Toggle", "Toggle disabled flag for selected markers"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ /* identifiers */
+ ot->name = "Disable Markers";
+ ot->description = "Disable/enable selected markers";
+ ot->idname = "CLIP_OT_graph_disable_markers";
+
+ /* api callbacks */
+ ot->exec = graph_disable_markers_exec;
+ ot->poll = ED_space_clip_graph_poll;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ /* properties */
+ RNA_def_enum(ot->srna, "action", actions_items, 0, "Action", "Disable action to execute");
+}
diff --git a/source/blender/editors/space_clip/clip_intern.h b/source/blender/editors/space_clip/clip_intern.h
index c0b7137b5d8..8d4da7e995c 100644
--- a/source/blender/editors/space_clip/clip_intern.h
+++ b/source/blender/editors/space_clip/clip_intern.h
@@ -58,10 +58,13 @@ void clip_draw_graph(struct SpaceClip *sc, struct ARegion *ar, struct Scene *sce
void ED_clip_graph_center_current_frame(struct Scene *scene, struct ARegion *ar);
void CLIP_OT_graph_select(struct wmOperatorType *ot);
+void CLIP_OT_graph_select_border(struct wmOperatorType *ot);
+void CLIP_OT_graph_select_all_markers(struct wmOperatorType *ot);
void CLIP_OT_graph_delete_curve(struct wmOperatorType *ot);
void CLIP_OT_graph_delete_knot(struct wmOperatorType *ot);
void CLIP_OT_graph_view_all(struct wmOperatorType *ot);
void CLIP_OT_graph_center_current_frame(struct wmOperatorType *ot);
+void CLIP_OT_graph_disable_markers(struct wmOperatorType *ot);
/* clip_ops.c */
void CLIP_OT_open(struct wmOperatorType *ot);
@@ -125,7 +128,7 @@ void CLIP_OT_hide_tracks_clear(struct wmOperatorType *ot);
void CLIP_OT_lock_tracks(struct wmOperatorType *ot);
void CLIP_OT_set_origin(struct wmOperatorType *ot);
-void CLIP_OT_set_floor(struct wmOperatorType *ot);
+void CLIP_OT_set_plane(struct wmOperatorType *ot);
void CLIP_OT_set_axis(struct wmOperatorType *ot);
void CLIP_OT_set_scale(struct wmOperatorType *ot);
void CLIP_OT_set_solution_scale(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index 99ee4974659..552c62936b6 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -649,12 +649,14 @@ void CLIP_OT_view_zoom_ratio(wmOperatorType *ot)
/********************** view all operator *********************/
-static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
+static int view_all_exec(bContext *C, wmOperator *op)
{
SpaceClip *sc;
ARegion *ar;
int w, h, width, height;
float aspx, aspy;
+ int fit_view= RNA_boolean_get(op->ptr, "fit_view");
+ float zoomx, zoomy;
/* retrieve state */
sc= CTX_wm_space_clip(C);
@@ -670,16 +672,25 @@ static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
width= ar->winrct.xmax - ar->winrct.xmin + 1;
height= ar->winrct.ymax - ar->winrct.ymin + 1;
- if((w >= width || h >= height) && (width > 0 && height > 0)) {
- float zoomx, zoomy;
+ if(fit_view) {
+ const int margin = 5; /* margin from border */
- /* find the zoom value that will fit the image in the image space */
- zoomx= (float)width/w;
- zoomy= (float)height/h;
- sclip_zoom_set(sc, ar, 1.0f/power_of_2(1/MIN2(zoomx, zoomy)), NULL);
+ zoomx= (float)width / (w + 2*margin);
+ zoomy= (float)height / (h + 2*margin);
+
+ sclip_zoom_set(sc, ar, MIN2(zoomx, zoomy), NULL);
+ }
+ else {
+ if((w >= width || h >= height) && (width > 0 && height > 0)) {
+ zoomx= (float)width/w;
+ zoomy= (float)height/h;
+
+ /* find the zoom value that will fit the image in the image space */
+ sclip_zoom_set(sc, ar, 1.0f/power_of_2(1/MIN2(zoomx, zoomy)), NULL);
+ }
+ else
+ sclip_zoom_set(sc, ar, 1.0f, NULL);
}
- else
- sclip_zoom_set(sc, ar, 1.0f, NULL);
sc->xof= sc->yof= 0.0f;
@@ -697,6 +708,9 @@ void CLIP_OT_view_all(wmOperatorType *ot)
/* api callbacks */
ot->exec= view_all_exec;
ot->poll= ED_space_clip_poll;
+
+ /* properties */
+ RNA_def_boolean(ot->srna, "fit_view", 0, "Fit View", "Fit frame to the viewport");
}
/********************** view selected operator *********************/
@@ -884,14 +898,12 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog
Scene *scene=pj->scene;
MovieClip *clip= pj->clip;
struct MovieDistortion *distortion= NULL;
- short tc_flag, size_flag, quality;
+ short size_flag;
int cfra, sfra= SFRA, efra= EFRA;
int build_sizes[4], build_count= 0;
int build_undistort_sizes[4], build_undistort_count= 0;
- tc_flag= clip->proxy.build_tc_flag;
size_flag= clip->proxy.build_size_flag;
- quality= clip->proxy.quality;
build_count= proxy_bitflag_to_array(size_flag, build_sizes, 0);
build_undistort_count= proxy_bitflag_to_array(size_flag, build_undistort_sizes, 1);
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index 9edf4fab280..a92830e1992 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -347,7 +347,7 @@ static void clip_operatortypes(void)
/* orientation */
WM_operatortype_append(CLIP_OT_set_origin);
- WM_operatortype_append(CLIP_OT_set_floor);
+ WM_operatortype_append(CLIP_OT_set_plane);
WM_operatortype_append(CLIP_OT_set_axis);
WM_operatortype_append(CLIP_OT_set_scale);
WM_operatortype_append(CLIP_OT_set_solution_scale);
@@ -368,13 +368,6 @@ static void clip_operatortypes(void)
WM_operatortype_append(CLIP_OT_clean_tracks);
- /* graph editing */
- WM_operatortype_append(CLIP_OT_graph_select);
- WM_operatortype_append(CLIP_OT_graph_delete_curve);
- WM_operatortype_append(CLIP_OT_graph_delete_knot);
- WM_operatortype_append(CLIP_OT_graph_view_all);
- WM_operatortype_append(CLIP_OT_graph_center_current_frame);
-
/* object tracking */
WM_operatortype_append(CLIP_OT_tracking_object_new);
WM_operatortype_append(CLIP_OT_tracking_object_remove);
@@ -382,6 +375,22 @@ static void clip_operatortypes(void)
/* clipboard */
WM_operatortype_append(CLIP_OT_copy_tracks);
WM_operatortype_append(CLIP_OT_paste_tracks);
+
+ /* ** clip_graph_ops.c ** */
+
+ /* graph editing */
+
+ /* selection */
+ WM_operatortype_append(CLIP_OT_graph_select);
+ WM_operatortype_append(CLIP_OT_graph_select_border);
+ WM_operatortype_append(CLIP_OT_graph_select_all_markers);
+
+ WM_operatortype_append(CLIP_OT_graph_delete_curve);
+ WM_operatortype_append(CLIP_OT_graph_delete_knot);
+ WM_operatortype_append(CLIP_OT_graph_view_all);
+ WM_operatortype_append(CLIP_OT_graph_center_current_frame);
+
+ WM_operatortype_append(CLIP_OT_graph_disable_markers);
}
static void clip_keymap(struct wmKeyConfig *keyconf)
@@ -452,6 +461,10 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
RNA_float_set(WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_ratio", PAD8, KM_PRESS, 0, 0)->ptr, "ratio", 0.125f);
WM_keymap_add_item(keymap, "CLIP_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
+
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_view_all", FKEY, KM_PRESS, 0, 0);
+ RNA_boolean_set(kmi->ptr, "fit_view", TRUE);
+
WM_keymap_add_item(keymap, "CLIP_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0);
/* jump to special frame */
@@ -513,13 +526,6 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks_clear", HKEY, KM_PRESS, KM_ALT, 0);
/* clean-up */
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT, 0);
- RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_REMAINED);
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_SHIFT, 0);
- RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_UPTO);
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0);
- RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_ALL);
-
WM_keymap_add_item(keymap, "CLIP_OT_join_tracks", JKEY, KM_PRESS, KM_CTRL, 0);
/* menus */
@@ -540,6 +546,17 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
transform_keymap_for_space(keyconf, keymap, SPACE_CLIP);
+ /* clean-up */
+ kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT, 0);
+ RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_REMAINED);
+ RNA_boolean_set(kmi->ptr, "clear_active", FALSE);
+ kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_SHIFT, 0);
+ RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_UPTO);
+ RNA_boolean_set(kmi->ptr, "clear_active", FALSE);
+ kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0);
+ RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_ALL);
+ RNA_boolean_set(kmi->ptr, "clear_active", FALSE);
+
/* ******** Hotkeys avalaible for preview region only ******** */
keymap= WM_keymap_find(keyconf, "Clip Graph Editor", SPACE_CLIP, 0);
@@ -553,6 +570,13 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
kmi = WM_keymap_add_item(keymap, "CLIP_OT_graph_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_graph_select_all_markers", AKEY, KM_PRESS, 0, 0);
+ RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_graph_select_all_markers", IKEY, KM_PRESS, KM_CTRL, 0);
+ RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
+
+ WM_keymap_add_item(keymap, "CLIP_OT_graph_select_border", BKEY, KM_PRESS, 0, 0);
+
/* delete */
WM_keymap_add_item(keymap, "CLIP_OT_graph_delete_curve", DELKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "CLIP_OT_graph_delete_curve", XKEY, KM_PRESS, 0, 0);
@@ -567,6 +591,21 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", LKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "data_path", "space_data.lock_time_cursor");
+ /* clean-up */
+ kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT, 0);
+ RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_REMAINED);
+ RNA_boolean_set(kmi->ptr, "clear_active", TRUE);
+ kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_SHIFT, 0);
+ RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_UPTO);
+ RNA_boolean_set(kmi->ptr, "clear_active", TRUE);
+ kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0);
+ RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_ALL);
+ RNA_boolean_set(kmi->ptr, "clear_active", TRUE);
+
+ /* tracks */
+ kmi= WM_keymap_add_item(keymap, "CLIP_OT_graph_disable_markers", DKEY, KM_PRESS, KM_SHIFT, 0);
+ RNA_enum_set(kmi->ptr, "action", 2); /* toggle */
+
transform_keymap_for_space(keyconf, keymap, SPACE_CLIP);
}
@@ -724,8 +763,8 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar)
Scene *scene= CTX_data_scene(C);
MovieClip *clip= ED_space_clip(sc);
- /* if trcking is in progress, we should sunchronize framenr from clipuser
- so latest tracked frame would be shown */
+ /* if tracking is in progress, we should synchronize framenr from clipuser
+ * so latest tracked frame would be shown */
if(clip && clip->tracking_context)
BKE_tracking_sync_user(&sc->user, clip->tracking_context);
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index 18a5d8689c8..b4990180b19 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -334,7 +334,7 @@ static SlideMarkerData *create_slide_marker_data(SpaceClip *sc, MovieTrackingTra
}
/* corner = 0: right-bottom corner,
- corner = 1: left-top corner */
+ * corner = 1: left-top corner */
static int mouse_on_corner(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker,
int area, float co[2], int corner, int width, int height)
{
@@ -1170,7 +1170,7 @@ void CLIP_OT_select_grouped(wmOperatorType *ot)
/* identifiers */
ot->name= "Select Grouped";
- ot->description= "Joint Selected Tracks";
+ ot->description= "Select all tracks from specified group";
ot->idname= "CLIP_OT_select_grouped";
/* api callbacks */
@@ -1327,11 +1327,11 @@ static int track_markers_initjob(bContext *C, TrackMarkersJob *tmj, int backward
tmj->lastfra= tmj->sfra;
- /* XXX: silly to store this, but this data is needed to update scene and movieclip
- frame numbers when tracking is finished. This introduces better feedback for artists.
- Maybe there's another way to solve this problem, but can't think better way atm.
- Anyway, this way isn't more unstable as animation rendering animation
- which uses the same approach (except storing screen). */
+ /* XXX: silly to store this, but this data is needed to update scene and movie-clip
+ * frame numbers when tracking is finished. This introduces better feedback for artists.
+ * Maybe there's another way to solve this problem, but can't think better way atm.
+ * Anyway, this way isn't more unstable as animation rendering animation
+ * which uses the same approach (except storing screen). */
tmj->scene= scene;
tmj->main= CTX_data_main(C);
tmj->screen= CTX_wm_screen(C);
@@ -1348,10 +1348,10 @@ static void track_markers_startjob(void *tmv, short *stop, short *do_update, flo
while(framenr != tmj->efra) {
if(tmj->delay>0) {
/* tracking should happen with fixed fps. Calculate time
- using current timer value before tracking frame and after.
-
- Small (and maybe unneeded optimization): do not calculate exec_time
- for "Fastest" tracking */
+ * using current timer value before tracking frame and after.
+ *
+ * Small (and maybe unneeded optimization): do not calculate exec_time
+ * for "Fastest" tracking */
double start_time= PIL_check_seconds_timer(), exec_time;
@@ -1493,9 +1493,9 @@ static int track_markers_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
WM_jobs_customdata(steve, tmj, track_markers_freejob);
/* if there's delay set in tracking job, tracking should happen
- with fixed FPS. To deal with editor refresh we have to syncronize
- tracks from job and tracks in clip. Do this in timer callback
- to prevent threading conflicts. */
+ * with fixed FPS. To deal with editor refresh we have to synchronize
+ * tracks from job and tracks in clip. Do this in timer callback
+ * to prevent threading conflicts. */
if(tmj->delay>0) WM_jobs_timer(steve, tmj->delay/1000.0f, NC_MOVIECLIP|NA_EVALUATED, 0);
else WM_jobs_timer(steve, 0.2, NC_MOVIECLIP|NA_EVALUATED, 0);
@@ -1627,7 +1627,7 @@ static void solve_camera_freejob(void *scv)
if(!solved)
BKE_report(scj->reports, RPT_WARNING, "Some data failed to reconstruct, see console for details");
else
- BKE_reportf(scj->reports, RPT_INFO, "Average reprojection error %.3f", tracking->reconstruction.error);
+ BKE_reportf(scj->reports, RPT_INFO, "Average re-projection error %.3f", tracking->reconstruction.error);
/* set currently solved clip as active for scene */
if(scene->clip)
@@ -1824,13 +1824,20 @@ static int clear_track_path_exec(bContext *C, wmOperator *op)
MovieTrackingTrack *track;
ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
int action= RNA_enum_get(op->ptr, "action");
+ int clear_active= RNA_boolean_get(op->ptr, "clear_active");
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track))
- BKE_tracking_clear_path(track, sc->user.framenr, action);
+ if (clear_active) {
+ track= BKE_tracking_active_track(&clip->tracking);
+ BKE_tracking_clear_path(track, sc->user.framenr, action);
+ }
+ else {
+ track= tracksbase->first;
+ while(track) {
+ if(TRACK_VIEW_SELECTED(sc, track))
+ BKE_tracking_clear_path(track, sc->user.framenr, action);
- track= track->next;
+ track= track->next;
+ }
}
WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip);
@@ -1861,6 +1868,7 @@ void CLIP_OT_clear_track_path(wmOperatorType *ot)
/* proeprties */
RNA_def_enum(ot->srna, "action", clear_path_actions, TRACK_CLEAR_REMAINED, "Action", "Clear action to execute");
+ RNA_def_boolean(ot->srna, "clear_active", 0, "Clear Active", "Clear active track only instead of all selected tracks");
}
/********************** disable markers operator *********************/
@@ -2248,7 +2256,7 @@ static void set_axis(Scene *scene, Object *ob, MovieClip *clip, MovieTrackingOb
object_apply_mat4(ob, mat, 0, 0);
}
-static int set_floor_exec(bContext *C, wmOperator *op)
+static int set_plane_exec(bContext *C, wmOperator *op)
{
SpaceClip *sc= CTX_wm_space_clip(C);
MovieClip *clip= ED_space_clip(sc);
@@ -2261,6 +2269,7 @@ static int set_floor_exec(bContext *C, wmOperator *op)
Object *camera= get_camera_with_movieclip(scene, clip);
int tot= 0;
float vec[3][3], mat[4][4], obmat[4][4], newmat[4][4], orig[3]= {0.0f, 0.0f, 0.0f};
+ int plane= RNA_enum_get(op->ptr, "plane");
float rot[4][4]={{0.0f, 0.0f, -1.0f, 0.0f},
{0.0f, 1.0f, 0.0f, 0.0f},
{1.0f, 0.0f, 0.0f, 0.0f},
@@ -2308,9 +2317,16 @@ static int set_floor_exec(bContext *C, wmOperator *op)
/* construct ortho-normal basis */
unit_m4(mat);
- cross_v3_v3v3(mat[0], vec[1], vec[2]);
- copy_v3_v3(mat[1], vec[1]);
- cross_v3_v3v3(mat[2], mat[0], mat[1]);
+ if (plane == 0) { /* floor */
+ cross_v3_v3v3(mat[0], vec[1], vec[2]);
+ copy_v3_v3(mat[1], vec[1]);
+ cross_v3_v3v3(mat[2], mat[0], mat[1]);
+ }
+ else if (plane == 1) { /* wall */
+ cross_v3_v3v3(mat[2], vec[1], vec[2]);
+ copy_v3_v3(mat[1], vec[1]);
+ cross_v3_v3v3(mat[0], mat[1], mat[2]);
+ }
normalize_v3(mat[0]);
normalize_v3(mat[1]);
@@ -2352,19 +2368,28 @@ static int set_floor_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void CLIP_OT_set_floor(wmOperatorType *ot)
+void CLIP_OT_set_plane(wmOperatorType *ot)
{
+ static EnumPropertyItem plane_items[] = {
+ {0, "FLOOR", 0, "Floor", "Set floor plane"},
+ {1, "WALL", 0, "Wall", "Set wall plane"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
/* identifiers */
- ot->name= "Set Floor";
- ot->description= "Set floor based on 3 selected bundles by moving camera (or it's parent if present) in 3D space";
- ot->idname= "CLIP_OT_set_floor";
+ ot->name= "Set Plane";
+ ot->description= "Set plane based on 3 selected bundles by moving camera (or it's parent if present) in 3D space";
+ ot->idname= "CLIP_OT_set_plane";
/* api callbacks */
- ot->exec= set_floor_exec;
+ ot->exec= set_plane_exec;
ot->poll= set_orientation_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ /* properties */
+ RNA_def_enum(ot->srna, "plane", plane_items, 0, "Plane", "Plane to be sued for orientation");
}
/********************** set axis operator *********************/
@@ -2949,6 +2974,9 @@ static int join_tracks_exec(bContext *C, wmOperator *op)
if(TRACK_VIEW_SELECTED(sc, track) && track!=act_track) {
BKE_tracking_join_tracks(act_track, track);
+ if(tracking->stabilization.rot_track == track)
+ tracking->stabilization.rot_track= act_track;
+
BKE_tracking_free_track(track);
BLI_freelinkN(tracksbase, track);
}
@@ -3332,7 +3360,7 @@ static int is_track_clean(MovieTrackingTrack *track, int frames, int del)
}
else if(markers[a].flag&MARKER_DISABLED) {
/* current segment which would be deleted was finished by disabled marker,
- so next segment should be started from disabled marker */
+ * so next segment should be started from disabled marker */
start_disabled= 1;
}
}
@@ -3455,7 +3483,7 @@ void CLIP_OT_clean_tracks(wmOperatorType *ot)
/* properties */
RNA_def_int(ot->srna, "frames", 0, 0, INT_MAX, "Tracked Frames", "Effect on tracks which are tracked less than specified amount of frames", 0, INT_MAX);
- RNA_def_float(ot->srna, "error", 0.0f, 0.0f, FLT_MAX, "Reprojection Error", "Effect on tracks with have got larger reprojection error", 0.0f, 100.0f);
+ RNA_def_float(ot->srna, "error", 0.0f, 0.0f, FLT_MAX, "Reprojection Error", "Effect on tracks with have got larger re-projection error", 0.0f, 100.0f);
RNA_def_enum(ot->srna, "action", actions_items, 0, "Action", "Cleanup action to execute");
}
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c
index 9640701965c..b52bc75eac8 100644
--- a/source/blender/editors/space_console/console_ops.c
+++ b/source/blender/editors/space_console/console_ops.c
@@ -34,7 +34,9 @@
#include "DNA_userdef_types.h"
-#include "BLI_blenlib.h"
+#include "BLI_listbase.h"
+#include "BLI_string_cursor_utf8.h"
+#include "BLI_string.h"
#include "BLI_dynstr.h"
#include "BLI_utildefines.h"
@@ -115,43 +117,20 @@ static ConsoleLine * console_history_find(SpaceConsole *sc, const char *str, Con
static int console_line_cursor_set(ConsoleLine *cl, int cursor)
{
int cursor_new;
+
+ if (cursor < 0) cursor_new = 0;
+ else if (cursor > cl->len) cursor_new = cl->len;
+ else cursor_new = cursor;
- if(cursor < 0) cursor_new= 0;
- else if(cursor > cl->len) cursor_new= cl->len;
- else cursor_new= cursor;
-
- if(cursor_new == cl->cursor)
- return 0;
+ if (cursor_new == cl->cursor) {
+ return FALSE;
+ }
- cl->cursor= cursor_new;
- return 1;
-}
-
-static char cursor_char(ConsoleLine *cl)
-{
- /* assume cursor is clamped */
- return cl->line[cl->cursor];
-}
-
-static char cursor_char_prev(ConsoleLine *cl)
-{
- /* assume cursor is clamped */
- if(cl->cursor <= 0)
- return '\0';
-
- return cl->line[cl->cursor-1];
+ cl->cursor = cursor_new;
+ return TRUE;
}
#if 0 // XXX unused
-static char cursor_char_next(ConsoleLine *cl)
-{
- /* assume cursor is clamped */
- if(cl->cursor + 1 >= cl->len)
- return '\0';
-
- return cl->line[cl->cursor+1];
-}
-
static void console_lb_debug__internal(ListBase *lb)
{
ConsoleLine *cl;
@@ -297,50 +276,53 @@ static int console_move_exec(bContext *C, wmOperator *op)
int type= RNA_enum_get(op->ptr, "type");
int done= 0;
+ int pos;
- switch(type) {
+ switch (type) {
case LINE_BEGIN:
- done= console_line_cursor_set(ci, 0);
+ pos = ci->cursor;
+ BLI_str_cursor_step_utf8(ci->line, ci->len,
+ &pos, STRCUR_DIR_PREV,
+ STRCUR_JUMP_ALL);
+ done = console_line_cursor_set(ci, pos);
break;
case LINE_END:
- done= console_line_cursor_set(ci, INT_MAX);
+ pos = ci->cursor;
+ BLI_str_cursor_step_utf8(ci->line, ci->len,
+ &pos, STRCUR_DIR_NEXT,
+ STRCUR_JUMP_ALL);
+ done = console_line_cursor_set(ci, pos);
break;
case PREV_CHAR:
- done= console_line_cursor_set(ci, ci->cursor-1);
+ pos = ci->cursor;
+ BLI_str_cursor_step_utf8(ci->line, ci->len,
+ &pos, STRCUR_DIR_PREV,
+ STRCUR_JUMP_NONE);
+ done = console_line_cursor_set(ci, pos);
break;
case NEXT_CHAR:
- done= console_line_cursor_set(ci, ci->cursor+1);
+ pos = ci->cursor;
+ BLI_str_cursor_step_utf8(ci->line, ci->len,
+ &pos, STRCUR_DIR_NEXT,
+ STRCUR_JUMP_NONE);
+ done = console_line_cursor_set(ci, pos);
break;
/* - if the character is a delimiter then skip delimiters (including white space)
* - when jump over the word */
case PREV_WORD:
- while(text_check_delim(cursor_char_prev(ci)))
- if(console_line_cursor_set(ci, ci->cursor-1)==FALSE)
- break;
-
- while(text_check_delim(cursor_char_prev(ci))==FALSE)
- if(console_line_cursor_set(ci, ci->cursor-1)==FALSE)
- break;
-
- /* This isnt used for NEXT_WORD because when going back
- * its more useful to have the cursor directly after a word then whitespace */
- while(text_check_whitespace(cursor_char_prev(ci))==TRUE)
- if(console_line_cursor_set(ci, ci->cursor-1)==FALSE)
- break;
-
- done= 1; /* assume changed */
+ pos = ci->cursor;
+ BLI_str_cursor_step_utf8(ci->line, ci->len,
+ &pos, STRCUR_DIR_PREV,
+ STRCUR_JUMP_DELIM);
+ done = console_line_cursor_set(ci, pos);
break;
case NEXT_WORD:
- while(text_check_delim(cursor_char(ci))==TRUE)
- if (console_line_cursor_set(ci, ci->cursor+1)==FALSE)
- break;
-
- while(text_check_delim(cursor_char(ci))==FALSE)
- if (console_line_cursor_set(ci, ci->cursor+1)==FALSE)
- break;
-
- done= 1; /* assume changed */
+ pos = ci->cursor;
+ BLI_str_cursor_step_utf8(ci->line, ci->len,
+ &pos, STRCUR_DIR_NEXT,
+ STRCUR_JUMP_DELIM);
+ done = console_line_cursor_set(ci, pos);
break;
}
@@ -925,12 +907,13 @@ static void console_cursor_set_exit(bContext *UNUSED(C), wmOperator *op)
// SpaceConsole *sc= CTX_wm_space_console(C);
SetConsoleCursor *scu= op->customdata;
- /*
+#if 0
if(txt_has_sel(text)) {
buffer = txt_sel_to_buf(text);
WM_clipboard_text_set(buffer, 1);
MEM_freeN(buffer);
- }*/
+ }
+#endif
MEM_freeN(scu);
}
diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c
index 3df8e98be3a..d781179249b 100644
--- a/source/blender/editors/space_console/space_console.c
+++ b/source/blender/editors/space_console/space_console.c
@@ -136,7 +136,7 @@ static void console_main_area_init(wmWindowManager *wm, ARegion *ar)
wmKeyMap *keymap;
ListBase *lb;
- const float prev_y_min= ar->v2d.cur.ymin; /* so resizing keeps the cursor visible */
+ const float prev_y_min= ar->v2d.cur.ymin; /* so re-sizing keeps the cursor visible */
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
@@ -297,7 +297,7 @@ static void console_keymap(struct wmKeyConfig *keyconf)
RNA_boolean_set(kmi->ptr, "reverse", TRUE);
WM_keymap_add_item(keymap, "CONSOLE_OT_history_cycle", DOWNARROWKEY, KM_PRESS, 0, 0);
- /*
+#if 0
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", LEFTARROWKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", PREV_WORD);
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", RIGHTARROWKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", NEXT_WORD);
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", UPARROWKEY, KM_PRESS, 0, 0)->ptr, "type", PREV_LINE);
@@ -311,7 +311,7 @@ static void console_keymap(struct wmKeyConfig *keyconf)
//RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0)->ptr, "type", DEL_PREV_CHAR);
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_delete", DELKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", DEL_NEXT_WORD);
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_delete", BACKSPACEKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", DEL_PREV_WORD);
- */
+#endif
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_delete", DELKEY, KM_PRESS, 0, 0)->ptr, "type", DEL_NEXT_CHAR);
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0)->ptr, "type", DEL_PREV_CHAR);
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 33d14ec38ae..462e7030805 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -221,12 +221,10 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
/* Execute / cancel buttons. */
if(loadbutton) {
- uiDefButO(block, BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, params->title,
- max_x - loadbutton, line1_y, loadbutton, btn_h,
- params->title);
+ uiDefButO(block, BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, IFACE_(params->title),
+ max_x - loadbutton, line1_y, loadbutton, btn_h, TIP_(params->title));
uiDefButO(block, BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, IFACE_("Cancel"),
- max_x - loadbutton, line2_y, loadbutton, btn_h,
- TIP_("Cancel"));
+ max_x - loadbutton, line2_y, loadbutton, btn_h, TIP_("Cancel"));
}
uiEndBlock(C, block);
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 548a51d9ee2..f663307507a 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -215,8 +215,7 @@ static FileSelect file_select(bContext* C, const rcti* rect, FileSelType select,
if (sel.first != sel.last) select = 0;
/* Do we have a valid selection and are we actually selecting */
- if ( (sel.last >= 0) && ((select == FILE_SEL_ADD) || (select == FILE_SEL_TOGGLE)) )
- {
+ if ((sel.last >= 0) && ((select == FILE_SEL_ADD) || (select == FILE_SEL_TOGGLE))) {
/* Check last selection, if selected, act on the file or dir */
if (filelist_is_selected(sfile->files, sel.last, check_type)) {
retval = file_select_do(C, sel.last);
@@ -735,7 +734,7 @@ int file_exec(bContext *C, wmOperator *exec_op)
wmOperator *op= sfile->op;
/* when used as a macro, for doubleclick,
- to prevent closing when doubleclicking on .. item */
+ * to prevent closing when doubleclicking on .. item */
if (RNA_boolean_get(exec_op->ptr, "need_active")) {
int i, active=0;
@@ -996,8 +995,8 @@ void FILE_OT_smoothscroll(wmOperatorType *ot)
/* create a new, non-existing folder name, returns 1 if successful, 0 if name couldn't be created.
- The actual name is returned in 'name', 'folder' contains the complete path, including the new folder name.
-*/
+ * The actual name is returned in 'name', 'folder' contains the complete path, including the new folder name.
+ */
static int new_folder_path(const char* parent, char *folder, char *name)
{
int i = 1;
@@ -1006,8 +1005,8 @@ static int new_folder_path(const char* parent, char *folder, char *name)
BLI_strncpy(name, "New Folder", FILE_MAXFILE);
BLI_join_dirfile(folder, FILE_MAX, parent, name); /* XXX, not real length */
/* check whether folder with the name already exists, in this case
- add number to the name. Check length of generated name to avoid
- crazy case of huge number of folders each named 'New Folder (x)' */
+ * add number to the name. Check length of generated name to avoid
+ * crazy case of huge number of folders each named 'New Folder (x)' */
while (BLI_exists(folder) && (len<FILE_MAXFILE)) {
len = BLI_snprintf(name, FILE_MAXFILE, "New Folder(%d)", i);
BLI_join_dirfile(folder, FILE_MAX, parent, name); /* XXX, not real length */
@@ -1171,9 +1170,8 @@ int file_filename_exec(bContext *C, wmOperator *UNUSED(unused))
{
SpaceFile *sfile= CTX_wm_space_file(C);
- if(sfile->params) {
- if (file_select_match(sfile, sfile->params->file))
- {
+ if (sfile->params) {
+ if (file_select_match(sfile, sfile->params->file)) {
sfile->params->file[0] = '\0';
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
}
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index 26083cbe625..a7cb800e5a7 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -205,25 +205,25 @@ void file_panels_register(ARegionType *art)
pt= MEM_callocN(sizeof(PanelType), "spacetype file system directories");
strcpy(pt->idname, "FILE_PT_system");
- strcpy(pt->label, "System");
+ strcpy(pt->label, N_("System"));
pt->draw= file_panel_system;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype file bookmarks");
strcpy(pt->idname, "FILE_PT_bookmarks");
- strcpy(pt->label, "Bookmarks");
+ strcpy(pt->label, N_("Bookmarks"));
pt->draw= file_panel_bookmarks;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype file recent directories");
strcpy(pt->idname, "FILE_PT_recent");
- strcpy(pt->label, "Recent");
+ strcpy(pt->label, N_("Recent"));
pt->draw= file_panel_recent;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype file operator properties");
strcpy(pt->idname, "FILE_PT_operator");
- strcpy(pt->label, "Operator");
+ strcpy(pt->label, N_("Operator"));
pt->poll= file_panel_operator_poll;
pt->draw_header= file_panel_operator_header;
pt->draw= file_panel_operator;
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 23250fc6696..8632abd3410 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -1011,7 +1011,7 @@ void filelist_from_library(struct FileList* filelist)
idcode= groupname_to_code(group);
/* memory for strings is passed into filelist[i].relname
- * and free'd in freefilelist */
+ * and freed in freefilelist */
if (idcode) {
previews= BLO_blendhandle_get_previews(filelist->libfiledata, idcode, &nprevs);
names= BLO_blendhandle_get_datablock_names(filelist->libfiledata, idcode, &nnames);
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 44eadc9dee8..fa2874f4842 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -363,8 +363,8 @@ void ED_fileselect_layout_tilepos(FileLayout* layout, int tile, int *x, int *y)
}
/* Shorten a string to a given width w.
- If front is set, shorten from the front,
- otherwise shorten from the end. */
+ * If front is set, shorten from the front,
+ * otherwise shorten from the end. */
float file_shorten_string(char* string, float w, int front)
{
char temp[FILE_MAX];
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index ea894750605..4c9d2be791b 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -210,8 +210,8 @@ void fsmenu_remove_entry(struct FSMenu* fsmenu, FSMenuCategory category, int idx
if (fsme) {
/* you should only be able to remove entries that were
- not added by default, like windows drives.
- also separators (where path == NULL) shouldn't be removed */
+ * not added by default, like windows drives.
+ * also separators (where path == NULL) shouldn't be removed */
if (fsme->save && fsme->path) {
/* remove fsme from list */
@@ -334,15 +334,15 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
continue;
FSRefMakePath(&dir, path, FILE_MAX);
- if (strcmp((char*)path, "/home") && strcmp((char*)path, "/net"))
- { /* /net and /home are meaningless on OSX, home folders are stored in /Users */
+ if (strcmp((char*)path, "/home") && strcmp((char*)path, "/net")) {
+ /* /net and /home are meaningless on OSX, home folders are stored in /Users */
fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)path, 1, 0);
}
}
/* As 10.4 doesn't provide proper API to retrieve the favorite places,
- assume they are the standard ones
- TODO : replace hardcoded paths with proper BLI_get_folder calls */
+ * assume they are the standard ones
+ * TODO : replace hardcoded paths with proper BLI_get_folder calls */
home = getenv("HOME");
if(home) {
BLI_snprintf(line, 256, "%s/", home);
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 02c9728348e..9eafd4533d2 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -196,8 +196,8 @@ static void file_refresh(const bContext *C, ScrArea *UNUSED(sa))
filelist_hidedot(sfile->files, params->flag & FILE_HIDE_DOT);
filelist_setfilter(sfile->files, params->flag & FILE_FILTER ? params->filter : 0);
filelist_setfilter_types(sfile->files, params->filter_glob);
- if (filelist_empty(sfile->files))
- {
+
+ if (filelist_empty(sfile->files)) {
thumbnails_stop(sfile->files, C);
filelist_readdir(sfile->files);
if(params->sort!=FILE_SORT_NONE) {
@@ -221,7 +221,7 @@ static void file_refresh(const bContext *C, ScrArea *UNUSED(sa))
}
} else {
/* stop any running thumbnail jobs if we're not
- displaying them - speedup for NFS */
+ * displaying them - speedup for NFS */
thumbnails_stop(sfile->files, C);
}
filelist_filter(sfile->files);
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index 1115d3c4cb4..642d43f2e71 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -147,16 +147,16 @@ static void graph_panel_view(const bContext *C, Panel *pa)
sub= uiLayoutColumn(col, 1);
uiLayoutSetActive(sub, RNA_boolean_get(&spaceptr, "show_cursor"));
- uiItemO(sub, "Cursor from Selection", ICON_NONE, "GRAPH_OT_frame_jump");
+ uiItemO(sub, IFACE_("Cursor from Selection"), ICON_NONE, "GRAPH_OT_frame_jump");
sub= uiLayoutColumn(col, 1);
uiLayoutSetActive(sub, RNA_boolean_get(&spaceptr, "show_cursor"));
row= uiLayoutSplit(sub, 0.7, 1);
- uiItemR(row, &sceneptr, "frame_current", 0, "Cursor X", ICON_NONE);
- uiItemEnumO(row, "GRAPH_OT_snap", "To Keys", 0, "type", GRAPHKEYS_SNAP_CFRA);
+ uiItemR(row, &sceneptr, "frame_current", 0, IFACE_("Cursor X"), ICON_NONE);
+ uiItemEnumO(row, "GRAPH_OT_snap", IFACE_("To Keys"), 0, "type", GRAPHKEYS_SNAP_CFRA);
row= uiLayoutSplit(sub, 0.7, 1);
- uiItemR(row, &spaceptr, "cursor_position_y", 0, "Cursor Y", ICON_NONE);
- uiItemEnumO(row, "GRAPH_OT_snap", "To Keys", 0, "type", GRAPHKEYS_SNAP_VALUE);
+ uiItemR(row, &spaceptr, "cursor_position_y", 0, IFACE_("Cursor Y"), ICON_NONE);
+ uiItemEnumO(row, "GRAPH_OT_snap", IFACE_("To Keys"), 0, "type", GRAPHKEYS_SNAP_VALUE);
}
/* ******************* active F-Curve ************** */
@@ -182,7 +182,7 @@ static void graph_panel_properties(const bContext *C, Panel *pa)
RNA_pointer_create(ale->id, &RNA_FCurve, fcu, &fcu_ptr);
/* user-friendly 'name' for F-Curve */
- // TODO: only show the path if this is invalid?
+ /* TODO: only show the path if this is invalid? */
col= uiLayoutColumn(layout, 0);
icon= getname_anim_fcurve(name, ale->id, fcu);
uiItemL(col, name, icon);
@@ -195,7 +195,7 @@ static void graph_panel_properties(const bContext *C, Panel *pa)
/* color settings */
col= uiLayoutColumn(layout, 1);
- uiItemL(col, "Display Color:", ICON_NONE);
+ uiItemL(col, IFACE_("Display Color:"), ICON_NONE);
row= uiLayoutRow(col, 1);
uiItemR(row, &fcu_ptr, "color_mode", 0, "", ICON_NONE);
@@ -318,36 +318,42 @@ static void graph_panel_key_properties(const bContext *C, Panel *pa)
col= uiLayoutColumn(layout, 1);
/* keyframe itself */
{
- uiItemL(col, "Key:", ICON_NONE);
+ uiItemL(col, IFACE_("Key:"), ICON_NONE);
- but = uiDefButR(block, NUM, B_REDR, "Frame", 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "co", 0, 0, 0, -1, -1, NULL);
+ but = uiDefButR(block, NUM, B_REDR, IFACE_("Frame"), 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ &bezt_ptr, "co", 0, 0, 0, -1, -1, NULL);
uiButSetFunc(but, graphedit_activekey_update_cb, fcu, bezt);
- but = uiDefButR(block, NUM, B_REDR, "Value", 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "co", 1, 0, 0, -1, -1, NULL);
+ but = uiDefButR(block, NUM, B_REDR, IFACE_("Value"), 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ &bezt_ptr, "co", 1, 0, 0, -1, -1, NULL);
uiButSetFunc(but, graphedit_activekey_update_cb, fcu, bezt);
uiButSetUnitType(but, unit);
}
/* previous handle - only if previous was Bezier interpolation */
if ((prevbezt) && (prevbezt->ipo == BEZT_IPO_BEZ)) {
- uiItemL(col, "Left Handle:", ICON_NONE);
+ uiItemL(col, IFACE_("Left Handle:"), ICON_NONE);
- but = uiDefButR(block, NUM, B_REDR, "X", 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "handle_left", 0, 0, 0, -1, -1, NULL);
- uiButSetFunc(but, graphedit_activekey_handles_cb, fcu, bezt);
+ but = uiDefButR(block, NUM, B_REDR, "X", 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ &bezt_ptr, "handle_left", 0, 0, 0, -1, -1, NULL);
+ uiButSetFunc(but, graphedit_activekey_handles_cb, fcu, bezt);
- but = uiDefButR(block, NUM, B_REDR, "Y", 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "handle_left", 1, 0, 0, -1, -1, NULL);
+ but = uiDefButR(block, NUM, B_REDR, "Y", 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ &bezt_ptr, "handle_left", 1, 0, 0, -1, -1, NULL);
uiButSetFunc(but, graphedit_activekey_handles_cb, fcu, bezt);
uiButSetUnitType(but, unit);
}
/* next handle - only if current is Bezier interpolation */
if (bezt->ipo == BEZT_IPO_BEZ) {
- uiItemL(col, "Right Handle:", ICON_NONE);
+ uiItemL(col, IFACE_("Right Handle:"), ICON_NONE);
- but = uiDefButR(block, NUM, B_REDR, "X", 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "handle_right", 0, 0, 0, -1, -1, NULL);
+ but = uiDefButR(block, NUM, B_REDR, "X", 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ &bezt_ptr, "handle_right", 0, 0, 0, -1, -1, NULL);
uiButSetFunc(but, graphedit_activekey_handles_cb, fcu, bezt);
- but = uiDefButR(block, NUM, B_REDR, "Y", 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "handle_right", 1, 0, 0, -1, -1, NULL);
+ but = uiDefButR(block, NUM, B_REDR, "Y", 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ &bezt_ptr, "handle_right", 1, 0, 0, -1, -1, NULL);
uiButSetFunc(but, graphedit_activekey_handles_cb, fcu, bezt);
uiButSetUnitType(but, unit);
}
@@ -355,15 +361,16 @@ static void graph_panel_key_properties(const bContext *C, Panel *pa)
else {
if ((fcu->bezt == NULL) && (fcu->modifiers.first)) {
/* modifiers only - so no keyframes to be active */
- uiItemL(layout, "F-Curve only has F-Modifiers", ICON_NONE);
- uiItemL(layout, "See Modifiers panel below", ICON_INFO);
+ uiItemL(layout, IFACE_("F-Curve only has F-Modifiers"), ICON_NONE);
+ uiItemL(layout, IFACE_("See Modifiers panel below"), ICON_INFO);
}
else if (fcu->fpt) {
/* samples only */
- uiItemL(layout, "F-Curve doesn't have any keyframes as it only contains sampled points", ICON_NONE);
+ uiItemL(layout, IFACE_("F-Curve doesn't have any keyframes as it only contains sampled points"),
+ ICON_NONE);
}
else
- uiItemL(layout, "No active keyframe on F-Curve", ICON_NONE);
+ uiItemL(layout, IFACE_("No active keyframe on F-Curve"), ICON_NONE);
}
MEM_freeN(ale);
@@ -463,7 +470,7 @@ static void graph_panel_driverVar__singleProp(uiLayout *layout, ID *id, DriverVa
/* Target ID */
row= uiLayoutRow(layout, 0);
- uiTemplateAnyID(row, &dtar_ptr, "id", "id_type", "Prop:");
+ uiTemplateAnyID(row, &dtar_ptr, "id", "id_type", IFACE_("Prop:"));
/* Target Property */
// TODO: make this less technical...
@@ -475,7 +482,7 @@ static void graph_panel_driverVar__singleProp(uiLayout *layout, ID *id, DriverVa
col= uiLayoutColumn(layout, 1);
/* rna path */
- uiTemplatePathBuilder(col, &dtar_ptr, "data_path", &root_ptr, "Path");
+ uiTemplatePathBuilder(col, &dtar_ptr, "data_path", &root_ptr, IFACE_("Path"));
}
}
@@ -495,7 +502,7 @@ static void graph_panel_driverVar__rotDiff(uiLayout *layout, ID *id, DriverVar *
/* Bone 1 */
col= uiLayoutColumn(layout, 1);
- uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", "Bone 1:");
+ uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", IFACE_("Bone 1:"));
if (dtar->id && ob1->pose) {
PointerRNA tar_ptr;
@@ -505,7 +512,7 @@ static void graph_panel_driverVar__rotDiff(uiLayout *layout, ID *id, DriverVar *
}
col= uiLayoutColumn(layout, 1);
- uiTemplateAnyID(col, &dtar2_ptr, "id", "id_type", "Bone 2:");
+ uiTemplateAnyID(col, &dtar2_ptr, "id", "id_type", IFACE_("Bone 2:"));
if (dtar2->id && ob2->pose) {
PointerRNA tar_ptr;
@@ -531,7 +538,7 @@ static void graph_panel_driverVar__locDiff(uiLayout *layout, ID *id, DriverVar *
/* Bone 1 */
col= uiLayoutColumn(layout, 1);
- uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", "Ob/Bone 1:");
+ uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", IFACE_("Ob/Bone 1:"));
if (dtar->id && ob1->pose) {
PointerRNA tar_ptr;
@@ -543,7 +550,7 @@ static void graph_panel_driverVar__locDiff(uiLayout *layout, ID *id, DriverVar *
uiItemR(col, &dtar_ptr, "transform_space", 0, NULL, ICON_NONE);
col= uiLayoutColumn(layout, 1);
- uiTemplateAnyID(col, &dtar2_ptr, "id", "id_type", "Ob/Bone 2:");
+ uiTemplateAnyID(col, &dtar2_ptr, "id", "id_type", IFACE_("Ob/Bone 2:"));
if (dtar2->id && ob2->pose) {
PointerRNA tar_ptr;
@@ -568,7 +575,7 @@ static void graph_panel_driverVar__transChan(uiLayout *layout, ID *id, DriverVar
/* properties */
col= uiLayoutColumn(layout, 1);
- uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", "Ob/Bone:");
+ uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", IFACE_("Ob/Bone:"));
if (dtar->id && ob->pose) {
PointerRNA tar_ptr;
@@ -579,7 +586,7 @@ static void graph_panel_driverVar__transChan(uiLayout *layout, ID *id, DriverVar
sub= uiLayoutColumn(layout, 1);
uiItemR(sub, &dtar_ptr, "transform_type", 0, NULL, ICON_NONE);
- uiItemR(sub, &dtar_ptr, "transform_space", 0, "Space", ICON_NONE);
+ uiItemR(sub, &dtar_ptr, "transform_space", 0, IFACE_("Space"), ICON_NONE);
}
/* driver settings for active F-Curve (only for 'Drivers' mode) */
@@ -607,10 +614,12 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
/* general actions - management */
col= uiLayoutColumn(pa->layout, 0);
block= uiLayoutGetBlock(col);
- but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, "Update Dependencies", 0, 0, 10*UI_UNIT_X, 22, NULL, 0.0, 0.0, 0, 0, "Force updates of dependencies");
+ but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, IFACE_("Update Dependencies"), 0, 0, 10*UI_UNIT_X, 22,
+ NULL, 0.0, 0.0, 0, 0, TIP_("Force updates of dependencies"));
uiButSetFunc(but, driver_update_flags_cb, fcu, NULL);
- but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, "Remove Driver", 0, 0, 10*UI_UNIT_X, 18, NULL, 0.0, 0.0, 0, 0, "Remove this driver");
+ but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, IFACE_("Remove Driver"), 0, 0, 10*UI_UNIT_X, 18,
+ NULL, 0.0, 0.0, 0, 0, TIP_("Remove this driver"));
uiButSetNFunc(but, driver_remove_cb, MEM_dupallocN(ale), NULL);
/* driver-level settings - type, expressions, and errors */
@@ -623,16 +632,16 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
/* show expression box if doing scripted drivers, and/or error messages when invalid drivers exist */
if (driver->type == DRIVER_TYPE_PYTHON) {
/* expression */
- uiItemR(col, &driver_ptr, "expression", 0, "Expr", ICON_NONE);
+ uiItemR(col, &driver_ptr, "expression", 0, IFACE_("Expr"), ICON_NONE);
/* errors? */
if (driver->flag & DRIVER_FLAG_INVALID)
- uiItemL(col, "ERROR: invalid Python expression", ICON_ERROR);
+ uiItemL(col, IFACE_("ERROR: invalid Python expression"), ICON_ERROR);
}
else {
/* errors? */
if (driver->flag & DRIVER_FLAG_INVALID)
- uiItemL(col, "ERROR: invalid target channel(s)", ICON_ERROR);
+ uiItemL(col, IFACE_("ERROR: invalid target channel(s)"), ICON_ERROR);
}
col= uiLayoutColumn(pa->layout, 1);
@@ -644,7 +653,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
uiLayout *row= uiLayoutRow(col, 1);
char valBuf[32];
- uiItemL(row, "Driver Value:", ICON_NONE);
+ uiItemL(row, IFACE_("Driver Value:"), ICON_NONE);
BLI_snprintf(valBuf, sizeof(valBuf), "%.3f", driver->curval);
uiItemL(row, valBuf, ICON_NONE);
@@ -653,7 +662,8 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
/* add driver variables */
col= uiLayoutColumn(pa->layout, 0);
block= uiLayoutGetBlock(col);
- but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, "Add Variable", 0, 0, 10*UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "Add a new target variable for this Driver");
+ but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, IFACE_("Add Variable"), 0, 0, 10*UI_UNIT_X, UI_UNIT_Y,
+ NULL, 0.0, 0.0, 0, 0, TIP_("Add a new target variable for this Driver"));
uiButSetFunc(but, driver_add_var_cb, driver, NULL);
/* loop over targets, drawing them */
@@ -676,7 +686,8 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
/* remove button */
uiBlockSetEmboss(block, UI_EMBOSSN);
- but= uiDefIconBut(block, BUT, B_IPO_DEPCHANGE, ICON_X, 290, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete target variable");
+ but= uiDefIconBut(block, BUT, B_IPO_DEPCHANGE, ICON_X, 290, 0, UI_UNIT_X, UI_UNIT_Y,
+ NULL, 0.0, 0.0, 0.0, 0.0, IFACE_("Delete target variable"));
uiButSetFunc(but, driver_delete_var_cb, driver, dvar);
uiBlockSetEmboss(block, UI_EMBOSS);
@@ -708,7 +719,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
box= uiLayoutBox(col);
row= uiLayoutRow(box, 1);
- uiItemL(row, "Value:", ICON_NONE);
+ uiItemL(row, IFACE_("Value:"), ICON_NONE);
BLI_snprintf(valBuf, sizeof(valBuf), "%.3f", dvar->curval);
uiItemL(row, valBuf, ICON_NONE);
@@ -753,8 +764,8 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa)
block= uiLayoutGetBlock(row);
// XXX for now, this will be a operator button which calls a 'add modifier' operator
- uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, IFACE_("Add Modifier"), 10, 0, 150, 20,
- TIP_("Adds a new F-Curve Modifier for the active F-Curve"));
+ uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, IFACE_("Add Modifier"),
+ 10, 0, 150, 20, TIP_("Adds a new F-Curve Modifier for the active F-Curve"));
/* copy/paste (as sub-row)*/
row= uiLayoutRow(row, 1);
@@ -780,21 +791,21 @@ void graph_buttons_register(ARegionType *art)
pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel view");
strcpy(pt->idname, "GRAPH_PT_view");
- strcpy(pt->label, "View Properties");
+ strcpy(pt->label, N_("View Properties"));
pt->draw= graph_panel_view;
pt->flag |= PNL_DEFAULT_CLOSED;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel properties");
strcpy(pt->idname, "GRAPH_PT_properties");
- strcpy(pt->label, "Active F-Curve");
+ strcpy(pt->label, N_("Active F-Curve"));
pt->draw= graph_panel_properties;
pt->poll= graph_panel_poll;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel properties");
strcpy(pt->idname, "GRAPH_PT_key_properties");
- strcpy(pt->label, "Active Keyframe");
+ strcpy(pt->label, N_("Active Keyframe"));
pt->draw= graph_panel_key_properties;
pt->poll= graph_panel_poll;
BLI_addtail(&art->paneltypes, pt);
@@ -802,14 +813,14 @@ void graph_buttons_register(ARegionType *art)
pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel drivers");
strcpy(pt->idname, "GRAPH_PT_drivers");
- strcpy(pt->label, "Drivers");
+ strcpy(pt->label, N_("Drivers"));
pt->draw= graph_panel_drivers;
pt->poll= graph_panel_drivers_poll;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel modifiers");
strcpy(pt->idname, "GRAPH_PT_modifiers");
- strcpy(pt->label, "Modifiers");
+ strcpy(pt->label, N_("Modifiers"));
pt->draw= graph_panel_modifiers;
pt->poll= graph_panel_poll;
BLI_addtail(&art->paneltypes, pt);
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index f1afb3c82db..8af16bd1aec 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -292,8 +292,7 @@ static void draw_fcurve_vertices (SpaceIpo *sipo, ARegion *ar, FCurve *fcu, shor
glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
/* draw the two handles first (if they're shown, the curve doesn't have just a single keyframe, and the curve is being edited) */
- if (do_handles)
- {
+ if (do_handles) {
set_fcurve_vertex_color(fcu, 0);
draw_fcurve_vertices_handles(fcu, sipo, v2d, 0, sel_handle_only);
@@ -327,8 +326,7 @@ static int draw_fcurve_handles_check(SpaceIpo *sipo, FCurve *fcu)
{
return 0;
}
- else
- {
+ else {
return 1;
}
}
@@ -368,8 +366,7 @@ static void draw_fcurve_handles (SpaceIpo *sipo, FCurve *fcu)
fp= bezt->vec[0];
/* only draw first handle if previous segment had handles */
- if ( (!prevbezt && (bezt->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) )
- {
+ if ((!prevbezt && (bezt->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ))) {
UI_GetThemeColor3ubv(basecol + bezt->h1, col);
col[3]= drawFCurveFade(fcu) * 255;
glColor4ubv((GLubyte *)col);
@@ -378,8 +375,7 @@ static void draw_fcurve_handles (SpaceIpo *sipo, FCurve *fcu)
}
/* only draw second handle if this segment is bezier */
- if (bezt->ipo == BEZT_IPO_BEZ)
- {
+ if (bezt->ipo == BEZT_IPO_BEZ) {
UI_GetThemeColor3ubv(basecol + bezt->h2, col);
col[3]= drawFCurveFade(fcu) * 255;
glColor4ubv((GLubyte *)col);
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index ffe5147074a..9a965c3a109 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -53,6 +53,8 @@
#include "RNA_define.h"
#include "RNA_enum_types.h"
+#include "BLF_translation.h"
+
#include "BKE_fcurve.h"
#include "BKE_nla.h"
#include "BKE_context.h"
@@ -2074,7 +2076,7 @@ static int graph_fmodifier_add_invoke (bContext *C, wmOperator *op, wmEvent *UNU
uiLayout *layout;
int i;
- pup= uiPupMenuBegin(C, "Add F-Curve Modifier", ICON_NONE);
+ pup= uiPupMenuBegin(C, IFACE_("Add F-Curve Modifier"), ICON_NONE);
layout= uiPupMenuLayout(pup);
/* start from 1 to skip the 'Invalid' modifier type */
@@ -2087,7 +2089,8 @@ static int graph_fmodifier_add_invoke (bContext *C, wmOperator *op, wmEvent *UNU
continue;
/* create operator menu item with relevant properties filled in */
- props_ptr= uiItemFullO_ptr(layout, ot, fmi->name, ICON_NONE, NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
+ props_ptr= uiItemFullO_ptr(layout, ot, IFACE_(fmi->name), ICON_NONE,
+ NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
/* the only thing that gets set from the menu is the type of F-Modifier to add */
RNA_enum_set(&props_ptr, "type", i);
/* the following properties are just repeats of existing ones... */
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index 2307f1db4f2..bdd3497a931 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -193,7 +193,7 @@ void GRAPH_OT_select_all_toggle (wmOperatorType *ot)
*/
/* Borderselect only selects keyframes now, as overshooting handles often get caught too,
- * which means that they may be inadvertantly moved as well. However, incl_handles overrides
+ * which means that they may be inadvertently moved as well. However, incl_handles overrides
* this, and allow handles to be considered independently too.
* Also, for convenience, handles should get same status as keyframe (if it was within bounds).
*/
@@ -1006,14 +1006,12 @@ static void get_nearest_fcurve_verts_list (bAnimContext *ac, const int mval[2],
/* handles - only do them if they're visible */
if (fcurve_handle_sel_check(sipo, bezt1) && (fcu->totvert > 1)) {
/* first handle only visible if previous segment had handles */
- if ( (!prevbezt && (bezt1->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) )
- {
+ if ((!prevbezt && (bezt1->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ))) {
nearest_fcurve_vert_store(matches, v2d, fcu, bezt1, NULL, NEAREST_HANDLE_LEFT, mval);
}
/* second handle only visible if this segment is bezier */
- if (bezt1->ipo == BEZT_IPO_BEZ)
- {
+ if (bezt1->ipo == BEZT_IPO_BEZ) {
nearest_fcurve_vert_store(matches, v2d, fcu, bezt1, NULL, NEAREST_HANDLE_RIGHT, mval);
}
}
diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c
index 8925866df8d..8c2afe8a242 100644
--- a/source/blender/editors/space_graph/graph_utils.c
+++ b/source/blender/editors/space_graph/graph_utils.c
@@ -122,7 +122,7 @@ int graphop_visible_keyframes_poll (bContext *C)
for (ale = anim_data.first; ale; ale= ale->next) {
FCurve *fcu= (FCurve *)ale->data;
- /* visible curves for selection must fulfull the following criteria:
+ /* visible curves for selection must fulfill the following criteria:
* - it has bezier keyframes
* - F-Curve modifiers do not interfere with the result too much
* (i.e. the modifier-control drawing check returns false)
@@ -171,7 +171,7 @@ int graphop_editable_keyframes_poll (bContext *C)
for (ale = anim_data.first; ale; ale= ale->next) {
FCurve *fcu= (FCurve *)ale->data;
- /* editable curves must fulfull the following criteria:
+ /* editable curves must fulfill the following criteria:
* - it has bezier keyframes
* - it must not be protected from editing (this is already checked for with the foredit flag
* - F-Curve modifiers do not interfere with the result too much
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 50178f73d89..08f21a3f5aa 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -508,7 +508,7 @@ static void graph_refresh(const bContext *C, ScrArea *sa)
}
/* region updates? */
- // XXX resizing y-extents of tot should go here?
+ // XXX re-sizing y-extents of tot should go here?
/* update the state of the animchannels in response to changes from the data they represent
* NOTE: the temp flag is used to indicate when this needs to be done, and will be cleared once handled
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index 150872813b2..d54468f64ea 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -212,10 +212,10 @@ static void image_panel_curves(const bContext *C, Panel *pa)
#if 0
/* 0: disable preview
- otherwise refresh preview
-
- XXX if you put this back, also check XXX in image_main_area_draw() */
-*/
+ * otherwise refresh preview
+ *
+ * XXX if you put this back, also check XXX in image_main_area_draw() */
+ */
void image_preview_event(int event)
{
int exec= 0;
@@ -602,12 +602,12 @@ static void rna_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg))
RNAUpdateCb *cb= (RNAUpdateCb*)arg_cb;
/* ideally this would be done by RNA itself, but there we have
- no image user available, so we just update this flag here */
+ * no image user available, so we just update this flag here */
cb->iuser->ok= 1;
/* we call update here on the pointer property, this way the
- owner of the image pointer can still define it's own update
- and notifier */
+ * owner of the image pointer can still define it's own update
+ * and notifier */
RNA_property_update(C, &cb->ptr, cb->prop);
}
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 9ec9c5ef0e0..e91a44e0358 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -79,11 +79,11 @@
static void image_verify_buffer_float(Image *ima, ImBuf *ibuf, int color_manage)
{
/* detect if we need to redo the curve map.
- ibuf->rect is zero for compositor and render results after change
- convert to 32 bits always... drawing float rects isnt supported well (atis)
-
- NOTE: if float buffer changes, we have to manually remove the rect
- */
+ * ibuf->rect is zero for compositor and render results after change
+ * convert to 32 bits always... drawing float rects isnt supported well (atis)
+ *
+ * NOTE: if float buffer changes, we have to manually remove the rect
+ */
if(ibuf->rect_float && (ibuf->rect==NULL || (ibuf->userflags & IB_RECT_INVALID)) ) {
if(color_manage) {
@@ -531,8 +531,10 @@ static void draw_image_buffer(SpaceImage *sima, ARegion *ar, Scene *scene, Image
if(ibuf->rect)
glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
- /*else
- glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_FLOAT, ibuf->rect_float);*/
+#if 0
+ else
+ glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_FLOAT, ibuf->rect_float);
+#endif
if(sima->flag & SI_USE_ALPHA)
glDisable(GL_BLEND);
@@ -734,7 +736,7 @@ static void draw_image_paint_helpers(ARegion *ar, Scene *scene, float zoomx, flo
if(brush && (brush->imagepaint_tool == PAINT_TOOL_CLONE)) {
/* this is not very efficient, but glDrawPixels doesn't allow
- drawing with alpha */
+ * drawing with alpha */
clonerect= get_alpha_clone_image(scene, &w, &h);
if(clonerect) {
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 6742852cbf4..ae47125fa84 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1059,7 +1059,7 @@ static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima,
/* sanitize all settings */
- /* unlikely but just incase */
+ /* unlikely but just in case */
if (ELEM3(simopts->im_format.planes, R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA) == 0) {
simopts->im_format.planes= R_IMF_PLANES_RGBA;
}
@@ -1229,7 +1229,7 @@ static int image_save_as_exec(bContext *C, wmOperator *op)
save_image_options_defaults(&simopts);
- /* just incase to initialize values,
+ /* just in case to initialize values,
* these should be set on invoke or by the caller. */
save_image_options_init(&simopts, sima, CTX_data_scene(C), 0);
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 7abc0c6ea71..1af37a66022 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -824,9 +824,11 @@ static void image_main_area_draw(const bContext *C, ARegion *ar)
draw_image_grease_pencil((bContext *)C, 0);
/* scrollers? */
- /*scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_UNIT_VALUES, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
+#if 0
+ scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_UNIT_VALUES, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
UI_view2d_scrollers_draw(C, v2d, scrollers);
- UI_view2d_scrollers_free(scrollers);*/
+ UI_view2d_scrollers_free(scrollers);
+#endif
}
static void image_main_area_listener(ARegion *ar, wmNotifier *wmn)
diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c
index 206639f064a..a1ea0449128 100644
--- a/source/blender/editors/space_info/info_report.c
+++ b/source/blender/editors/space_info/info_report.c
@@ -236,14 +236,14 @@ static int borderselect_exec(bContext *C, wmOperator *op)
rect.xmax= RNA_int_get(op->ptr, "xmax");
rect.ymax= RNA_int_get(op->ptr, "ymax");
- /*
+#if 0
mval[0]= rect.xmin;
mval[1]= rect.ymin;
UI_view2d_region_to_view(v2d, mval[0], mval[1], &rectf.xmin, &rectf.ymin);
mval[0]= rect.xmax;
mval[1]= rect.ymax;
UI_view2d_region_to_view(v2d, mval[0], mval[1], &rectf.xmax, &rectf.ymax);
-*/
+#endif
if(!extend) {
for(report= reports->list.first; report; report= report->next) {
diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c
index 0dfcafcf549..86ac2d0c369 100644
--- a/source/blender/editors/space_logic/logic_ops.c
+++ b/source/blender/editors/space_logic/logic_ops.c
@@ -119,7 +119,7 @@ static Object *edit_object_property_get(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "object", ob_name);
/* if ob_name is valid try to find the object with this name
- otherwise gets the active object */
+ * otherwise gets the active object */
if (BLI_strnlen(ob_name, MAX_NAME) > 0)
ob = BLI_findstring(&(CTX_data_main(C)->object), ob_name, offsetof(ID, name) + 2);
else
@@ -406,8 +406,8 @@ static int controller_add_exec(bContext *C, wmOperator *op)
make_unique_prop_names(C, cont->name);
/* set the controller state mask from the current object state.
- A controller is always in a single state, so select the lowest bit set
- from the object state */
+ * A controller is always in a single state, so select the lowest bit set
+ * from the object state */
for (bit=0; bit<OB_MAX_STATES; bit++) {
if (ob->state & (1<<bit))
break;
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 878543e6a36..4a301277ff3 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -124,8 +124,8 @@ void make_unique_prop_names(bContext *C, char *str)
char **names;
/* this function is called by a Button, and gives the current
- * stringpointer as an argument, this is the one that can change
- */
+ * stringpointer as an argument, this is the one that can change
+ */
idar= get_selected_and_linked_obs(C, &obcount, BUTS_SENS_SEL|BUTS_SENS_ACT|BUTS_ACT_SEL|BUTS_ACT_ACT|BUTS_CONT_SEL|BUTS_CONT_ACT);
@@ -436,8 +436,8 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
ob->scaflag |= OB_SHOWCONT;
BLI_addtail(&(ob->controllers), cont);
/* set the controller state mask from the current object state.
- A controller is always in a single state, so select the lowest bit set
- from the object state */
+ * A controller is always in a single state, so select the lowest bit set
+ * from the object state */
for (bit=0; bit<32; bit++) {
if (ob->state & (1<<bit))
break;
@@ -1187,9 +1187,9 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
ts= sens->data;
- /* uiDefBut(block, TEX, 1, "Property:", xco,yco-22,width, 19, &ts->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property"); */
+ // uiDefBut(block, TEX, 1, "Property:", xco,yco-22,width, 19, &ts->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property");
uiDefIDPoinBut(block, test_matpoin_but, ID_MA, 1, "MA:",(short)(xco + 10),(short)(yco-44), (short)(width - 20), 19, &ts->ma, "Only look for floors with this Material");
- ///* uiDefButF(block, NUM, 1, "Margin:", xco+width/2,yco-44,width/2, 19, &ts->dist, 0.0, 10.0, 100, 0, "Extra margin (distance) for larger sensitivity");
+ // uiDefButF(block, NUM, 1, "Margin:", xco+width/2,yco-44,width/2, 19, &ts->dist, 0.0, 10.0, 100, 0, "Extra margin (distance) for larger sensitivity");
yco-= ysize;
break;
}
@@ -1359,11 +1359,12 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
uiDefBut(block, TEX, 1, "Max: ", xco+width/2,yco-92,width/2, 19,
ps->maxvalue, 0, MAX_NAME, 0, 0, "check for max value");
}
- else if(ps->type == SENS_PROP_CHANGED);
- else
- {
+ else if(ps->type == SENS_PROP_CHANGED) {
+ /* pass */
+ }
+ else {
uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-92,width-60, 19,
- ps->value, 0, MAX_NAME, 0, 0, "check for value");
+ ps->value, 0, MAX_NAME, 0, 0, "check for value");
}
yco-= ysize;
@@ -1458,9 +1459,10 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
draw_default_sensor_header(sens, block, xco, yco, width);
/* Line 2: type selection. The number are a bit mangled to get
- * proper compatibility with older .blend files. */
+ * proper compatibility with older .blend files. */
+
/* Any sensor type default is 0 but the ms enum starts in 1.
- * Therefore the mosue sensor is initialized to 1 in sca.c */
+ * Therefore the mouse sensor is initialized to 1 in sca.c */
str= "Type %t|Left button %x1|Middle button %x2|"
"Right button %x4|Wheel Up %x5|Wheel Down %x6|Movement %x8|Mouse over %x16|Mouse over any%x32";
uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, (width*0.8f)-20, 19,
@@ -1510,14 +1512,12 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
&raySens->mode, 0.0, 0.0, 0, 0,
"Toggle collision on material or property");
- if (raySens->mode & SENS_COLLISION_MATERIAL)
- {
+ if (raySens->mode & SENS_COLLISION_MATERIAL) {
uiDefBut(block, TEX, 1, "Material:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19,
&raySens->matname, 0, MAX_NAME, 0, 0,
"Only look for Objects with this material");
}
- else
- {
+ else {
uiDefBut(block, TEX, 1, "Property:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19,
&raySens->propname, 0, MAX_NAME, 0, 0,
"Only look for Objects with this property");
@@ -1616,8 +1616,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
"Specify which button to use");
}
}
- else if(joy->type == SENS_JOY_AXIS)
- {
+ else if(joy->type == SENS_JOY_AXIS) {
uiDefButS(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19,
&joy->axis, 1, 8.0, 100, 0,
"Specify which axis pair to use, 1 is useually the main direction input");
@@ -1633,8 +1632,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
"The direction of the axis, use 'All Events' to receive events on any direction");
}
}
- else if (joy->type == SENS_JOY_HAT)
- {
+ else if (joy->type == SENS_JOY_HAT) {
uiDefButI(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19,
&joy->hat, 1, 4.0, 100, 0,
"Specify which hat to use");
@@ -1877,12 +1875,10 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
wval = (width-100)/3;
if (oa->type == ACT_OBJECT_NORMAL)
{
- if ( ob->gameflag & OB_DYNAMIC )
- {
+ if (ob->gameflag & OB_DYNAMIC) {
ysize= 175;
}
- else
- {
+ else {
ysize= 72;
}
@@ -2030,12 +2026,10 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
&aa->end_reset, 0.0, 0.0, 0, 0, "Restore last frame when switching on/off, otherwise play from the start each time");
- if(aa->type == ACT_ACTION_FROM_PROP)
- {
+ if(aa->type == ACT_ACTION_FROM_PROP) {
uiDefBut(block, TEX, 0, "Prop: ",xco+10, yco-44, width-20, 19, aa->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Action position");
}
- else
- {
+ else {
uiDefButF(block, NUM, 0, "Sta: ",xco+10, yco-44, (width-20)/2, 19, &aa->sta, 1.0, MAXFRAMEF, 0, 0, "Start frame");
uiDefButF(block, NUM, 0, "End: ",xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 1.0, MAXFRAMEF, 0, 0, "End frame");
}
@@ -2047,8 +2041,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
- if(aa->type == ACT_ACTION_MOTION)
- {
+ if (aa->type == ACT_ACTION_MOTION) {
uiDefButF(block, NUM, 0, "Cycle: ",xco+30, yco-84, (width-60)/2, 19, &aa->stridelength, 0.0, 2500.0, 0, 0, "Distance covered by a single cycle of the action");
}
#endif
@@ -2184,8 +2177,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
12.0, 0, 0, "Sets the pitch of this sound");
uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19,
&sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space");
- if(sa->flag & ACT_SND_3D_SOUND)
- {
+ if(sa->flag & ACT_SND_3D_SOUND) {
uiDefButF(block, NUM, 0, "Minimum Gain: ", xco+10, yco-110, wval, 19,
&sa->sound3D.min_gain, 0.0, 1.0, 0.0, 0.0,
"The minimum gain of the sound, no matter how far it is away");
@@ -2394,14 +2386,12 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
&coa->flag, 0.0, 0.0, 0, 0, "Set object axis along (local axis) or parallel (global axis) to the normal at hit position");
uiDefButBitS(block, TOG, ACT_CONST_MATERIAL, B_REDR, "M/P", xco+10, yco-84, 40, 19,
&coa->flag, 0.0, 0.0, 0, 0, "Detect material instead of property");
- if (coa->flag & ACT_CONST_MATERIAL)
- {
+ if (coa->flag & ACT_CONST_MATERIAL) {
uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19,
coa->matprop, 0, MAX_NAME, 0, 0,
"Ray detects only Objects with this material");
}
- else
- {
+ else {
uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19,
coa->matprop, 0, MAX_NAME, 0, 0,
"Ray detect only Objects with this property");
@@ -2453,14 +2443,12 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
&coa->flag, 0.0, 0.0, 0, 0, "Add a horizontal spring force on slopes");
uiDefButBitS(block, TOG, ACT_CONST_MATERIAL, B_REDR, "M/P", xco+10, yco-84, 40, 19,
&coa->flag, 0.0, 0.0, 0, 0, "Detect material instead of property");
- if (coa->flag & ACT_CONST_MATERIAL)
- {
+ if (coa->flag & ACT_CONST_MATERIAL) {
uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19,
coa->matprop, 0, MAX_NAME, 0, 0,
"Ray detects only Objects with this material");
}
- else
- {
+ else {
uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19,
coa->matprop, 0, MAX_NAME, 0, 0,
"Ray detect only Objects with this property");
@@ -2547,9 +2535,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
break;
case ACT_GAME:
{
- gma = act->data;
- if (gma->type == ACT_GAME_LOAD)
- {
+ gma = act->data;
+ if (gma->type == ACT_GAME_LOAD) {
//ysize = 68;
ysize = 48;
glRects(xco, yco-ysize, xco+width, yco);
@@ -2557,8 +2544,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this blend file, use the \"//\" prefix for a path relative to the current blend file");
// uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation");
}
-/* else if (gma->type == ACT_GAME_START)
- {
+#if 0
+ else if (gma->type == ACT_GAME_START) {
ysize = 68;
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
@@ -2566,8 +2553,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this file");
uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation");
}
-*/ else if (ELEM4(gma->type, ACT_GAME_RESTART, ACT_GAME_QUIT, ACT_GAME_SAVECFG, ACT_GAME_LOADCFG))
- {
+#endif
+ else if (ELEM4(gma->type, ACT_GAME_RESTART, ACT_GAME_QUIT, ACT_GAME_SAVECFG, ACT_GAME_LOADCFG)) {
ysize = 28;
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
@@ -2804,15 +2791,14 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
&ma->bodyType, 0.0, 0.0, 0, 0,
"Toggle message type: either Text or a PropertyName");
- if (ma->bodyType == ACT_MESG_MESG)
- {
+ if (ma->bodyType == ACT_MESG_MESG) {
/* line 3: Message Body */
uiDefBut(block, TEX, 1, "Body: ",
(xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19,
&ma->body, 0, MAX_NAME, 0, 0,
"Optional message body Text");
- } else
- {
+ }
+ else {
/* line 3: Property body (set by property) */
uiDefBut(block, TEX, 1, "Propname: ",
(xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19,
@@ -2826,8 +2812,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
tdfa = act->data;
ysize = 50;
- if(tdfa->type == ACT_2DFILTER_CUSTOMFILTER)
- {
+ if (tdfa->type == ACT_2DFILTER_CUSTOMFILTER) {
ysize +=20;
}
glRects( xco, yco-ysize, xco+width, yco );
@@ -2836,13 +2821,11 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
switch(tdfa->type)
{
case ACT_2DFILTER_MOTIONBLUR:
- if(!tdfa->flag)
- {
+ if (!tdfa->flag) {
uiDefButS(block, TOG, B_REDR, "D", xco+30,yco-44,19, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Disable Motion Blur");
uiDefButF(block, NUM, B_REDR, "Value:", xco+52,yco-44,width-82,19,&tdfa->float_arg,0.0,1.0,0.0,0.0,"Set motion blur value");
}
- else
- {
+ else {
uiDefButS(block, TOG, B_REDR, "Disabled", xco+30,yco-44,width-60, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Enable Motion Blur");
}
break;
@@ -3806,6 +3789,16 @@ static void draw_actuator_armature(uiLayout *layout, PointerRNA *ptr)
uiItemR(layout, ptr, "weight", 0, NULL, ICON_NONE);
break;
+ case ACT_ARM_SETINFLUENCE:
+ if (ob->pose) {
+ uiItemPointerR(layout, ptr, "bone", &pose_ptr, "bones", NULL, ICON_BONE_DATA);
+
+ if (RNA_property_collection_lookup_string(&pose_ptr, bones_prop, aa->posechannel, &pchan_ptr))
+ uiItemPointerR(layout, ptr, "constraint", &pchan_ptr, "constraints", NULL, ICON_CONSTRAINT_BONE);
+ }
+
+ uiItemR(layout, ptr, "influence", 0, NULL, ICON_NONE);
+ break;
}
}
@@ -4174,11 +4167,11 @@ static void draw_actuator_property(uiLayout *layout, PointerRNA *ptr)
case ACT_PROP_COPY:
row = uiLayoutRow(layout, 0);
uiItemR(row, ptr, "object", 0, NULL, ICON_NONE);
- if(ob_from){
+ if (ob_from) {
RNA_pointer_create((ID *)ob_from, &RNA_GameObjectSettings, ob_from, &obj_settings_ptr);
uiItemPointerR(row, ptr, "object_property", &obj_settings_ptr, "properties", NULL, ICON_NONE);
- }else
- {
+ }
+ else {
sub= uiLayoutRow(row, 0);
uiLayoutSetActive(sub, 0);
uiItemR(sub, ptr, "object_property", 0, NULL, ICON_NONE);
@@ -4312,8 +4305,7 @@ static void draw_actuator_sound(uiLayout *layout, PointerRNA *ptr, bContext *C)
uiLayout *row, *col;
uiTemplateID(layout, C, ptr, "sound", NULL, "SOUND_OT_open", NULL);
- if (!RNA_pointer_get(ptr, "sound").data)
- {
+ if (!RNA_pointer_get(ptr, "sound").data) {
uiItemL(layout, "Select a sound from the list or load a new one", ICON_NONE);
return;
}
@@ -4389,21 +4381,18 @@ static void draw_actuator_steering(uiLayout *layout, PointerRNA *ptr)
uiItemR(col, ptr, "facing", 0, NULL, 0);
col = uiLayoutColumn(row, 0);
uiItemR(col, ptr, "facing_axis", 0, NULL, 0);
- if (!RNA_boolean_get(ptr, "facing"))
- {
+ if (!RNA_boolean_get(ptr, "facing")) {
uiLayoutSetActive(col, 0);
}
col = uiLayoutColumn(row, 0);
uiItemR(col, ptr, "normal_up", 0, NULL, 0);
- if (!RNA_pointer_get(ptr, "navmesh").data)
- {
+ if (!RNA_pointer_get(ptr, "navmesh").data) {
uiLayoutSetActive(col, 0);
}
row = uiLayoutRow(layout, 0);
uiItemR(row, ptr, "self_terminated", 0, NULL, 0);
- if (RNA_enum_get(ptr, "mode")==ACT_STEERING_PATHFOLLOWING)
- {
+ if (RNA_enum_get(ptr, "mode")==ACT_STEERING_PATHFOLLOWING) {
uiItemR(row, ptr, "update_period", 0, NULL, 0);
row = uiLayoutRow(layout, 0);
}
@@ -4703,7 +4692,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
/* put link button to the right */
col = uiLayoutColumn(split, 0);
- /* use oldskool uiButtons for links for now */
+ /* use old-school uiButtons for links for now */
but= uiDefIconBut(block, LINK, 0, ICON_LINK, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
uiSetButLink(but, NULL, (void ***)&(sens->links), &sens->totlinks, LINK_SENSOR, LINK_CONTROLLER);
}
@@ -4824,7 +4813,7 @@ void logic_buttons(bContext *C, ARegion *ar)
idar= get_selected_and_linked_obs(C, &count, slogic->scaflag);
/* clean ACT_LINKED and ACT_VISIBLE of all potentially visible actuators so that
- we can determine which is actually linked/visible */
+ * we can determine which is actually linked/visible */
for(a=0; a<count; a++) {
ob= (Object *)idar[a];
act= ob->actuators.first;
@@ -4871,7 +4860,7 @@ void logic_buttons(bContext *C, ARegion *ar)
/* mark all actuators linked to these controllers */
/* note that some of these actuators could be from objects that are not in the display list.
- It's ok because those actuators will not be displayed here */
+ * It's ok because those actuators will not be displayed here */
cont= ob->controllers.first;
while(cont) {
for (iact=0; iact<cont->totlinks; iact++) {
@@ -5027,8 +5016,7 @@ void logic_buttons(bContext *C, ARegion *ar)
uiDefIconButBitS(block, ICONTOG, SENS_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, UI_UNIT_Y, &sens->flag, 0, 0, 0, 0, "Sensor settings");
ycoo= yco;
- if(sens->flag & SENS_SHOW)
- {
+ if (sens->flag & SENS_SHOW) {
uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 80, UI_UNIT_Y, &sens->type, 0, 0, 0, 0, "Sensor type");
but= uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens->name, 0, MAX_NAME, 0, 0, "Sensor name");
uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0);
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index 0253f04a05d..f94918e4b4a 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -692,8 +692,7 @@ static void draw_nla_channel_list_gl (bAnimContext *ac, ListBase *anim_data, Vie
/* if this track is active and we're tweaking it, don't draw these toggles */
// TODO: need a special macro for this...
- if ( ((nlt->flag & NLATRACK_ACTIVE) && (nlt->flag & NLATRACK_DISABLED)) == 0 )
- {
+ if (((nlt->flag & NLATRACK_ACTIVE) && (nlt->flag & NLATRACK_DISABLED)) == 0) {
if (nlt->flag & NLATRACK_MUTED)
mute = ICON_MUTE_IPO_ON;
else
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index a142119d685..c0e9b7a3a57 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -1282,8 +1282,7 @@ static int nlaedit_swap_exec (bContext *C, wmOperator *op)
if ((nlt->strips.first == nlt->strips.last) && (nlt->strips.first != NULL)) {
NlaStrip *mstrip = (NlaStrip *)nlt->strips.first;
- if ((mstrip->flag & NLASTRIP_FLAG_TEMP_META) && (BLI_countlist(&mstrip->strips) == 2))
- {
+ if ((mstrip->flag & NLASTRIP_FLAG_TEMP_META) && (BLI_countlist(&mstrip->strips) == 2)) {
/* remove this temp meta, so that we can see the strips inside */
BKE_nlastrips_clear_metas(&nlt->strips, 0, 1);
}
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
index 48859acff6a..2f0d39c5f91 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -466,12 +466,14 @@ static void nla_listener(ScrArea *sa, wmNotifier *wmn)
ED_area_tag_refresh(sa);
break;
case NC_SCENE:
- /*switch (wmn->data) {
+#if 0
+ switch (wmn->data) {
case ND_OB_ACTIVE:
case ND_OB_SELECT:
ED_area_tag_refresh(sa);
break;
- }*/
+ }
+#endif
ED_area_tag_refresh(sa);
break;
case NC_OBJECT:
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index bc22e668b5a..64af846a79b 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -1093,6 +1093,14 @@ static void node_shader_buts_tex_image(uiLayout *layout, bContext *C, PointerRNA
uiItemR(layout, ptr, "color_space", 0, "", ICON_NONE);
}
+
+static void node_shader_buts_tex_environment(uiLayout *layout, bContext *C, PointerRNA *ptr)
+{
+ uiTemplateID(layout, C, ptr, "image", NULL, "IMAGE_OT_open", NULL);
+ uiItemR(layout, ptr, "color_space", 0, "", ICON_NONE);
+ uiItemR(layout, ptr, "projection", 0, "", ICON_NONE);
+}
+
static void node_shader_buts_tex_sky(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "sun_direction", 0, "", ICON_NONE);
@@ -1225,7 +1233,7 @@ static void node_shader_set_butfunc(bNodeType *ntype)
ntype->uifunc= node_shader_buts_tex_image;
break;
case SH_NODE_TEX_ENVIRONMENT:
- ntype->uifunc= node_shader_buts_tex_image;
+ ntype->uifunc= node_shader_buts_tex_environment;
break;
case SH_NODE_TEX_GRADIENT:
ntype->uifunc= node_shader_buts_tex_gradient;
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 5b35352417c..a2775832c1d 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -453,7 +453,7 @@ static void node_draw_mute_line(View2D *v2d, SpaceNode *snode, bNode *node)
}
/* this might have some more generic use */
-static void node_circle_draw(float x, float y, float size, char *col)
+static void node_circle_draw(float x, float y, float size, char *col, int highlight)
{
/* 16 values of sin function */
static float si[16] = {
@@ -478,7 +478,13 @@ static void node_circle_draw(float x, float y, float size, char *col)
glVertex2f(x+size*si[a], y+size*co[a]);
glEnd();
- glColor4ub(0, 0, 0, 150);
+ if (highlight) {
+ UI_ThemeColor(TH_TEXT_HI);
+ glLineWidth(1.5f);
+ }
+ else {
+ glColor4ub(0, 0, 0, 150);
+ }
glEnable(GL_BLEND);
glEnable( GL_LINE_SMOOTH );
glBegin(GL_LINE_LOOP);
@@ -487,12 +493,13 @@ static void node_circle_draw(float x, float y, float size, char *col)
glEnd();
glDisable( GL_LINE_SMOOTH );
glDisable(GL_BLEND);
+ glLineWidth(1.0f);
}
void node_socket_circle_draw(bNodeTree *UNUSED(ntree), bNodeSocket *sock, float size)
{
bNodeSocketType *stype = ntreeGetSocketType(sock->type);
- node_circle_draw(sock->locx, sock->locy, size, stype->ui_color);
+ node_circle_draw(sock->locx, sock->locy, size, stype->ui_color, (sock->flag & SELECT));
}
/* ************** Socket callbacks *********** */
@@ -653,11 +660,13 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
UI_DrawTriIcon(rct->xmin+10.0f, rct->ymax-NODE_DY/2.0f, 'v');
}
- /* this isn't doing anything for the label, so commenting out
+ /* this isn't doing anything for the label, so commenting out */
+#if 0
if(node->flag & SELECT)
UI_ThemeColor(TH_TEXT_HI);
else
- UI_ThemeColor(TH_TEXT); */
+ UI_ThemeColor(TH_TEXT);
+#endif
BLI_strncpy(showname, nodeLabel(node), sizeof(showname));
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index a6d18b58cca..8587133976d 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -139,7 +139,7 @@ static void compo_freejob(void *cjv)
}
/* only now we copy the nodetree, so adding many jobs while
- sliding buttons doesn't frustrate */
+ * sliding buttons doesn't frustrate */
static void compo_initjob(void *cjv)
{
CompoJob *cj= cjv;
@@ -1639,15 +1639,18 @@ void node_set_hidden_sockets(SpaceNode *snode, bNode *node, short flag, int set)
}
}
-static void node_link_viewer(SpaceNode *snode, bNode *tonode)
+static int node_link_viewer(const bContext *C, bNode *tonode)
{
+ SpaceNode *snode = CTX_wm_space_node(C);
bNode *node;
+ bNodeLink *link;
+ bNodeSocket *sock;
/* context check */
if(tonode==NULL || tonode->outputs.first==NULL)
- return;
+ return OPERATOR_CANCELLED;
if( ELEM(tonode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
- return;
+ return OPERATOR_CANCELLED;
/* get viewer */
for(node= snode->edittree->nodes.first; node; node= node->next)
@@ -1663,52 +1666,69 @@ static void node_link_viewer(SpaceNode *snode, bNode *tonode)
}
}
}
-
- if(node) {
- bNodeLink *link;
- bNodeSocket *sock= NULL;
-
- /* try to find an already connected socket to cycle to the next */
+
+ sock = NULL;
+
+ /* try to find an already connected socket to cycle to the next */
+ if (node) {
+ link = NULL;
for(link= snode->edittree->links.first; link; link= link->next)
if(link->tonode==node && link->fromnode==tonode)
if(link->tosock==node->inputs.first)
break;
-
if(link) {
/* unlink existing connection */
sock= link->fromsock;
nodeRemLink(snode->edittree, link);
-
+
/* find a socket after the previously connected socket */
for(sock=sock->next; sock; sock= sock->next)
if(!nodeSocketIsHidden(sock))
break;
}
-
- /* find a socket starting from the first socket */
- if(!sock) {
- for(sock= tonode->outputs.first; sock; sock= sock->next)
- if(!nodeSocketIsHidden(sock))
- break;
+ }
+
+ /* find a socket starting from the first socket */
+ if(!sock) {
+ for(sock= tonode->outputs.first; sock; sock= sock->next)
+ if(!nodeSocketIsHidden(sock))
+ break;
+ }
+
+ if(sock) {
+ /* add a new viewer if none exists yet */
+ if(!node) {
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
+ bNodeTemplate ntemp;
+
+ ntemp.type = CMP_NODE_VIEWER;
+ /* XXX location is a quick hack, just place it next to the linked socket */
+ node = node_add_node(snode, bmain, scene, &ntemp, sock->locx + 100, sock->locy);
+ if (!node)
+ return OPERATOR_CANCELLED;
+
+ link = NULL;
}
-
- if(sock) {
+ else {
/* get link to viewer */
for(link= snode->edittree->links.first; link; link= link->next)
if(link->tonode==node && link->tosock==node->inputs.first)
break;
-
- if(link==NULL) {
- nodeAddLink(snode->edittree, tonode, sock, node, node->inputs.first);
- }
- else {
- link->fromnode= tonode;
- link->fromsock= sock;
- }
- ntreeUpdateTree(snode->edittree);
- snode_update(snode, node);
}
+
+ if(link==NULL) {
+ nodeAddLink(snode->edittree, tonode, sock, node, node->inputs.first);
+ }
+ else {
+ link->fromnode= tonode;
+ link->fromsock= sock;
+ }
+ ntreeUpdateTree(snode->edittree);
+ snode_update(snode, node);
}
+
+ return OPERATOR_FINISHED;
}
@@ -1724,7 +1744,9 @@ static int node_active_link_viewer(bContext *C, wmOperator *UNUSED(op))
ED_preview_kill_jobs(C);
- node_link_viewer(snode, node);
+ if (node_link_viewer(C, node) == OPERATOR_CANCELLED)
+ return OPERATOR_CANCELLED;
+
snode_notify(C, snode);
return OPERATOR_FINISHED;
@@ -1741,7 +1763,7 @@ void NODE_OT_link_viewer(wmOperatorType *ot)
/* api callbacks */
ot->exec= node_active_link_viewer;
- ot->poll= ED_operator_node_active;
+ ot->poll= composite_node_active;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1779,12 +1801,15 @@ static int UNUSED_FUNCTION(node_mouse_groupheader)(SpaceNode *snode)
/* checks snode->mouse position, and returns found node/socket */
/* type is SOCK_IN and/or SOCK_OUT */
-static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **sockp, int in_out)
+int node_find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **sockp, int in_out)
{
bNode *node;
bNodeSocket *sock;
rctf rect;
+ *nodep= NULL;
+ *sockp= NULL;
+
/* check if we click in a socket */
for(node= snode->edittree->nodes.first; node; node= node->next) {
@@ -1861,43 +1886,6 @@ static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **
return 0;
}
-static int node_socket_hilights(SpaceNode *snode, int in_out)
-{
- bNode *node;
- bNodeSocket *sock, *tsock, *socksel= NULL;
- short redraw= 0;
-
- if(snode->edittree==NULL) return 0;
-
- /* deselect sockets */
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- for(sock= node->inputs.first; sock; sock= sock->next) {
- if(sock->flag & SELECT) {
- sock->flag &= ~SELECT;
- redraw++;
- socksel= sock;
- }
- }
- for(sock= node->outputs.first; sock; sock= sock->next) {
- if(sock->flag & SELECT) {
- sock->flag &= ~SELECT;
- redraw++;
- socksel= sock;
- }
- }
- }
-
- // XXX mousepos should be set here!
-
- if(find_indicated_socket(snode, &node, &tsock, in_out)) {
- tsock->flag |= SELECT;
- if(redraw==1 && tsock==socksel) redraw= 0;
- else redraw= 1;
- }
-
- return redraw;
-}
-
static int outside_group_rect(SpaceNode *snode)
{
bNode *gnode= node_tree_get_editgroup(snode->nodetree);
@@ -1944,9 +1932,17 @@ static bNodeSocket *best_socket_output(bNodeTree *ntree, bNode *node, bNodeSocke
{
bNodeSocket *sock;
- /* first try to find a socket with a matching name */
+ /* first look for selected output */
+ for (sock=node->outputs.first; sock; sock=sock->next) {
+ if (!socket_is_available(ntree, sock, allow_multiple))
+ continue;
+
+ if (sock->flag & SELECT)
+ return sock;
+ }
+
+ /* try to find a socket with a matching name */
for (sock=node->outputs.first; sock; sock=sock->next) {
-
if (!socket_is_available(ntree, sock, allow_multiple))
continue;
@@ -1972,7 +1968,7 @@ static bNodeSocket *best_socket_output(bNodeTree *ntree, bNode *node, bNodeSocke
return NULL;
}
-/* this is a bit complicated, but designed to prioritise finding
+/* this is a bit complicated, but designed to prioritize finding
* sockets of higher types, such as image, first */
static bNodeSocket *best_socket_input(bNodeTree *ntree, bNode *node, int num, int replace)
{
@@ -2006,15 +2002,36 @@ static bNodeSocket *best_socket_input(bNodeTree *ntree, bNode *node, int num, in
return NULL;
}
+static int snode_autoconnect_input(SpaceNode *snode, bNode *node_fr, bNodeSocket *sock_fr, bNode *node_to, bNodeSocket *sock_to, int replace)
+{
+ bNodeTree *ntree = snode->edittree;
+ bNodeLink *link;
+
+ /* then we can connect */
+ if (replace)
+ nodeRemSocketLinks(ntree, sock_to);
+
+ link = nodeAddLink(ntree, node_fr, sock_fr, node_to, sock_to);
+ /* validate the new link */
+ ntreeUpdateTree(ntree);
+ if (!(link->flag & NODE_LINK_VALID)) {
+ nodeRemLink(ntree, link);
+ return 0;
+ }
+
+ snode_update(snode, node_to);
+ return 1;
+}
+
void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace)
{
+ bNodeTree *ntree = snode->edittree;
ListBase *nodelist = MEM_callocN(sizeof(ListBase), "items_list");
bNodeListItem *nli;
bNode *node;
- bNodeLink *link;
int i, numlinks=0;
- for(node= snode->edittree->nodes.first; node; node= node->next) {
+ for(node= ntree->nodes.first; node; node= node->next) {
if(node->flag & NODE_SELECT) {
nli = MEM_mallocN(sizeof(bNodeListItem), "temporary node list item");
nli->node = node;
@@ -2028,43 +2045,57 @@ void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace)
for (nli=nodelist->first; nli; nli=nli->next) {
bNode *node_fr, *node_to;
bNodeSocket *sock_fr, *sock_to;
+ int has_selected_inputs = 0;
if (nli->next == NULL) break;
node_fr = nli->node;
node_to = nli->next->node;
- /* check over input sockets first */
- for (i=0; i<BLI_countlist(&node_to->inputs); i++) {
-
- /* find the best guess input socket */
- sock_to = best_socket_input(snode->edittree, node_to, i, replace);
- if (!sock_to) continue;
-
- /* check for an appropriate output socket to connect from */
- sock_fr = best_socket_output(snode->edittree, node_fr, sock_to, allow_multiple);
- if (!sock_fr) continue;
-
- /* then we can connect */
- if (replace)
- nodeRemSocketLinks(snode->edittree, sock_to);
-
- link = nodeAddLink(snode->edittree, node_fr, sock_fr, node_to, sock_to);
- /* validate the new link */
- ntreeUpdateTree(snode->edittree);
- if (!(link->flag & NODE_LINK_VALID)) {
- nodeRemLink(snode->edittree, link);
- continue;
+ /* if there are selected sockets, connect those */
+ for (sock_to = node_to->inputs.first; sock_to; sock_to=sock_to->next) {
+ if (sock_to->flag & SELECT) {
+ has_selected_inputs = 1;
+
+ if (!socket_is_available(ntree, sock_to, replace))
+ continue;
+
+ /* check for an appropriate output socket to connect from */
+ sock_fr = best_socket_output(ntree, node_fr, sock_to, allow_multiple);
+ if (!sock_fr)
+ continue;
+
+ if (snode_autoconnect_input(snode, node_fr, sock_fr, node_to, sock_to, replace))
+ ++numlinks;
}
+ }
+
+ if (!has_selected_inputs) {
+ /* no selected inputs, connect by finding suitable match */
+ int num_inputs = BLI_countlist(&node_to->inputs);
- snode_update(snode, node_to);
- ++numlinks;
- break;
+ for (i=0; i<num_inputs; i++) {
+
+ /* find the best guess input socket */
+ sock_to = best_socket_input(ntree, node_to, i, replace);
+ if (!sock_to)
+ continue;
+
+ /* check for an appropriate output socket to connect from */
+ sock_fr = best_socket_output(ntree, node_fr, sock_to, allow_multiple);
+ if (!sock_fr)
+ continue;
+
+ if (snode_autoconnect_input(snode, node_fr, sock_fr, node_to, sock_to, replace)) {
+ ++numlinks;
+ break;
+ }
+ }
}
}
if (numlinks > 0) {
- ntreeUpdateTree(snode->edittree);
+ ntreeUpdateTree(ntree);
}
BLI_freelistN(nodelist);
@@ -2126,6 +2157,7 @@ static int node_duplicate_exec(bContext *C, wmOperator *op)
SpaceNode *snode= CTX_wm_space_node(C);
bNodeTree *ntree= snode->edittree;
bNode *node, *newnode, *lastnode;
+ bNodeSocket *sock;
bNodeLink *link, *newlink, *lastlink;
int keep_inputs = RNA_boolean_get(op->ptr, "keep_inputs");
@@ -2190,6 +2222,12 @@ static int node_duplicate_exec(bContext *C, wmOperator *op)
node->flag &= ~(NODE_SELECT|NODE_ACTIVE);
newnode->flag |= NODE_SELECT;
+
+ /* deselect old node sockets */
+ for (sock=node->inputs.first; sock; sock=sock->next)
+ sock->flag &= ~SELECT;
+ for (sock=node->outputs.first; sock; sock=sock->next)
+ sock->flag &= ~SELECT;
}
/* make sure we don't copy new nodes again! */
@@ -2284,7 +2322,10 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event)
case MOUSEMOVE:
if(in_out==SOCK_OUT) {
- if(find_indicated_socket(snode, &tnode, &tsock, SOCK_IN)) {
+ /* only target socket becomes hilighted */
+ node_deselect_all_input_sockets(snode, 0);
+
+ if(node_find_indicated_socket(snode, &tnode, &tsock, SOCK_IN)) {
if(nodeFindLink(snode->edittree, sock, tsock)==NULL) {
if( link->tosock!= tsock && (!tnode || (tnode!=node && link->tonode!=tnode)) ) {
link->tonode= tnode;
@@ -2297,6 +2338,9 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event)
ntreeUpdateTree(snode->edittree);
}
}
+
+ /* hilight target socket */
+ tsock->flag |= SELECT;
}
else {
if (link->tonode || link->tosock) {
@@ -2311,7 +2355,10 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event)
}
}
else {
- if(find_indicated_socket(snode, &tnode, &tsock, SOCK_OUT)) {
+ /* only target socket becomes hilighted */
+ node_deselect_all_output_sockets(snode, 0);
+
+ if(node_find_indicated_socket(snode, &tnode, &tsock, SOCK_OUT)) {
if(nodeFindLink(snode->edittree, sock, tsock)==NULL) {
if(nodeCountSocketLinks(snode->edittree, tsock) < tsock->limit) {
if( link->fromsock!= tsock && (!tnode || (tnode!=node && link->fromnode!=tnode)) ) {
@@ -2326,6 +2373,9 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event)
}
}
}
+
+ /* hilight target socket */
+ tsock->flag |= SELECT;
}
else {
if (link->tonode || link->tosock) {
@@ -2338,8 +2388,7 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event)
}
}
}
- /* hilight target sockets only */
- node_socket_hilights(snode, in_out==SOCK_OUT?SOCK_IN:SOCK_OUT);
+
ED_region_tag_redraw(ar);
break;
@@ -2354,6 +2403,10 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event)
if(in_out==SOCK_OUT)
node_remove_extra_links(snode, link->tosock, link);
+ /* deselect sockets after successful linking */
+ node_deselect_all_input_sockets(snode, 0);
+ node_deselect_all_output_sockets(snode, 0);
+
/* when linking to group outputs, update the socket type */
/* XXX this should all be part of a generic update system */
if (!link->tonode) {
@@ -2378,6 +2431,10 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event)
}
snode->edittree->update |= NTREE_UPDATE_GROUP_OUT | NTREE_UPDATE_LINKS;
}
+
+ /* deselect sockets after successful linking */
+ node_deselect_all_input_sockets(snode, 0);
+ node_deselect_all_output_sockets(snode, 0);
}
else
nodeRemLink(snode->edittree, link);
@@ -2399,11 +2456,12 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event)
static int node_link_init(SpaceNode *snode, bNodeLinkDrag *nldrag)
{
bNodeLink *link;
+ int in_out = 0;
/* output indicated? */
- if(find_indicated_socket(snode, &nldrag->node, &nldrag->sock, SOCK_OUT)) {
+ if(node_find_indicated_socket(snode, &nldrag->node, &nldrag->sock, SOCK_OUT)) {
if(nodeCountSocketLinks(snode->edittree, nldrag->sock) < nldrag->sock->limit)
- return SOCK_OUT;
+ in_out = SOCK_OUT;
else {
/* find if we break a link */
for(link= snode->edittree->links.first; link; link= link->next) {
@@ -2414,14 +2472,18 @@ static int node_link_init(SpaceNode *snode, bNodeLinkDrag *nldrag)
nldrag->node= link->tonode;
nldrag->sock= link->tosock;
nodeRemLink(snode->edittree, link);
- return SOCK_IN;
+ in_out = SOCK_IN;
}
}
+
+ /* hilight source socket only */
+ node_deselect_all_output_sockets(snode, 0);
+ nldrag->sock->flag |= SELECT;
}
/* or an input? */
- else if(find_indicated_socket(snode, &nldrag->node, &nldrag->sock, SOCK_IN)) {
+ else if(node_find_indicated_socket(snode, &nldrag->node, &nldrag->sock, SOCK_IN)) {
if(nodeCountSocketLinks(snode->edittree, nldrag->sock) < nldrag->sock->limit)
- return SOCK_IN;
+ in_out = SOCK_IN;
else {
/* find if we break a link */
for(link= snode->edittree->links.first; link; link= link->next) {
@@ -2436,12 +2498,16 @@ static int node_link_init(SpaceNode *snode, bNodeLinkDrag *nldrag)
nldrag->node= link->fromnode;
nldrag->sock= link->fromsock;
nodeRemLink(snode->edittree, link);
- return SOCK_OUT;
+ in_out = SOCK_OUT;
}
}
+
+ /* hilight source socket only */
+ node_deselect_all_input_sockets(snode, 0);
+ nldrag->sock->flag |= SELECT;
}
- return 0;
+ return in_out;
}
static int node_link_invoke(bContext *C, wmOperator *op, wmEvent *event)
@@ -2530,6 +2596,10 @@ static int node_make_link_exec(bContext *C, wmOperator *op)
snode_autoconnect(snode, 1, replace);
+ /* deselect sockets after linking */
+ node_deselect_all_input_sockets(snode, 0);
+ node_deselect_all_output_sockets(snode, 0);
+
ntreeUpdateTree(snode->edittree);
snode_notify(C, snode);
snode_dag_update(C, snode);
@@ -2676,34 +2746,35 @@ void NODE_OT_links_detach(wmOperatorType *ot)
/* ********************* automatic node insert on dragging ******************* */
/* assumes sockets in list */
-static bNodeSocket *socket_best_match(ListBase *sockets, int type)
+static bNodeSocket *socket_best_match(ListBase *sockets)
{
bNodeSocket *sock;
+ int type, maxtype=0;
- /* first, match type */
- for(sock= sockets->first; sock; sock= sock->next)
- if(!nodeSocketIsHidden(sock))
- if(type == sock->type)
- return sock;
+ /* find type range */
+ for (sock=sockets->first; sock; sock=sock->next)
+ maxtype = MAX2(sock->type, maxtype);
- /* then just use first unhidden socket */
- for(sock= sockets->first; sock; sock= sock->next)
- if(!nodeSocketIsHidden(sock))
- return sock;
-
- /* OK, let's unhide proper one */
- for(sock= sockets->first; sock; sock= sock->next) {
- if(type == sock->type) {
- sock->flag &= ~(SOCK_HIDDEN|SOCK_AUTO_HIDDEN);
- return sock;
+ /* try all types, starting from 'highest' (i.e. colors, vectors, values) */
+ for (type=maxtype; type >= 0; --type) {
+ for(sock= sockets->first; sock; sock= sock->next) {
+ if(!nodeSocketIsHidden(sock) && type==sock->type) {
+ return sock;
+ }
}
}
- /* just the first */
- sock= sockets->first;
- sock->flag &= ~(SOCK_HIDDEN|SOCK_AUTO_HIDDEN);
+ /* no visible sockets, unhide first of highest type */
+ for (type=maxtype; type >= 0; --type) {
+ for(sock= sockets->first; sock; sock= sock->next) {
+ if(type==sock->type) {
+ sock->flag &= ~(SOCK_HIDDEN|SOCK_AUTO_HIDDEN);
+ return sock;
+ }
+ }
+ }
- return sockets->first;
+ return NULL;
}
/* prevent duplicate testing code below */
@@ -2761,10 +2832,10 @@ void ED_node_link_insert(ScrArea *sa)
sockto= link->tosock;
link->tonode= select;
- link->tosock= socket_best_match(&select->inputs, link->fromsock->type);
+ link->tosock= socket_best_match(&select->inputs);
link->flag &= ~NODE_LINKFLAG_HILITE;
- nodeAddLink(snode->edittree, select, socket_best_match(&select->outputs, sockto->type), node, sockto);
+ nodeAddLink(snode->edittree, select, socket_best_match(&select->outputs), node, sockto);
ntreeUpdateTree(snode->edittree); /* needed for pointers */
snode_update(snode, select);
ED_node_changed_update(snode->id, select);
@@ -2879,7 +2950,7 @@ static int node_read_fullsamplelayers_exec(bContext *C, wmOperator *UNUSED(op))
WM_cursor_wait(0);
/* note we are careful to send the right notifier, as otherwise the
- compositor would reexecute and overwrite the full sample result */
+ * compositor would reexecute and overwrite the full sample result */
WM_event_add_notifier(C, NC_SCENE|ND_COMPO_RESULT, NULL);
return OPERATOR_FINISHED;
@@ -3367,8 +3438,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
ntemp.type = -1;
/* check input variables */
- if (RNA_struct_property_is_set(op->ptr, "filepath"))
- {
+ if (RNA_struct_property_is_set(op->ptr, "filepath")) {
char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path);
@@ -3381,8 +3451,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
}
- else if(RNA_struct_property_is_set(op->ptr, "name"))
- {
+ else if(RNA_struct_property_is_set(op->ptr, "name")) {
char name[MAX_ID_NAME-2];
RNA_string_get(op->ptr, "name", name);
ima= (Image *)find_id("IM", name);
diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h
index 2524454d9c0..c2a418af064 100644
--- a/source/blender/editors/space_node/node_intern.h
+++ b/source/blender/editors/space_node/node_intern.h
@@ -82,6 +82,8 @@ void node_keymap(wmKeyConfig *keyconf);
/* node_select.c */
void node_deselect_all(struct SpaceNode *snode);
+void node_deselect_all_input_sockets(struct SpaceNode *snode, int deselect_nodes);
+void node_deselect_all_output_sockets(struct SpaceNode *snode, int deselect_nodes);
int node_select_same_type(struct SpaceNode *snode);
int node_select_same_type_np(struct SpaceNode *snode, int dir);
void node_select_single(struct bContext *C, struct bNode *node);
@@ -118,6 +120,7 @@ void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace);
int node_has_hidden_sockets(bNode *node, short flag);
void node_set_hidden_sockets(SpaceNode *snode, bNode *node, short flag, int set);
int node_render_changed_exec(bContext *, wmOperator *);
+int node_find_indicated_socket(struct SpaceNode *snode, struct bNode **nodep, struct bNodeSocket **sockp, int in_out);
void NODE_OT_duplicate(struct wmOperatorType *ot);
void NODE_OT_delete(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c
index d358556d36a..93263a2e54b 100644
--- a/source/blender/editors/space_node/node_ops.c
+++ b/source/blender/editors/space_node/node_ops.c
@@ -149,6 +149,7 @@ void node_keymap(struct wmKeyConfig *keyconf)
/* mouse select in nodes used to be both keys, but perhaps this should be reduced?
* NOTE: mouse-clicks on left-mouse will fall through to allow transform-tweak, but also link/resize
+ * NOTE 2: socket select is part of the node select operator, to handle overlapping cases
*/
kmi = WM_keymap_add_item(keymap, "NODE_OT_select", ACTIONMOUSE, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index 15efd65450c..e2f3e7b51f2 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -173,13 +173,150 @@ static void node_sort(bNodeTree *ntree)
}
}
+static void node_select(bNode *node)
+{
+ node->flag |= SELECT;
+}
+
+static void node_deselect(bNode *node)
+{
+ bNodeSocket *sock;
+
+ node->flag &= ~SELECT;
+
+ /* deselect sockets too */
+ for (sock=node->inputs.first; sock; sock=sock->next)
+ sock->flag &= ~SELECT;
+ for (sock=node->outputs.first; sock; sock=sock->next)
+ sock->flag &= ~SELECT;
+}
+
+static void node_toggle(bNode *node)
+{
+ if (node->flag & SELECT)
+ node_deselect(node);
+ else
+ node_select(node);
+}
+
+static void node_socket_select(bNode *node, bNodeSocket *sock)
+{
+ sock->flag |= SELECT;
+
+ /* select node too */
+ if (node)
+ node->flag |= SELECT;
+}
+
+static void node_socket_deselect(bNode *node, bNodeSocket *sock, int deselect_node)
+{
+ sock->flag &= ~SELECT;
+
+ if (node && deselect_node) {
+ int sel=0;
+
+ /* if no selected sockets remain, also deselect the node */
+ for (sock=node->inputs.first; sock; sock=sock->next) {
+ if (sock->flag & SELECT) {
+ sel = 1;
+ break;
+ }
+ }
+ for (sock=node->outputs.first; sock; sock=sock->next) {
+ if (sock->flag & SELECT) {
+ sel = 1;
+ break;
+ }
+ }
+
+ if (!sel)
+ node->flag &= ~SELECT;
+ }
+}
+
+static void node_socket_toggle(bNode *node, bNodeSocket *sock, int deselect_node)
+{
+ if (sock->flag & SELECT)
+ node_socket_deselect(node, sock, deselect_node);
+ else
+ node_socket_select(node, sock);
+}
+
/* no undo here! */
void node_deselect_all(SpaceNode *snode)
{
bNode *node;
for(node= snode->edittree->nodes.first; node; node= node->next)
- node->flag &= ~SELECT;
+ node_deselect(node);
+}
+
+void node_deselect_all_input_sockets(SpaceNode *snode, int deselect_nodes)
+{
+ bNode *node;
+ bNodeSocket *sock;
+
+ /* XXX not calling node_socket_deselect here each time, because this does iteration
+ * over all node sockets internally to check if the node stays selected.
+ * We can do that more efficiently here.
+ */
+
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
+ int sel=0;
+
+ for (sock= node->inputs.first; sock; sock=sock->next)
+ sock->flag &= ~SELECT;
+
+ /* if no selected sockets remain, also deselect the node */
+ if (deselect_nodes) {
+ for (sock= node->outputs.first; sock; sock=sock->next) {
+ if (sock->flag & SELECT) {
+ sel = 1;
+ break;
+ }
+ }
+
+ if (!sel)
+ node->flag &= ~SELECT;
+ }
+ }
+
+ for (sock= snode->edittree->outputs.first; sock; sock=sock->next)
+ sock->flag &= ~SELECT;
+}
+
+void node_deselect_all_output_sockets(SpaceNode *snode, int deselect_nodes)
+{
+ bNode *node;
+ bNodeSocket *sock;
+
+ /* XXX not calling node_socket_deselect here each time, because this does iteration
+ * over all node sockets internally to check if the node stays selected.
+ * We can do that more efficiently here.
+ */
+
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
+ int sel=0;
+
+ for (sock= node->outputs.first; sock; sock=sock->next)
+ sock->flag &= ~SELECT;
+
+ /* if no selected sockets remain, also deselect the node */
+ if (deselect_nodes) {
+ for (sock= node->inputs.first; sock; sock=sock->next) {
+ if (sock->flag & SELECT) {
+ sel = 1;
+ break;
+ }
+ }
+
+ if (!sel)
+ node->flag &= ~SELECT;
+ }
+ }
+
+ for (sock= snode->edittree->inputs.first; sock; sock=sock->next)
+ sock->flag &= ~SELECT;
}
/* return 1 if we need redraw otherwise zero. */
@@ -203,12 +340,12 @@ int node_select_same_type(SpaceNode *snode)
if (p->type != nac->type && p->flag & SELECT) {
/* if it's selected but different type, unselect */
redraw= 1;
- p->flag &= ~SELECT;
+ node_deselect(p);
}
else if (p->type == nac->type && (!(p->flag & SELECT))) {
/* if it's the same type and is not selected, select! */
redraw= 1;
- p->flag |= SELECT;
+ node_select(p);
}
}
return(redraw);
@@ -219,7 +356,7 @@ int node_select_same_type(SpaceNode *snode)
*/
int node_select_same_type_np(SpaceNode *snode, int dir)
{
- bNode *nac, *p;
+ bNode *nac, *p, *tnode;
/* search the active one. */
for (nac= snode->edittree->nodes.first; nac; nac= nac->next) {
@@ -248,8 +385,10 @@ int node_select_same_type_np(SpaceNode *snode, int dir)
}
if (p) {
- node_deselect_all(snode);
- p->flag |= SELECT;
+ for (tnode=snode->edittree->nodes.first; tnode; tnode=tnode->next)
+ if (tnode!=p)
+ node_deselect(tnode);
+ node_select(p);
return(1);
}
return(0);
@@ -259,9 +398,12 @@ void node_select_single(bContext *C, bNode *node)
{
Main *bmain= CTX_data_main(C);
SpaceNode *snode= CTX_wm_space_node(C);
+ bNode *tnode;
- node_deselect_all(snode);
- node->flag |= SELECT;
+ for (tnode=snode->edittree->nodes.first; tnode; tnode=tnode->next)
+ if (tnode!=node)
+ node_deselect(tnode);
+ node_select(node);
ED_node_set_active(bmain, snode->edittree, node);
@@ -272,34 +414,75 @@ void node_select_single(bContext *C, bNode *node)
/* ****** Click Select ****** */
-static bNode *node_mouse_select(Main *bmain, SpaceNode *snode, ARegion *ar, const int mval[2], short extend)
+static int node_mouse_select(Main *bmain, SpaceNode *snode, ARegion *ar, const int mval[2], short extend)
{
- bNode *node;
+ bNode *node, *tnode;
+ bNodeSocket *sock, *tsock;
float mx, my;
/* get mouse coordinates in view2d space */
- mx= (float)mval[0];
- my= (float)mval[1];
-
UI_view2d_region_to_view(&ar->v2d, mval[0], mval[1], &mx, &my);
-
- /* find the closest visible node */
- node = node_under_mouse(snode->edittree, mx, my);
-
- if (node) {
- if (extend == 0) {
- node_deselect_all(snode);
- node->flag |= SELECT;
+ /* node_find_indicated_socket uses snode->mx/my */
+ snode->mx = mx;
+ snode->my = my;
+
+ /* first do socket selection, these generally overlap with nodes */
+ if (node_find_indicated_socket(snode, &node, &sock, SOCK_IN)) {
+ if (extend) {
+ node_socket_toggle(node, sock, 1);
+ }
+ else {
+ node_deselect_all_input_sockets(snode, 1);
+ node_socket_select(node, sock);
+ }
+
+ return 1;
+ }
+ else if (node_find_indicated_socket(snode, &node, &sock, SOCK_OUT)) {
+ if (extend) {
+ if (sock->flag & SELECT) {
+ node_socket_deselect(node, sock, 1);
+ }
+ else {
+ /* still only allow one selected output per node when extending, for sensible linking.
+ * extend allows selecting outputs from different nodes though.
+ */
+ if (node) {
+ for (tsock=node->outputs.first; tsock; tsock=tsock->next)
+ node_socket_deselect(node, tsock, 1);
+ }
+ node_socket_select(node, sock);
+ }
+ }
+ else {
+ node_deselect_all_output_sockets(snode, 1);
+ node_socket_select(node, sock);
}
- else
- node->flag ^= SELECT;
- ED_node_set_active(bmain, snode->edittree, node);
+ return 1;
+ }
+ else {
+ /* find the closest visible node */
+ node = node_under_mouse(snode->edittree, mx, my);
+
+ if (node) {
+ if (extend == 0) {
+ for (tnode=snode->edittree->nodes.first; tnode; tnode=tnode->next)
+ if (tnode!=node)
+ node_deselect(tnode);
+ node_select(node);
+ }
+ else {
+ node_toggle(node);
+ }
+
+ ED_node_set_active(bmain, snode->edittree, node);
+ node_sort(snode->edittree);
+ return 1;
+ }
- node_sort(snode->edittree);
+ return 0;
}
-
- return node;
}
static int node_select_exec(bContext *C, wmOperator *op)
@@ -309,7 +492,6 @@ static int node_select_exec(bContext *C, wmOperator *op)
ARegion *ar= CTX_wm_region(C);
int mval[2];
short extend;
- /* bNode *node= NULL; */ /* UNUSED */
/* get settings from RNA properties for operator */
mval[0] = RNA_int_get(op->ptr, "mouse_x");
@@ -318,13 +500,17 @@ static int node_select_exec(bContext *C, wmOperator *op)
extend = RNA_boolean_get(op->ptr, "extend");
/* perform the select */
- /* node= */ /* UNUSED*/ node_mouse_select(bmain, snode, ar, mval, extend);
-
- /* send notifiers */
- WM_event_add_notifier(C, NC_NODE|NA_SELECTED, NULL);
-
- /* allow tweak event to work too */
- return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
+ if (node_mouse_select(bmain, snode, ar, mval, extend)) {
+ /* send notifiers */
+ WM_event_add_notifier(C, NC_NODE|NA_SELECTED, NULL);
+
+ /* allow tweak event to work too */
+ return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
+ }
+ else {
+ /* allow tweak event to work too */
+ return OPERATOR_CANCELLED|OPERATOR_PASS_THROUGH;
+ }
}
static int node_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
@@ -379,12 +565,12 @@ static int node_borderselect_exec(bContext *C, wmOperator *op)
for(node= snode->edittree->nodes.first; node; node= node->next) {
if(BLI_isect_rctf(&rectf, &node->totr, NULL)) {
if(gesture_mode==GESTURE_MODAL_SELECT)
- node->flag |= SELECT;
+ node_select(node);
else
- node->flag &= ~SELECT;
+ node_deselect(node);
}
else if(!extend) {
- node->flag &= ~SELECT;
+ node_deselect(node);
}
}
@@ -453,11 +639,11 @@ static int node_select_all_exec(bContext *C, wmOperator *UNUSED(op))
if(count) {
for(node=first; node; node=node->next)
- node->flag &= ~NODE_SELECT;
+ node_deselect(node);
}
else {
for(node=first; node; node=node->next)
- node->flag |= NODE_SELECT;
+ node_select(node);
}
node_sort(snode->edittree);
@@ -499,7 +685,7 @@ static int node_select_linked_to_exec(bContext *C, wmOperator *UNUSED(op))
for (node=snode->edittree->nodes.first; node; node=node->next) {
if (node->flag & NODE_TEST)
- node->flag |= NODE_SELECT;
+ node_select(node);
}
node_sort(snode->edittree);
@@ -541,7 +727,7 @@ static int node_select_linked_from_exec(bContext *C, wmOperator *UNUSED(op))
for(node=snode->edittree->nodes.first; node; node=node->next) {
if(node->flag & NODE_TEST)
- node->flag |= NODE_SELECT;
+ node_select(node);
}
node_sort(snode->edittree);
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c
index 24fb55be38e..781f37918fd 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -277,8 +277,12 @@ static void ui_node_sock_name(bNodeSocket *sock, char name[UI_MAX_NAME_STR])
bNode *node = sock->link->fromnode;
char node_name[UI_MAX_NAME_STR];
- if(node->type == NODE_GROUP)
- BLI_strncpy(node_name, node->id->name+2, UI_MAX_NAME_STR);
+ if(node->type == NODE_GROUP) {
+ if (node->id)
+ BLI_strncpy(node_name, node->id->name+2, UI_MAX_NAME_STR);
+ else
+ BLI_strncpy(node_name, "Group", UI_MAX_NAME_STR);
+ }
else
BLI_strncpy(node_name, node->typeinfo->name, UI_MAX_NAME_STR);
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index bb694ae5705..f0115170525 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -127,11 +127,13 @@ static void outliner_rna_width(SpaceOops *soops, ListBase *lb, int *w, int start
TreeElement *te= lb->first;
while(te) {
TreeStoreElem *tselem= TREESTORE(te);
- // XXX fixme... (currently, we're using a fixed length of 100)!
- /*if(te->xend) {
+ // XXX fixme... (currently, we're using a fixed length of 100)!
+#if 0
+ if(te->xend) {
if(te->xend > *w)
*w = te->xend;
- }*/
+ }
+#endif
if(startx+100 > *w)
*w = startx+100;
@@ -892,7 +894,7 @@ struct DrawIconArg {
static void tselem_draw_icon_uibut(struct DrawIconArg *arg, int icon)
{
- /* restrict collumn clip... it has been coded by simply overdrawing, doesnt work for buttons */
+ /* restrict column clip... it has been coded by simply overdrawing, doesnt work for buttons */
if(arg->x >= arg->xmax) {
glEnable(GL_BLEND);
UI_icon_draw_aspect(arg->x, arg->y, icon, 1.0f, arg->alpha);
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index ca0a9c15c8c..e844688b6c2 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -1128,7 +1128,7 @@ static void do_outliner_drivers_editop(SpaceOops *soops, ListBase *tree, ReportL
short flag= 0;
short groupmode= KSP_GROUP_KSNAME;
- /* check if RNA-property described by this selected element is an animateable prop */
+ /* check if RNA-property described by this selected element is an animatable prop */
if (ELEM(tselem->type, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM) && RNA_property_animateable(&te->rnaptr, te->directdata)) {
/* get id + path + index info from the selected element */
tree_element_to_path(soops, te, tselem,
@@ -1283,7 +1283,7 @@ static KeyingSet *verify_active_keyingset(Scene *scene, short add)
/* add if none found */
// XXX the default settings have yet to evolve
if ((add) && (ks==NULL)) {
- ks= BKE_keyingset_add(&scene->keyingsets, NULL, KEYINGSET_ABSOLUTE, 0);
+ ks= BKE_keyingset_add(&scene->keyingsets, NULL, NULL, KEYINGSET_ABSOLUTE, 0);
scene->active_keyingset= BLI_countlist(&scene->keyingsets);
}
@@ -1307,7 +1307,7 @@ static void do_outliner_keyingset_editop(SpaceOops *soops, KeyingSet *ks, ListBa
short flag= 0;
short groupmode= KSP_GROUP_KSNAME;
- /* check if RNA-property described by this selected element is an animateable prop */
+ /* check if RNA-property described by this selected element is an animatable prop */
if (ELEM(tselem->type, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM) && RNA_property_animateable(&te->rnaptr, te->directdata)) {
/* get id + path + index info from the selected element */
tree_element_to_path(soops, te, tselem,
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index 8c53e9ad111..b1990d3054e 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -127,20 +127,20 @@ typedef struct TreeElement {
/* Outliner Searching --
-
- Are we looking for something in the outliner?
- If so finding matches in child items makes it more useful
-
- - We want to flag parents to act as being open to filter child matches
- - and also flag matches so we can highlight them
- - Flags are stored in TreeStoreElem->flag
- - Flag options defined in DNA_outliner_types.h
- - SO_SEARCH_RECURSIVE defined in DNA_space_types.h
-
- - NOT in datablocks view - searching all datablocks takes way too long
- to be useful
- - not searching into RNA items helps but isn't the complete solution
- */
+ *
+ * Are we looking for something in the outliner?
+ * If so finding matches in child items makes it more useful
+ *
+ * - We want to flag parents to act as being open to filter child matches
+ * - and also flag matches so we can highlight them
+ * - Flags are stored in TreeStoreElem->flag
+ * - Flag options defined in DNA_outliner_types.h
+ * - SO_SEARCH_RECURSIVE defined in DNA_space_types.h
+ *
+ * - NOT in datablocks view - searching all datablocks takes way too long
+ * to be useful
+ * - not searching into RNA items helps but isn't the complete solution
+ */
#define SEARCHING_OUTLINER(sov) (sov->search_flags & SO_SEARCH_RECURSIVE)
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 345e7a835f4..4814edf585e 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -190,7 +190,7 @@ static int tree_element_set_active_object(bContext *C, Scene *scene, SpaceOops
sce= (Scene *)outliner_search_back(soops, te, ID_SCE);
if(sce && scene != sce) {
- ED_screen_set_scene(C, sce);
+ ED_screen_set_scene(C, CTX_wm_screen(C), sce);
}
/* find associated base in current scene */
@@ -374,7 +374,7 @@ static int tree_element_active_world(bContext *C, Scene *scene, SpaceOops *soops
if(set) { // make new scene active
if(sce && scene != sce) {
- ED_screen_set_scene(C, sce);
+ ED_screen_set_scene(C, CTX_wm_screen(C), sce);
}
}
@@ -664,7 +664,7 @@ int tree_element_active(bContext *C, Scene *scene, SpaceOops *soops, TreeElement
switch(te->idcode) {
/* Note: no ID_OB: objects are handled specially to allow multiple
- selection. See do_outliner_item_activate. */
+ * selection. See do_outliner_item_activate. */
case ID_MA:
return tree_element_active_material(C, scene, soops, te, set);
case ID_WO:
@@ -761,7 +761,7 @@ static int do_outliner_item_activate(bContext *C, Scene *scene, ARegion *ar, Spa
/* editmode? */
if(te->idcode==ID_SCE) {
if(scene!=(Scene *)tselem->id) {
- ED_screen_set_scene(C, (Scene *)tselem->id);
+ ED_screen_set_scene(C, CTX_wm_screen(C), (Scene *)tselem->id);
}
}
else if(te->idcode==ID_GR) {
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 09a125692d2..b44e363090f 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -391,7 +391,7 @@ static void group_linkobs2scene_cb(bContext *UNUSED(C), Scene *scene, TreeElemen
gob->ob->flag |= SELECT;
base->flag = gob->ob->flag;
base->object= gob->ob;
- id_lib_extern((ID *)gob->ob); /* incase these are from a linked group */
+ id_lib_extern((ID *)gob->ob); /* in case these are from a linked group */
}
}
}
@@ -409,7 +409,7 @@ void outliner_do_object_operation(bContext *C, Scene *scene_act, SpaceOops *soop
// when objects selected in other scenes... dunno if that should be allowed
Scene *scene_owner= (Scene *)outliner_search_back(soops, te, ID_SCE);
if(scene_owner && scene_act != scene_owner) {
- ED_screen_set_scene(C, scene_owner);
+ ED_screen_set_scene(C, CTX_wm_screen(C), scene_owner);
}
/* important to use 'scene_owner' not scene_act else deleting objects can crash.
* only use 'scene_act' when 'scene_owner' is NULL, which can happen when the
@@ -561,7 +561,7 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
Scene *sce= scene; // to be able to delete, scenes are set...
outliner_do_object_operation(C, scene, soops, &soops->tree, object_select_cb);
if(scene != sce) {
- ED_screen_set_scene(C, sce);
+ ED_screen_set_scene(C, CTX_wm_screen(C), sce);
}
str= "Select Objects";
@@ -576,10 +576,10 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
outliner_do_object_operation(C, scene, soops, &soops->tree, object_delete_cb);
/* XXX: tree management normally happens from draw_outliner(), but when
- you're clicking to fast on Delete object from context menu in
- outliner several mouse events can be handled in one cycle without
- handling notifiers/redraw which leads to deleting the same object twice.
- cleanup tree here to prevent such cases. */
+ * you're clicking to fast on Delete object from context menu in
+ * outliner several mouse events can be handled in one cycle without
+ * handling notifiers/redraw which leads to deleting the same object twice.
+ * cleanup tree here to prevent such cases. */
outliner_cleanup_tree(soops);
DAG_scene_sort(bmain, scene);
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 7f3a8694d68..56cfcf9e18a 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -644,7 +644,7 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
for(a=0; a<me->totcol; a++)
outliner_add_element(soops, &te->subtree, me->mat[a], te, 0, a);
/* could do tfaces with image links, but the images are not grouped nicely.
- would require going over all tfaces, sort images in use. etc... */
+ * would require going over all tfaces, sort images in use. etc... */
}
break;
case ID_CU:
@@ -1412,8 +1412,8 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
int show_opened= (soops->treestore==NULL); /* on first view, we open scenes */
/* Are we looking for something - we want to tag parents to filter child matches
- - NOT in datablocks view - searching all datablocks takes way too long to be useful
- - this variable is only set once per tree build */
+ * - NOT in datablocks view - searching all datablocks takes way too long to be useful
+ * - this variable is only set once per tree build */
if(soops->search_string[0]!=0 && soops->outlinevis!=SO_DATABLOCKS)
soops->search_flags |= SO_SEARCH_RECURSIVE;
else
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index df38f87b798..96e837eb95b 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -592,7 +592,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- /* If seq1 is NULL and no error was rasied it means the seq is standalone
+ /* If seq1 is NULL and no error was raised it means the seq is standalone
* (like color strips) and we need to check its start and end frames are valid */
if (seq1==NULL && end_frame <= start_frame) {
BKE_report(op->reports, RPT_ERROR, "Start and end frame are not set");
@@ -701,7 +701,7 @@ static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEven
type= RNA_enum_get(op->ptr, "type");
/* when invoking an effect strip which uses inputs,
- * skip initialzing the channel from the mouse.
+ * skip initializing the channel from the mouse.
* Instead leave the property unset so exec() initializes it to be
* above the strips its applied to. */
if(get_sequence_effect_num_inputs(type) != 0) {
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 7bc8600c11c..1bbf4b670b5 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -167,12 +167,11 @@ static void get_seq_color3ubv(Scene *curscene, Sequence *seq, unsigned char col[
static void drawseqwave(Scene *scene, Sequence *seq, float x1, float y1, float x2, float y2, float stepsize)
{
/*
- x1 is the starting x value to draw the wave,
- x2 the end x value, same for y1 and y2
- stepsize is width of a pixel.
- */
- if(seq->flag & SEQ_AUDIO_DRAW_WAVEFORM)
- {
+ * x1 is the starting x value to draw the wave,
+ * x2 the end x value, same for y1 and y2
+ * stepsize is width of a pixel.
+ */
+ if(seq->flag & SEQ_AUDIO_DRAW_WAVEFORM) {
int i, j, pos;
int length = floor((x2-x1)/stepsize)+1;
float ymid = (y1+y2)/2;
@@ -478,7 +477,7 @@ static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq)
draw_shadedstrip(seq, col, x1, y1, (float)(seq->start), y2);
/* feint pinstripes, helps see exactly which is extended and which isn't,
- * especially when the extension is very small */
+ * especially when the extension is very small */
if (seq->flag & SELECT) UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 24);
else UI_GetColorPtrShade3ubv(col, col, -16);
@@ -496,7 +495,7 @@ static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq)
draw_shadedstrip(seq, col, (float)(seq->start+seq->len), y1, x2, y2);
/* feint pinstripes, helps see exactly which is extended and which isn't,
- * especially when the extension is very small */
+ * especially when the extension is very small */
if (seq->flag & SELECT) UI_GetColorPtrShade3ubv(col, col, 24);
else UI_GetColorPtrShade3ubv(col, col, -16);
@@ -637,10 +636,10 @@ static void draw_shadedstrip(Sequence *seq, unsigned char col[3], float x1, floa
}
/*
-Draw a sequence strip, bounds check already made
-ARegion is currently only used to get the windows width in pixels
-so wave file sample drawing precision is zoom adjusted
-*/
+ * Draw a sequence strip, bounds check already made
+ * ARegion is currently only used to get the windows width in pixels
+ * so wave file sample drawing precision is zoom adjusted
+ */
static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline_tint, float pixelx)
{
View2D *v2d= &ar->v2d;
@@ -831,7 +830,7 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq
}
break;
case SEQ_DRAW_IMG_WAVEFORM:
- if ((sseq->flag & SEQ_DRAW_COLOR_SEPERATED) != 0) {
+ if ((sseq->flag & SEQ_DRAW_COLOR_SEPARATED) != 0) {
scope = make_sep_waveform_view_from_ibuf(ibuf);
} else {
scope = make_waveform_view_from_ibuf(ibuf);
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index fad402a6787..2815297eb13 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -414,7 +414,7 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[
if (displen / pixelx > 16) { /* dont even try to grab the handles of small strips */
/* Set the max value to handle to 1/3 of the total len when its less then 28.
- * This is important because otherwise selecting handles happens even when you click in the middle */
+ * This is important because otherwise selecting handles happens even when you click in the middle */
if ((displen/3) < 30*pixelx) {
handsize = displen/3;
@@ -515,7 +515,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
}
/* make sequence selection a little bit more intuitive
- for 3 strips: the last-strip should be sequence3 */
+ * for 3 strips: the last-strip should be sequence3 */
if (seq3 != NULL && seq2 != NULL) {
Sequence *tmp = seq2;
seq2 = seq3;
@@ -559,7 +559,7 @@ static Sequence *del_seq_find_replace_recurs(Scene *scene, Sequence *seq)
Sequence *seq1, *seq2, *seq3;
/* try to find a replacement input sequence, and flag for later deletion if
- no replacement can be found */
+ * no replacement can be found */
if(!seq)
return NULL;
@@ -886,7 +886,7 @@ static void UNUSED_FUNCTION(touch_seq_files)(Scene *scene)
WM_cursor_wait(0);
}
-/*
+#if 0
static void set_filter_seq(Scene *scene)
{
Sequence *seq;
@@ -909,7 +909,7 @@ static void set_filter_seq(Scene *scene)
}
SEQ_END
}
-*/
+#endif
static void UNUSED_FUNCTION(seq_remap_paths)(Scene *scene)
{
@@ -980,7 +980,7 @@ static void UNUSED_FUNCTION(no_gaps)(Scene *scene)
static int seq_get_snaplimit(View2D *v2d)
{
/* fake mouse coords to get the snap value
- a bit lazy but its only done once pre transform */
+ * a bit lazy but its only done once pre transform */
float xmouse, ymouse, x;
int mval[2] = {24, 0}; /* 24 screen px snap */
@@ -1733,7 +1733,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
while (seq) {
if((seq->flag & SELECT) && (seq->type == SEQ_IMAGE) && (seq->len > 1)) {
/* remove seq so overlap tests dont conflict,
- see seq_free_sequence below for the real free'ing */
+ * see seq_free_sequence below for the real free'ing */
BLI_remlink(ed->seqbasep, seq);
/* if(seq->ipo) seq->ipo->id.us--; */
/* XXX, remove fcurve and assign to split image strips */
@@ -2306,8 +2306,8 @@ static int find_next_prev_edit(Scene *scene, int cfra, int side)
}
/* if no sequence to the right is found and the
- frame is on the start of the last sequence,
- move to the end of the last sequence */
+ * frame is on the start of the last sequence,
+ * move to the end of the last sequence */
if (frame_seq) cfra = frame_seq->enddisp;
return best_seq ? best_seq->startdisp : cfra;
@@ -2913,7 +2913,7 @@ static int sequencer_change_effect_type_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- /* can someone explain the logic behind only allowing to increse this,
+ /* can someone explain the logic behind only allowing to increase this,
* copied from 2.4x - campbell */
if (get_sequence_effect_num_inputs(seq->type) <
get_sequence_effect_num_inputs(new_type)
diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c
index ec9f8bb36d9..e53d06c9786 100644
--- a/source/blender/editors/space_sequencer/sequencer_ops.c
+++ b/source/blender/editors/space_sequencer/sequencer_ops.c
@@ -1,6 +1,4 @@
-
/*
- *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -45,6 +43,7 @@
#include "WM_api.h"
#include "WM_types.h"
+#include "ED_markers.h"
#include "ED_transform.h" /* transform keymap */
#include "sequencer_intern.h"
@@ -118,16 +117,19 @@ void sequencer_operatortypes(void)
void sequencer_keymap(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "SequencerCommon", SPACE_SEQ, 0);
+ wmKeyMap *keymap;
wmKeyMapItem *kmi;
-
+
+ /* Common items ------------------------------------------------------------------ */
+ keymap = WM_keymap_find(keyconf, "SequencerCommon", SPACE_SEQ, 0);
+
kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", OKEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "data_path", "scene.sequence_editor.show_overlay");
/* operators common to sequence and preview view */
WM_keymap_add_item(keymap, "SEQUENCER_OT_view_toggle", TABKEY, KM_PRESS, KM_CTRL, 0);
- /* operators for sequence */
+ /* Strips Region --------------------------------------------------------------- */
keymap= WM_keymap_find(keyconf, "Sequencer", SPACE_SEQ, 0);
WM_keymap_add_item(keymap, "SEQUENCER_OT_properties", NKEY, KM_PRESS, 0, 0);
@@ -188,7 +190,7 @@ void sequencer_keymap(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "SEQUENCER_OT_swap_inputs", SKEY, KM_PRESS, KM_ALT, 0);
/* multicam editing keyboard layout, switch to camera 1-10 using
- regular number keys */
+ * regular number keys */
{
int keys[] = { ONEKEY, TWOKEY, THREEKEY, FOURKEY, FIVEKEY,
SIXKEY, SEVENKEY, EIGHTKEY, NINEKEY, ZEROKEY };
@@ -213,7 +215,7 @@ void sequencer_keymap(wmKeyConfig *keyconf)
/* 2.4x method, now use Alt for handles and select the side based on which handle was selected */
- /*
+#if 0
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "linked_left", TRUE);
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
@@ -235,7 +237,7 @@ void sequencer_keymap(wmKeyConfig *keyconf)
kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_boolean_set(kmi->ptr, "linked_right", TRUE);
- */
+#endif
/* 2.5 method, Alt and use selected handle */
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
@@ -287,7 +289,12 @@ void sequencer_keymap(wmKeyConfig *keyconf)
RNA_int_set(kmi->ptr, "value", 0);
transform_keymap_for_space(keyconf, keymap, SPACE_SEQ);
-
+
+ /* special markers hotkeys for anim editors: see note in definition of this function */
+ ED_marker_keymap_animedit_conflictfree(keymap);
+
+
+ /* Preview Region ----------------------------------------------------------- */
keymap= WM_keymap_find(keyconf, "SequencerPreview", SPACE_SEQ, 0);
WM_keymap_add_item(keymap, "SEQUENCER_OT_view_all_preview", HOMEKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "SEQUENCER_OT_properties", NKEY, KM_PRESS, 0, 0);
@@ -307,6 +314,5 @@ void sequencer_keymap(wmKeyConfig *keyconf)
RNA_float_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_view_zoom_ratio", PAD4, KM_PRESS, 0, 0)->ptr, "ratio", 0.25f);
RNA_float_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_view_zoom_ratio", PAD8, KM_PRESS, 0, 0)->ptr, "ratio", 0.125f);
#endif
-
}
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 303f6912ff1..e3e362c53a8 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -572,8 +572,8 @@ void ED_spacetype_sequencer(void)
BLI_addhead(&st->regiontypes, art);
/* Keep as python only for now
- sequencer_buttons_register(art);
- */
+ * sequencer_buttons_register(art);
+ */
/* regions: header */
art= MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
@@ -591,7 +591,7 @@ void ED_spacetype_sequencer(void)
/* set the sequencer callback when not in background mode */
if(G.background==0) {
- sequencer_view3d_cb= ED_view3d_draw_offscreen_imbuf_simple;
+ sequencer_view3d_cb = ED_view3d_draw_offscreen_imbuf_simple;
}
}
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index 314afeac0e6..a416e9cf973 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -127,8 +127,8 @@ static void text_listener(ScrArea *sa, wmNotifier *wmn)
switch(wmn->category) {
case NC_TEXT:
/* check if active text was changed, no need to redraw if text isn't active
- reference==NULL means text was unlinked, should update anyway for this
- case -- no way to know was text active before unlinking or not */
+ * reference==NULL means text was unlinked, should update anyway for this
+ * case -- no way to know was text active before unlinking or not */
if(wmn->reference && wmn->reference != st->text)
break;
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 8a78f236fea..e9062b052e6 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -180,11 +180,11 @@ void flatten_string_free(FlattenString *fs)
}
/* Checks the specified source string for a Python built-in function name. This
- name must start at the beginning of the source string and must be followed by
- a non-identifier (see text_check_identifier(char)) or null character.
-
- If a built-in function is found, the length of the matching name is returned.
- Otherwise, -1 is returned. */
+ * name must start at the beginning of the source string and must be followed by
+ * a non-identifier (see text_check_identifier(char)) or null character.
+ *
+ * If a built-in function is found, the length of the matching name is returned.
+ * Otherwise, -1 is returned. */
static int find_builtinfunc(char *string)
{
@@ -219,11 +219,11 @@ static int find_builtinfunc(char *string)
}
/* Checks the specified source string for a Python special name. This name must
- start at the beginning of the source string and must be followed by a non-
- identifier (see text_check_identifier(char)) or null character.
-
- If a special name is found, the length of the matching name is returned.
- Otherwise, -1 is returned. */
+ * start at the beginning of the source string and must be followed by a non-
+ * identifier (see text_check_identifier(char)) or null character.
+ *
+ * If a special name is found, the length of the matching name is returned.
+ * Otherwise, -1 is returned. */
static int find_specialvar(char *string)
{
@@ -271,7 +271,7 @@ static int find_bool(char *string)
}
/* Ensures the format string for the given line is long enough, reallocating
- as needed. Allocation is done here, alone, to ensure consistency. */
+ * as needed. Allocation is done here, alone, to ensure consistency. */
static int text_check_format_len(TextLine *line, unsigned int len)
{
if(line->format) {
@@ -290,18 +290,18 @@ static int text_check_format_len(TextLine *line, unsigned int len)
}
/* Formats the specified line. If do_next is set, the process will move on to
- the succeeding line if it is affected (eg. multiline strings). Format strings
- may contain any of the following characters:
- '_' Whitespace
- '#' Comment text
- '!' Punctuation and other symbols
- 'n' Numerals
- 'l' String letters
- 'v' Special variables (class, def)
- 'b' Built-in names (print, for, etc.)
- 'q' Other text (identifiers, etc.)
- It is terminated with a null-terminator '\0' followed by a continuation
- flag indicating whether the line is part of a multi-line string. */
+ * the succeeding line if it is affected (eg. multiline strings). Format strings
+ * may contain any of the following characters:
+ * '_' Whitespace
+ * '#' Comment text
+ * '!' Punctuation and other symbols
+ * 'n' Numerals
+ * 'l' String letters
+ * 'v' Special variables (class, def)
+ * 'b' Built-in names (print, for, etc.)
+ * 'q' Other text (identifiers, etc.)
+ * It is terminated with a null-terminator '\0' followed by a continuation
+ * flag indicating whether the line is part of a multi-line string. */
static void txt_format_line(SpaceText *st, TextLine *line, int do_next)
{
@@ -488,31 +488,29 @@ static void format_draw_color(char formatchar)
/************************** draw text *****************************/
-/***********************/ /*
-
-Notes on word-wrap
---
-All word-wrap functions follow the algorithm below to maintain consistency.
- line The line to wrap (tabs converted to spaces)
- view_width The maximum number of characters displayable in the region
- This equals region_width/font_width for the region
- wrap_chars Characters that allow wrapping. This equals [' ', '\t', '-']
-
-def wrap(line, view_width, wrap_chars):
- draw_start = 0
- draw_end = view_width
- pos = 0
- for c in line:
- if pos-draw_start >= view_width:
- print line[draw_start:draw_end]
- draw_start = draw_end
- draw_end += view_width
- elif c in wrap_chars:
- draw_end = pos+1
- pos += 1
- print line[draw_start:]
-
-*/ /***********************/
+/* Notes on word-wrap
+ * --
+ * All word-wrap functions follow the algorithm below to maintain consistency.
+ * line The line to wrap (tabs converted to spaces)
+ * view_width The maximum number of characters displayable in the region
+ * This equals region_width/font_width for the region
+ * wrap_chars Characters that allow wrapping. This equals [' ', '\t', '-']
+ *
+ * def wrap(line, view_width, wrap_chars):
+ * draw_start = 0
+ * draw_end = view_width
+ * pos = 0
+ * for c in line:
+ * if pos-draw_start >= view_width:
+ * print line[draw_start:draw_end]
+ * draw_start = draw_end
+ * draw_end += view_width
+ * elif c in wrap_chars:
+ * draw_end = pos+1
+ * pos += 1
+ * print line[draw_start:]
+ *
+ */
int wrap_width(SpaceText *st, ARegion *ar)
{
@@ -961,8 +959,8 @@ void text_drawcache_tag_update(SpaceText *st, int full)
}
/* quick cache recalculation is also used in delete operator,
- which could merge lines which are adjusent to current selection lines
- expand recalculate area to this lines */
+ * which could merge lines which are adjacent to current selection lines
+ * expand recalculate area to this lines */
if(drawcache->valid_head>0) drawcache->valid_head--;
if(drawcache->valid_tail>0) drawcache->valid_tail--;
} else {
@@ -1115,7 +1113,7 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll, rcti *back)
scroll->ymin= 4;
scroll->ymax= 4+pix_available;
- /* when resizing a vieport with the bar at the bottom to a greater height more blank lines will be added */
+ /* when re-sizing a view-port with the bar at the bottom to a greater height more blank lines will be added */
if(ltexth + blank_lines < st->top + st->viewlines) {
blank_lines = st->top + st->viewlines - ltexth;
}
@@ -1856,7 +1854,7 @@ void text_update_character_width(SpaceText *st)
}
/* Moves the view to the cursor location,
- also used to make sure the view isnt outside the file */
+ * also used to make sure the view isnt outside the file */
void text_scroll_to_cursor(SpaceText *st, ScrArea *sa)
{
Text *text;
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index a44d5909a4f..17857275d36 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -73,6 +73,13 @@
/************************ poll ***************************/
+
+BM_INLINE int text_pixel_x_to_index(SpaceText *st, const int x)
+{
+ /* add half the char width so mouse cursor selection is inbetween letters */
+ return (x + (st->cwidth / 2)) / st->cwidth;
+}
+
static int text_new_poll(bContext *UNUSED(C))
{
return 1;
@@ -1132,8 +1139,8 @@ static int text_convert_whitespace_exec(bContext *C, wmOperator *op)
tmp = tmp->next;
}
- if(type == TO_TABS) // Converting to tabs
- { //start over from the beginning
+ if (type == TO_TABS) { // Converting to tabs
+ //start over from the beginning
tmp = text->lines.first;
while(tmp) {
@@ -1775,10 +1782,10 @@ static void txt_wrap_move_down(SpaceText *st, ARegion *ar, short sel)
}
/* Moves the cursor vertically by the specified number of lines.
- If the destination line is shorter than the current cursor position, the
- cursor will be positioned at the end of this line.
-
- This is to replace screen_skip for PageUp/Down operations.
+ * If the destination line is shorter than the current cursor position, the
+ * cursor will be positioned at the end of this line.
+ *
+ * This is to replace screen_skip for PageUp/Down operations.
*/
static void cursor_skip(SpaceText* st, ARegion *ar, Text *text, int lines, int sel)
{
@@ -2243,9 +2250,9 @@ void TEXT_OT_scroll(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scroll";
- /*don't really see the difference between this and
- scroll_bar. Both do basically the same thing (aside
- from keymaps).*/
+ /* don't really see the difference between this and
+ * scroll_bar. Both do basically the same thing (aside
+ * from keymaps).*/
ot->idname= "TEXT_OT_scroll";
ot->description= "Scroll text screen";
@@ -2337,9 +2344,9 @@ void TEXT_OT_scroll_bar(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scrollbar";
- /*don't really see the difference between this and
- scroll. Both do basically the same thing (aside
- from keymaps).*/
+ /* don't really see the difference between this and
+ * scroll. Both do basically the same thing (aside
+ * from keymaps).*/
ot->idname= "TEXT_OT_scroll_bar";
ot->description= "Scroll text screen";
@@ -2530,7 +2537,7 @@ static void text_cursor_set_to_pos(SpaceText *st, ARegion *ar, int x, int y, int
else x-= TXT_OFFSET;
if(x<0) x= 0;
- x = (x/st->cwidth) + st->left;
+ x = text_pixel_x_to_index(st, x) + st->left;
if(st->wordwrap) {
text_cursor_set_to_pos_wrapped(st, ar, x, y, sel);
@@ -3103,9 +3110,9 @@ static EnumPropertyItem resolution_items[]= {
{0, NULL, 0, NULL, NULL}};
/* returns 0 if file on disk is the same or Text is in memory only
- returns 1 if file has been modified on disk since last local edit
- returns 2 if file on disk has been deleted
- -1 is returned if an error occurs */
+ * returns 1 if file has been modified on disk since last local edit
+ * returns 2 if file on disk has been deleted
+ * -1 is returned if an error occurs */
int text_file_modified(Text *text)
{
diff --git a/source/blender/editors/space_text/text_python.c b/source/blender/editors/space_text/text_python.c
index efe744696df..88bd6b9c4c0 100644
--- a/source/blender/editors/space_text/text_python.c
+++ b/source/blender/editors/space_text/text_python.c
@@ -355,9 +355,10 @@ static short UNUSED_FUNCTION(do_texttools)(SpaceText *st, char ascii, unsigned s
}
}
- if(draw)
- {}; // XXX redraw_alltext();
-
+ if (draw) {
+ // XXX redraw_alltext();
+ }
+
return swallow;
}
@@ -540,8 +541,9 @@ static short UNUSED_FUNCTION(do_textmarkers)(SpaceText *st, char ascii, unsigned
}
}
- if(draw)
- {}; // XXX redraw_alltext();
+ if (draw) {
+ // XXX redraw_alltext();
+ }
return swallow;
}
diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c
index 922102e3921..e15252056cc 100644
--- a/source/blender/editors/space_view3d/drawanimviz.c
+++ b/source/blender/editors/space_view3d/drawanimviz.c
@@ -195,7 +195,9 @@ void draw_motion_path_instance(Scene *scene,
/* Draw big green dot where the current frame is */
// NOTE: only do this when drawing keyframes for now...
- if (avs->path_viewflag & MOTIONPATH_VIEW_KFRAS) {
+ if ((avs->path_viewflag & MOTIONPATH_VIEW_KFRAS) &&
+ (sfra < CFRA) && (CFRA <= efra))
+ {
UI_ThemeColor(TH_CFRAME);
glPointSize(6.0f);
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index e611ae1b64c..54dff3e4786 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -1280,8 +1280,8 @@ static void draw_wire_bone(int dt, int armflag, int boneflag, short constflag, u
static void draw_bone(int dt, int armflag, int boneflag, short constflag, unsigned int id, float length)
{
- /* Draw a 3d octahedral bone, we use normalized space based on length,
- for glDisplayLists */
+ /* Draw a 3d octahedral bone, we use normalized space based on length,
+ * for glDisplayLists */
glScalef(length, length, length);
@@ -1980,7 +1980,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
unsigned char col[4];
float col_f[4];
- glGetFloatv(GL_CURRENT_COLOR, col_f); /* incase this is not set below */
+ glGetFloatv(GL_CURRENT_COLOR, col_f); /* in case this is not set below */
rgb_float_to_uchar(col, col_f);
col[3]= 255;
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index e368d8c10b7..651b0edb123 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -139,7 +139,7 @@ static EdgeHash *get_tface_mesh_marked_edge_info(Mesh *me)
}
-static int draw_mesh_face_select__setHiddenOpts(void *userData, int index)
+static DMDrawOption draw_mesh_face_select__setHiddenOpts(void *userData, int index)
{
drawMeshFaceSelect_userData *data = userData;
Mesh *me= data->me;
@@ -147,34 +147,36 @@ static int draw_mesh_face_select__setHiddenOpts(void *userData, int index)
uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
if (me->drawflag & ME_DRAWEDGES) {
- if (me->drawflag & ME_HIDDENEDGES)
- return 1;
+ if ((me->drawflag & ME_HIDDENEDGES) || (flags & eEdge_Visible))
+ return DM_DRAW_OPTION_NORMAL;
else
- return (flags & eEdge_Visible);
+ return DM_DRAW_OPTION_SKIP;
}
+ else if(flags & eEdge_Select)
+ return DM_DRAW_OPTION_NORMAL;
else
- return (flags & eEdge_Select);
+ return DM_DRAW_OPTION_SKIP;
}
-static int draw_mesh_face_select__setSelectOpts(void *userData, int index)
+static DMDrawOption draw_mesh_face_select__setSelectOpts(void *userData, int index)
{
drawMeshFaceSelect_userData *data = userData;
MEdge *med = &data->me->medge[index];
uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
- return flags & eEdge_Select;
+ return (flags & eEdge_Select) ? DM_DRAW_OPTION_NORMAL : DM_DRAW_OPTION_SKIP;
}
/* draws unselected */
-static int draw_mesh_face_select__drawFaceOptsInv(void *userData, int index)
+static DMDrawOption draw_mesh_face_select__drawFaceOptsInv(void *userData, int index)
{
Mesh *me = (Mesh*)userData;
MPoly *mface = &me->mpoly[index];
if (!(mface->flag&ME_HIDE) && !(mface->flag&ME_FACE_SEL))
- return 2; /* Don't set color */
+ return DM_DRAW_OPTION_NO_MCOL; /* Don't set color */
else
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
static void draw_mesh_face_select(RegionView3D *rv3d, Mesh *me, DerivedMesh *dm)
@@ -388,22 +390,23 @@ static void draw_textured_end(void)
glPopMatrix();
}
-static int draw_tface__set_draw_legacy(MTFace *tface, int has_mcol, int matnr)
+static DMDrawOption draw_tface__set_draw_legacy(MTFace *tface, int has_mcol, int matnr)
{
Material *ma= give_current_material(Gtexdraw.ob, matnr+1);
int validtexture=0;
- if (ma && (ma->game.flag & GEMAT_INVISIBLE)) return 0;
+ if (ma && (ma->game.flag & GEMAT_INVISIBLE))
+ return DM_DRAW_OPTION_SKIP;
validtexture = set_draw_settings_cached(0, tface, ma, Gtexdraw);
if (tface && validtexture) {
glColor3ub(0xFF, 0x00, 0xFF);
- return 2; /* Don't set color */
+ return DM_DRAW_OPTION_NO_MCOL; /* Don't set color */
}
else if (ma && ma->shade_flag&MA_OBCOLOR) {
glColor3ubv(Gtexdraw.obcol);
- return 2; /* Don't set color */
+ return DM_DRAW_OPTION_NO_MCOL; /* Don't set color */
}
else if (!has_mcol) {
if (tface) glColor3f(1.0, 1.0, 1.0);
@@ -417,36 +420,39 @@ static int draw_tface__set_draw_legacy(MTFace *tface, int has_mcol, int matnr)
}
else glColor3f(1.0, 1.0, 1.0);
}
- return 2; /* Don't set color */
+ return DM_DRAW_OPTION_NO_MCOL; /* Don't set color */
}
else {
- return 1; /* Set color from mcol */
+ return DM_DRAW_OPTION_NORMAL; /* Set color from mcol */
}
}
-static int draw_mcol__set_draw_legacy(MTFace *UNUSED(tface), int has_mcol, int UNUSED(matnr))
+static DMDrawOption draw_mcol__set_draw_legacy(MTFace *UNUSED(tface), int has_mcol, int UNUSED(matnr))
{
- if (has_mcol) return 1;
- else return 2;
+ if (has_mcol)
+ return DM_DRAW_OPTION_NORMAL;
+ else
+ return DM_DRAW_OPTION_NO_MCOL;
}
-static int draw_tface__set_draw(MTFace *tface, int has_mcol, int matnr)
+static DMDrawOption draw_tface__set_draw(MTFace *tface, int has_mcol, int matnr)
{
Material *ma= give_current_material(Gtexdraw.ob, matnr+1);
if (ma && (ma->game.flag & GEMAT_INVISIBLE)) return 0;
if (tface && set_draw_settings_cached(0, tface, ma, Gtexdraw)) {
- return 2; /* Don't set color */
+ return DM_DRAW_OPTION_NO_MCOL; /* Don't set color */
}
else if (tface && tface->mode&TF_OBCOL) {
- return 2; /* Don't set color */
+ return DM_DRAW_OPTION_NO_MCOL; /* Don't set color */
}
else if (!has_mcol) {
- return 1; /* Don't set color */
+ /* XXX: this return value looks wrong (and doesn't match comment) */
+ return DM_DRAW_OPTION_NORMAL; /* Don't set color */
}
else {
- return 1; /* Set color from mcol */
+ return DM_DRAW_OPTION_NORMAL; /* Set color from mcol */
}
}
static void add_tface_color_layer(DerivedMesh *dm)
@@ -528,7 +534,7 @@ static void add_tface_color_layer(DerivedMesh *dm)
CustomData_add_layer( &dm->faceData, CD_TEXTURE_MCOL, CD_ASSIGN, finalCol, dm->numTessFaceData );
}
-static int draw_tface_mapped__set_draw(void *userData, int index)
+static DMDrawOption draw_tface_mapped__set_draw(void *userData, int index)
{
Mesh *me = (Mesh *)userData;
@@ -538,7 +544,7 @@ static int draw_tface_mapped__set_draw(void *userData, int index)
BLI_assert(index >= 0 && index < me->totpoly);
if (mpoly->flag & ME_HIDE) {
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
else {
MTexPoly *tpoly = (me->mtpoly) ? &me->mtpoly[index] : NULL;
@@ -553,14 +559,14 @@ static int draw_tface_mapped__set_draw(void *userData, int index)
}
}
-static int draw_em_tf_mapped__set_draw(void *userData, int index)
+static DMDrawOption draw_em_tf_mapped__set_draw(void *userData, int index)
{
drawEMTFMapped_userData *data = userData;
BMEditMesh *em = data->em;
BMFace *efa= EDBM_get_face_for_index(em, index);
if (efa==NULL || BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
else {
MTFace mtf= {{{0}}};
@@ -571,33 +577,33 @@ static int draw_em_tf_mapped__set_draw(void *userData, int index)
ME_MTEXFACE_CPY(&mtf, tpoly);
}
- return draw_tface__set_draw_legacy(&mtf, data->has_mcol, matnr);
+ return draw_tface__set_draw_legacy(data->has_mtface ? &mtf : NULL,
+ data->has_mcol, matnr);
}
}
-static int wpaint__setSolidDrawOptions_material(void *userData, int index, int *drawSmooth_r)
+static DMDrawOption wpaint__setSolidDrawOptions_material(void *userData, int index)
{
Mesh *me = (Mesh*)userData;
if (me->mat && me->mpoly) {
Material *ma= me->mat[me->mpoly[index].mat_nr];
if (ma && (ma->game.flag & GEMAT_INVISIBLE)) {
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
}
- *drawSmooth_r = 1;
- return 1;
+ return DM_DRAW_OPTION_NORMAL;
}
/* when face select is on, use face hidden flag */
-static int wpaint__setSolidDrawOptions_facemask(void *userData, int index, int *drawSmooth_r)
+static DMDrawOption wpaint__setSolidDrawOptions_facemask(void *userData, int index)
{
Mesh *me = (Mesh*)userData;
MPoly *mp = &me->mpoly[index];
- if (mp->flag & ME_HIDE) return 0;
- *drawSmooth_r = 1;
- return 1;
+ if (mp->flag & ME_HIDE)
+ return DM_DRAW_OPTION_SKIP;
+ return DM_DRAW_OPTION_NORMAL;
}
static void draw_mesh_text(Scene *scene, Object *ob, int glsl)
@@ -782,7 +788,8 @@ void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
}
else if (draw_flags & DRAW_FACE_SELECT) {
if (ob->mode & OB_MODE_WEIGHT_PAINT)
- dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions_facemask, GPU_enable_material, NULL, me, 1);
+ dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions_facemask, GPU_enable_material, NULL, me,
+ DM_DRAW_USE_COLORS | DM_DRAW_ALWAYS_SMOOTH);
else
dm->drawMappedFacesTex(dm, me->mpoly ? draw_tface_mapped__set_draw : NULL, NULL, me);
}
@@ -819,7 +826,7 @@ void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
/* reset from negative scale correction */
glFrontFace(GL_CCW);
- /* in editmode, the blend mode needs to be set incase it was ADD */
+ /* in editmode, the blend mode needs to be set in case it was ADD */
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
@@ -835,9 +842,9 @@ typedef struct TexMatCallback {
static void tex_mat_set_material_cb(void *UNUSED(userData), int mat_nr, void *attribs)
{
/* all we have to do here is simply enable the GLSL material, but note
- that the GLSL code will give different result depending on the drawtype,
- in texture draw mode it will output the active texture node, in material
- draw mode it will show the full material. */
+ * that the GLSL code will give different result depending on the drawtype,
+ * in texture draw mode it will output the active texture node, in material
+ * draw mode it will show the full material. */
GPU_enable_material(mat_nr, attribs);
}
@@ -939,10 +946,8 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *o
if (ob->mode & OB_MODE_WEIGHT_PAINT) {
/* weight paint mode exception */
- int useColors= 1;
-
dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions_material,
- GPU_enable_material, NULL, ob->data, useColors);
+ GPU_enable_material, NULL, ob->data, DM_DRAW_USE_COLORS | DM_DRAW_ALWAYS_SMOOTH);
}
else {
Mesh *me= ob->data;
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index fd978cf8fef..925e8703577 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -356,7 +356,7 @@ static float cube[8][3] = {
{ 1.0, 1.0, -1.0},
};
-/* ----------------- OpenGL Circle Drawing - Tables for Optimised Drawing Speed ------------------ */
+/* ----------------- OpenGL Circle Drawing - Tables for Optimized Drawing Speed ------------------ */
/* 32 values of sin function (still same result!) */
#define CIRCLE_RESOL 32
@@ -750,7 +750,7 @@ static void drawcentercircle(View3D *v3d, RegionView3D *rv3d, const float co[3],
float verts[CIRCLE_RESOL][3];
/* using gldepthfunc guarantees that it does write z values,
- * but not checks for it, so centers remain visible independt order of drawing */
+ * but not checks for it, so centers remain visible independent order of drawing */
if (v3d->zbuf) glDepthFunc(GL_ALWAYS);
glEnable(GL_BLEND);
@@ -778,7 +778,7 @@ static void drawcentercircle(View3D *v3d, RegionView3D *rv3d, const float co[3],
UI_ThemeColorShadeAlpha(TH_WIRE, 0, -30);
glDrawArrays(GL_LINE_LOOP, 0, CIRCLE_RESOL);
- /* finishe up */
+ /* finish up */
glDisableClientState(GL_VERTEX_ARRAY);
glDisable(GL_BLEND);
@@ -1057,7 +1057,7 @@ static void spotvolume(float lvec[3], float vvec[3], const float inp)
plane[1]= 1.0f;
/* now we've got two equations: one of a cone and one of a plane, but we have
- three unknowns. We remove one unkown by rotating the plane to z=0 (the plane normal) */
+ * three unknowns. We remove one unknown by rotating the plane to z=0 (the plane normal) */
/* rotate around cross product vector of (0,0,1) and plane normal, dot product degrees */
/* according definition, we derive cross product is (plane[1],-plane[0],0), en cos = plane[2]);*/
@@ -1339,8 +1339,8 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
if (la->type==LA_SPOT) {
float spotblcirc = fabs(z)*(1 - pow(la->spotblend, 2));
/* hide line if it is zero size or overlaps with outer border,
- previously it adjusted to always to show it but that seems
- confusing because it doesn't show the actual blend size */
+ * previously it adjusted to always to show it but that seems
+ * confusing because it doesn't show the actual blend size */
if (spotblcirc != 0 && spotblcirc != fabsf(z))
circ(0.0, 0.0, spotblcirc);
}
@@ -1543,8 +1543,8 @@ static void draw_viewport_object_reconstruction(Scene *scene, Base *base, View3D
if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
/* current ogl matrix is translated in camera space, bundles should
- be rendered in world space, so camera matrix should be "removed"
- from current ogl matrix */
+ * be rendered in world space, so camera matrix should be "removed"
+ * from current ogl matrix */
invert_m4_m4(imat, base->object->obmat);
glMultMatrixf(imat);
@@ -1562,7 +1562,7 @@ static void draw_viewport_object_reconstruction(Scene *scene, Base *base, View3D
for (track= tracksbase->first; track; track= track->next) {
int selected= TRACK_SELECTED(track);
- if ((draw_selected && !selected) || (draw_selected && !selected))
+ if (draw_selected && !selected)
continue;
if ((track->flag&TRACK_HAS_BUNDLE)==0)
@@ -2375,7 +2375,7 @@ static void draw_dm_verts(BMEditMesh *em, DerivedMesh *dm, int sel, BMVert *eve_
}
/* Draw edges with color set based on selection */
-static int draw_dm_edges_sel__setDrawOptions(void *userData, int index)
+static DMDrawOption draw_dm_edges_sel__setDrawOptions(void *userData, int index)
{
BMEdge *eed;
//unsigned char **cols = userData, *col;
@@ -2396,14 +2396,15 @@ static int draw_dm_edges_sel__setDrawOptions(void *userData, int index)
col = data->baseCol;
}
/* no alpha, this is used so a transparent color can disable drawing unselected edges in editmode */
- if (col[3]==0) return 0;
+ if (col[3]==0)
+ return DM_DRAW_OPTION_SKIP;
glColor4ubv(col);
}
- return 1;
+ return DM_DRAW_OPTION_NORMAL;
}
else {
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
}
static void draw_dm_edges_sel(BMEditMesh *em, DerivedMesh *dm, unsigned char *baseCol,
@@ -2420,19 +2421,26 @@ static void draw_dm_edges_sel(BMEditMesh *em, DerivedMesh *dm, unsigned char *ba
}
/* Draw edges */
-static int draw_dm_edges__setDrawOptions(void *userData, int index)
+static DMDrawOption draw_dm_edges__setDrawOptions(void *userData, int index)
{
- return !BM_elem_flag_test(EDBM_get_edge_for_index(userData, index), BM_ELEM_HIDDEN);
+ if (BM_elem_flag_test(EDBM_get_edge_for_index(userData, index), BM_ELEM_HIDDEN))
+ return DM_DRAW_OPTION_SKIP;
+ else
+ return DM_DRAW_OPTION_NORMAL;
}
+
static void draw_dm_edges(BMEditMesh *em, DerivedMesh *dm)
{
dm->drawMappedEdges(dm, draw_dm_edges__setDrawOptions, em);
}
/* Draw edges with color interpolated based on selection */
-static int draw_dm_edges_sel_interp__setDrawOptions(void *userData, int index)
+static DMDrawOption draw_dm_edges_sel_interp__setDrawOptions(void *userData, int index)
{
- return !BM_elem_flag_test(EDBM_get_edge_for_index(((void**)userData)[0], index), BM_ELEM_HIDDEN);
+ if (BM_elem_flag_test(EDBM_get_edge_for_index(((void**)userData)[0], index), BM_ELEM_HIDDEN))
+ return DM_DRAW_OPTION_SKIP;
+ else
+ return DM_DRAW_OPTION_NORMAL;
}
static void draw_dm_edges_sel_interp__setDrawInterpOptions(void *userData, int index, float t)
{
@@ -2455,11 +2463,14 @@ static void draw_dm_edges_sel_interp(BMEditMesh *em, DerivedMesh *dm, unsigned c
}
/* Draw only seam edges */
-static int draw_dm_edges_seams__setDrawOptions(void *userData, int index)
+static DMDrawOption draw_dm_edges_seams__setDrawOptions(void *userData, int index)
{
BMEdge *eed = EDBM_get_edge_for_index(userData, index);
- return !BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && BM_elem_flag_test(eed, BM_ELEM_SEAM);
+ if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && BM_elem_flag_test(eed, BM_ELEM_SEAM))
+ return DM_DRAW_OPTION_NORMAL;
+ else
+ return DM_DRAW_OPTION_SKIP;
}
static void draw_dm_edges_seams(BMEditMesh *em, DerivedMesh *dm)
@@ -2468,12 +2479,16 @@ static void draw_dm_edges_seams(BMEditMesh *em, DerivedMesh *dm)
}
/* Draw only sharp edges */
-static int draw_dm_edges_sharp__setDrawOptions(void *userData, int index)
+static DMDrawOption draw_dm_edges_sharp__setDrawOptions(void *userData, int index)
{
BMEdge *eed = EDBM_get_edge_for_index(userData, index);
- return !BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && !BM_elem_flag_test(eed, BM_ELEM_SMOOTH);
+ if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && !BM_elem_flag_test(eed, BM_ELEM_SMOOTH))
+ return DM_DRAW_OPTION_NORMAL;
+ else
+ return DM_DRAW_OPTION_SKIP;
}
+
static void draw_dm_edges_sharp(BMEditMesh *em, DerivedMesh *dm)
{
dm->drawMappedEdges(dm, draw_dm_edges_sharp__setDrawOptions, em);
@@ -2493,28 +2508,29 @@ static void draw_dm_edges_freestyle(BMEditMesh *em, DerivedMesh *dm)
/* Draw faces with color set based on selection
* return 2 for the active face so it renders with stipple enabled */
-static int draw_dm_faces_sel__setDrawOptions(void *userData, int index, int *UNUSED(drawSmooth_r))
+static DMDrawOption draw_dm_faces_sel__setDrawOptions(void *userData, int index)
{
drawDMFacesSel_userData * data = userData;
BMFace *efa = EDBM_get_face_for_index(data->em, index);
unsigned char *col;
if (!efa)
- return 0;
+ return DM_DRAW_OPTION_SKIP;
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
if (efa == data->efa_act) {
glColor4ubv(data->cols[3]);
- return 2; /* stipple */
+ return DM_DRAW_OPTION_STIPPLE;
}
else {
col = data->cols[BM_elem_flag_test(efa, BM_ELEM_SELECT)?1:BM_elem_flag_test(efa, BM_ELEM_FREESTYLE)?2:0];
- if (col[3]==0) return 0;
+ if (col[3]==0)
+ return DM_DRAW_OPTION_SKIP;
glColor4ubv(col);
- return 1;
+ return DM_DRAW_OPTION_NORMAL;
}
}
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
static int draw_dm_faces_sel__compareDrawOptions(void *userData, int index, int next_index)
@@ -2564,21 +2580,21 @@ static void draw_dm_faces_sel(BMEditMesh *em, DerivedMesh *dm, unsigned char *ba
dm->drawMappedFaces(dm, draw_dm_faces_sel__setDrawOptions, GPU_enable_material, draw_dm_faces_sel__compareDrawOptions, &data, 0);
}
-static int draw_dm_creases__setDrawOptions(void *userData, int index)
+static DMDrawOption draw_dm_creases__setDrawOptions(void *userData, int index)
{
BMEditMesh *em = userData;
BMEdge *eed = EDBM_get_edge_for_index(userData, index);
float *crease = eed ? (float *)CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_CREASE) : NULL;
if (!crease)
- return 0;
+ return DM_DRAW_OPTION_SKIP;
if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && *crease!=0.0f) {
UI_ThemeColorBlend(TH_WIRE, TH_EDGE_CREASE, *crease);
- return 1;
+ return DM_DRAW_OPTION_NORMAL;
}
else {
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
}
static void draw_dm_creases(BMEditMesh *em, DerivedMesh *dm)
@@ -2588,21 +2604,21 @@ static void draw_dm_creases(BMEditMesh *em, DerivedMesh *dm)
glLineWidth(1.0);
}
-static int draw_dm_bweights__setDrawOptions(void *userData, int index)
+static DMDrawOption draw_dm_bweights__setDrawOptions(void *userData, int index)
{
BMEditMesh *em = userData;
BMEdge *eed = EDBM_get_edge_for_index(userData, index);
float *bweight = (float *)CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_BWEIGHT);
if (!bweight)
- return 0;
+ return DM_DRAW_OPTION_SKIP;
if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && *bweight!=0.0f) {
UI_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, *bweight);
- return 1;
+ return DM_DRAW_OPTION_NORMAL;
}
else {
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
}
static void draw_dm_bweights__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
@@ -2831,7 +2847,7 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitS
if (me->drawflag & ME_DRAWEXTRA_FACEAREA) {
/* would be nice to use BM_face_area_calc, but that is for 2d faces
- so instead add up tessalation triangle areas */
+ * so instead add up tessellation triangle areas */
BMFace *f;
int n;
@@ -2977,23 +2993,26 @@ static void draw_em_indices(BMEditMesh *em)
}
}
-static int draw_em_fancy__setFaceOpts(void *userData, int index, int *UNUSED(drawSmooth_r))
+static DMDrawOption draw_em_fancy__setFaceOpts(void *userData, int index)
{
BMFace *efa = EDBM_get_face_for_index(userData, index);
if (efa && !BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
GPU_enable_material(efa->mat_nr+1, NULL);
- return 1;
+ return DM_DRAW_OPTION_NORMAL;
}
else
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
-static int draw_em_fancy__setGLSLFaceOpts(void *userData, int index)
+static DMDrawOption draw_em_fancy__setGLSLFaceOpts(void *userData, int index)
{
BMFace *efa = EDBM_get_face_for_index(userData, index);
- return !BM_elem_flag_test(efa, BM_ELEM_HIDDEN);
+ if (BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
+ return DM_DRAW_OPTION_SKIP;
+ else
+ return DM_DRAW_OPTION_NORMAL;
}
static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
@@ -3008,10 +3027,13 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
if (em->bm->selected.last) {
BMEditSelection *ese= em->bm->selected.last;
/* face is handeled above */
- /*if (ese->type == BM_FACE ) {
+#if 0
+ if (ese->type == BM_FACE ) {
efa_act = (BMFace *)ese->data;
}
- else */ if ( ese->htype == BM_EDGE ) {
+ else
+#endif
+ if ( ese->htype == BM_EDGE ) {
eed_act = (BMEdge *)ese->ele;
}
else if ( ese->htype == BM_VERT ) {
@@ -3191,12 +3213,14 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
static void draw_mesh_object_outline(View3D *v3d, Object *ob, DerivedMesh *dm)
{
- if (v3d->transp==0) { // not when we draw the transparent pass
+ if ((v3d->transp == FALSE) && /* not when we draw the transparent pass */
+ (ob->mode & OB_MODE_ALL_PAINT) == FALSE) /* not when painting (its distracting) - campbell */
+ {
glLineWidth(UI_GetThemeValuef(TH_OUTLINE_WIDTH) * 2.0f);
glDepthMask(0);
/* if transparent, we cannot draw the edges for solid select... edges have no material info.
- drawFacesSolid() doesn't draw the transparent faces */
+ * drawFacesSolid() doesn't draw the transparent faces */
if (ob->dtx & OB_DRAWTRANSP) {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
dm->drawFacesSolid(dm, NULL, 0, GPU_enable_material);
@@ -3212,12 +3236,6 @@ static void draw_mesh_object_outline(View3D *v3d, Object *ob, DerivedMesh *dm)
}
}
-static int wpaint__setSolidDrawOptions(void *UNUSED(userData), int UNUSED(index), int *drawSmooth_r)
-{
- *drawSmooth_r = 1;
- return 1;
-}
-
static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, Base *base, int dt, int flag)
{
Object *ob= base->object;
@@ -3306,7 +3324,8 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
/* weight paint in solid mode, special case. focus on making the weights clear
* rather than the shading, this is also forced in wire view */
GPU_enable_material(0, NULL);
- dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, GPU_enable_material, NULL, me->mpoly, 1);
+ dm->drawMappedFaces(dm, NULL, GPU_enable_material, NULL, me->mpoly,
+ DM_DRAW_USE_COLORS | DM_DRAW_ALWAYS_SMOOTH);
bglPolygonOffset(rv3d->dist, 1.0);
glDepthMask(0); // disable write in zbuffer, selected edge wires show better
@@ -3359,7 +3378,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);
- dm->drawMappedFaces(dm, NULL, GPU_enable_material, NULL, NULL, 1);
+ dm->drawMappedFaces(dm, NULL, GPU_enable_material, NULL, NULL, DM_DRAW_USE_COLORS);
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_LIGHTING);
@@ -3434,7 +3453,8 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);
- dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, GPU_enable_material, NULL, me->mpoly, 1);
+ dm->drawMappedFaces(dm, NULL, GPU_enable_material, NULL, me->mpoly,
+ DM_DRAW_USE_COLORS | DM_DRAW_ALWAYS_SMOOTH);
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_LIGHTING);
@@ -3442,10 +3462,12 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
}
else if (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_TEXTURE_PAINT)) {
if (me->mloopcol)
- dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, GPU_enable_material, NULL, NULL, 1);
+ dm->drawMappedFaces(dm, NULL, GPU_enable_material, NULL, NULL,
+ DM_DRAW_USE_COLORS | DM_DRAW_ALWAYS_SMOOTH);
else {
glColor3f(1.0f, 1.0f, 1.0f);
- dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, GPU_enable_material, NULL, NULL, 0);
+ dm->drawMappedFaces(dm, NULL, GPU_enable_material, NULL, NULL,
+ DM_DRAW_ALWAYS_SMOOTH);
}
}
}
@@ -3476,7 +3498,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
}
if (draw_wire != OBDRAW_WIRE_OFF) {
- /* When using wireframe object traw in particle edit mode
+ /* When using wireframe object draw in particle edit mode
* the mesh gets in the way of seeing the particles, fade the wire color
* with the background. */
if (is_obact && (ob->mode & OB_MODE_PARTICLE_EDIT)) {
@@ -4516,8 +4538,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
drawn = 1;
}
}
- else
- {
+ else {
state.time=cfra;
if (psys_get_particle_state(&sim,a,&state,0)) {
float pixsize;
@@ -4623,13 +4644,15 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
glEnable(GL_COLOR_MATERIAL);
}
- /*else {
+#if 0
+ else {
glDisableClientState(GL_NORMAL_ARRAY);
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_LIGHTING);
UI_ThemeColor(TH_WIRE);
- }*/
+ }
+#endif
if (totchild && (part->draw&PART_DRAW_PARENT)==0)
totpart=0;
@@ -5505,8 +5528,8 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
- /* direction vectors for 3d curve paths
- when at its lowest, dont render normals */
+ /* direction vectors for 3d curve paths
+ * when at its lowest, dont render normals */
if (cu->flag & CU_3D && ts->normalsize > 0.0015f && (cu->drawflag & CU_HIDE_NORMALS)==0) {
UI_ThemeColor(TH_WIRE);
@@ -6790,11 +6813,10 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
SmokeModifierData *smd = (SmokeModifierData *)md;
// draw collision objects
- if ((smd->type & MOD_SMOKE_TYPE_COLL) && smd->coll)
- {
- /*SmokeCollSettings *scs = smd->coll;
- if (scs->points)
- {
+ if ((smd->type & MOD_SMOKE_TYPE_COLL) && smd->coll) {
+#if 0
+ SmokeCollSettings *scs = smd->coll;
+ if (scs->points) {
size_t i;
glLoadMatrixf(rv3d->viewmat);
@@ -6821,16 +6843,15 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
if (col) cpack(col);
}
- */
+#endif
}
// only draw domains
- if (smd->domain && smd->domain->fluid)
- {
- if (CFRA < smd->domain->point_cache[0]->startframe)
- ; /* don't show smoke before simulation starts, this could be made an option in the future */
- else if (!smd->domain->wt || !(smd->domain->viewsettings & MOD_SMOKE_VIEW_SHOWBIG))
- {
+ if (smd->domain && smd->domain->fluid) {
+ if (CFRA < smd->domain->point_cache[0]->startframe) {
+ /* don't show smoke before simulation starts, this could be made an option in the future */
+ }
+ else if (!smd->domain->wt || !(smd->domain->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) {
// #if 0
smd->domain->tex = NULL;
GPU_create_smoke(smd, 0);
@@ -6862,8 +6883,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
float tmp[3];
int index = smoke_get_index(x, smd->domain->res[0], y, smd->domain->res[1], z);
- if (density[index] > FLT_EPSILON)
- {
+ if (density[index] > FLT_EPSILON) {
float color[3];
copy_v3_v3(tmp, smd->domain->p0);
tmp[0] += smd->domain->dx * x + smd->domain->dx * 0.5;
@@ -6884,8 +6904,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
if (col) cpack(col);
#endif
}
- else if (smd->domain->wt && (smd->domain->viewsettings & MOD_SMOKE_VIEW_SHOWBIG))
- {
+ else if (smd->domain->wt && (smd->domain->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) {
smd->domain->tex = NULL;
GPU_create_smoke(smd, 1);
draw_volume(ar, smd->domain->tex,
@@ -6898,12 +6917,10 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
}
if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
-
bConstraint *con;
- for (con=ob->constraints.first; con; con= con->next)
- {
- if (con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT)
- {
+
+ for (con=ob->constraints.first; con; con= con->next) {
+ if (con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) {
bRigidBodyJointConstraint *data = (bRigidBodyJointConstraint*)con->data;
if (data->flag&CONSTRAINT_DRAW_PIVOT)
drawRBpivot(data);
@@ -6927,7 +6944,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
if (dtx & OB_BOUNDBOX) {
draw_bounding_volume(scene, ob, ob->boundtype);
}
- if (dtx & OB_TEXSPACE) drawtexspace(ob);
+ if (dtx & OB_TEXSPACE) {
+ drawtexspace(ob);
+ }
if (dtx & OB_DRAWNAME) {
/* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */
/* but, we also dont draw names for sets or duplicators */
@@ -6942,13 +6961,16 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
}
}
/*if (dtx & OB_DRAWIMAGE) drawDispListwire(&ob->disp);*/
- if ((dtx & OB_DRAWWIRE) && dt>=OB_SOLID) drawWireExtra(scene, rv3d, ob);
+ if ((dtx & OB_DRAWWIRE) && dt>=OB_SOLID) {
+ drawWireExtra(scene, rv3d, ob);
+ }
}
}
if (dt<=OB_SOLID && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
if ((ob->gameflag & OB_DYNAMIC) ||
- ((ob->gameflag & OB_BOUNDS) && (ob->boundtype == OB_BOUND_SPHERE))) {
+ ((ob->gameflag & OB_BOUNDS) && (ob->boundtype == OB_BOUND_SPHERE)))
+ {
float imat[4][4], vec[3]= {0.0f, 0.0f, 0.0f};
invert_m4_m4(imat, rv3d->viewmatob);
@@ -6965,11 +6987,16 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
glLoadMatrixf(rv3d->viewmat);
- if (zbufoff) glDisable(GL_DEPTH_TEST);
+ if (zbufoff) {
+ glDisable(GL_DEPTH_TEST);
+ }
- if (warning_recursive) return;
- if (base->flag & OB_FROMDUPLI) return;
- if (v3d->flag2 & V3D_RENDER_OVERRIDE) return;
+ if ((warning_recursive) ||
+ (base->flag & OB_FROMDUPLI) ||
+ (v3d->flag2 & V3D_RENDER_OVERRIDE))
+ {
+ return;
+ }
/* object centers, need to be drawn in viewmat space for speed, but OK for picking select */
if (!is_obact || !(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) {
@@ -7040,8 +7067,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
if (ELEM(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_OBJECTSOLVER)) {
/* special case for object solver and follow track constraints because they don't fill
- constraint targets properly (design limitation -- scene is needed for their target
- but it can't be accessed from get_targets callvack) */
+ * constraint targets properly (design limitation -- scene is needed for their target
+ * but it can't be accessed from get_targets callvack) */
Object *camob= NULL;
@@ -7145,7 +7172,7 @@ static void bbs_mesh_verts(BMEditMesh *em, DerivedMesh *dm, int offset)
glPointSize(1.0);
}
-static int bbs_mesh_wire__setDrawOptions(void *userData, int index)
+static DMDrawOption bbs_mesh_wire__setDrawOptions(void *userData, int index)
{
void **ptrs = userData;
int offset = (intptr_t) ptrs[0];
@@ -7153,10 +7180,10 @@ static int bbs_mesh_wire__setDrawOptions(void *userData, int index)
if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
WM_set_framebuffer_index_color(offset+index);
- return 1;
+ return DM_DRAW_OPTION_NORMAL;
}
else {
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
}
static void bbs_mesh_wire(BMEditMesh *em, DerivedMesh *dm, int offset)
@@ -7165,7 +7192,7 @@ static void bbs_mesh_wire(BMEditMesh *em, DerivedMesh *dm, int offset)
dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOptions, ptrs);
}
-static int bbs_mesh_solid__setSolidDrawOptions(void *userData, int index, int *UNUSED(drawSmooth_r))
+static DMDrawOption bbs_mesh_solid__setSolidDrawOptions(void *userData, int index)
{
BMFace *efa = EDBM_get_face_for_index(((void**)userData)[0], index);
@@ -7173,10 +7200,10 @@ static int bbs_mesh_solid__setSolidDrawOptions(void *userData, int index, int *U
if (((void**)userData)[1]) {
WM_set_framebuffer_index_color(index+1);
}
- return 1;
+ return DM_DRAW_OPTION_NORMAL;
}
else {
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
}
@@ -7216,35 +7243,35 @@ static void bbs_mesh_solid_EM(BMEditMesh *em, Scene *scene, View3D *v3d,
}
}
-static int bbs_mesh_solid__setDrawOpts(void *UNUSED(userData), int index, int *UNUSED(drawSmooth_r))
+static DMDrawOption bbs_mesh_solid__setDrawOpts(void *UNUSED(userData), int index)
{
WM_set_framebuffer_index_color(index+1);
- return 1;
+ return DM_DRAW_OPTION_NORMAL;
}
-static int bbs_mesh_solid_hide__setDrawOpts(void *userData, int index, int *UNUSED(drawSmooth_r))
+static DMDrawOption bbs_mesh_solid_hide__setDrawOpts(void *userData, int index)
{
Mesh *me = userData;
if (!(me->mpoly[index].flag&ME_HIDE)) {
WM_set_framebuffer_index_color(index+1);
- return 1;
+ return DM_DRAW_OPTION_NORMAL;
}
else {
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
}
// must have called WM_set_framebuffer_index_color beforehand
-static int bbs_mesh_solid_hide2__setDrawOpts(void *userData, int index, int *UNUSED(drawSmooth_r))
+static DMDrawOption bbs_mesh_solid_hide2__setDrawOpts(void *userData, int index)
{
Mesh *me = userData;
if (!(me->mpoly[index].flag & ME_HIDE)) {
- return 1;
+ return DM_DRAW_OPTION_NORMAL;
}
else {
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
}
static void bbs_mesh_solid(Scene *scene, Object *ob)
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 9618e5aeef0..52f432c2e7d 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -305,12 +305,12 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- /*
+#if 0
printf("Viewinv:\n");
printf("%f, %f, %f\n", rv3d->viewinv[0][0], rv3d->viewinv[0][1], rv3d->viewinv[0][2]);
printf("%f, %f, %f\n", rv3d->viewinv[1][0], rv3d->viewinv[1][1], rv3d->viewinv[1][2]);
printf("%f, %f, %f\n", rv3d->viewinv[2][0], rv3d->viewinv[2][1], rv3d->viewinv[2][2]);
- */
+#endif
// get view vector
copy_v3_v3(viewnormal, rv3d->viewinv[2]);
@@ -339,8 +339,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
// printf("i: %d\n", i);
// printf("point %f, %f, %f\n", cv[i][0], cv[i][1], cv[i][2]);
- if (GL_TRUE == glewIsSupported("GL_ARB_fragment_program"))
- {
+ if (GL_TRUE == glewIsSupported("GL_ARB_fragment_program")) {
glEnable(GL_FRAGMENT_PROGRAM_ARB);
glGenProgramsARB(1, &prog);
@@ -406,12 +405,9 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
copy_v3_v3(p0, points);
// sort points to get a convex polygon
- for (i = 1; i < numpoints - 1; i++)
- {
- for (j = i + 1; j < numpoints; j++)
- {
- if (!convex(p0, viewnormal, &points[j * 3], &points[i * 3]))
- {
+ for (i = 1; i < numpoints - 1; i++) {
+ for (j = i + 1; j < numpoints; j++) {
+ if (!convex(p0, viewnormal, &points[j * 3], &points[i * 3])) {
float tmp2[3];
copy_v3_v3(tmp2, &points[j * 3]);
copy_v3_v3(&points[j * 3], &points[i * 3]);
@@ -441,8 +437,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
GPU_texture_unbind(tex_shadow);
GPU_texture_unbind(tex);
- if (GLEW_ARB_fragment_program)
- {
+ if (GLEW_ARB_fragment_program) {
glDisable(GL_FRAGMENT_PROGRAM_ARB);
glDeleteProgramsARB(1, &prog);
}
@@ -450,10 +445,11 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
MEM_freeN(points);
- if (!gl_blend)
+ if (!gl_blend) {
glDisable(GL_BLEND);
- if (gl_depth)
- {
+ }
+
+ if (gl_depth) {
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
}
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 996d782be4d..405ce80323b 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -234,8 +234,8 @@ void ED_view3d_init_mats_rv3d_gl(struct Object *ob, struct RegionView3D *rv3d)
ED_view3d_init_mats_rv3d(ob, rv3d);
/* we have to multiply instead of loading viewmatob to make
- it work with duplis using displists, otherwise it will
- override the dupli-matrix */
+ * it work with duplis using displists, otherwise it will
+ * override the dupli-matrix */
glMultMatrixf(ob->obmat);
}
@@ -333,10 +333,6 @@ static void view3d_free(SpaceLink *sl)
{
View3D *vd= (View3D *) sl;
- BGpic *bgpic;
- for (bgpic= vd->bgpicbase.first; bgpic; bgpic= bgpic->next) {
- if (bgpic->ima) bgpic->ima->id.us--;
- }
BLI_freelistN(&vd->bgpicbase);
if (vd->localvd) MEM_freeN(vd->localvd);
@@ -355,7 +351,6 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl)
{
View3D *v3do= (View3D *)sl;
View3D *v3dn= MEM_dupallocN(sl);
- BGpic *bgpic;
/* clear or remove stuff from old */
@@ -374,9 +369,6 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl)
/* copy or clear inside new stuff */
BLI_duplicatelist(&v3dn->bgpicbase, &v3do->bgpicbase);
- for (bgpic= v3dn->bgpicbase.first; bgpic; bgpic= bgpic->next)
- if (bgpic->ima)
- bgpic->ima->id.us++;
v3dn->properties_storage= NULL;
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index 3e2979a7e88..a9521a61eb2 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -4,7 +4,7 @@
* 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.
+ * 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
@@ -18,7 +18,7 @@
* The Original Code is Copyright (C) 2009 Blender Foundation.
* All rights reserved.
*
- *
+ *
* Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
@@ -45,6 +45,8 @@
#include "MEM_guardedalloc.h"
+#include "BLF_translation.h"
+
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_rand.h"
@@ -77,7 +79,7 @@
#include "UI_interface.h"
#include "UI_resources.h"
-#include "view3d_intern.h" // own include
+#include "view3d_intern.h" /* own include */
/* ******************* view3d space & buttons ************** */
@@ -122,8 +124,8 @@
/* temporary struct for storing transform properties */
typedef struct {
- float ob_eul[4]; // used for quat too....
- float ob_scale[3]; // need temp space due to linked values
+ float ob_eul[4]; /* used for quat too... */
+ float ob_scale[3]; /* need temp space due to linked values */
float ob_dims[3];
short link_scale;
float ve_median[7];
@@ -165,34 +167,34 @@ static float compute_scale_factor(const float ve_median, const float median)
/* is used for both read and write... */
static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim)
{
- uiBlock *block= (layout)? uiLayoutAbsoluteBlock(layout): NULL;
- MDeformVert *dvert=NULL;
+ uiBlock *block = (layout)? uiLayoutAbsoluteBlock(layout): NULL;
+ MDeformVert *dvert =NULL;
TransformProperties *tfp;
float median[7], ve_median[7];
int tot, totw, totweight, totedge, totradius;
char defstr[320];
PointerRNA radius_ptr;
- median[0]= median[1]= median[2]= median[3]= median[4]= median[5]= median[6]= 0.0;
- tot= totw= totweight= totedge= totradius= 0;
- defstr[0]= 0;
+ median[0] = median[1] = median[2] = median[3] = median[4] = median[5] = median[6] = 0.0;
+ tot = totw = totweight = totedge = totradius = 0;
+ defstr[0] = 0;
/* make sure we got storage */
- if (v3d->properties_storage==NULL)
- v3d->properties_storage= MEM_callocN(sizeof(TransformProperties), "TransformProperties");
- tfp= v3d->properties_storage;
-
- if (ob->type==OB_MESH) {
- Mesh *me= ob->data;
+ if (v3d->properties_storage == NULL)
+ v3d->properties_storage = MEM_callocN(sizeof(TransformProperties), "TransformProperties");
+ tfp = v3d->properties_storage;
+
+ if (ob->type == OB_MESH) {
+ Mesh *me = ob->data;
BMEditMesh *em = me->edit_btmesh;
BMesh *bm = em->bm;
- BMVert *eve, *evedef=NULL;
+ BMVert *eve, *evedef = NULL;
BMEdge *eed;
BMIter iter;
-
+
BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
- evedef= eve;
+ evedef = eve;
tot++;
add_v3_v3(median, eve->co);
}
@@ -204,65 +206,65 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
totedge++;
f = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_CREASE);
- median[3]+= f ? *f : 0.0f;
+ median[3] += f ? *f : 0.0f;
f = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_BWEIGHT);
- median[6]+= f ? *f : 0.0f;
+ median[6] += f ? *f : 0.0f;
}
}
/* check for defgroups */
if (evedef)
- dvert= CustomData_bmesh_get(&bm->vdata, evedef->head.data, CD_MDEFORMVERT);
- if (tot==1 && dvert && dvert->totweight) {
+ dvert = CustomData_bmesh_get(&bm->vdata, evedef->head.data, CD_MDEFORMVERT);
+ if (tot == 1 && dvert && dvert->totweight) {
bDeformGroup *dg;
- int i, max=1, init=1;
+ int i, max = 1, init = 1;
char str[320];
-
- for (i=0; i<dvert->totweight; i++) {
+
+ for (i = 0; i<dvert->totweight; i++) {
dg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr);
if (dg) {
- max+= BLI_snprintf(str, sizeof(str), "%s %%x%d|", dg->name, dvert->dw[i].def_nr);
+ max += BLI_snprintf(str, sizeof(str), "%s %%x%d|", dg->name, dvert->dw[i].def_nr);
if (max < sizeof(str)) strcat(defstr, str);
}
- if (tfp->curdef==dvert->dw[i].def_nr) {
- init= 0;
- tfp->defweightp= &dvert->dw[i].weight;
+ if (tfp->curdef == dvert->dw[i].def_nr) {
+ init = 0;
+ tfp->defweightp = &dvert->dw[i].weight;
}
}
-
- if (init) { // needs new initialized
- tfp->curdef= dvert->dw[0].def_nr;
- tfp->defweightp= &dvert->dw[0].weight;
+
+ if (init) { /* needs new initialized */
+ tfp->curdef = dvert->dw[0].def_nr;
+ tfp->defweightp = &dvert->dw[0].weight;
}
}
}
- else if (ob->type==OB_CURVE || ob->type==OB_SURF) {
- Curve *cu= ob->data;
+ else if (ob->type == OB_CURVE || ob->type == OB_SURF) {
+ Curve *cu = ob->data;
Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int a;
- ListBase *nurbs= curve_editnurbs(cu);
- StructRNA *seltype= NULL;
- void *selp= NULL;
+ ListBase *nurbs = curve_editnurbs(cu);
+ StructRNA *seltype = NULL;
+ void *selp = NULL;
- nu= nurbs->first;
+ nu = nurbs->first;
while (nu) {
if (nu->type == CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
+ bezt = nu->bezt;
+ a = nu->pntsu;
while (a--) {
if (bezt->f2 & SELECT) {
add_v3_v3(median, bezt->vec[1]);
tot++;
- median[4]+= bezt->weight;
+ median[4] += bezt->weight;
totweight++;
- median[5]+= bezt->radius;
+ median[5] += bezt->radius;
totradius++;
- selp= bezt;
- seltype= &RNA_BezierSplinePoint;
+ selp = bezt;
+ seltype = &RNA_BezierSplinePoint;
}
else {
if (bezt->f1 & SELECT) {
@@ -278,50 +280,50 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
+ bp = nu->bp;
+ a = nu->pntsu*nu->pntsv;
while (a--) {
if (bp->f1 & SELECT) {
add_v3_v3(median, bp->vec);
- median[3]+= bp->vec[3];
+ median[3] += bp->vec[3];
totw++;
tot++;
- median[4]+= bp->weight;
+ median[4] += bp->weight;
totweight++;
- median[5]+= bp->radius;
+ median[5] += bp->radius;
totradius++;
- selp= bp;
- seltype= &RNA_SplinePoint;
+ selp = bp;
+ seltype = &RNA_SplinePoint;
}
bp++;
}
}
- nu= nu->next;
+ nu = nu->next;
}
- if (totradius==1)
+ if (totradius == 1)
RNA_pointer_create(&cu->id, seltype, selp, &radius_ptr);
}
- else if (ob->type==OB_LATTICE) {
- Lattice *lt= ob->data;
+ else if (ob->type == OB_LATTICE) {
+ Lattice *lt = ob->data;
BPoint *bp;
int a;
-
- a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
- bp= lt->editlatt->latt->def;
+
+ 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(median, bp->vec);
tot++;
- median[4]+= bp->weight;
+ median[4] += bp->weight;
totweight++;
}
bp++;
}
}
-
- if (tot==0) {
- uiDefBut(block, LABEL, 0, "Nothing selected",0, 130, 200, 20, NULL, 0, 0, 0, 0, "");
+
+ if (tot == 0) {
+ uiDefBut(block, LABEL, 0, IFACE_("Nothing selected"), 0, 130, 200, 20, NULL, 0, 0, 0, 0, "");
return;
}
median[0] /= (float)tot;
@@ -331,87 +333,105 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
median[3] /= (float)totedge;
median[6] /= (float)totedge;
}
- else if (totw) median[3] /= (float)totw;
- if (totweight) median[4] /= (float)totweight;
- if (totradius) median[5] /= (float)totradius;
-
+ else if (totw)
+ median[3] /= (float)totw;
+ if (totweight)
+ median[4] /= (float)totweight;
+ if (totradius)
+ median[5] /= (float)totradius;
+
if (v3d->flag & V3D_GLOBAL_STATS)
mul_m4_v3(ob->obmat, median);
-
- if (block) { // buttons
+
+ if (block) { /* buttons */
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, "");
+ if (tot == 1) {
+ uiDefBut(block, LABEL, 0, IFACE_("Vertex:"), 0, 150, 200, 20, NULL, 0, 0, 0, 0, "");
}
else {
- uiDefBut(block, LABEL, 0, "Median:", 0, 150, 200, 20, NULL, 0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, IFACE_("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, "");
+ /* Should be no need to translate these. */
+ 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, "");
+ 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, "");
+ 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, "");
+ 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");
+ uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, IFACE_("Global"), 0, 65, 100, 20,
+ &v3d->flag, 0, 0, 0, 0, "Displays global values");
+ uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, IFACE_("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");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Weight:"), 0, 40, 200, 20,
+ &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, TIP_("Weight 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");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Weight:"), 0, 40, 200, 20,
+ &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, TIP_("Weight 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");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Radius:"), 0, 20, 200, 20,
+ &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, TIP_("Radius of curve control points"));
}
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");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Radius:"), 0, 20, 200, 20,
+ &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, TIP_("Radius of curve control points"));
}
- if (totedge==1) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Crease:", 0, 40, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, "");
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Bevel Weight:", 0, 20, 200, 20, &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, "");
+ if (totedge == 1) {
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Crease:"), 0, 40, 200, 20,
+ &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, TIP_("Weight used by SubSurf modifier"));
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Bevel Weight:"), 0, 20, 200, 20,
+ &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, TIP_("Weight used by Bevel modifier"));
}
else if (totedge>1) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Crease:", 0, 40, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, "");
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Bevel Weight:", 0, 20, 200, 20, &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, "");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Crease:"), 0, 40, 200, 20,
+ &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, TIP_("Weight used by SubSurf modifier"));
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Bevel Weight:"), 0, 20, 200, 20,
+ &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, TIP_("Weight used by Bevel modifier"));
}
uiBlockEndAlign(block);
uiBlockEndAlign(block);
}
- else { // apply
+ else { /* apply */
memcpy(ve_median, tfp->ve_median, sizeof(tfp->ve_median));
-
+
if (v3d->flag & V3D_GLOBAL_STATS) {
invert_m4_m4(ob->imat, ob->obmat);
mul_m4_v3(ob->imat, median);
mul_m4_v3(ob->imat, ve_median);
}
sub_v3_v3v3(median, ve_median, median);
- median[3]= ve_median[3]-median[3];
- median[4]= ve_median[4]-median[4];
- median[5]= ve_median[5]-median[5];
- median[6]= ve_median[6]-median[6];
-
- if (ob->type==OB_MESH) {
- Mesh *me= ob->data;
+ median[3] = ve_median[3] - median[3];
+ median[4] = ve_median[4] - median[4];
+ median[5] = ve_median[5] - median[5];
+ median[6] = ve_median[6] - median[6];
+
+ if (ob->type == OB_MESH) {
+ Mesh *me = ob->data;
BMEditMesh *em = me->edit_btmesh;
BMesh *bm = em->bm;
BMVert *eve;
@@ -424,10 +444,10 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
add_v3_v3(eve->co, median);
}
}
-
+
EDBM_RecalcNormals(em);
}
-
+
if (median[3] != 0.0f) {
BMEdge *eed;
const float sca = compute_scale_factor(ve_median[3], median[3]);
@@ -505,20 +525,20 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
EDBM_RecalcNormals(em);
}
- else if (ob->type==OB_CURVE || ob->type==OB_SURF) {
- Curve *cu= ob->data;
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ Curve *cu = ob->data;
Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int a;
- ListBase *nurbs= curve_editnurbs(cu);
+ ListBase *nurbs = curve_editnurbs(cu);
const float scale_w = compute_scale_factor(ve_median[4], median[4]);
- nu= nurbs->first;
+ nu = nurbs->first;
while (nu) {
if (nu->type == CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
+ bezt = nu->bezt;
+ a = nu->pntsu;
while (a--) {
if (bezt->f2 & SELECT) {
add_v3_v3(bezt->vec[0], median);
@@ -536,7 +556,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
- bezt->radius+= median[5];
+ bezt->radius += median[5];
}
else {
if (bezt->f1 & SELECT) {
@@ -550,12 +570,12 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
+ bp = nu->bp;
+ a = nu->pntsu*nu->pntsv;
while (a--) {
if (bp->f1 & SELECT) {
add_v3_v3(bp->vec, median);
- bp->vec[3]+= median[3];
+ bp->vec[3] += median[3];
if (median[4] != 0.0f) {
if (ELEM(scale_w, 0.0f, 1.0f)) {
@@ -568,7 +588,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
- bp->radius+= median[5];
+ bp->radius += median[5];
}
bp++;
}
@@ -576,17 +596,17 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
test2DNurb(nu);
testhandlesNurb(nu); /* test for bezier too */
- nu= nu->next;
+ nu = nu->next;
}
}
- else if (ob->type==OB_LATTICE) {
- Lattice *lt= ob->data;
+ else if (ob->type == OB_LATTICE) {
+ 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;
+ 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);
@@ -605,8 +625,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
bp++;
}
}
-
-// ED_undo_push(C, "Transform properties");
+
+/* ED_undo_push(C, "Transform properties"); */
}
}
#define B_VGRP_PNL_COPY 1
@@ -616,8 +636,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
static void act_vert_def(Object *ob, BMVert **eve, MDeformVert **dvert)
{
- if (ob && ob->mode & OB_MODE_EDIT && ob->type==OB_MESH && ob->defbase.first) {
- Mesh *me= ob->data;
+ if (ob && ob->mode & OB_MODE_EDIT && ob->type == OB_MESH && ob->defbase.first) {
+ Mesh *me = ob->data;
BMEditMesh *em = me->edit_btmesh;
BMEditSelection *ese = (BMEditSelection *)em->bm->selected.last;
@@ -628,34 +648,34 @@ static void act_vert_def(Object *ob, BMVert **eve, MDeformVert **dvert)
}
}
- *eve= NULL;
- *dvert= NULL;
+ *eve = NULL;
+ *dvert = NULL;
}
static void editvert_mirror_update(Object *ob, BMVert *eve, int def_nr, int index)
{
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
BMEditMesh *em = me->edit_btmesh;
BMVert *eve_mirr;
- eve_mirr= editbmesh_get_x_mirror_vert(ob, em, eve, eve->co, index);
+ eve_mirr = editbmesh_get_x_mirror_vert(ob, em, eve, eve->co, index);
if (eve_mirr && eve_mirr != eve) {
- MDeformVert *dvert_src= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
- MDeformVert *dvert_dst= CustomData_bmesh_get(&em->bm->vdata, eve_mirr->head.data, CD_MDEFORMVERT);
+ MDeformVert *dvert_src = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
+ MDeformVert *dvert_dst = CustomData_bmesh_get(&em->bm->vdata, eve_mirr->head.data, CD_MDEFORMVERT);
if (dvert_dst) {
if (def_nr == -1) {
/* all vgroups, add groups where neded */
int flip_map_len;
- int *flip_map= defgroup_flip_map(ob, &flip_map_len, TRUE);
+ int *flip_map = defgroup_flip_map(ob, &flip_map_len, TRUE);
defvert_sync_mapped(dvert_dst, dvert_src, flip_map, flip_map_len, TRUE);
MEM_freeN(flip_map);
}
else {
/* single vgroup */
- MDeformWeight *dw= defvert_verify_index(dvert_dst, defgroup_flip_index(ob, def_nr, 1));
+ MDeformWeight *dw = defvert_verify_index(dvert_dst, defgroup_flip_index(ob, def_nr, 1));
if (dw) {
- dw->weight= defvert_find_weight(dvert_src, def_nr);
+ dw->weight = defvert_find_weight(dvert_src, def_nr);
}
}
}
@@ -682,20 +702,20 @@ static void vgroup_copy_active_to_sel(Object *ob)
act_vert_def(ob, &eve_act, &dvert_act);
- if (dvert_act==NULL) {
+ if (dvert_act == NULL) {
return;
}
else {
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
BMEditMesh *em = me->edit_btmesh;
BMIter iter;
BMVert *eve;
MDeformVert *dvert;
- int index= 0;
+ int index = 0;
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT) && eve != eve_act) {
- dvert= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
+ dvert = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
if (dvert) {
defvert_copy(dvert, dvert_act);
@@ -717,33 +737,33 @@ static void vgroup_copy_active_to_sel_single(Object *ob, const int def_nr)
act_vert_def(ob, &eve_act, &dv_act);
- if (dv_act==NULL) {
+ if (dv_act == NULL) {
return;
}
else {
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
BMEditMesh *em = me->edit_btmesh;
BMIter iter;
BMVert *eve;
MDeformVert *dv;
MDeformWeight *dw;
float weight_act;
- int index= 0;
+ int index = 0;
- dw= defvert_find_index(dv_act, def_nr);
+ dw = defvert_find_index(dv_act, def_nr);
if (dw == NULL)
return;
-
- weight_act= dw->weight;
+
+ weight_act = dw->weight;
eve = BM_iter_new(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
- for (index=0; eve; eve=BM_iter_step(&iter), index++) {
+ for (index = 0; eve; eve = BM_iter_step(&iter), index++) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT) && eve != eve_act) {
- dv= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
- dw= defvert_find_index(dv, def_nr);
+ dv = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
+ dw = defvert_find_index(dv, def_nr);
if (dw) {
- dw->weight= weight_act;
+ dw->weight = weight_act;
if (me->editflag & ME_EDIT_MIRROR_X) {
editvert_mirror_update(ob, eve, -1, index);
@@ -765,24 +785,22 @@ static void vgroup_normalize_active(Object *ob)
act_vert_def(ob, &eve_act, &dvert_act);
- if (dvert_act==NULL)
+ if (dvert_act == NULL)
return;
defvert_normalize(dvert_act);
if (((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_X)
editvert_mirror_update(ob, eve_act, -1, -1);
-
-
-
}
static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event)
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= OBACT;
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = OBACT;
- if (event==B_VGRP_PNL_NORMALIZE) {
+ /* XXX TODO Use operators? */
+ if (event == B_VGRP_PNL_NORMALIZE) {
vgroup_normalize_active(ob);
}
else if (event == B_VGRP_PNL_COPY) {
@@ -795,9 +813,10 @@ static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event)
vgroup_adjust_active(ob, event - B_VGRP_PNL_EDIT_SINGLE);
}
-// todo
-// if (((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_X)
-// ED_vgroup_mirror(ob, 1, 1, 0);
+#if 0 /* TODO */
+ if (((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_X)
+ ED_vgroup_mirror(ob, 1, 1, 0);
+#endif
/* default for now */
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -806,8 +825,8 @@ static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event)
static int view3d_panel_vgroup_poll(const bContext *C, PanelType *UNUSED(pt))
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= OBACT;
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = OBACT;
BMVert *eve_act;
MDeformVert *dvert_act;
@@ -819,9 +838,9 @@ static int view3d_panel_vgroup_poll(const bContext *C, PanelType *UNUSED(pt))
static void view3d_panel_vgroup(const bContext *C, Panel *pa)
{
- uiBlock *block= uiLayoutAbsoluteBlock(pa->layout);
- Scene *scene= CTX_data_scene(C);
- Object *ob= OBACT;
+ uiBlock *block = uiLayoutAbsoluteBlock(pa->layout);
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = OBACT;
BMVert *eve;
MDeformVert *dv;
@@ -837,25 +856,29 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
uiBlockSetHandleFunc(block, do_view3d_vgroup_buttons, NULL);
- col= uiLayoutColumn(pa->layout, 0);
- block= uiLayoutAbsoluteBlock(col);
+ col = uiLayoutColumn(pa->layout, 0);
+ block = uiLayoutAbsoluteBlock(col);
uiBlockBeginAlign(block);
- for (i= dv->totweight; i != 0; i--, dw++) {
+ for (i = dv->totweight; i != 0; i--, dw++) {
dg = BLI_findlink (&ob->defbase, dw->def_nr);
if (dg) {
- uiDefButF(block, NUM, B_VGRP_PNL_EDIT_SINGLE + dw->def_nr, dg->name, 0, yco, 180, 20, &dw->weight, 0.0, 1.0, 1, 3, "");
- uiDefBut(block, BUT, B_VGRP_PNL_COPY_SINGLE + dw->def_nr, "C", 180,yco,20,20, NULL, 0, 0, 0, 0, "Copy this groups weight to other selected verts");
+ uiDefButF(block, NUM, B_VGRP_PNL_EDIT_SINGLE + dw->def_nr, dg->name, 0, yco, 180, 20,
+ &dw->weight, 0.0, 1.0, 1, 3, "");
+ uiDefBut(block, BUT, B_VGRP_PNL_COPY_SINGLE + dw->def_nr, "C", 180, yco, 20, 20,
+ NULL, 0, 0, 0, 0, TIP_("Copy this group's weight to other selected verts"));
yco -= 20;
}
}
- yco-=2;
+ yco -= 2;
uiBlockEndAlign(block);
uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_VGRP_PNL_NORMALIZE, "Normalize", 0, yco,100,20, NULL, 0, 0, 0, 0, "Normalize active vertex weights");
- uiDefBut(block, BUT, B_VGRP_PNL_COPY, "Copy", 100,yco,100,20, NULL, 0, 0, 0, 0, "Copy active vertex to other seleted verts");
+ uiDefBut(block, BUT, B_VGRP_PNL_NORMALIZE, IFACE_("Normalize"), 0, yco, 100, 20,
+ NULL, 0, 0, 0, 0, TIP_("Normalize active vertex weights"));
+ uiDefBut(block, BUT, B_VGRP_PNL_COPY, IFACE_("Copy"), 100, yco, 100, 20,
+ NULL, 0, 0, 0, 0, TIP_("Copy active vertex to other seleted verts"));
uiBlockEndAlign(block);
}
}
@@ -863,105 +886,105 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr)
{
uiLayout *split, *colsub;
-
+
split = uiLayoutSplit(layout, 0.8, 0);
-
+
if (ptr->type == &RNA_PoseBone) {
PointerRNA boneptr;
Bone *bone;
-
+
boneptr = RNA_pointer_get(ptr, "bone");
bone = boneptr.data;
uiLayoutSetActive(split, !(bone->parent && bone->flag & BONE_CONNECTED));
}
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, ptr, "location", 0, "Location", ICON_NONE);
+ uiItemR(colsub, ptr, "location", 0, NULL, ICON_NONE);
colsub = uiLayoutColumn(split, 1);
uiItemL(colsub, "", ICON_NONE);
- uiItemR(colsub, ptr, "lock_location", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
-
+ uiItemR(colsub, ptr, "lock_location", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+
split = uiLayoutSplit(layout, 0.8, 0);
-
- switch(RNA_enum_get(ptr, "rotation_mode")) {
+
+ switch (RNA_enum_get(ptr, "rotation_mode")) {
case ROT_MODE_QUAT: /* quaternion */
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, ptr, "rotation_quaternion", 0, "Rotation", ICON_NONE);
+ uiItemR(colsub, ptr, "rotation_quaternion", 0, IFACE_("Rotation"), ICON_NONE);
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, "4L", ICON_NONE);
+ uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, IFACE_("4L"), ICON_NONE);
if (RNA_boolean_get(ptr, "lock_rotations_4d"))
uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
else
uiItemL(colsub, "", ICON_NONE);
- uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
break;
case ROT_MODE_AXISANGLE: /* axis angle */
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, ptr, "rotation_axis_angle", 0, "Rotation", ICON_NONE);
+ uiItemR(colsub, ptr, "rotation_axis_angle", 0, IFACE_("Rotation"), ICON_NONE);
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, "4L", ICON_NONE);
+ uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, IFACE_("4L"), ICON_NONE);
if (RNA_boolean_get(ptr, "lock_rotations_4d"))
- uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
else
uiItemL(colsub, "", ICON_NONE);
- uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
break;
default: /* euler rotations */
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, ptr, "rotation_euler", 0, "Rotation", ICON_NONE);
+ uiItemR(colsub, ptr, "rotation_euler", 0, IFACE_("Rotation"), ICON_NONE);
colsub = uiLayoutColumn(split, 1);
uiItemL(colsub, "", ICON_NONE);
- uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
break;
}
uiItemR(layout, ptr, "rotation_mode", 0, "", ICON_NONE);
-
+
split = uiLayoutSplit(layout, 0.8, 0);
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, ptr, "scale", 0, "Scale", ICON_NONE);
+ uiItemR(colsub, ptr, "scale", 0, NULL, ICON_NONE);
colsub = uiLayoutColumn(split, 1);
uiItemL(colsub, "", ICON_NONE);
- uiItemR(colsub, ptr, "lock_scale", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
-
+ uiItemR(colsub, ptr, "lock_scale", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+
if (ptr->type == &RNA_Object) {
Object *ob = ptr->data;
/* dimensions and material support just happen to be the same checks
* later we may want to add dimensions for lattice, armature etc too */
if (OB_TYPE_SUPPORT_MATERIAL(ob->type)) {
- uiItemR(layout, ptr, "dimensions", 0, "Dimensions", ICON_NONE);
+ uiItemR(layout, ptr, "dimensions", 0, NULL, ICON_NONE);
}
}
}
static void v3d_posearmature_buts(uiLayout *layout, Object *ob)
{
-// uiBlock *block= uiLayoutGetBlock(layout);
-// bArmature *arm;
+/* uiBlock *block = uiLayoutGetBlock(layout); */
+/* bArmature *arm; */
bPoseChannel *pchan;
-// TransformProperties *tfp= v3d->properties_storage;
+/* TransformProperties *tfp = v3d->properties_storage; */
PointerRNA pchanptr;
uiLayout *col;
-// uiLayout *row;
-// uiBut *but;
+/* uiLayout *row; */
+/* uiBut *but; */
- pchan= get_active_posechannel(ob);
+ pchan = get_active_posechannel(ob);
+
+/* row = uiLayoutRow(layout, 0); */
-// row= uiLayoutRow(layout, 0);
-
if (!pchan) {
- uiItemL(layout, "No Bone Active", ICON_NONE);
- return;
+ uiItemL(layout, IFACE_("No Bone Active"), ICON_NONE);
+ return;
}
RNA_pointer_create(&ob->id, &RNA_PoseBone, pchan, &pchanptr);
- col= uiLayoutColumn(layout, 0);
-
+ col = uiLayoutColumn(layout, 0);
+
/* XXX: RNA buts show data in native types (i.e. quats, 4-component axis/angle, etc.)
- * but oldskool UI shows in eulers always. Do we want to be able to still display in Eulers?
+ * but old-school UI shows in eulers always. Do we want to be able to still display in Eulers?
* Maybe needs RNA/ui options to display rotations as different types... */
v3d_transform_butsR(col, &pchanptr);
-#if 0
+#if 0 /* TODO: delete this? */
uiLayoutAbsoluteBlock(layout);
if (pchan->rotmode == ROT_MODE_AXISANGLE) {
@@ -977,10 +1000,10 @@ static void v3d_posearmature_buts(uiLayout *layout, Object *ob)
tfp->ob_eul[0]*= RAD2DEGF(1.0f);
tfp->ob_eul[1]*= RAD2DEGF(1.0f);
tfp->ob_eul[2]*= RAD2DEGF(1.0f);
-
- uiDefBut(block, LABEL, 0, "Location:", 0, 240, 100, 20, 0, 0, 0, 0, 0, "");
+
+ uiDefBut(block, LABEL, 0, "Location:", 0, 240, 100, 20, 0, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
-
+
but= uiDefButF(block, NUM, B_ARMATUREPANEL2, "X:", 0, 220, 120, 19, pchan->loc, -lim, lim, 100, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
but= uiDefButF(block, NUM, B_ARMATUREPANEL2, "Y:", 0, 200, 120, 19, pchan->loc+1, -lim, lim, 100, 3, "");
@@ -988,33 +1011,33 @@ static void v3d_posearmature_buts(uiLayout *layout, Object *ob)
but= uiDefButF(block, NUM, B_ARMATUREPANEL2, "Z:", 0, 180, 120, 19, pchan->loc+2, -lim, lim, 100, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
uiBlockEndAlign(block);
-
+
uiBlockBeginAlign(block);
uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCX, B_REDR, ICON_UNLOCKED, 125, 220, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects X Location value from being Transformed");
uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCY, B_REDR, ICON_UNLOCKED, 125, 200, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects Y Location value from being Transformed");
uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCZ, B_REDR, ICON_UNLOCKED, 125, 180, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects Z Location value from being Transformed");
uiBlockEndAlign(block);
-
+
uiDefBut(block, LABEL, 0, "Rotation:", 0, 160, 100, 20, 0, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
uiDefButF(block, NUM, B_ARMATUREPANEL3, "X:", 0, 140, 120, 19, tfp->ob_eul, -1000.0, 1000.0, 100, 3, "");
uiDefButF(block, NUM, B_ARMATUREPANEL3, "Y:", 0, 120, 120, 19, tfp->ob_eul+1, -1000.0, 1000.0, 100, 3, "");
uiDefButF(block, NUM, B_ARMATUREPANEL3, "Z:", 0, 100, 120, 19, tfp->ob_eul+2, -1000.0, 1000.0, 100, 3, "");
uiBlockEndAlign(block);
-
+
uiBlockBeginAlign(block);
uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTX, B_REDR, ICON_UNLOCKED, 125, 140, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects X Rotation value from being Transformed");
uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTY, B_REDR, ICON_UNLOCKED, 125, 120, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects Y Rotation value from being Transformed");
uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTZ, B_REDR, ICON_UNLOCKED, 125, 100, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects Z Rotation value from being Transformed");
uiBlockEndAlign(block);
-
+
uiDefBut(block, LABEL, 0, "Scale:", 0, 80, 100, 20, 0, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
uiDefButF(block, NUM, B_ARMATUREPANEL2, "X:", 0, 60, 120, 19, pchan->size, -lim, lim, 10, 3, "");
uiDefButF(block, NUM, B_ARMATUREPANEL2, "Y:", 0, 40, 120, 19, pchan->size+1, -lim, lim, 10, 3, "");
uiDefButF(block, NUM, B_ARMATUREPANEL2, "Z:", 0, 20, 120, 19, pchan->size+2, -lim, lim, 10, 3, "");
uiBlockEndAlign(block);
-
+
uiBlockBeginAlign(block);
uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEX, B_REDR, ICON_UNLOCKED, 125, 60, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects X Scale value from being Transformed");
uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEY, B_REDR, ICON_UNLOCKED, 125, 40, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects Y Scale value from being Transformed");
@@ -1027,7 +1050,7 @@ static void v3d_posearmature_buts(uiLayout *layout, Object *ob)
#if 0
static void validate_editbonebutton_cb(bContext *C, void *bonev, void *namev)
{
- EditBone *eBone= bonev;
+ EditBone *eBone = bonev;
char oldname[sizeof(eBone->name)], newname[sizeof(eBone->name)];
/* need to be on the stack */
@@ -1036,185 +1059,186 @@ static void validate_editbonebutton_cb(bContext *C, void *bonev, void *namev)
/* restore */
BLI_strncpy(eBone->name, oldname, sizeof(eBone->name));
- ED_armature_bone_rename(CTX_data_edit_object(C)->data, oldname, newname); // editarmature.c
- WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, CTX_data_edit_object(C)); // XXX fix
+ ED_armature_bone_rename(CTX_data_edit_object(C)->data, oldname, newname); /* editarmature.c */
+ WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, CTX_data_edit_object(C)); /* XXX fix */
}
#endif
static void v3d_editarmature_buts(uiLayout *layout, Object *ob)
{
-// uiBlock *block= uiLayoutGetBlock(layout);
- bArmature *arm= ob->data;
+/* uiBlock *block = uiLayoutGetBlock(layout); */
+ bArmature *arm = ob->data;
EditBone *ebone;
-// TransformProperties *tfp= v3d->properties_storage;
-// uiLayout *row;
+/* TransformProperties *tfp = v3d->properties_storage; */
+/* uiLayout *row; */
uiLayout *col;
PointerRNA eboneptr;
-
- ebone= arm->act_edbone;
- if (!ebone || (ebone->layer & arm->layer)==0) {
- uiItemL(layout, "Nothing selected", ICON_NONE);
+ ebone = arm->act_edbone;
+
+ if (!ebone || (ebone->layer & arm->layer) == 0) {
+ uiItemL(layout, IFACE_("Nothing selected"), ICON_NONE);
return;
}
-// row= uiLayoutRow(layout, 0);
+/* row = uiLayoutRow(layout, 0); */
RNA_pointer_create(&arm->id, &RNA_EditBone, ebone, &eboneptr);
- col= uiLayoutColumn(layout, 0);
- uiItemR(col, &eboneptr, "head", 0, "Head", ICON_NONE);
+ col = uiLayoutColumn(layout, 0);
+ uiItemR(col, &eboneptr, "head", 0, NULL, ICON_NONE);
if (ebone->parent && ebone->flag & BONE_CONNECTED ) {
PointerRNA parptr = RNA_pointer_get(&eboneptr, "parent");
- uiItemR(col, &parptr, "tail_radius", 0, "Radius (Parent)", ICON_NONE);
+ uiItemR(col, &parptr, "tail_radius", 0, IFACE_("Radius (Parent)"), ICON_NONE);
}
else {
- uiItemR(col, &eboneptr, "head_radius", 0, "Radius", ICON_NONE);
+ uiItemR(col, &eboneptr, "head_radius", 0, IFACE_("Radius"), ICON_NONE);
}
-
- uiItemR(col, &eboneptr, "tail", 0, "Tail", ICON_NONE);
- uiItemR(col, &eboneptr, "tail_radius", 0, "Radius", ICON_NONE);
-
- uiItemR(col, &eboneptr, "roll", 0, "Roll", ICON_NONE);
- uiItemR(col, &eboneptr, "envelope_distance", 0, "Envelope", ICON_NONE);
+
+ uiItemR(col, &eboneptr, "tail", 0, NULL, ICON_NONE);
+ uiItemR(col, &eboneptr, "tail_radius", 0, IFACE_("Radius"), ICON_NONE);
+
+ uiItemR(col, &eboneptr, "roll", 0, NULL, ICON_NONE);
+ uiItemR(col, &eboneptr, "envelope_distance", 0, IFACE_("Envelope"), ICON_NONE);
}
static void v3d_editmetaball_buts(uiLayout *layout, Object *ob)
{
PointerRNA mbptr, ptr;
- MetaBall *mball= ob->data;
-// uiLayout *row;
+ MetaBall *mball = ob->data;
+/* uiLayout *row; */
uiLayout *col;
-
- if (!mball || !(mball->lastelem)) return;
-
+
+ if (!mball || !(mball->lastelem))
+ return;
+
RNA_pointer_create(&mball->id, &RNA_MetaBall, mball, &mbptr);
-
-// row= uiLayoutRow(layout, 0);
+
+/* row = uiLayoutRow(layout, 0); */
RNA_pointer_create(&mball->id, &RNA_MetaElement, mball->lastelem, &ptr);
-
- col= uiLayoutColumn(layout, 0);
- uiItemR(col, &ptr, "co", 0, "Location", ICON_NONE);
-
- uiItemR(col, &ptr, "radius", 0, "Radius", ICON_NONE);
- uiItemR(col, &ptr, "stiffness", 0, "Stiffness", ICON_NONE);
-
- uiItemR(col, &ptr, "type", 0, "Type", ICON_NONE);
-
- col= uiLayoutColumn(layout, 1);
+
+ col = uiLayoutColumn(layout, 0);
+ uiItemR(col, &ptr, "co", 0, NULL, ICON_NONE);
+
+ uiItemR(col, &ptr, "radius", 0, NULL, ICON_NONE);
+ uiItemR(col, &ptr, "stiffness", 0, NULL, ICON_NONE);
+
+ uiItemR(col, &ptr, "type", 0, NULL, ICON_NONE);
+
+ col = uiLayoutColumn(layout, 1);
switch (RNA_enum_get(&ptr, "type")) {
case MB_BALL:
break;
case MB_CUBE:
- uiItemL(col, "Size:", ICON_NONE);
+ uiItemL(col, IFACE_("Size:"), ICON_NONE);
uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE);
uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NONE);
uiItemR(col, &ptr, "size_z", 0, "Z", ICON_NONE);
break;
case MB_TUBE:
- uiItemL(col, "Size:", ICON_NONE);
+ uiItemL(col, IFACE_("Size:"), ICON_NONE);
uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE);
break;
case MB_PLANE:
- uiItemL(col, "Size:", ICON_NONE);
+ uiItemL(col, IFACE_("Size:"), ICON_NONE);
uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE);
uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NONE);
break;
case MB_ELIPSOID:
- uiItemL(col, "Size:", ICON_NONE);
+ uiItemL(col, IFACE_("Size:"), ICON_NONE);
uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE);
uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NONE);
uiItemR(col, &ptr, "size_z", 0, "Z", ICON_NONE);
- break;
- }
+ break;
+ }
}
static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event)
{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
-// Object *obedit= CTX_data_edit_object(C);
- View3D *v3d= CTX_wm_view3d(C);
-// BoundBox *bb;
- Object *ob= OBACT;
- TransformProperties *tfp= v3d->properties_storage;
-
- switch(event) {
-
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
+/* Object *obedit = CTX_data_edit_object(C); */
+ View3D *v3d = CTX_wm_view3d(C);
+/* BoundBox *bb; */
+ Object *ob = OBACT;
+ TransformProperties *tfp = v3d->properties_storage;
+
+ switch (event) {
+
case B_REDR:
ED_area_tag_redraw(CTX_wm_area(C));
return; /* no notifier! */
-
+
case B_OBJECTPANEL:
DAG_id_tag_update(&ob->id, OB_RECALC_OB);
break;
-
case B_OBJECTPANELMEDIAN:
if (ob) {
v3d_editvertex_buts(NULL, v3d, ob, 1.0);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
break;
-
/* note; this case also used for parbone */
+
case B_OBJECTPANELPARENT:
if (ob) {
if (ob->id.lib || BKE_object_parent_loop_check(ob->parent, ob))
- ob->parent= NULL;
+ ob->parent = NULL;
else {
DAG_scene_sort(bmain, scene);
DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
}
break;
-
- case B_ARMATUREPANEL3: // rotate button on channel
+ case B_ARMATUREPANEL3: /* rotate button on channel */
{
bPoseChannel *pchan;
float eul[3];
-
- pchan= get_active_posechannel(ob);
- if (!pchan) return;
-
+
+ pchan = get_active_posechannel(ob);
+ if (!pchan)
+ return;
+
/* make a copy to eul[3], to allow TAB on buttons to work */
- eul[0]= DEG2RADF(tfp->ob_eul[0]);
- eul[1]= DEG2RADF(tfp->ob_eul[1]);
- eul[2]= DEG2RADF(tfp->ob_eul[2]);
-
+ eul[0] = DEG2RADF(tfp->ob_eul[0]);
+ eul[1] = DEG2RADF(tfp->ob_eul[1]);
+ eul[2] = DEG2RADF(tfp->ob_eul[2]);
+
if (pchan->rotmode == ROT_MODE_AXISANGLE) {
float quat[4];
/* convert to axis-angle, passing through quats */
- eul_to_quat( quat,eul);
- quat_to_axis_angle( pchan->rotAxis, &pchan->rotAngle,quat);
+ eul_to_quat(quat, eul);
+ quat_to_axis_angle(pchan->rotAxis, &pchan->rotAngle, quat);
}
else if (pchan->rotmode == ROT_MODE_QUAT)
- eul_to_quat( pchan->quat,eul);
+ eul_to_quat(pchan->quat, eul);
else
copy_v3_v3(pchan->eul, eul);
}
/* no break, pass on */
+
case B_ARMATUREPANEL2:
- {
- ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
- DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- }
+ ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
+ DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
break;
+
case B_TRANSFORMSPACEADD:
- {
- char names[sizeof(((TransformOrientation *)NULL)->name)]= "";
- BIF_createTransformOrientation(C, NULL, names, 1, 0);
+ {
+ char names[sizeof(((TransformOrientation *)NULL)->name)] = "";
+ BIF_createTransformOrientation(C, NULL, names, 1, 0);
+ }
break;
- }
+
case B_TRANSFORMSPACECLEAR:
BIF_clearTransformOrientation(C);
break;
-
-#if 0 // XXX
+
+#if 0 /* XXX */
case B_WEIGHT0_0:
wpaint->weight = 0.0f;
break;
-
+
case B_WEIGHT1_4:
wpaint->weight = 0.25f;
break;
@@ -1227,7 +1251,7 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event
case B_WEIGHT1_0:
wpaint->weight = 1.0f;
break;
-
+
case B_OPA1_8:
wpaint->a = 0.125f;
break;
@@ -1245,46 +1269,47 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event
break;
#endif
case B_CLR_WPAINT:
-// if (!multires_level1_test()) {
+/* if (!multires_level1_test()) { */
{
bDeformGroup *defGroup = BLI_findlink(&ob->defbase, ob->actdef-1);
if (defGroup) {
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
int a;
- for (a=0; a<me->totvert; a++)
+ for (a = 0; a < me->totvert; a++)
ED_vgroup_vert_remove (ob, defGroup, a);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
}
break;
+
case B_RV3D_LOCKED:
case B_RV3D_BOXVIEW:
case B_RV3D_BOXCLIP:
{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= sa->regionbase.last;
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = sa->regionbase.last;
RegionView3D *rv3d;
short viewlock;
-
- ar= ar->prev;
- rv3d= ar->regiondata;
- viewlock= rv3d->viewlock;
-
- if ((viewlock & RV3D_LOCKED)==0)
- viewlock= 0;
- else if ((viewlock & RV3D_BOXVIEW)==0)
+
+ ar = ar->prev;
+ rv3d = ar->regiondata;
+ viewlock = rv3d->viewlock;
+
+ if (!(viewlock & RV3D_LOCKED))
+ viewlock = 0;
+ else if (!(viewlock & RV3D_BOXVIEW))
viewlock &= ~RV3D_BOXCLIP;
-
- for (; ar; ar= ar->prev) {
- if (ar->alignment==RGN_ALIGN_QSPLIT) {
- rv3d= ar->regiondata;
- rv3d->viewlock= viewlock;
+
+ for (; ar; ar = ar->prev) {
+ if (ar->alignment == RGN_ALIGN_QSPLIT) {
+ rv3d = ar->regiondata;
+ rv3d->viewlock = viewlock;
}
}
-
+
if (rv3d->viewlock & RV3D_BOXVIEW)
view3d_boxview_copy(sa, sa->regionbase.last);
-
+
ED_area_tag_redraw(sa);
}
break;
@@ -1297,78 +1322,82 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event
static void view3d_panel_object(const bContext *C, Panel *pa)
{
uiBlock *block;
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- View3D *v3d= CTX_wm_view3d(C);
- //uiBut *bt;
- Object *ob= OBACT;
- // TransformProperties *tfp; // UNUSED
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ View3D *v3d = CTX_wm_view3d(C);
+ /* uiBut *bt; */
+ Object *ob = OBACT;
+ /* TransformProperties *tfp; */ /* UNUSED */
PointerRNA obptr;
uiLayout *col /* , *row */ /* UNUSED */;
float lim;
-
- if (ob==NULL) return;
+
+ if (ob == NULL)
+ return;
/* make sure we got storage */
- /*
- if (v3d->properties_storage==NULL)
- v3d->properties_storage= MEM_callocN(sizeof(TransformProperties), "TransformProperties");
- tfp= v3d->properties_storage;
+#if 0
+ if (v3d->properties_storage == NULL)
+ v3d->properties_storage = MEM_callocN(sizeof(TransformProperties), "TransformProperties");
+ tfp = v3d->properties_storage;
-// XXX uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
+ /* XXX uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); */
if (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)) {
}
else {
- if ((ob->mode & OB_MODE_PARTICLE_EDIT)==0) {
+ if ((ob->mode & OB_MODE_PARTICLE_EDIT) == 0) {
uiBlockEndAlign(block);
}
}
- */
+#endif
- lim= 10000.0f * MAX2(1.0f, v3d->grid);
+ lim = 10000.0f * MAX2(1.0f, v3d->grid);
- block= uiLayoutGetBlock(pa->layout);
+ block = uiLayoutGetBlock(pa->layout);
uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL);
- col= uiLayoutColumn(pa->layout, 0);
- /* row= uiLayoutRow(col, 0); */ /* UNUSED */
+ col = uiLayoutColumn(pa->layout, 0);
+ /* row = uiLayoutRow(col, 0); */ /* UNUSED */
RNA_id_pointer_create(&ob->id, &obptr);
- if (ob==obedit) {
- if (ob->type==OB_ARMATURE) v3d_editarmature_buts(col, ob);
- else if (ob->type==OB_MBALL) v3d_editmetaball_buts(col, ob);
- else v3d_editvertex_buts(col, v3d, ob, lim);
+ if (ob == obedit) {
+ if (ob->type == OB_ARMATURE)
+ v3d_editarmature_buts(col, ob);
+ else if (ob->type == OB_MBALL)
+ v3d_editmetaball_buts(col, ob);
+ else
+ v3d_editvertex_buts(col, v3d, ob, lim);
}
else if (ob->mode & OB_MODE_POSE) {
v3d_posearmature_buts(col, ob);
}
else {
-
v3d_transform_butsR(col, &obptr);
}
}
#if 0
-static void view3d_panel_preview(bContext *C, ARegion *ar, short cntrl) // VIEW3D_HANDLER_PREVIEW
+static void view3d_panel_preview(bContext *C, ARegion *ar, short cntrl) /* VIEW3D_HANDLER_PREVIEW */
{
uiBlock *block;
- View3D *v3d= sa->spacedata.first;
+ View3D *v3d = sa->spacedata.first;
int ofsx, ofsy;
-
- block= uiBeginBlock(C, ar, __func__, UI_EMBOSS);
+
+ block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);
uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | UI_PNL_SCALE | cntrl);
- uiSetPanelHandler(VIEW3D_HANDLER_PREVIEW); // for close and esc
-
- ofsx= -150+(sa->winx/2)/v3d->blockscale;
- ofsy= -100+(sa->winy/2)/v3d->blockscale;
- if (uiNewPanel(C, ar, block, "Preview", "View3d", ofsx, ofsy, 300, 200)==0) return;
+ uiSetPanelHandler(VIEW3D_HANDLER_PREVIEW); /* for close and esc */
+
+ ofsx = -150 + (sa->winx/2) / v3d->blockscale;
+ ofsy = -100 + (sa->winy/2) / v3d->blockscale;
+ if (uiNewPanel(C, ar, block, "Preview", "View3d", ofsx, ofsy, 300, 200) == 0)
+ return;
uiBlockSetDrawExtraFunc(block, BIF_view3d_previewdraw);
-
+
if (scene->recalc & SCE_PRV_CHANGED) {
scene->recalc &= ~SCE_PRV_CHANGED;
- //printf("found recalc\n");
+ /* printf("found recalc\n"); */
BIF_view3d_previewrender_free(sa->spacedata.first);
BIF_preview_changed(0);
}
@@ -1379,33 +1408,33 @@ void view3d_buttons_register(ARegionType *art)
{
PanelType *pt;
- pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel object");
+ pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel object");
strcpy(pt->idname, "VIEW3D_PT_object");
strcpy(pt->label, "Transform");
- pt->draw= view3d_panel_object;
+ pt->draw = view3d_panel_object;
BLI_addtail(&art->paneltypes, pt);
-
- pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel gpencil");
+
+ pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel gpencil");
strcpy(pt->idname, "VIEW3D_PT_gpencil");
strcpy(pt->label, "Grease Pencil");
- pt->draw= gpencil_panel_standard;
+ pt->draw = gpencil_panel_standard;
BLI_addtail(&art->paneltypes, pt);
- pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel vgroup");
+ pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel vgroup");
strcpy(pt->idname, "VIEW3D_PT_vgroup");
strcpy(pt->label, "Vertex Groups");
- pt->draw= view3d_panel_vgroup;
- pt->poll= view3d_panel_vgroup_poll;
+ pt->draw = view3d_panel_vgroup;
+ pt->poll = view3d_panel_vgroup_poll;
BLI_addtail(&art->paneltypes, pt);
- // XXX view3d_panel_preview(C, ar, 0);
+ /* XXX view3d_panel_preview(C, ar, 0); */
}
static int view3d_properties(bContext *C, wmOperator *UNUSED(op))
{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= view3d_has_buttons_region(sa);
-
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = view3d_has_buttons_region(sa);
+
if (ar)
ED_region_toggle_hidden(C, ar);
@@ -1414,13 +1443,13 @@ static int view3d_properties(bContext *C, wmOperator *UNUSED(op))
void VIEW3D_OT_properties(wmOperatorType *ot)
{
- ot->name= "Properties";
- ot->description= "Toggles the properties panel display";
- ot->idname= "VIEW3D_OT_properties";
-
- ot->exec= view3d_properties;
- ot->poll= ED_operator_view3d_active;
-
+ ot->name = "Properties";
+ ot->description = "Toggles the properties panel display";
+ ot->idname = "VIEW3D_OT_properties";
+
+ ot->exec = view3d_properties;
+ ot->poll = ED_operator_view3d_active;
+
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index dd121265522..3d570252126 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -177,7 +177,7 @@ void ED_view3d_clipping_set(RegionView3D *rv3d)
unsigned int a;
for (a = 0; a < tot; a++) {
- QUATCOPY(plane, rv3d->clip[a]);
+ copy_v4db_v4fl(plane, rv3d->clip[a]);
glClipPlane(GL_CLIP_PLANE0 + a, plane);
glEnable(GL_CLIP_PLANE0 + a);
}
@@ -225,21 +225,21 @@ int ED_view3d_clipping_test(RegionView3D *rv3d, const float vec[3], const int is
/* ********* end custom clipping *********** */
-static void drawgrid_draw(ARegion *ar, float wx, float wy, float x, float y, float dx)
+static void drawgrid_draw(ARegion *ar, double wx, double wy, double x, double y, double dx)
{
- float verts[2][2];
+ double verts[2][2];
x+= (wx);
y+= (wy);
/* set fixed 'Y' */
verts[0][1]= 0.0f;
- verts[1][1]= (float)ar->winy;
+ verts[1][1]= (double)ar->winy;
/* iter over 'X' */
- verts[0][0] = verts[1][0] = x-dx*floorf(x/dx);
+ verts[0][0] = verts[1][0] = x-dx*floor(x/dx);
glEnableClientState(GL_VERTEX_ARRAY);
- glVertexPointer(2, GL_FLOAT, 0, verts);
+ glVertexPointer(2, GL_DOUBLE, 0, verts);
while (verts[0][0] < ar->winx) {
glDrawArrays(GL_LINES, 0, 2);
@@ -248,10 +248,10 @@ static void drawgrid_draw(ARegion *ar, float wx, float wy, float x, float y, flo
/* set fixed 'X' */
verts[0][0]= 0.0f;
- verts[1][0]= (float)ar->winx;
+ verts[1][0]= (double)ar->winx;
/* iter over 'Y' */
- verts[0][1]= verts[1][1]= y-dx*floorf(y/dx);
+ verts[0][1]= verts[1][1]= y-dx*floor(y/dx);
while (verts[0][1] < ar->winy) {
glDrawArrays(GL_LINES, 0, 2);
verts[0][1] = verts[1][1] = verts[0][1] + dx;
@@ -266,16 +266,13 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
{
/* extern short bgpicmode; */
RegionView3D *rv3d= ar->regiondata;
- float wx, wy, x, y, fw, fx, fy, dx;
- float vec4[4];
+ double wx, wy, x, y, fw, fx, fy, dx;
+ double vec4[4];
unsigned char col[3], col2[3];
- vec4[0]=vec4[1]=vec4[2]=0.0;
- vec4[3]= 1.0;
- mul_m4_v4(rv3d->persmat, vec4);
- fx= vec4[0];
- fy= vec4[1];
- fw= vec4[3];
+ fx= rv3d->persmat[3][0];
+ fy= rv3d->persmat[3][1];
+ fw= rv3d->persmat[3][3];
wx= (ar->winx/2.0); /* because of rounding errors, grid at wrong location */
wy= (ar->winy/2.0);
@@ -287,7 +284,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
vec4[2]= 0.0;
vec4[3]= 1.0;
- mul_m4_v4(rv3d->persmat, vec4);
+ mul_m4_v4d(rv3d->persmat, vec4);
fx= vec4[0];
fy= vec4[1];
fw= vec4[3];
@@ -305,7 +302,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
* items are less useful when dealing with units */
void *usys;
int len, i;
- float dx_scalar;
+ double dx_scalar;
float blend_fac;
bUnit_GetSystem(&usys, &len, unit->system, B_UNIT_LENGTH);
@@ -313,7 +310,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
if (usys) {
i= len;
while (i--) {
- float scalar= bUnit_GetScaler(usys, i);
+ double scalar= bUnit_GetScaler(usys, i);
dx_scalar = dx * scalar / unit->scale_length;
if (dx_scalar < (GRID_MIN_PX*2))
@@ -841,8 +838,8 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d)
}
/* draw info beside axes in bottom left-corner:
-* framenum, object name, bone name (if available), marker name (if available)
-*/
+ * framenum, object name, bone name (if available), marker name (if available)
+ */
static void draw_selected_name(Scene *scene, Object *ob)
{
char info[256], *markern;
@@ -1079,7 +1076,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
* 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 noticeable
- * but keep it here incase we need to remove the workaround */
+ * but keep it here in case we need to remove the workaround */
x1i= (int)(x1 - 1.0001f);
y1i= (int)(y1 - 1.0001f);
x2i= (int)(x2 + (1.0f-0.0001f));
@@ -1225,7 +1222,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
}
if (ca && (ca->flag & CAM_SHOWSENSOR)) {
/* determine sensor fit, and get sensor x/y, for auto fit we
- assume and square sensor and only use sensor_x */
+ * assume and square sensor and only use sensor_x */
float sizex= scene->r.xsch*scene->r.xasp;
float sizey= scene->r.ysch*scene->r.yasp;
int sensor_fit = camera_sensor_fit(ca->sensor_fit, sizex, sizey);
@@ -1562,8 +1559,8 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d)
ibuf= BKE_movieclip_get_ibuf(clip, &bgpic->cuser);
/* working with ibuf from image and clip has got different workflow now.
- ibuf acquired from clip is referenced by cache system and should
- be dereferenced after usage. */
+ * ibuf acquired from clip is referenced by cache system and should
+ * be dereferenced after usage. */
freeibuf= ibuf;
}
@@ -1603,7 +1600,7 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d)
asp= ( (float)ibuf->y)/(float)ibuf->x;
vec[0] = vec[1] = vec[2] = 0.0;
- ED_view3d_project_float(ar, vec, sco, rv3d->persmat);
+ ED_view3d_project_float_v2(ar, vec, sco, rv3d->persmat);
cx = sco[0];
cy = sco[1];
@@ -1764,9 +1761,9 @@ static void view3d_draw_xraytransp(Scene *scene, ARegion *ar, View3D *v3d, int c
/* *********************** */
/*
- In most cases call draw_dupli_objects,
- draw_dupli_objects_color was added because when drawing set dupli's
- we need to force the color
+ * In most cases call draw_dupli_objects,
+ * draw_dupli_objects_color was added because when drawing set dupli's
+ * we need to force the color
*/
#if 0
@@ -1895,7 +1892,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas
static void draw_dupli_objects(Scene *scene, ARegion *ar, View3D *v3d, Base *base)
{
/* define the color here so draw_dupli_objects_color can be called
- * from the set loop */
+ * from the set loop */
int color= (base->flag & SELECT)?TH_SELECT:TH_WIRE;
/* debug */
@@ -2225,7 +2222,7 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d)
}
/* render shadows after updating all lamps, nested object_duplilist
- * don't work correct since it's replacing object matrices */
+ * don't work correct since it's replacing object matrices */
for (shadow=shadows.first; shadow; shadow=shadow->next) {
/* this needs to be done better .. */
float viewmat[4][4], winmat[4][4];
@@ -2252,7 +2249,7 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d)
mult_m4_m4m4(rv3d.persmat, rv3d.winmat, rv3d.viewmat);
invert_m4_m4(rv3d.persinv, rv3d.viewinv);
- ED_view3d_draw_offscreen(scene, v3d, &ar, winsize, winsize, viewmat, winmat);
+ ED_view3d_draw_offscreen(scene, v3d, &ar, winsize, winsize, viewmat, winmat, FALSE);
GPU_lamp_shadow_buffer_unbind(shadow->lamp);
v3d->drawtype= drawtype;
@@ -2330,22 +2327,22 @@ CustomDataMask ED_view3d_screen_datamask(bScreen *screen)
return mask;
}
-static void view3d_main_area_setup_view(Scene *scene, View3D *v3d, ARegion *ar, float viewmat[][4], float winmat[][4])
+void ED_view3d_update_viewmat(Scene *scene, View3D *v3d, ARegion *ar, float viewmat[][4], float winmat[][4])
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
/* setup window matrices */
if (winmat)
copy_m4_m4(rv3d->winmat, winmat);
else
setwinmatrixview3d(ar, v3d, NULL); /* NULL= no pickrect */
-
+
/* setup view matrix */
if (viewmat)
copy_m4_m4(rv3d->viewmat, viewmat);
else
setviewmatrixview3d(scene, v3d, rv3d); /* note: calls where_is_object for camera... */
-
+
/* update utilitity matrices */
mult_m4_m4m4(rv3d->persmat, rv3d->winmat, rv3d->viewmat);
invert_m4_m4(rv3d->persinv, rv3d->persmat);
@@ -2365,12 +2362,19 @@ static void view3d_main_area_setup_view(Scene *scene, View3D *v3d, ARegion *ar,
v2[0]= rv3d->persmat[0][1];
v2[1]= rv3d->persmat[1][1];
v2[2]= rv3d->persmat[2][1];
-
+
len1= 1.0f / len_v3(v1);
len2= 1.0f / len_v3(v2);
rv3d->pixsize = (2.0f * MAX2(len1, len2)) / (float)MAX2(ar->winx, ar->winy);
}
+}
+
+static void view3d_main_area_setup_view(Scene *scene, View3D *v3d, ARegion *ar, float viewmat[][4], float winmat[][4])
+{
+ RegionView3D *rv3d = ar->regiondata;
+
+ ED_view3d_update_viewmat(scene, v3d, ar, viewmat, winmat);
/* set for opengl */
glMatrixMode(GL_PROJECTION);
@@ -2380,13 +2384,15 @@ static void view3d_main_area_setup_view(Scene *scene, View3D *v3d, ARegion *ar,
}
void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar,
- int winx, int winy, float viewmat[][4], float winmat[][4])
+ int winx, int winy, float viewmat[][4], float winmat[][4],
+ int draw_background)
{
RegionView3D *rv3d= ar->regiondata;
Base *base;
float backcol[3];
int bwinx, bwiny;
rcti brect;
+ ImBuf *bg_ibuf = NULL;
glPushMatrix();
@@ -2414,20 +2420,67 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar,
if (draw_glsl_material(scene, NULL, v3d, v3d->drawtype))
gpu_update_lamps_shadows(scene, v3d);
- /* set background color, fallback on the view background color */
- if (scene->world) {
- if (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
- linearrgb_to_srgb_v3_v3(backcol, &scene->world->horr);
- else
- copy_v3_v3(backcol, &scene->world->horr);
- glClearColor(backcol[0], backcol[1], backcol[2], 0.0);
+ /* if scene has got active clip, use it for render backdrop */
+ if (draw_background && scene->clip && rv3d->persp==RV3D_CAMOB && v3d->camera) {
+ MovieClipUser user = {0};
+
+ BKE_movieclip_user_set_frame(&user, CFRA);
+ bg_ibuf = BKE_movieclip_get_ibuf(scene->clip, &user);
}
- else {
- UI_ThemeClearColor(TH_BACK);
+
+ if (!bg_ibuf) {
+ /* set background color, fallback on the view background color
+ * (if active clip is set but frame is failed to load fallback to horizon color as background) */
+ if (scene->world) {
+ if (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
+ linearrgb_to_srgb_v3_v3(backcol, &scene->world->horr);
+ else
+ copy_v3_v3(backcol, &scene->world->horr);
+ glClearColor(backcol[0], backcol[1], backcol[2], 0.0);
+ }
+ else {
+ UI_ThemeClearColor(TH_BACK);
+ }
}
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+ if (bg_ibuf) {
+ unsigned char *pixels, *cp, *dst_cp;
+ int i;
+
+ if (bg_ibuf->rect_float && !bg_ibuf->rect)
+ IMB_rect_from_float(bg_ibuf);
+
+ dst_cp = pixels = MEM_callocN(4*sizeof(unsigned char)*bg_ibuf->x*bg_ibuf->y, "draw offscreen clip pixels");
+ cp = (unsigned char *)bg_ibuf->rect;
+ for (i = 0; i < bg_ibuf->x*bg_ibuf->y; i++, cp += 4, dst_cp += 4) {
+ dst_cp[0] = cp[0];
+ dst_cp[1] = cp[1];
+ dst_cp[2] = cp[2];
+ dst_cp[3] = 255;
+ }
+
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ ED_region_pixelspace(ar);
+
+ glPixelZoom((float)winx / bg_ibuf->x, (float)winy / bg_ibuf->y);
+ glaDrawPixelsTex(0, 0, bg_ibuf->x, bg_ibuf->y, GL_UNSIGNED_BYTE, pixels);
+
+ glPixelZoom(1.0, 1.0);
+
+ glMatrixMode(GL_PROJECTION);
+ glPopMatrix();
+ glMatrixMode(GL_MODELVIEW);
+ glPopMatrix();
+
+ IMB_freeImBuf(bg_ibuf);
+ MEM_freeN(pixels);
+ }
+
/* setup view matrices */
view3d_main_area_setup_view(scene, v3d, ar, viewmat, winmat);
@@ -2513,7 +2566,7 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar,
/* utility func for ED_view3d_draw_offscreen */
ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar,
- int sizex, int sizey, unsigned int flag, char err_out[256])
+ int sizex, int sizey, unsigned int flag, int draw_background, char err_out[256])
{
RegionView3D *rv3d= ar->regiondata;
ImBuf *ibuf;
@@ -2538,10 +2591,10 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar,
camera_params_compute_viewplane(&params, sizex, sizey, scene->r.xasp, scene->r.yasp);
camera_params_compute_matrix(&params);
- ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, params.winmat);
+ ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, params.winmat, draw_background);
}
else {
- ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, NULL);
+ ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, NULL, draw_background);
}
/* read in pixels & stamp */
@@ -2569,7 +2622,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar,
/* creates own 3d views, used by the sequencer */
ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, Object *camera, int width, int height,
- unsigned int flag, int drawtype, char err_out[256])
+ unsigned int flag, int drawtype, int draw_background, char err_out[256])
{
View3D v3d= {NULL};
ARegion ar= {NULL};
@@ -2608,7 +2661,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, Object *camera, int w
mult_m4_m4m4(rv3d.persmat, rv3d.winmat, rv3d.viewmat);
invert_m4_m4(rv3d.persinv, rv3d.viewinv);
- return ED_view3d_draw_offscreen_imbuf(scene, &v3d, &ar, width, height, flag, err_out);
+ return ED_view3d_draw_offscreen_imbuf(scene, &v3d, &ar, width, height, flag, draw_background, err_out);
// seq_view3d_cb(scene, cfra, render_size, seqrectx, seqrecty);
}
@@ -2753,9 +2806,11 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const
v3d->zbuf= FALSE;
/* enables anti-aliasing for 3D view drawing */
- /*if (!(U.gameflags & USER_DISABLE_AA))
- glEnable(GL_MULTISAMPLE_ARB);*/
-
+#if 0
+ if (!(U.gameflags & USER_DISABLE_AA))
+ glEnable(GL_MULTISAMPLE_ARB);
+#endif
+
// needs to be done always, gridview is adjusted in drawgrid() now
rv3d->gridview= v3d->grid;
@@ -2868,10 +2923,12 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const
ED_view3d_clipping_disable();
BIF_draw_manipulator(C);
-
+
+#if 0
/* Disable back anti-aliasing */
- /*if (!(U.gameflags & USER_DISABLE_AA))
- glDisable(GL_MULTISAMPLE_ARB);*/
+ if (!(U.gameflags & USER_DISABLE_AA))
+ glDisable(GL_MULTISAMPLE_ARB);
+#endif
if (v3d->zbuf) {
v3d->zbuf= FALSE;
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index c78d63c174b..0b12db5d290 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -302,12 +302,12 @@ void view3d_boxview_copy(ScrArea *sa, ARegion *ar)
/* 'clip' is used to know if our clip setting has changed */
void ED_view3d_quadview_update(ScrArea *sa, ARegion *ar, short do_clip)
{
- ARegion *arsync= NULL;
+ ARegion *ar_sync= NULL;
RegionView3D *rv3d= ar->regiondata;
short viewlock;
/* this function copies flags from the first of the 3 other quadview
- regions to the 2 other, so it assumes this is the region whose
- properties are always being edited, weak */
+ * regions to the 2 other, so it assumes this is the region whose
+ * properties are always being edited, weak */
viewlock= rv3d->viewlock;
if ((viewlock & RV3D_LOCKED)==0)
@@ -326,15 +326,15 @@ void ED_view3d_quadview_update(ScrArea *sa, ARegion *ar, short do_clip)
rv3d->rflag &= ~RV3D_BOXCLIP;
}
- /* use arsync so we sync with one of the aligned views below
+ /* use ar_sync so we sync with one of the aligned views below
* else the view jumps on changing view settings like 'clip'
* since it copies from the perspective view */
- arsync= ar;
+ ar_sync= ar;
}
}
if (rv3d->viewlock & RV3D_BOXVIEW) {
- view3d_boxview_copy(sa, arsync ? arsync : sa->regionbase.last);
+ view3d_boxview_copy(sa, ar_sync ? ar_sync : sa->regionbase.last);
}
ED_area_tag_redraw(sa);
@@ -356,7 +356,7 @@ typedef struct ViewOpsData {
float viewquat[4]; /* working copy of rv3d->viewquat */
float trackvec[3];
float mousevec[3]; /* dolly only */
- float reverse, dist0;
+ float reverse, dist0, camzoom0;
float grid, far;
short axis_snap; /* view rotate only */
@@ -416,6 +416,7 @@ static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event)
ED_view3d_camera_lock_init(vod->v3d, vod->rv3d);
vod->dist0= rv3d->dist;
+ vod->camzoom0= rv3d->camzoom;
copy_qt_qt(vod->viewquat, rv3d->viewquat);
copy_qt_qt(vod->oldquat, rv3d->viewquat);
vod->origx= vod->oldx= event->x;
@@ -445,8 +446,8 @@ static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event)
negate_v3_v3(my_origin, rv3d->ofs); /* ofs is flipped */
- /* Set the dist value to be the distance from this 3d point */
- /* this means youll always be able to zoom into it and panning wont go bad when dist was zero */
+ /* Set the dist value to be the distance from this 3d point
+ * this means youll always be able to zoom into it and panning wont go bad when dist was zero */
/* remove dist value */
upvec[0] = upvec[1] = 0;
@@ -610,11 +611,12 @@ void viewrotate_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_add_item(keymap, LEFTALTKEY, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_AXIS_SNAP_ENABLE);
WM_modalkeymap_add_item(keymap, LEFTALTKEY, KM_RELEASE, KM_ANY, 0, VIEWROT_MODAL_AXIS_SNAP_DISABLE);
- /* disabled mode switching for now, can re-implement better, later on
+ /* disabled mode switching for now, can re-implement better, later on */
+#if 0
WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ZOOM);
WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ZOOM);
WM_modalkeymap_add_item(keymap, LEFTSHIFTKEY, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_MOVE);
- */
+#endif
/* assign map to operators */
WM_modalkeymap_assign(keymap, "VIEW3D_OT_rotate");
@@ -640,16 +642,15 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y)
cross_v3_v3v3(q1+1, vod->trackvec, newvec);
normalize_v3(q1+1);
- /* Allow for rotation beyond the interval
- * [-pi, pi] */
+ /* Allow for rotation beyond the interval [-pi, pi] */
while (si > 1.0f)
si -= 2.0f;
/* This relation is used instead of
- * phi = asin(si) so that the angle
- * of rotation is linearly proportional
- * to the distance that the mouse is
- * dragged. */
+ * - phi = asin(si) so that the angle
+ * - of rotation is linearly proportional
+ * - to the distance that the mouse is
+ * - dragged. */
phi = si * (float)(M_PI / 2.0);
q1[0]= cos(phi);
@@ -676,8 +677,8 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y)
float m_inv[3][3];
float xvec[3] = {1.0f, 0.0f, 0.0f};
/* Sensitivity will control how fast the viewport rotates. 0.0035 was
- obtained experimentally by looking at viewport rotation sensitivities
- on other modeling programs. */
+ * obtained experimentally by looking at viewport rotation sensitivities
+ * on other modeling programs. */
/* Perhaps this should be a configurable user parameter. */
const float sensitivity = 0.0035f;
@@ -1254,11 +1255,12 @@ void viewmove_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_RELEASE, KM_ANY, 0, VIEW_MODAL_CONFIRM);
WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, VIEW_MODAL_CONFIRM);
- /* disabled mode switching for now, can re-implement better, later on
+ /* disabled mode switching for now, can re-implement better, later on */
+#if 0
WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ZOOM);
WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ZOOM);
WM_modalkeymap_add_item(keymap, LEFTSHIFTKEY, KM_RELEASE, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ROTATE);
- */
+#endif
/* assign map to operators */
WM_modalkeymap_assign(keymap, "VIEW3D_OT_move");
@@ -1414,11 +1416,12 @@ void viewzoom_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_RELEASE, KM_ANY, 0, VIEW_MODAL_CONFIRM);
WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, VIEW_MODAL_CONFIRM);
- /* disabled mode switching for now, can re-implement better, later on
+ /* disabled mode switching for now, can re-implement better, later on */
+#if 0
WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_RELEASE, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ROTATE);
WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_RELEASE, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ROTATE);
WM_modalkeymap_add_item(keymap, LEFTSHIFTKEY, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_MOVE);
- */
+#endif
/* assign map to operators */
WM_modalkeymap_assign(keymap, "VIEW3D_OT_zoom");
@@ -1466,7 +1469,17 @@ static void view_zoom_mouseloc(ARegion *ar, float dfac, int mx, int my)
static void viewzoom_apply(ViewOpsData *vod, int x, int y, const short viewzoom, const short zoom_invert)
{
float zfac=1.0;
+ short use_cam_zoom;
+
+ use_cam_zoom = (vod->rv3d->persp==RV3D_CAMOB) && !(vod->rv3d->is_persp && ED_view3d_camera_lock_check(vod->v3d, vod->rv3d));
+ if (use_cam_zoom) {
+ float delta;
+ delta = (x - vod->origx + y - vod->origy) / 10.0f;
+ vod->rv3d->camzoom = vod->camzoom0 - delta;
+
+ CLAMP(vod->rv3d->camzoom, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX);
+ }
if (viewzoom==USER_ZOOM_CONT) {
double time= PIL_check_seconds_timer();
float time_step= (float)(time - vod->timer_lastdraw);
@@ -1514,12 +1527,20 @@ static void viewzoom_apply(ViewOpsData *vod, int x, int y, const short viewzoom,
SWAP(float, len1, len2);
}
- zfac = vod->dist0 * (2.0f * ((len2/len1)-1.0f) + 1.0f) / vod->rv3d->dist;
+ if (use_cam_zoom) {
+ zfac = vod->camzoom0 * (2.0f * ((len2/len1)-1.0f) + 1.0f) / vod->rv3d->camzoom;
+ zfac = 0;
+ }
+ else {
+ zfac = vod->dist0 * (2.0f * ((len2/len1)-1.0f) + 1.0f) / vod->rv3d->dist;
+ }
}
- if (zfac != 1.0f && zfac*vod->rv3d->dist > 0.001f * vod->grid &&
- zfac * vod->rv3d->dist < 10.0f * vod->far)
- view_zoom_mouseloc(vod->ar, zfac, vod->oldx, vod->oldy);
+ if (!use_cam_zoom) {
+ if (zfac != 1.0f && zfac*vod->rv3d->dist > 0.001f * vod->grid &&
+ zfac * vod->rv3d->dist < 10.0f * vod->far)
+ view_zoom_mouseloc(vod->ar, zfac, vod->oldx, vod->oldy);
+ }
/* these limits were in old code too */
if (vod->rv3d->dist<0.001f * vod->grid) vod->rv3d->dist= 0.001f * vod->grid;
@@ -1612,7 +1633,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
if (delta < 0) {
/* this min and max is also in viewmove() */
if (use_cam_zoom) {
- rv3d->camzoom-= 10;
+ rv3d->camzoom -= 10.0f;
if (rv3d->camzoom < RV3D_CAMZOOM_MIN) rv3d->camzoom= RV3D_CAMZOOM_MIN;
}
else if (rv3d->dist < 10.0f * v3d->far) {
@@ -1621,7 +1642,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
}
else {
if (use_cam_zoom) {
- rv3d->camzoom+= 10;
+ rv3d->camzoom += 10.0f;
if (rv3d->camzoom > RV3D_CAMZOOM_MAX) rv3d->camzoom= RV3D_CAMZOOM_MAX;
}
else if (rv3d->dist> 0.001f * v3d->grid) {
@@ -1666,11 +1687,12 @@ void viewdolly_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_RELEASE, KM_ANY, 0, VIEW_MODAL_CONFIRM);
WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, VIEW_MODAL_CONFIRM);
- /* disabled mode switching for now, can re-implement better, later on
+ /* disabled mode switching for now, can re-implement better, later on */
+#if 0
WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_RELEASE, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ROTATE);
WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_RELEASE, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ROTATE);
WM_modalkeymap_add_item(keymap, LEFTSHIFTKEY, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_MOVE);
- */
+#endif
/* assign map to operators */
WM_modalkeymap_assign(keymap, "VIEW3D_OT_dolly");
@@ -3538,11 +3560,12 @@ int ED_view3d_autodist_depth_seg(struct ARegion *ar, const int mval_sta[2], cons
return (*depth==FLT_MAX) ? 0:1;
}
-/* Gets the view trasnformation from a camera
-* currently dosnt take camzoom into account
-*
-* The dist is not modified for this function, if NULL its assimed zero
-* */
+/**
+ * Gets the view transformation from a camera
+ * currently dosnt take camzoom into account
+ *
+ * The dist is not modified for this function, if NULL its assumed zero
+ */
void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist)
{
/* Offset */
@@ -3625,12 +3648,6 @@ void ED_view3D_background_image_remove(View3D *v3d, BGpic *bgpic)
{
BLI_remlink(&v3d->bgpicbase, bgpic);
- if (bgpic->ima)
- id_us_min(&bgpic->ima->id);
-
- if (bgpic->clip)
- id_us_min(&bgpic->clip->id);
-
MEM_freeN(bgpic);
}
diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c
index c8c62d63e36..614fa45771d 100644
--- a/source/blender/editors/space_view3d/view3d_fly.c
+++ b/source/blender/editors/space_view3d/view3d_fly.c
@@ -24,12 +24,10 @@
* \ingroup spview3d
*/
-
/* defines VIEW3D_OT_fly modal operator */
//#define NDOF_FLY_DEBUG
//#define NDOF_FLY_DRAW_TOOMUCH // is this needed for ndof? - commented so redraw doesnt thrash - campbell
-
#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
@@ -59,10 +57,9 @@
#include "PIL_time.h" /* smoothview */
#include "view3d_intern.h" // own include
-
/* NOTE: these defines are saved in keymap files, do not change values but just add new ones */
enum {
- FLY_MODAL_CANCEL= 1,
+ FLY_MODAL_CANCEL = 1,
FLY_MODAL_CONFIRM,
FLY_MODAL_ACCELERATE,
FLY_MODAL_DECELERATE,
@@ -87,41 +84,42 @@ enum {
void fly_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
- {FLY_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
- {FLY_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
- {FLY_MODAL_ACCELERATE, "ACCELERATE", 0, "Accelerate", ""},
- {FLY_MODAL_DECELERATE, "DECELERATE", 0, "Decelerate", ""},
+ {FLY_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
+ {FLY_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
+ {FLY_MODAL_ACCELERATE, "ACCELERATE", 0, "Accelerate", ""},
+ {FLY_MODAL_DECELERATE, "DECELERATE", 0, "Decelerate", ""},
- {FLY_MODAL_PAN_ENABLE, "PAN_ENABLE", 0, "Pan Enable", ""},
- {FLY_MODAL_PAN_DISABLE, "PAN_DISABLE", 0, "Pan Disable", ""},
+ {FLY_MODAL_PAN_ENABLE, "PAN_ENABLE", 0, "Pan Enable", ""},
+ {FLY_MODAL_PAN_DISABLE, "PAN_DISABLE", 0, "Pan Disable", ""},
- {FLY_MODAL_DIR_FORWARD, "FORWARD", 0, "Fly Forward", ""},
- {FLY_MODAL_DIR_BACKWARD,"BACKWARD", 0, "Fly Backward", ""},
- {FLY_MODAL_DIR_LEFT, "LEFT", 0, "Fly Left", ""},
- {FLY_MODAL_DIR_RIGHT, "RIGHT", 0, "Fly Right", ""},
- {FLY_MODAL_DIR_UP, "UP", 0, "Fly Up", ""},
- {FLY_MODAL_DIR_DOWN, "DOWN", 0, "Fly Down", ""},
+ {FLY_MODAL_DIR_FORWARD, "FORWARD", 0, "Fly Forward", ""},
+ {FLY_MODAL_DIR_BACKWARD, "BACKWARD", 0, "Fly Backward", ""},
+ {FLY_MODAL_DIR_LEFT, "LEFT", 0, "Fly Left", ""},
+ {FLY_MODAL_DIR_RIGHT, "RIGHT", 0, "Fly Right", ""},
+ {FLY_MODAL_DIR_UP, "UP", 0, "Fly Up", ""},
+ {FLY_MODAL_DIR_DOWN, "DOWN", 0, "Fly Down", ""},
- {FLY_MODAL_AXIS_LOCK_X, "AXIS_LOCK_X", 0, "X Axis Correction", "X axis correction (toggle)"},
- {FLY_MODAL_AXIS_LOCK_Z, "AXIS_LOCK_Z", 0, "X Axis Correction", "Z axis correction (toggle)"},
+ {FLY_MODAL_AXIS_LOCK_X, "AXIS_LOCK_X", 0, "X Axis Correction", "X axis correction (toggle)"},
+ {FLY_MODAL_AXIS_LOCK_Z, "AXIS_LOCK_Z", 0, "X Axis Correction", "Z axis correction (toggle)"},
- {FLY_MODAL_PRECISION_ENABLE, "PRECISION_ENABLE", 0, "Precision Enable", ""},
- {FLY_MODAL_PRECISION_DISABLE, "PRECISION_DISABLE", 0, "Precision Disable", ""},
+ {FLY_MODAL_PRECISION_ENABLE, "PRECISION_ENABLE", 0, "Precision Enable", ""},
+ {FLY_MODAL_PRECISION_DISABLE, "PRECISION_DISABLE", 0, "Precision Disable", ""},
- {FLY_MODAL_FREELOOK_ENABLE, "FREELOOK_ENABLE", 0, "Rotation Enable", ""},
- {FLY_MODAL_FREELOOK_DISABLE, "FREELOOK_DISABLE", 0, "Rotation Disable", ""},
+ {FLY_MODAL_FREELOOK_ENABLE, "FREELOOK_ENABLE", 0, "Rotation Enable", ""},
+ {FLY_MODAL_FREELOOK_DISABLE, "FREELOOK_DISABLE", 0, "Rotation Disable", ""},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}};
- wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "View3D Fly Modal");
+ wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "View3D Fly Modal");
/* this function is called for each spacetype, only needs to add map once */
- if (keymap) return;
+ if (keymap)
+ return;
- keymap= WM_modalkeymap_add(keyconf, "View3D Fly Modal", modal_items);
+ keymap = WM_modalkeymap_add(keyconf, "View3D Fly Modal", modal_items);
/* items for modal map */
- WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, FLY_MODAL_CANCEL);
+ WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, FLY_MODAL_CANCEL);
WM_modalkeymap_add_item(keymap, RIGHTMOUSE, KM_ANY, KM_ANY, 0, FLY_MODAL_CANCEL);
WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_ANY, KM_ANY, 0, FLY_MODAL_CONFIRM);
@@ -171,8 +169,9 @@ typedef struct FlyInfo {
short state;
short redraw;
unsigned char use_precision;
- unsigned char use_freelook; /* if the user presses shift they can look about
- * without moving the direction there looking */
+ /* if the user presses shift they can look about
+ * without moving the direction there looking */
+ unsigned char use_freelook;
int mval[2]; /* latest 2D mouse values */
wmNDOFMotionData* ndof; /* latest 3D mouse values */
@@ -183,10 +182,10 @@ typedef struct FlyInfo {
short pan_view; /* when true, pan the view instead of rotating */
/* relative view axis locking - xlock, zlock
- 0; disabled
- 1; enabled but not checking because mouse hasnt moved outside the margin since locking was checked an not needed
- when the mouse moves, locking is set to 2 so checks are done.
- 2; mouse moved and checking needed, if no view altering is donem its changed back to 1 */
+ * 0) disabled
+ * 1) enabled but not checking because mouse hasn't moved outside the margin since locking was checked an not needed
+ * when the mouse moves, locking is set to 2 so checks are done.
+ * 2) mouse moved and checking needed, if no view altering is donem its changed back to 1 */
short xlock, zlock;
float xlock_momentum, zlock_momentum; /* nicer dynamics */
float grid; /* world scale 1.0 default */
@@ -196,15 +195,17 @@ typedef struct FlyInfo {
/* backup values */
float dist_backup; /* backup the views distance since we use a zero dist for fly mode */
- float ofs_backup[3]; /* backup the views offset incase the user cancels flying in non camera mode */
- float rot_backup[4]; /* backup the views quat incase the user cancels flying in non camera mode.
- * (quat for view, eul for camera) */
- short persp_backup; /* remember if were ortho or not, only used for restoring the view if it was a ortho view */
+ float ofs_backup[3]; /* backup the views offset in case the user cancels flying in non camera mode */
- short is_ortho_cam; /* are we flying an ortho camera in perspective view,
- * which was originall in ortho view?
- * could probably figure it out but better be explicit */
+ /* backup the views quat in case the user cancels flying in non camera mode.
+ * (quat for view, eul for camera) */
+ float rot_backup[4];
+ short persp_backup; /* remember if were ortho or not, only used for restoring the view if it was a ortho view */
+ /* are we flying an ortho camera in perspective view,
+ * which was originall in ortho view?
+ * could probably figure it out but better be explicit */
+ short is_ortho_cam;
void *obtfm; /* backup the objects transform */
/* compare between last state */
@@ -223,44 +224,43 @@ static void drawFlyPixel(const struct bContext *UNUSED(C), struct ARegion *UNUSE
FlyInfo *fly = arg;
/* draws 4 edge brackets that frame the safe area where the
- mouse can move during fly mode without spinning the view */
+ * mouse can move during fly mode without spinning the view */
float x1, x2, y1, y2;
-
- x1= 0.45f * (float)fly->ar->winx;
- y1= 0.45f * (float)fly->ar->winy;
- x2= 0.55f * (float)fly->ar->winx;
- y2= 0.55f * (float)fly->ar->winy;
+
+ x1 = 0.45f * (float)fly->ar->winx;
+ y1 = 0.45f * (float)fly->ar->winy;
+ x2 = 0.55f * (float)fly->ar->winx;
+ y2 = 0.55f * (float)fly->ar->winy;
cpack(0);
-
-
+
glBegin(GL_LINES);
/* bottom left */
- glVertex2f(x1,y1);
- glVertex2f(x1,y1+5);
-
- glVertex2f(x1,y1);
- glVertex2f(x1+5,y1);
-
+ glVertex2f(x1, y1);
+ glVertex2f(x1, y1 + 5);
+
+ glVertex2f(x1, y1);
+ glVertex2f(x1 + 5, y1);
+
/* top right */
- glVertex2f(x2,y2);
- glVertex2f(x2,y2-5);
-
- glVertex2f(x2,y2);
- glVertex2f(x2-5,y2);
-
+ glVertex2f(x2, y2);
+ glVertex2f(x2, y2 - 5);
+
+ glVertex2f(x2, y2);
+ glVertex2f(x2 - 5, y2);
+
/* top left */
- glVertex2f(x1,y2);
- glVertex2f(x1,y2-5);
-
- glVertex2f(x1,y2);
- glVertex2f(x1+5,y2);
-
+ glVertex2f(x1, y2);
+ glVertex2f(x1, y2 - 5);
+
+ glVertex2f(x1, y2);
+ glVertex2f(x1 + 5, y2);
+
/* bottom right */
- glVertex2f(x2,y1);
- glVertex2f(x2,y1+5);
-
- glVertex2f(x2,y1);
- glVertex2f(x2-5,y1);
+ glVertex2f(x2, y1);
+ glVertex2f(x2, y1 + 5);
+
+ glVertex2f(x2, y1);
+ glVertex2f(x2 - 5, y1);
glEnd();
}
@@ -269,21 +269,22 @@ static void drawFlyPixel(const struct bContext *UNUSED(C), struct ARegion *UNUSE
#define FLY_CANCEL 1
#define FLY_CONFIRM 2
-static int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *event)
+static int initFlyInfo(bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *event)
{
+ wmWindow *win = CTX_wm_window(C);
float upvec[3]; // tmp
float mat[3][3];
- fly->rv3d= CTX_wm_region_view3d(C);
+ fly->rv3d = CTX_wm_region_view3d(C);
fly->v3d = CTX_wm_view3d(C);
fly->ar = CTX_wm_region(C);
- fly->scene= CTX_data_scene(C);
+ fly->scene = CTX_data_scene(C);
#ifdef NDOF_FLY_DEBUG
puts("\n-- fly begin --");
#endif
- if (fly->rv3d->persp==RV3D_CAMOB && fly->v3d->camera->id.lib) {
+ if (fly->rv3d->persp == RV3D_CAMOB && fly->v3d->camera->id.lib) {
BKE_report(op->reports, RPT_ERROR, "Cannot fly a camera from an external library");
return FALSE;
}
@@ -293,113 +294,117 @@ static int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *even
return FALSE;
}
- if (fly->rv3d->persp==RV3D_CAMOB && fly->v3d->camera->constraints.first) {
+ if (fly->rv3d->persp == RV3D_CAMOB && fly->v3d->camera->constraints.first) {
BKE_report(op->reports, RPT_ERROR, "Cannot fly an object with constraints");
return FALSE;
}
- fly->state= FLY_RUNNING;
- fly->speed= 0.0f;
- fly->axis= 2;
- fly->pan_view= FALSE;
- fly->xlock= FALSE;
- fly->zlock= FALSE;
- fly->xlock_momentum=0.0f;
- fly->zlock_momentum=0.0f;
- fly->grid= 1.0f;
- fly->use_precision= FALSE;
- fly->use_freelook= FALSE;
+ fly->state = FLY_RUNNING;
+ fly->speed = 0.0f;
+ fly->axis = 2;
+ fly->pan_view = FALSE;
+ fly->xlock = FALSE;
+ fly->zlock = FALSE;
+ fly->xlock_momentum = 0.0f;
+ fly->zlock_momentum = 0.0f;
+ fly->grid = 1.0f;
+ fly->use_precision = FALSE;
+ fly->use_freelook = FALSE;
#ifdef NDOF_FLY_DRAW_TOOMUCH
fly->redraw= 1;
#endif
- fly->dvec_prev[0]= fly->dvec_prev[1]= fly->dvec_prev[2]= 0.0f;
+ fly->dvec_prev[0] = fly->dvec_prev[1] = fly->dvec_prev[2] = 0.0f;
- fly->timer= WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f);
+ fly->timer = WM_event_add_timer(CTX_wm_manager(C), win, TIMER, 0.01f);
copy_v2_v2_int(fly->mval, event->mval);
fly->ndof = NULL;
- fly->time_lastdraw= fly->time_lastwheel= PIL_check_seconds_timer();
+ fly->time_lastdraw = fly->time_lastwheel = PIL_check_seconds_timer();
fly->draw_handle_pixel = ED_region_draw_cb_activate(fly->ar->type, drawFlyPixel, fly, REGION_DRAW_POST_PIXEL);
fly->rv3d->rflag |= RV3D_NAVIGATING; /* so we draw the corner margins */
/* detect weather to start with Z locking */
- upvec[0]=1.0f; upvec[1]=0.0f; upvec[2]=0.0f;
+ upvec[0] = 1.0f;
+ upvec[1] = 0.0f;
+ upvec[2] = 0.0f;
copy_m3_m4(mat, fly->rv3d->viewinv);
mul_m3_v3(mat, upvec);
if (fabs(upvec[2]) < 0.1)
fly->zlock = 1;
- upvec[0]=0; upvec[1]=0; upvec[2]=0;
+ upvec[0] = 0;
+ upvec[1] = 0;
+ upvec[2] = 0;
- fly->persp_backup= fly->rv3d->persp;
- fly->dist_backup= fly->rv3d->dist;
+ fly->persp_backup = fly->rv3d->persp;
+ fly->dist_backup = fly->rv3d->dist;
/* check for flying ortho camera - which we cant support well
* we _could_ also check for an ortho camera but this is easier */
- if ( (fly->rv3d->persp == RV3D_CAMOB) &&
- (fly->v3d->camera != NULL) &&
- (fly->rv3d->is_persp == FALSE))
+ if ((fly->rv3d->persp == RV3D_CAMOB) &&
+ (fly->v3d->camera != NULL) &&
+ (fly->rv3d->is_persp == FALSE))
{
((Camera *)fly->v3d->camera->data)->type= CAM_PERSP;
fly->is_ortho_cam= TRUE;
}
- if (fly->rv3d->persp==RV3D_CAMOB) {
+ if (fly->rv3d->persp == RV3D_CAMOB) {
Object *ob_back;
- if ((U.uiflag & USER_CAM_LOCK_NO_PARENT)==0 && (fly->root_parent=fly->v3d->camera->parent)) {
+ if ((U.uiflag & USER_CAM_LOCK_NO_PARENT) == 0 && (fly->root_parent = fly->v3d->camera->parent)) {
while (fly->root_parent->parent)
- fly->root_parent= fly->root_parent->parent;
- ob_back= fly->root_parent;
+ fly->root_parent = fly->root_parent->parent;
+ ob_back = fly->root_parent;
}
else {
- ob_back= fly->v3d->camera;
+ ob_back = fly->v3d->camera;
}
/* store the original camera loc and rot */
/* TODO. axis angle etc */
- fly->obtfm= object_tfm_backup(ob_back);
+ fly->obtfm = object_tfm_backup(ob_back);
where_is_object(fly->scene, fly->v3d->camera);
negate_v3_v3(fly->rv3d->ofs, fly->v3d->camera->obmat[3]);
- fly->rv3d->dist=0.0;
+ fly->rv3d->dist = 0.0;
}
else {
/* perspective or ortho */
- if (fly->rv3d->persp==RV3D_ORTHO)
- fly->rv3d->persp= RV3D_PERSP; /*if ortho projection, make perspective */
+ if (fly->rv3d->persp == RV3D_ORTHO)
+ fly->rv3d->persp = RV3D_PERSP; /*if ortho projection, make perspective */
copy_qt_qt(fly->rot_backup, fly->rv3d->viewquat);
copy_v3_v3(fly->ofs_backup, fly->rv3d->ofs);
/* the dist defines a vector that is infront of the offset
- to rotate the view about.
- this is no good for fly mode because we
- want to rotate about the viewers center.
- but to correct the dist removal we must
- alter offset so the view doesn't jump. */
+ * to rotate the view about.
+ * this is no good for fly mode because we
+ * want to rotate about the viewers center.
+ * but to correct the dist removal we must
+ * alter offset so the view doesn't jump. */
- fly->rv3d->dist= 0.0f;
+ fly->rv3d->dist = 0.0f;
- upvec[2]= fly->dist_backup; /*x and y are 0*/
+ upvec[2] = fly->dist_backup; /*x and y are 0*/
mul_m3_v3(mat, upvec);
sub_v3_v3(fly->rv3d->ofs, upvec);
/*Done with correcting for the dist*/
}
-
+
/* center the mouse, probably the UI mafia are against this but without its quite annoying */
- WM_cursor_warp(CTX_wm_window(C), fly->ar->winrct.xmin + fly->ar->winx/2, fly->ar->winrct.ymin + fly->ar->winy/2);
-
+ WM_cursor_warp(win, fly->ar->winrct.xmin + fly->ar->winx / 2, fly->ar->winrct.ymin + fly->ar->winy / 2);
+
return 1;
}
static int flyEnd(bContext *C, FlyInfo *fly)
{
- RegionView3D *rv3d= fly->rv3d;
+ RegionView3D *rv3d = fly->rv3d;
View3D *v3d = fly->v3d;
float upvec[3];
@@ -415,13 +420,13 @@ static int flyEnd(bContext *C, FlyInfo *fly)
ED_region_draw_cb_exit(fly->ar->type, fly->draw_handle_pixel);
- rv3d->dist= fly->dist_backup;
+ rv3d->dist = fly->dist_backup;
if (fly->state == FLY_CANCEL) {
- /* Revert to original view? */
- if (fly->persp_backup==RV3D_CAMOB) { /* a camera view */
+ /* Revert to original view? */
+ if (fly->persp_backup == RV3D_CAMOB) { /* a camera view */
Object *ob_back;
- ob_back= (fly->root_parent) ? fly->root_parent : fly->v3d->camera;
+ ob_back = (fly->root_parent) ? fly->root_parent : fly->v3d->camera;
/* store the original camera loc and rot */
object_tfm_restore(ob_back, fly->obtfm);
@@ -432,18 +437,18 @@ static int flyEnd(bContext *C, FlyInfo *fly)
/* Non Camera we need to reset the view back to the original location bacause the user canceled*/
copy_qt_qt(rv3d->viewquat, fly->rot_backup);
copy_v3_v3(rv3d->ofs, fly->ofs_backup);
- rv3d->persp= fly->persp_backup;
+ rv3d->persp = fly->persp_backup;
}
}
- else if (fly->persp_backup==RV3D_CAMOB) { /* camera */
+ else if (fly->persp_backup == RV3D_CAMOB) { /* camera */
DAG_id_tag_update(fly->root_parent ? &fly->root_parent->id : &v3d->camera->id, OB_RECALC_OB);
}
else { /* not camera */
/* Apply the fly mode view */
/*restore the dist*/
float mat[3][3];
- upvec[0]= upvec[1]= 0;
- upvec[2]= fly->dist_backup; /*x and y are 0*/
+ upvec[0] = upvec[1] = 0;
+ upvec[2] = fly->dist_backup; /*x and y are 0*/
copy_m3_m4(mat, rv3d->viewinv);
mul_m3_v3(mat, upvec);
add_v3_v3(rv3d->ofs, upvec);
@@ -451,7 +456,7 @@ static int flyEnd(bContext *C, FlyInfo *fly)
}
if (fly->is_ortho_cam) {
- ((Camera *)fly->v3d->camera->data)->type= CAM_ORTHO;
+ ((Camera *)fly->v3d->camera->data)->type = CAM_ORTHO;
}
rv3d->rflag &= ~RV3D_NAVIGATING;
@@ -459,7 +464,6 @@ static int flyEnd(bContext *C, FlyInfo *fly)
if (fly->obtfm)
MEM_freeN(fly->obtfm);
-
if (fly->ndof)
MEM_freeN(fly->ndof);
@@ -485,7 +489,7 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
// puts("ndof motion detected in fly mode!");
// static const char* tag_name = "3D mouse position";
- wmNDOFMotionData* incoming_ndof = (wmNDOFMotionData*) event->customdata;
+ wmNDOFMotionData* incoming_ndof = (wmNDOFMotionData*)event->customdata;
switch (incoming_ndof->progress) {
case P_STARTING:
// start keeping track of 3D mouse position
@@ -518,12 +522,12 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
fly->ndof = NULL;
}
/* update the time else the view will jump when 2D mouse/timer resume */
- fly->time_lastdraw= PIL_check_seconds_timer();
+ fly->time_lastdraw = PIL_check_seconds_timer();
break;
default:
; // should always be one of the above 3
- }
}
+ }
/* handle modal keymap first */
else if (event->type == EVT_MODAL_MAP) {
switch (event->val) {
@@ -539,7 +543,7 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
double time_currwheel;
float time_wheel;
- time_currwheel= PIL_check_seconds_timer();
+ time_currwheel = PIL_check_seconds_timer();
time_wheel = (float)(time_currwheel - fly->time_lastwheel);
fly->time_lastwheel = time_currwheel;
/*printf("Wheel %f\n", time_wheel);*/
@@ -547,10 +551,10 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
time_wheel = 1.0f + (10.0f - (20.0f * MIN2(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */
if (fly->speed < 0.0f) {
- fly->speed= 0.0f;
+ fly->speed = 0.0f;
}
else {
- fly->speed += fly->grid*time_wheel * (fly->use_precision ? 0.1f : 1.0f);
+ fly->speed += fly->grid * time_wheel * (fly->use_precision ? 0.1f : 1.0f);
}
break;
}
@@ -559,69 +563,106 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
double time_currwheel;
float time_wheel;
- time_currwheel= PIL_check_seconds_timer();
+ time_currwheel = PIL_check_seconds_timer();
time_wheel = (float)(time_currwheel - fly->time_lastwheel);
fly->time_lastwheel = time_currwheel;
time_wheel = 1.0f + (10.0f - (20.0f * MIN2(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */
if (fly->speed > 0.0f) {
- fly->speed=0;
+ fly->speed = 0;
}
else {
- fly->speed-= fly->grid*time_wheel * (fly->use_precision ? 0.1f : 1.0f);
+ fly->speed -= fly->grid * time_wheel * (fly->use_precision ? 0.1f : 1.0f);
}
break;
}
case FLY_MODAL_PAN_ENABLE:
- fly->pan_view= TRUE;
+ fly->pan_view = TRUE;
break;
case FLY_MODAL_PAN_DISABLE:
//XXX2.5 warp_pointer(cent_orig[0], cent_orig[1]);
- fly->pan_view= FALSE;
+ fly->pan_view = FALSE;
break;
- /* implement WASD keys */
+ /* implement WASD keys,
+ * comments only for 'forward '*/
case FLY_MODAL_DIR_FORWARD:
- if (fly->speed < 0.0f) fly->speed= -fly->speed; /* flip speed rather than stopping, game like motion */
- else if (fly->axis==2) fly->speed += fly->grid; /* increse like mousewheel if were already
- * moving in that difection*/
- fly->axis= 2;
+ if (fly->axis == 2 && fly->speed < 0.0f) { /* reverse direction stops, tap again to continue */
+ fly->axis = -1;
+ }
+ else {
+ /* flip speed rather than stopping, game like motion,
+ * else increase like mousewheel if were already moving in that direction */
+ if (fly->speed < 0.0f) fly->speed = -fly->speed;
+ else if (fly->axis == 2) fly->speed += fly->grid;
+ fly->axis = 2;
+ }
break;
case FLY_MODAL_DIR_BACKWARD:
- if (fly->speed > 0.0f) fly->speed= -fly->speed;
- else if (fly->axis==2) fly->speed -= fly->grid;
- fly->axis= 2;
+ if (fly->axis == 2 && fly->speed > 0.0f) {
+ fly->axis = -1;
+ }
+ else {
+ if (fly->speed > 0.0f) fly->speed = -fly->speed;
+ else if (fly->axis == 2) fly->speed -= fly->grid;
+
+ fly->axis = 2;
+ }
break;
case FLY_MODAL_DIR_LEFT:
- if (fly->speed < 0.0f) fly->speed= -fly->speed;
- else if (fly->axis==0) fly->speed += fly->grid;
- fly->axis= 0;
+ if (fly->axis == 0 && fly->speed < 0.0f) {
+ fly->axis = -1;
+ }
+ else {
+ if (fly->speed < 0.0f) fly->speed = -fly->speed;
+ else if (fly->axis == 0) fly->speed += fly->grid;
+
+ fly->axis = 0;
+ }
break;
case FLY_MODAL_DIR_RIGHT:
- if (fly->speed > 0.0f) fly->speed= -fly->speed;
- else if (fly->axis==0) fly->speed -= fly->grid;
- fly->axis= 0;
+ if (fly->axis == 0 && fly->speed > 0.0f) {
+ fly->axis = -1;
+ }
+ else {
+ if (fly->speed > 0.0f) fly->speed = -fly->speed;
+ else if (fly->axis == 0) fly->speed -= fly->grid;
+
+ fly->axis = 0;
+ }
break;
case FLY_MODAL_DIR_DOWN:
- if (fly->speed < 0.0f) fly->speed= -fly->speed;
- else if (fly->axis==1) fly->speed += fly->grid;
- fly->axis= 1;
+ if (fly->axis == 1 && fly->speed < 0.0f) {
+ fly->axis = -1;
+ }
+ else {
+ if (fly->speed < 0.0f) fly->speed = -fly->speed;
+ else if (fly->axis == 1) fly->speed += fly->grid;
+ fly->axis = 1;
+ }
break;
case FLY_MODAL_DIR_UP:
- if (fly->speed > 0.0f) fly->speed= -fly->speed;
- else if (fly->axis==1) fly->speed -= fly->grid;
- fly->axis= 1;
+ if (fly->axis == 1 && fly->speed > 0.0f) {
+ fly->axis = -1;
+ }
+ else {
+ if (fly->speed > 0.0f) fly->speed = -fly->speed;
+ else if (fly->axis == 1) fly->speed -= fly->grid;
+ fly->axis = 1;
+ }
break;
case FLY_MODAL_AXIS_LOCK_X:
- if (fly->xlock) fly->xlock=0;
+ if (fly->xlock)
+ fly->xlock = 0;
else {
fly->xlock = 2;
fly->xlock_momentum = 0.0;
}
break;
case FLY_MODAL_AXIS_LOCK_Z:
- if (fly->zlock) fly->zlock=0;
+ if (fly->zlock)
+ fly->zlock = 0;
else {
fly->zlock = 2;
fly->zlock_momentum = 0.0;
@@ -629,29 +670,28 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
break;
case FLY_MODAL_PRECISION_ENABLE:
- fly->use_precision= TRUE;
+ fly->use_precision = TRUE;
break;
case FLY_MODAL_PRECISION_DISABLE:
- fly->use_precision= FALSE;
+ fly->use_precision = FALSE;
break;
case FLY_MODAL_FREELOOK_ENABLE:
- fly->use_freelook= TRUE;
+ fly->use_freelook = TRUE;
break;
case FLY_MODAL_FREELOOK_DISABLE:
- fly->use_freelook= FALSE;
+ fly->use_freelook = FALSE;
break;
}
}
}
-
static void move_camera(bContext* C, RegionView3D* rv3d, FlyInfo* fly, int orientationChanged, int positionChanged)
{
/* we are in camera view so apply the view ofs and quat to the view matrix and set the camera to the view */
View3D* v3d = fly->v3d;
- Scene *scene= fly->scene;
+ Scene *scene = fly->scene;
ID *id_key;
/* transform the parent or the camera? */
@@ -673,42 +713,42 @@ static void move_camera(bContext* C, RegionView3D* rv3d, FlyInfo* fly, int orien
// where_is_object(scene, fly->root_parent);
- ob_update= v3d->camera->parent;
+ ob_update = v3d->camera->parent;
while (ob_update) {
DAG_id_tag_update(&ob_update->id, OB_RECALC_OB);
- ob_update= ob_update->parent;
+ ob_update = ob_update->parent;
}
- id_key= &fly->root_parent->id;
+ id_key = &fly->root_parent->id;
}
else {
float view_mat[4][4];
ED_view3d_to_m4(view_mat, rv3d->ofs, rv3d->viewquat, rv3d->dist);
object_apply_mat4(v3d->camera, view_mat, TRUE, FALSE);
- id_key= &v3d->camera->id;
+ id_key = &v3d->camera->id;
}
/* record the motion */
if (autokeyframe_cfra_can_key(scene, id_key)) {
ListBase dsources = {NULL, NULL};
-
+
/* add datasource override for the camera object */
- ANIM_relative_keyingset_add_source(&dsources, id_key, NULL, NULL);
-
+ ANIM_relative_keyingset_add_source(&dsources, id_key, NULL, NULL);
+
/* insert keyframes
* 1) on the first frame
* 2) on each subsequent frame
* TODO: need to check in future that frame changed before doing this
*/
if (orientationChanged) {
- KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_ROTATION_ID);
+ KeyingSet *ks = ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_ROTATION_ID);
ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA);
}
if (positionChanged) {
- KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_LOCATION_ID);
+ KeyingSet *ks = ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_LOCATION_ID);
ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA);
}
-
+
/* free temp data */
BLI_freelistN(&dsources);
}
@@ -720,18 +760,17 @@ static int flyApply(bContext *C, FlyInfo *fly)
#define FLY_ZUP_CORRECT_FAC 0.1f /* amount to correct per step */
#define FLY_ZUP_CORRECT_ACCEL 0.05f /* increase upright momentum each step */
- /*
- fly mode - Shift+F
- a fly loop where the user can move move the view as if they are flying
- */
- RegionView3D *rv3d= fly->rv3d;
+ /* fly mode - Shift+F
+ * a fly loop where the user can move move the view as if they are flying
+ */
+ RegionView3D *rv3d = fly->rv3d;
ARegion *ar = fly->ar;
float mat[3][3], /* 3x3 copy of the view matrix so we can move along the view axis */
- dvec[3]={0,0,0}, /* this is the direction thast added to the view offset per redraw */
+ dvec[3] = {0, 0, 0}, /* this is the direction thast added to the view offset per redraw */
/* Camera Uprighting variables */
- upvec[3]={0,0,0}, /* stores the view's up vector */
+ upvec[3] = {0, 0, 0}, /* stores the view's up vector */
moffset[2], /* mouse offset from the views center */
tmp_quat[4]; /* used for rotating the view */
@@ -748,9 +787,8 @@ static int flyApply(bContext *C, FlyInfo *fly)
}
#endif
-
- xmargin= ar->winx/20.0f;
- ymargin= ar->winy/20.0f;
+ xmargin = ar->winx / 20.0f;
+ ymargin = ar->winy / 20.0f;
// UNUSED
// cent_orig[0]= ar->winrct.xmin + ar->winx/2;
@@ -759,17 +797,17 @@ static int flyApply(bContext *C, FlyInfo *fly)
{
/* mouse offset from the center */
- moffset[0]= fly->mval[0]- ar->winx/2;
- moffset[1]= fly->mval[1]- ar->winy/2;
+ moffset[0] = fly->mval[0] - ar->winx / 2;
+ moffset[1] = fly->mval[1] - ar->winy / 2;
/* enforce a view margin */
- if (moffset[0]>xmargin) moffset[0]-=xmargin;
- else if (moffset[0] < -xmargin) moffset[0]+=xmargin;
- else moffset[0]=0;
+ if (moffset[0] > xmargin) moffset[0] -= xmargin;
+ else if (moffset[0] < -xmargin) moffset[0] += xmargin;
+ else moffset[0] = 0;
- if (moffset[1]>ymargin) moffset[1]-=ymargin;
- else if (moffset[1] < -ymargin) moffset[1]+=ymargin;
- else moffset[1]=0;
+ if (moffset[1] > ymargin) moffset[1] -= ymargin;
+ else if (moffset[1] < -ymargin) moffset[1] += ymargin;
+ else moffset[1] = 0;
/* scale the mouse movement by this value - scales mouse movement to the view size
@@ -778,46 +816,49 @@ static int flyApply(bContext *C, FlyInfo *fly)
* the mouse moves isnt linear */
if (moffset[0]) {
- moffset[0] /= ar->winx - (xmargin*2);
+ moffset[0] /= ar->winx - (xmargin * 2);
moffset[0] *= fabsf(moffset[0]);
}
if (moffset[1]) {
- moffset[1] /= ar->winy - (ymargin*2);
+ moffset[1] /= ar->winy - (ymargin * 2);
moffset[1] *= fabsf(moffset[1]);
}
/* Should we redraw? */
- if ( (fly->speed != 0.0f) ||
- moffset[0] || moffset[1] ||
- fly->zlock || fly->xlock ||
- dvec[0] || dvec[1] || dvec[2])
+ if ((fly->speed != 0.0f) ||
+ moffset[0] || moffset[1] ||
+ fly->zlock || fly->xlock ||
+ dvec[0] || dvec[1] || dvec[2])
{
float dvec_tmp[3];
- double time_current; /*time how fast it takes for us to redraw, this is so simple scenes dont fly too fast */
+
+ /* time how fast it takes for us to redraw,
+ * this is so simple scenes dont fly too fast */
+ double time_current;
float time_redraw;
float time_redraw_clamped;
#ifdef NDOF_FLY_DRAW_TOOMUCH
fly->redraw= 1;
#endif
- time_current= PIL_check_seconds_timer();
- time_redraw= (float)(time_current - fly->time_lastdraw);
- time_redraw_clamped= MIN2(0.05f, time_redraw); /* clamp redraw time to avoid jitter in roll correction */
- fly->time_lastdraw= time_current;
- /*fprintf(stderr, "%f\n", time_redraw);*/ /* 0.002 is a small redraw 0.02 is larger */
+ time_current = PIL_check_seconds_timer();
+ time_redraw = (float)(time_current - fly->time_lastdraw);
+ time_redraw_clamped = MIN2(0.05f, time_redraw); /* clamp redraw time to avoid jitter in roll correction */
+ fly->time_lastdraw = time_current;
+ /*fprintf(stderr, "%f\n", time_redraw);*//* 0.002 is a small redraw 0.02 is larger */
/* Scale the time to use shift to scale the speed down- just like
- shift slows many other areas of blender down */
+ * shift slows many other areas of blender down */
if (fly->use_precision)
- fly->speed= fly->speed * (1.0f-time_redraw_clamped);
+ fly->speed = fly->speed * (1.0f - time_redraw_clamped);
copy_m3_m4(mat, rv3d->viewinv);
- if (fly->pan_view==TRUE) {
+ if (fly->pan_view == TRUE) {
/* pan only */
- dvec_tmp[0]= -moffset[0];
- dvec_tmp[1]= -moffset[1];
- dvec_tmp[2]= 0;
+ dvec_tmp[0] = -moffset[0];
+ dvec_tmp[1] = -moffset[1];
+ dvec_tmp[2] = 0;
if (fly->use_precision) {
dvec_tmp[0] *= 0.1f;
@@ -829,45 +870,47 @@ static int flyApply(bContext *C, FlyInfo *fly)
}
else {
float roll; /* similar to the angle between the camera's up and the Z-up,
- * but its very rough so just roll*/
+ * but its very rough so just roll */
/* rotate about the X axis- look up/down */
if (moffset[1]) {
- upvec[0]=1;
- upvec[1]=0;
- upvec[2]=0;
+ upvec[0] = 1;
+ upvec[1] = 0;
+ upvec[2] = 0;
mul_m3_v3(mat, upvec);
/* Rotate about the relative up vec */
- axis_angle_to_quat( tmp_quat, upvec, (float)moffset[1] * time_redraw * -FLY_ROTATE_FAC);
+ axis_angle_to_quat(tmp_quat, upvec, (float)moffset[1] * time_redraw * -FLY_ROTATE_FAC);
mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, tmp_quat);
- if (fly->xlock) fly->xlock = 2; /*check for rotation*/
- if (fly->zlock) fly->zlock = 2;
- fly->xlock_momentum= 0.0f;
+ if (fly->xlock)
+ fly->xlock = 2; /*check for rotation*/
+ if (fly->zlock)
+ fly->zlock = 2;
+ fly->xlock_momentum = 0.0f;
}
/* rotate about the Y axis- look left/right */
if (moffset[0]) {
/* if we're upside down invert the moffset */
- upvec[0]= 0.0f;
- upvec[1]= 1.0f;
- upvec[2]= 0.0f;
+ upvec[0] = 0.0f;
+ upvec[1] = 1.0f;
+ upvec[2] = 0.0f;
mul_m3_v3(mat, upvec);
if (upvec[2] < 0.0f)
- moffset[0]= -moffset[0];
+ moffset[0] = -moffset[0];
/* make the lock vectors */
if (fly->zlock) {
- upvec[0]= 0.0f;
- upvec[1]= 0.0f;
- upvec[2]= 1.0f;
+ upvec[0] = 0.0f;
+ upvec[1] = 0.0f;
+ upvec[2] = 1.0f;
}
else {
- upvec[0]= 0.0f;
- upvec[1]= 1.0f;
- upvec[2]= 0.0f;
+ upvec[0] = 0.0f;
+ upvec[1] = 1.0f;
+ upvec[2] = 0.0f;
mul_m3_v3(mat, upvec);
}
@@ -875,71 +918,76 @@ static int flyApply(bContext *C, FlyInfo *fly)
axis_angle_to_quat(tmp_quat, upvec, (float)moffset[0] * time_redraw * FLY_ROTATE_FAC);
mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, tmp_quat);
- if (fly->xlock) fly->xlock = 2;/*check for rotation*/
- if (fly->zlock) fly->zlock = 2;
+ if (fly->xlock)
+ fly->xlock = 2;/*check for rotation*/
+ if (fly->zlock)
+ fly->zlock = 2;
}
- if (fly->zlock==2) {
- upvec[0]= 1.0f;
- upvec[1]= 0.0f;
- upvec[2]= 0.0f;
+ if (fly->zlock == 2) {
+ upvec[0] = 1.0f;
+ upvec[1] = 0.0f;
+ upvec[2] = 0.0f;
mul_m3_v3(mat, upvec);
/*make sure we have some z rolling*/
if (fabsf(upvec[2]) > 0.00001f) {
- roll= upvec[2] * 5.0f;
- upvec[0]= 0.0f; /*rotate the view about this axis*/
- upvec[1]= 0.0f;
- upvec[2]= 1.0f;
+ roll = upvec[2] * 5.0f;
+ upvec[0] = 0.0f; /*rotate the view about this axis*/
+ upvec[1] = 0.0f;
+ upvec[2] = 1.0f;
mul_m3_v3(mat, upvec);
/* Rotate about the relative up vec */
axis_angle_to_quat(tmp_quat, upvec,
- roll * time_redraw_clamped * fly->zlock_momentum * FLY_ZUP_CORRECT_FAC);
+ roll * time_redraw_clamped * fly->zlock_momentum * FLY_ZUP_CORRECT_FAC);
mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, tmp_quat);
fly->zlock_momentum += FLY_ZUP_CORRECT_ACCEL;
}
else {
- fly->zlock= 1; /* dont check until the view rotates again */
- fly->zlock_momentum= 0.0f;
+ fly->zlock = 1; /* dont check until the view rotates again */
+ fly->zlock_momentum = 0.0f;
}
}
- if (fly->xlock==2 && moffset[1]==0) { /*only apply xcorrect when mouse isnt applying x rot*/
- upvec[0]=0;
- upvec[1]=0;
- upvec[2]=1;
+ if (fly->xlock == 2 && moffset[1] == 0) { /*only apply xcorrect when mouse isnt applying x rot*/
+ upvec[0] = 0;
+ upvec[1] = 0;
+ upvec[2] = 1;
mul_m3_v3(mat, upvec);
/*make sure we have some z rolling*/
if (fabsf(upvec[2]) > 0.00001f) {
- roll= upvec[2] * -5.0f;
+ roll = upvec[2] * -5.0f;
- upvec[0]= 1.0f; /*rotate the view about this axis*/
- upvec[1]= 0.0f;
- upvec[2]= 0.0f;
+ upvec[0] = 1.0f; /*rotate the view about this axis*/
+ upvec[1] = 0.0f;
+ upvec[2] = 0.0f;
mul_m3_v3(mat, upvec);
/* Rotate about the relative up vec */
- axis_angle_to_quat( tmp_quat, upvec, roll*time_redraw_clamped*fly->xlock_momentum*0.1f);
+ axis_angle_to_quat(tmp_quat, upvec, roll * time_redraw_clamped * fly->xlock_momentum * 0.1f);
mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, tmp_quat);
fly->xlock_momentum += 0.05f;
}
else {
- fly->xlock=1; /* see above */
- fly->xlock_momentum= 0.0f;
+ fly->xlock = 1; /* see above */
+ fly->xlock_momentum = 0.0f;
}
}
-
+ if (fly->axis == -1) {
+ /* pause */
+ zero_v3(dvec_tmp);
+ }
if (!fly->use_freelook) {
/* Normal operation */
/* define dvec, view direction vector */
- dvec_tmp[0]= dvec_tmp[1]= dvec_tmp[2]= 0.0f;
+ dvec_tmp[0] = dvec_tmp[1] = dvec_tmp[2] = 0.0f;
/* move along the current axis */
- dvec_tmp[fly->axis]= 1.0f;
+ dvec_tmp[fly->axis] = 1.0f;
mul_m3_v3(mat, dvec_tmp);
}
@@ -954,10 +1002,10 @@ static int flyApply(bContext *C, FlyInfo *fly)
}
/* impose a directional lag */
- interp_v3_v3v3(dvec, dvec_tmp, fly->dvec_prev, (1.0f/(1.0f+(time_redraw*5.0f))));
+ interp_v3_v3v3(dvec, dvec_tmp, fly->dvec_prev, (1.0f / (1.0f + (time_redraw * 5.0f))));
- if (rv3d->persp==RV3D_CAMOB) {
- Object *lock_ob= fly->root_parent ? fly->root_parent : fly->v3d->camera;
+ if (rv3d->persp == RV3D_CAMOB) {
+ Object *lock_ob = fly->root_parent ? fly->root_parent : fly->v3d->camera;
if (lock_ob->protectflag & OB_LOCK_LOCX) dvec[0] = 0.0;
if (lock_ob->protectflag & OB_LOCK_LOCY) dvec[1] = 0.0;
if (lock_ob->protectflag & OB_LOCK_LOCZ) dvec[2] = 0.0;
@@ -965,13 +1013,13 @@ static int flyApply(bContext *C, FlyInfo *fly)
add_v3_v3(rv3d->ofs, dvec);
- if (rv3d->persp==RV3D_CAMOB)
+ if (rv3d->persp == RV3D_CAMOB)
move_camera(C, rv3d, fly, (fly->xlock || fly->zlock || moffset[0] || moffset[1]), fly->speed);
}
else {
/* we're not redrawing but we need to update the time else the view will jump */
- fly->time_lastdraw= PIL_check_seconds_timer();
+ fly->time_lastdraw = PIL_check_seconds_timer();
}
/* end drawing */
copy_v3_v3(fly->dvec_prev, dvec);
@@ -988,11 +1036,12 @@ static int flyApply_ndof(bContext *C, FlyInfo *fly)
RegionView3D* rv3d = fly->rv3d;
const int flag = U.ndof_flag;
-/* int shouldRotate = (flag & NDOF_SHOULD_ROTATE) && (fly->pan_view == FALSE),
- shouldTranslate = (flag & (NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM)); */
+#if 0
+ int shouldRotate = (flag & NDOF_SHOULD_ROTATE) && (fly->pan_view == FALSE),
+ shouldTranslate = (flag & (NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM));
+#endif
- int shouldRotate = (fly->pan_view == FALSE),
- shouldTranslate = TRUE;
+ int shouldRotate = (fly->pan_view == FALSE), shouldTranslate = TRUE;
float view_inv[4];
invert_qt_qt(view_inv, rv3d->viewquat);
@@ -1024,12 +1073,12 @@ static int flyApply_ndof(bContext *C, FlyInfo *fly)
trans[2] = speed * dt * vertical_sensitivity * ndof->tvec[1];
}
- if (rv3d->persp==RV3D_CAMOB) {
+ if (rv3d->persp == RV3D_CAMOB) {
// respect camera position locks
- Object *lock_ob= fly->root_parent ? fly->root_parent : fly->v3d->camera;
- if (lock_ob->protectflag & OB_LOCK_LOCX) trans[0] = 0.f;
- if (lock_ob->protectflag & OB_LOCK_LOCY) trans[1] = 0.f;
- if (lock_ob->protectflag & OB_LOCK_LOCZ) trans[2] = 0.f;
+ Object *lock_ob = fly->root_parent ? fly->root_parent : fly->v3d->camera;
+ if (lock_ob->protectflag & OB_LOCK_LOCX) trans[0] = 0.0f;
+ if (lock_ob->protectflag & OB_LOCK_LOCY) trans[1] = 0.0f;
+ if (lock_ob->protectflag & OB_LOCK_LOCZ) trans[2] = 0.0f;
}
if (!is_zero_v3(trans)) {
@@ -1099,7 +1148,7 @@ static int flyApply_ndof(bContext *C, FlyInfo *fly)
if (shouldTranslate || shouldRotate) {
fly->redraw = TRUE;
- if (rv3d->persp==RV3D_CAMOB) {
+ if (rv3d->persp == RV3D_CAMOB) {
move_camera(C, rv3d, fly, shouldRotate, shouldTranslate);
}
}
@@ -1107,20 +1156,19 @@ static int flyApply_ndof(bContext *C, FlyInfo *fly)
return OPERATOR_FINISHED;
}
-
static int fly_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
FlyInfo *fly;
if (rv3d->viewlock)
return OPERATOR_CANCELLED;
- fly= MEM_callocN(sizeof(FlyInfo), "FlyOperation");
+ fly = MEM_callocN(sizeof(FlyInfo), "FlyOperation");
- op->customdata= fly;
+ op->customdata = fly;
- if (initFlyInfo(C, fly, op, event)==FALSE) {
+ if (initFlyInfo(C, fly, op, event) == FALSE) {
MEM_freeN(op->customdata);
return OPERATOR_CANCELLED;
}
@@ -1138,7 +1186,7 @@ static int fly_cancel(bContext *C, wmOperator *op)
fly->state = FLY_CANCEL;
flyEnd(C, fly);
- op->customdata= NULL;
+ op->customdata = NULL;
return OPERATOR_CANCELLED;
}
@@ -1146,21 +1194,21 @@ static int fly_cancel(bContext *C, wmOperator *op)
static int fly_modal(bContext *C, wmOperator *op, wmEvent *event)
{
int exit_code;
- short do_draw= FALSE;
- FlyInfo *fly= op->customdata;
- RegionView3D *rv3d= fly->rv3d;
- Object *fly_object= fly->root_parent ? fly->root_parent : fly->v3d->camera;
+ short do_draw = FALSE;
+ FlyInfo *fly = op->customdata;
+ RegionView3D *rv3d = fly->rv3d;
+ Object *fly_object = fly->root_parent ? fly->root_parent : fly->v3d->camera;
- fly->redraw= 0;
+ fly->redraw = 0;
flyEvent(fly, event);
if (fly->ndof) { /* 3D mouse overrules [2D mouse + timer] */
- if (event->type==NDOF_MOTION) {
+ if (event->type == NDOF_MOTION) {
flyApply_ndof(C, fly);
}
}
- else if (event->type==TIMER && event->customdata == fly->timer) {
+ else if (event->type == TIMER && event->customdata == fly->timer) {
flyApply(C, fly);
}
@@ -1168,12 +1216,12 @@ static int fly_modal(bContext *C, wmOperator *op, wmEvent *event)
exit_code = flyEnd(C, fly);
- if (exit_code!=OPERATOR_RUNNING_MODAL)
- do_draw= TRUE;
+ if (exit_code != OPERATOR_RUNNING_MODAL)
+ do_draw = TRUE;
if (do_draw) {
- if (rv3d->persp==RV3D_CAMOB) {
- WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, fly_object);
+ if (rv3d->persp == RV3D_CAMOB) {
+ WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, fly_object);
}
// puts("redraw!"); // too frequent, commented with NDOF_FLY_DRAW_TOOMUCH for now
@@ -1186,16 +1234,16 @@ static int fly_modal(bContext *C, wmOperator *op, wmEvent *event)
void VIEW3D_OT_fly(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Fly Navigation";
- ot->description= "Interactively fly around the scene";
- ot->idname= "VIEW3D_OT_fly";
+ ot->name = "Fly Navigation";
+ ot->description = "Interactively fly around the scene";
+ ot->idname = "VIEW3D_OT_fly";
/* api callbacks */
- ot->invoke= fly_invoke;
- ot->cancel= fly_cancel;
- ot->modal= fly_modal;
- ot->poll= ED_operator_view3d_active;
+ ot->invoke = fly_invoke;
+ ot->cancel = fly_cancel;
+ ot->modal = fly_modal;
+ ot->poll = ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
}
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index f80bd6c3807..17f5ab68633 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -130,8 +130,8 @@ static void handle_view3d_lock(bContext *C)
scene->layact= v3d->layact;
scene->camera= v3d->camera;
- /* not through notifiery, listener don't have context
- and non-open screens or spaces need to be updated too */
+ /* not through notifier, listener don't have context
+ * and non-open screens or spaces need to be updated too */
BKE_screen_view3d_main_sync(&bmain->screen, scene);
/* notifiers for scene update */
@@ -140,10 +140,11 @@ static void handle_view3d_lock(bContext *C)
}
}
-/* layer code is on three levels actually:
-- here for operator
-- uiTemplateLayers in interface/ code for buttons
-- ED_view3d_scene_layer_set for RNA
+/**
+ * layer code is on three levels actually:
+ * - here for operator
+ * - uiTemplateLayers in interface/ code for buttons
+ * - ED_view3d_scene_layer_set for RNA
*/
static void view3d_layers_editmode_ensure(Scene *scene, View3D *v3d)
{
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index a5c7e21e3b4..93cf656dea4 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -394,8 +394,8 @@ int lasso_inside_edge(int mcords[][2], short moves, int x0, int y0, int x1, int
/* warning; lasso select with backbuffer-check draws in backbuf with persp(PERSP_WIN)
- and returns with persp(PERSP_VIEW). After lasso select backbuf is not OK
-*/
+ * and returns with persp(PERSP_VIEW). After lasso select backbuf is not OK
+ */
static void do_lasso_select_pose(ViewContext *vc, Object *ob, int mcords[][2], short moves, short select)
{
bPoseChannel *pchan;
@@ -962,7 +962,7 @@ static void view3d_lasso_select(bContext *C, ViewContext *vc, int mcords[][2], s
/* lasso operator gives properties, but since old code works
- with short array we convert */
+ * with short array we convert */
static int view3d_lasso_select_exec(bContext *C, wmOperator *op)
{
ViewContext vc;
@@ -1377,7 +1377,7 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
base= startbase;
while (base) {
/* skip objects with select restriction, to prevent prematurely ending this loop
- * with an un-selectable choice */
+ * with an un-selectable choice */
if (base->object->restrictflag & OB_RESTRICT_SELECT) {
base=base->next;
if (base==NULL) base= FIRSTBASE;
@@ -1534,13 +1534,13 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce
hitresult= buffer[3+(i*4)];
/* if there's bundles in buffer select bundles first,
- so non-camera elements should be ignored in buffer */
+ * so non-camera elements should be ignored in buffer */
if (basact->selcol != (hitresult & 0xFFFF)) {
continue;
}
/* index of bundle is 1<<16-based. if there's no "bone" index
- in hight word, this buffer value belongs to camera,. not to bundle */
+ * in hight word, this buffer value belongs to camera,. not to bundle */
if (buffer[4*i+3] & 0xFFFF0000) {
MovieClip *clip= object_get_movieclip(scene, basact->object, 0);
MovieTracking *tracking= &clip->tracking;
@@ -1578,7 +1578,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce
if (!changed) {
/* fallback to regular object selection if no new bundles were selected,
- allows to select object parented to reconstruction object */
+ * allows to select object parented to reconstruction object */
basact= mouse_select_eval_buffer(&vc, buffer, hits, mval, startbase, 0);
}
}
@@ -1586,7 +1586,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce
else if (ED_do_pose_selectbuffer(scene, basact, buffer, hits, extend) ) { /* then bone is found */
/* we make the armature selected:
- not-selected active object in posemode won't work well for tools */
+ * not-selected active object in posemode won't work well for tools */
basact->flag|= SELECT;
basact->object->flag= basact->flag;
@@ -1984,16 +1984,16 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, i
vbuffer = MEM_mallocN(4 * (totobj+MAXPICKBUF) * sizeof(unsigned int), "selection buffer");
hits= view3d_opengl_select(vc, vbuffer, 4*(totobj+MAXPICKBUF), rect);
/*
- LOGIC NOTES (theeth):
- The buffer and ListBase have the same relative order, which makes the selection
- very simple. Loop through both data sets at the same time, if the color
- is the same as the object, we have a hit and can move to the next color
- and object pair, if not, just move to the next object,
- keeping the same color until we have a hit.
-
- The buffer order is defined by OGL standard, hopefully no stupid GFX card
- does it incorrectly.
- */
+ * LOGIC NOTES (theeth):
+ * The buffer and ListBase have the same relative order, which makes the selection
+ * very simple. Loop through both data sets at the same time, if the color
+ * is the same as the object, we have a hit and can move to the next color
+ * and object pair, if not, just move to the next object,
+ * keeping the same color until we have a hit.
+ *
+ * The buffer order is defined by OGL standard, hopefully no stupid GFX card
+ * does it incorrectly.
+ */
if (hits>0) { /* no need to loop if there's no hit */
Base *base;
@@ -2167,7 +2167,7 @@ static int vertsel_vert_pick(struct bContext *C, Mesh *me, const int mval[2], un
if (size > 0) {
/* sample rect to increase changes of selecting, so that when clicking
- on an face in the backbuf, we can still select a vert */
+ * on an face in the backbuf, we can still select a vert */
int dist;
*index = view3d_sample_backbuf_rect(&vc, mval, size, 1, me->totvert+1, &dist,0,NULL, NULL);
@@ -2520,7 +2520,7 @@ static void pose_circle_select(ViewContext *vc, int select, const int mval[2], f
ED_view3d_init_mats_rv3d(vc->obact, vc->rv3d); /* for foreach's screen/vert projection */
/* check each PoseChannel... */
- // TODO: could be optimised at some point
+ // TODO: could be optimized at some point
for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
short sco1[2], sco2[2], didpoint=0;
float vec[3];
@@ -2592,7 +2592,7 @@ static void armature_circle_select(ViewContext *vc, int select, const int mval[2
ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
/* check each EditBone... */
- // TODO: could be optimised at some point
+ // TODO: could be optimized at some point
for (ebone= arm->edbo->first; ebone; ebone=ebone->next) {
short sco1[2], sco2[2], didpoint=0;
float vec[3];
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 847bd2e0b24..88658b30662 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -74,8 +74,8 @@
#include "view3d_intern.h" // own include
/* use this call when executing an operator,
- event system doesn't set for each event the
- opengl drawing context */
+ * event system doesn't set for each event the
+ * opengl drawing context */
void view3d_operator_needs_opengl(const bContext *C)
{
wmWindow *win = CTX_wm_window(C);
@@ -179,7 +179,7 @@ void smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Objec
changed = 1;
/* The new view is different from the old one
- * so animate the view */
+ * so animate the view */
if (changed) {
/* original values */
@@ -203,9 +203,9 @@ void smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Objec
sms.time_allowed= (double)U.smooth_viewtx / 1000.0;
/* if this is view rotation only
- * we can decrease the time allowed by
- * the angle between quats
- * this means small rotations wont lag */
+ * we can decrease the time allowed by
+ * the angle between quats
+ * this means small rotations wont lag */
if (quat && !ofs && !dist) {
float vec1[3]={0,0,1}, vec2[3]= {0,0,1};
float q1[4], q2[4];
@@ -531,7 +531,7 @@ void ED_view3d_calc_clipping(BoundBox *bb, float planes[4][4], bglMats *mats, co
int val, flip_sign, a;
/* near zero floating point values can give issues with gluUnProject
- in side view on some implementations */
+ * in side view on some implementations */
if (fabs(mats->modelview[0]) < 1e-6) mats->modelview[0]= 0.0;
if (fabs(mats->modelview[5]) < 1e-6) mats->modelview[5]= 0.0;
@@ -546,15 +546,15 @@ void ED_view3d_calc_clipping(BoundBox *bb, float planes[4][4], bglMats *mats, co
ys= (val==0||val==1)?rect->ymin:rect->ymax;
gluUnProject(xs, ys, 0.0, mats->modelview, mats->projection, mats->viewport, &p[0], &p[1], &p[2]);
- VECCOPY(bb->vec[val], p);
+ copy_v3fl_v3db(bb->vec[val], p);
gluUnProject(xs, ys, 1.0, mats->modelview, mats->projection, mats->viewport, &p[0], &p[1], &p[2]);
- VECCOPY(bb->vec[4+val], p);
+ copy_v3fl_v3db(bb->vec[4 + val], p);
}
/* verify if we have negative scale. doing the transform before cross
- product flips the sign of the vector compared to doing cross product
- before transform then, so we correct for that. */
+ * product flips the sign of the vector compared to doing cross product
+ * before transform then, so we correct for that. */
for (a=0; a<16; a++)
((float*)modelview)[a] = mats->modelview[a];
flip_sign = is_negative_m4(modelview);
@@ -649,15 +649,15 @@ int initgrabz(RegionView3D *rv3d, float x, float y, float z)
if (rv3d->zfac < 0.0f)
flip= TRUE;
/* if x,y,z is exactly the viewport offset, zfac is 0 and we don't want that
- * (accounting for near zero values)
- * */
+ * (accounting for near zero values)
+ */
if (rv3d->zfac < 1.e-6f && rv3d->zfac > -1.e-6f) rv3d->zfac = 1.0f;
/* Negative zfac means x, y, z was behind the camera (in perspective).
- * This gives flipped directions, so revert back to ok default case.
- */
- // NOTE: I've changed this to flip zfac to be positive again for now so that GPencil draws ok
- // -- Aligorith, 2009Aug31
+ * This gives flipped directions, so revert back to ok default case.
+ */
+ /* NOTE: I've changed this to flip zfac to be positive again for now so that GPencil draws ok
+ * Aligorith, 2009Aug31 */
//if (rv3d->zfac < 0.0f) rv3d->zfac = 1.0f;
if (rv3d->zfac < 0.0f) rv3d->zfac= -rv3d->zfac;
@@ -757,31 +757,32 @@ void ED_view3d_ob_project_mat_get(RegionView3D *rv3d, Object *ob, float pmat[4][
}
/* Uses window coordinates (x,y) and depth component z to find a point in
- modelspace */
+ * modelspace */
void view3d_unproject(bglMats *mats, float out[3], const short x, const short y, const float z)
{
double ux, uy, uz;
- gluUnProject(x,y,z, mats->modelview, mats->projection,
- (GLint *)mats->viewport, &ux, &uy, &uz );
+ gluUnProject(x,y,z, mats->modelview, mats->projection,
+ (GLint *)mats->viewport, &ux, &uy, &uz);
+
out[0] = ux;
out[1] = uy;
out[2] = uz;
}
/* use view3d_get_object_project_mat to get projecting mat */
-void ED_view3d_project_float(const ARegion *ar, const float vec[3], float adr[2], float mat[4][4])
+void ED_view3d_project_float_v2(const ARegion *ar, const float vec[3], float adr[2], float mat[4][4])
{
float vec4[4];
- adr[0]= IS_CLIPPED;
copy_v3_v3(vec4, vec);
vec4[3]= 1.0;
+ /* adr[0]= IS_CLIPPED; */ /* always overwritten */
mul_m4_v4(mat, vec4);
- if ( vec4[3]>FLT_EPSILON ) {
- adr[0] = (float)(ar->winx/2.0f)+(ar->winx/2.0f)*vec4[0]/vec4[3];
+ if (vec4[3] > FLT_EPSILON) {
+ adr[0] = (float)(ar->winx/2.0f)+(ar->winx/2.0f)*vec4[0]/vec4[3];
adr[1] = (float)(ar->winy/2.0f)+(ar->winy/2.0f)*vec4[1]/vec4[3];
}
else {
@@ -790,17 +791,17 @@ void ED_view3d_project_float(const ARegion *ar, const float vec[3], float adr[2]
}
/* use view3d_get_object_project_mat to get projecting mat */
-void ED_view3d_project_float_v3(ARegion *ar, const float vec[3], float *adr, float mat[4][4])
+void ED_view3d_project_float_v3(ARegion *ar, const float vec[3], float adr[3], float mat[4][4])
{
float vec4[4];
copy_v3_v3(vec4, vec);
vec4[3]= 1.0;
- adr[0]= IS_CLIPPED;
+ /* adr[0]= IS_CLIPPED; */ /* always overwritten */
mul_m4_v4(mat, vec4);
- if ( vec4[3]>FLT_EPSILON ) {
+ if (vec4[3] > FLT_EPSILON) {
adr[0] = (float)(ar->winx/2.0f)+(ar->winx/2.0f)*vec4[0]/vec4[3];
adr[1] = (float)(ar->winy/2.0f)+(ar->winy/2.0f)*vec4[1]/vec4[3];
adr[2] = vec4[2]/vec4[3];
@@ -1192,11 +1193,11 @@ void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d)
}
}
-/* IGLuint-> GLuint*/
+/* IGLuint-> GLuint */
/* Warning: be sure to account for a negative return value
-* This is an error, "Too many objects in select buffer"
-* and no action should be taken (can crash blender) if this happens
-*/
+ * This is an error, "Too many objects in select buffer"
+ * and no action should be taken (can crash blender) if this happens
+ */
short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int bufsize, rcti *input)
{
Scene *scene= vc->scene;
@@ -1683,9 +1684,9 @@ static void game_set_commmandline_options(GameData *gm)
static int game_engine_poll(bContext *C)
{
/* we need a context and area to launch BGE
- it's a temporary solution to avoid crash at load time
- if we try to auto run the BGE. Ideally we want the
- context to be set as soon as we load the file. */
+ * it's a temporary solution to avoid crash at load time
+ * if we try to auto run the BGE. Ideally we want the
+ * context to be set as soon as we load the file. */
if (CTX_wm_window(C)==NULL) return 0;
if (CTX_wm_screen(C)==NULL) return 0;
@@ -1743,7 +1744,7 @@ static int game_engine_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
/* redraw to hide any menus/popups, we don't go back to
- the window manager until after this operator exits */
+ * the window manager until after this operator exits */
WM_redraw_windows(C);
rv3d= CTX_wm_region_view3d(C);
@@ -1789,7 +1790,7 @@ static int game_engine_exec(bContext *C, wmOperator *op)
if (prevwin) {
/* restore context, in case it changed in the meantime, for
- example by working in another window or closing it */
+ * example by working in another window or closing it */
CTX_wm_region_set(C, prevar);
CTX_wm_window_set(C, prevwin);
CTX_wm_area_set(C, prevsa);
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 61fcf0d6def..43427d0dbe8 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -136,15 +136,13 @@ static void convertViewVec2D(View2D *v2d, float vec[3], int dx, int dy)
vec[2]= 0.0f;
}
-void convertViewVec(TransInfo *t, float *vec, int dx, int dy)
+void convertViewVec(TransInfo *t, float vec[3], int dx, int dy)
{
- if(t->spacetype==SPACE_VIEW3D) {
- if(t->ar->regiontype == RGN_TYPE_WINDOW) {
- float mval_f[2];
- mval_f[0]= dx;
- mval_f[1]= dy;
- ED_view3d_win_to_delta(t->ar, mval_f, vec);
- }
+ if ((t->spacetype == SPACE_VIEW3D) && (t->ar->regiontype == RGN_TYPE_WINDOW)) {
+ float mval_f[2];
+ mval_f[0] = dx;
+ mval_f[1] = dy;
+ ED_view3d_win_to_delta(t->ar, mval_f, vec);
}
else if(t->spacetype==SPACE_IMAGE) {
float aspx, aspy;
@@ -172,6 +170,10 @@ void convertViewVec(TransInfo *t, float *vec, int dx, int dy)
vec[1]= (v2d->cur.ymax-v2d->cur.ymin)*(dy)/divy;
vec[2]= 0.0f;
}
+ else {
+ printf("%s: called in an invalid context\n", __func__);
+ zero_v3(vec);
+ }
}
void projectIntView(TransInfo *t, float *vec, int *adr)
@@ -316,13 +318,11 @@ static void viewRedrawForce(const bContext *C, TransInfo *t)
else if (t->spacetype == SPACE_NLA) {
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
}
- else if(t->spacetype == SPACE_NODE)
- {
+ else if(t->spacetype == SPACE_NODE) {
//ED_area_tag_redraw(t->sa);
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
}
- else if(t->spacetype == SPACE_SEQ)
- {
+ else if(t->spacetype == SPACE_SEQ) {
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, NULL);
}
else if (t->spacetype==SPACE_IMAGE) {
@@ -1516,8 +1516,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
{
t->launch_event = RIGHTMOUSE;
}
- else if (t->launch_event == EVT_TWEAK_L)
- {
+ else if (t->launch_event == EVT_TWEAK_L) {
t->launch_event = LEFTMOUSE;
}
@@ -1713,7 +1712,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
/* overwrite initial values if operator supplied a non-null vector */
if ( (prop = RNA_struct_find_property(op->ptr, "value")) && RNA_property_is_set(op->ptr, prop))
{
- float values[4]= {0}; /* incase value isn't length 4, avoid uninitialized memory */
+ float values[4]= {0}; /* in case value isn't length 4, avoid uninitialized memory */
if(RNA_property_array_check(prop)) {
RNA_float_get_array(op->ptr, "value", values);
@@ -1827,8 +1826,7 @@ int transformEnd(bContext *C, TransInfo *t)
exit_code = OPERATOR_CANCELLED;
restoreTransObjects(t); // calls recalcData()
}
- else
- {
+ else {
exit_code = OPERATOR_FINISHED;
}
@@ -2076,8 +2074,8 @@ static void constraintob_from_transdata(bConstraintOb *cob, TransData *td)
if (td->ext->rotOrder == ROT_MODE_QUAT) {
/* quats */
/* objects and bones do normalization first too, otherwise
- we don't necessarily end up with a rotation matrix, and
- then conversion back to quat gives a different result */
+ * we don't necessarily end up with a rotation matrix, and
+ * then conversion back to quat gives a different result */
float quat[4];
normalize_qt_qt(quat, td->ext->quat);
quat_to_mat4(cob->matrix, quat);
@@ -2447,8 +2445,7 @@ int handleEventShear(TransInfo *t, wmEvent *event)
initMouseInputMode(t, &t->mouse, INPUT_VERTICAL_ABSOLUTE);
t->customData = (void*)1;
}
- else
- {
+ else {
initMouseInputMode(t, &t->mouse, INPUT_HORIZONTAL_ABSOLUTE);
t->customData = NULL;
}
@@ -2732,8 +2729,7 @@ int Resize(TransInfo *t, const int mval[2])
{
ratio = 1.0f - ((t->imval[0] - mval[0]) + (t->imval[1] - mval[1]))/100.0f;
}
- else
- {
+ else {
ratio = t->values[0];
}
@@ -3451,10 +3447,8 @@ static void applyTranslation(TransInfo *t, float vec[3])
continue;
/* handle snapping rotation before doing the translation */
- if (usingSnappingNormal(t))
- {
- if (validSnappingNormal(t))
- {
+ if (usingSnappingNormal(t)) {
+ if (validSnappingNormal(t)) {
float *original_normal = td->axismtx[2];
float axis[3];
float quat[4];
@@ -3470,8 +3464,7 @@ static void applyTranslation(TransInfo *t, float vec[3])
ElementRotation(t, td, mat, V3D_LOCAL);
}
- else
- {
+ else {
float mat[3][3];
unit_m3(mat);
@@ -3740,7 +3733,7 @@ int CurveShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
continue;
if(td->val) {
- //*td->val= ratio;
+ // *td->val= ratio;
*td->val= td->ival*ratio;
if (*td->val <= 0.0f) *td->val = 0.001f;
}
@@ -4174,12 +4167,10 @@ int BoneSize(TransInfo *t, const int mval[2])
// TRANSFORM_FIX_ME MOVE TO MOUSE INPUT
/* for manipulator, center handle, the scaling can't be done relative to center */
- if( (t->flag & T_USES_MANIPULATOR) && t->con.mode==0)
- {
+ if ((t->flag & T_USES_MANIPULATOR) && t->con.mode==0) {
ratio = 1.0f - ((t->imval[0] - mval[0]) + (t->imval[1] - mval[1]))/100.0f;
}
- else
- {
+ else {
ratio = t->values[0];
}
@@ -4310,7 +4301,7 @@ static BMLoop *get_next_loop(BMesh *UNUSED(bm), BMVert *v, BMLoop *l,
firstl = l;
do {
- l = BM_face_other_loop(l->e, l->f, v);
+ l = BM_face_other_edge_loop(l->f, l->e, v);
if (l->radial_next == l)
return NULL;
@@ -4339,12 +4330,12 @@ static BMLoop *get_next_loop(BMesh *UNUSED(bm), BMVert *v, BMLoop *l,
i += 1;
}
- if (BM_face_other_loop(l->e, l->f, v)->e == nexte) {
+ if (BM_face_other_edge_loop(l->f, l->e, v)->e == nexte) {
if (i)
mul_v3_fl(a, 1.0f / (float)i);
copy_v3_v3(vec, a);
- return BM_face_other_loop(l->e, l->f, v);
+ return BM_face_other_edge_loop(l->f, l->e, v);
}
l = l->radial_next;
@@ -4396,8 +4387,8 @@ static int createSlideVerts(TransInfo *t)
numsel = 0;
BM_ITER(e, &iter2, em->bm, BM_EDGES_OF_VERT, v) {
if (BM_elem_flag_test(e, BM_ELEM_SELECT)) {
- /*BMESH_TODO: this is probably very evil,
- set v->e to a selected edge*/
+ /* BMESH_TODO: this is probably very evil,
+ * set v->e to a selected edge*/
v->e = e;
numsel++;
@@ -4477,11 +4468,11 @@ static int createSlideVerts(TransInfo *t)
l1 = e->l;
l2 = e->l->radial_next;
- l = BM_face_other_loop(l1->e, l1->f, v);
+ l = BM_face_other_edge_loop(l1->f, l1->e, v);
sub_v3_v3v3(vec, BM_edge_other_vert(l->e, v)->co, v->co);
if (l2 != l1) {
- l = BM_face_other_loop(l2->e, l2->f, v);
+ l = BM_face_other_edge_loop(l2->f, l2->e, v);
sub_v3_v3v3(vec2, BM_edge_other_vert(l->e, v)->co, v->co);
} else {
l2 = NULL;
@@ -4498,11 +4489,11 @@ static int createSlideVerts(TransInfo *t)
if (l2)
copy_v3_v3(sv->downvec, vec2);
- l = BM_face_other_loop(l1->e, l1->f, v);
+ l = BM_face_other_edge_loop(l1->f, l1->e, v);
sv->up = BM_edge_other_vert(l->e, v);
if (l2) {
- l = BM_face_other_loop(l2->e, l2->f, v);
+ l = BM_face_other_edge_loop(l2->f, l2->e, v);
sv->down = BM_edge_other_vert(l->e, v);
}
@@ -4517,12 +4508,12 @@ static int createSlideVerts(TransInfo *t)
sv->v = v;
sv->origvert = *v;
- l = BM_face_other_loop(l1->e, l1->f, v);
+ l = BM_face_other_edge_loop(l1->f, l1->e, v);
sv->up = BM_edge_other_vert(l->e, v);
sub_v3_v3v3(sv->upvec, BM_edge_other_vert(l->e, v)->co, v->co);
if (l2) {
- l = BM_face_other_loop(l2->e, l2->f, v);
+ l = BM_face_other_edge_loop(l2->f, l2->e, v);
sv->down = BM_edge_other_vert(l->e, v);
sub_v3_v3v3(sv->downvec, BM_edge_other_vert(l->e, v)->co, v->co);
}
@@ -4560,8 +4551,8 @@ static int createSlideVerts(TransInfo *t)
BMEdge *e2;
float vec1[3], dis2, mval[2] = {t->mval[0], t->mval[1]}, d;
- /*search cross edges for visible edge to the mouse cursor,
- then use the shared vertex to calculate screen vector*/
+ /* search cross edges for visible edge to the mouse cursor,
+ * then use the shared vertex to calculate screen vector*/
dis2 = -1.0f;
for (i=0; i<2; i++) {
v = i?e->v1:e->v2;
@@ -4692,8 +4683,8 @@ void projectSVData(TransInfo *t, int final)
BLI_smallhash_insert(&visit, (uintptr_t)f, NULL);
/*the face attributes of the copied face will get
- copied over, so its necessary to save the selection
- and hidden state*/
+ * copied over, so its necessary to save the selection
+ * and hidden state*/
sel = BM_elem_flag_test(f, BM_ELEM_SELECT);
hide = BM_elem_flag_test(f, BM_ELEM_HIDDEN);
@@ -4721,7 +4712,10 @@ void projectSVData(TransInfo *t, int final)
continue; /* shouldn't happen, but protection */
}
- BM_loop_interp_from_face(em->bm, l2, copyf, do_vdata, FALSE);
+ /* do not run interpolation of all layers for now because it's not actually what you'll always expect
+ * and layers like shapekeys shouldn't be interpolated from here because oherwise they'll
+ * propagate to basis keys and will propagate twice to related keys (sergey) */
+ // BM_loop_interp_from_face(em->bm, l2, copyf, do_vdata, FALSE);
if (final) {
BM_loop_interp_multires(em->bm, l2, copyf);
@@ -4855,7 +4849,10 @@ static int doEdgeSlide(TransInfo *t, float perc)
}
}
- projectSVData(t, 0);
+ /* BMESH_TODO: simply not all layers should be interpolated from there
+ * but it's quite complicated to set this up with current API.
+ * details are in comments in projectSVData function */
+ // projectSVData(t, 0);
return 1;
}
@@ -5066,7 +5063,7 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2]))
char str[200];
/*
- * OPTIMISATION:
+ * OPTIMIZATION:
* This still recalcs transformation on mouse move
* while it should only recalc on constraint change
* */
@@ -5097,8 +5094,7 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2]))
ED_area_headerprint(t->sa, str);
}
- else
- {
+ else {
size[0] = size[1] = size[2] = 1;
size_to_mat3( mat,size);
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 07c90f95840..48c05f00ea8 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -103,20 +103,20 @@ typedef struct TransCon {
float imtx[3][3]; /* Inverse Matrix of the Constraint space */
float pmtx[3][3]; /* Projection Constraint Matrix (same as imtx with some axis == 0) */
float center[3]; /* transformation center to define where to draw the view widget
- ALWAYS in global space. Unlike the transformation center */
+ * ALWAYS in global space. Unlike the transformation center */
int imval[2]; /* initial mouse value for visual calculation */
- /* the one in TransInfo is not garanty to stay the same (Rotates change it) */
+ /* the one in TransInfo is not garanty to stay the same (Rotates change it) */
int mode; /* Mode flags of the Constraint */
void (*drawExtra)(struct TransInfo *);
- /* For constraints that needs to draw differently from the other
- uses this instead of the generic draw function */
+ /* For constraints that needs to draw differently from the other
+ * uses this instead of the generic draw function */
void (*applyVec)(struct TransInfo *, struct TransData *, float *, float *, float *);
- /* Apply function pointer for linear vectorial transformation */
- /* The last three parameters are pointers to the in/out/printable vectors */
+ /* Apply function pointer for linear vectorial transformation */
+ /* The last three parameters are pointers to the in/out/printable vectors */
void (*applySize)(struct TransInfo *, struct TransData *, float [3][3]);
- /* Apply function pointer for size transformation */
+ /* Apply function pointer for size transformation */
void (*applyRot)(struct TransInfo *, struct TransData *, float [3], float *);
- /* Apply function pointer for rotation transformation */
+ /* Apply function pointer for rotation transformation */
} TransCon;
typedef struct TransDataExtension {
@@ -129,10 +129,10 @@ typedef struct TransDataExtension {
float irot[3]; /* Initial rotation */
float *quat; /* Rotation quaternion of the data to transform (Faculative) */
float iquat[4]; /* Initial rotation quaternion */
- float *rotAngle; /* Rotation angle of the data to transform (Faculative) */
- float irotAngle; /* Initial rotation angle */
- float *rotAxis; /* Rotation axis of the data to transform (Faculative) */
- float irotAxis[4]; /* Initial rotation axis */
+ float *rotAngle; /* Rotation angle of the data to transform (Faculative) */
+ float irotAngle; /* Initial rotation angle */
+ float *rotAxis; /* Rotation axis of the data to transform (Faculative) */
+ float irotAxis[4]; /* Initial rotation axis */
float *size; /* Size of the data to transform (Faculative) */
float isize[3]; /* Initial size */
float obmat[4][4]; /* Object matrix */
@@ -148,7 +148,7 @@ typedef struct TransData2D {
float ih1[2], ih2[2];
} TransData2D;
-/* we need to store 2 handles for each transdata incase the other handle wasnt selected */
+/* we need to store 2 handles for each transdata in case the other handle wasnt selected */
typedef struct TransDataCurveHandleFlags {
char ih1, ih2;
char *h1, *h2;
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index bd34477c13f..017501bd78e 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -80,16 +80,13 @@ static void constraintAutoValues(TransInfo *t, float vec[3])
{
float nval = (t->flag & T_NULL_ONE)?1.0f:0.0f;
- if ((mode & CON_AXIS0) == 0)
- {
+ if ((mode & CON_AXIS0) == 0) {
vec[0] = nval;
}
- if ((mode & CON_AXIS1) == 0)
- {
+ if ((mode & CON_AXIS1) == 0) {
vec[1] = nval;
}
- if ((mode & CON_AXIS2) == 0)
- {
+ if ((mode & CON_AXIS2) == 0) {
vec[2] = nval;
}
}
@@ -165,8 +162,7 @@ static void postConstraintChecks(TransInfo *t, float vec[3], float pvec[3])
}
/* autovalues is operator param, use that directly but not if snapping is forced */
- if (t->flag & T_AUTOVALUES && (t->tsnap.status & SNAP_FORCED) == 0)
- {
+ if (t->flag & T_AUTOVALUES && (t->tsnap.status & SNAP_FORCED) == 0) {
mul_v3_m3v3(vec, t->con.imtx, t->auto_values);
constraintAutoValues(t, vec);
/* inverse transformation at the end */
@@ -231,8 +227,8 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3
angle = RAD2DEGF(angle);
/* For when view is parallel to constraint... will cause NaNs otherwise
- So we take vertical motion in 3D space and apply it to the
- constraint axis. Nice for camera grab + MMB */
+ * So we take vertical motion in 3D space and apply it to the
+ * constraint axis. Nice for camera grab + MMB */
if(angle < 5.0f) {
project_v3_v3v3(vec, in, t->viewinv[1]);
factor = dot_v3v3(t->viewinv[1], vec) * 2.0f;
@@ -597,11 +593,11 @@ void setLocalConstraint(TransInfo *t, int mode, const char text[])
}
/*
- Set the constraint according to the user defined orientation
-
- ftext is a format string passed to BLI_snprintf. It will add the name of
- the orientation where %s is (logically).
-*/
+ * Set the constraint according to the user defined orientation
+ *
+ * ftext is a format string passed to BLI_snprintf. It will add the name of
+ * the orientation where %s is (logically).
+ */
void setUserConstraint(TransInfo *t, short orientation, int mode, const char ftext[])
{
char text[40];
@@ -716,13 +712,11 @@ void drawPropCircle(const struct bContext *C, TransInfo *t)
UI_ThemeColor(TH_GRID);
- if(t->spacetype == SPACE_VIEW3D && rv3d != NULL)
- {
+ if(t->spacetype == SPACE_VIEW3D && rv3d != NULL) {
copy_m4_m4(tmat, rv3d->viewmat);
invert_m4_m4(imat, tmat);
}
- else
- {
+ else {
unit_m4(tmat);
unit_m4(imat);
}
@@ -731,12 +725,10 @@ void drawPropCircle(const struct bContext *C, TransInfo *t)
copy_v3_v3(center, t->center);
- if((t->spacetype == SPACE_VIEW3D) && t->obedit)
- {
+ if((t->spacetype == SPACE_VIEW3D) && t->obedit) {
mul_m4_v3(t->obedit->obmat, center); /* because t->center is in local space */
}
- else if(t->spacetype == SPACE_IMAGE)
- {
+ else if(t->spacetype == SPACE_IMAGE) {
float aspx, aspy;
ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
@@ -757,10 +749,10 @@ static void drawObjectConstraint(TransInfo *t)
TransData * td = t->data;
/* Draw the first one lighter because that's the one who controls the others.
- Meaning the transformation is projected on that one and just copied on the others
- constraint space.
- In a nutshell, the object with light axis is controlled by the user and the others follow.
- Without drawing the first light, users have little clue what they are doing.
+ * Meaning the transformation is projected on that one and just copied on the others
+ * constraint space.
+ * In a nutshell, the object with light axis is controlled by the user and the others follow.
+ * Without drawing the first light, users have little clue what they are doing.
*/
if (t->con.mode & CON_AXIS0) {
drawLine(t, td->ob->obmat[3], td->axismtx[0], 'X', DRAWLIGHT);
@@ -896,12 +888,12 @@ static void setNearestAxis3d(TransInfo *t)
mvec[2] = 0.0f;
/* we need to correct axis length for the current zoomlevel of view,
- this to prevent projected values to be clipped behind the camera
- and to overflow the short integers.
- The formula used is a bit stupid, just a simplification of the substraction
- of two 2D points 30 pixels apart (that's the last factor in the formula) after
- projecting them with window_to_3d_delta and then get the length of that vector.
- */
+ * this to prevent projected values to be clipped behind the camera
+ * and to overflow the short integers.
+ * The formula used is a bit stupid, just a simplification of the subtraction
+ * of two 2D points 30 pixels apart (that's the last factor in the formula) after
+ * projecting them with window_to_3d_delta and then get the length of that vector.
+ */
zfac= t->persmat[0][3]*t->center[0]+ t->persmat[1][3]*t->center[1]+ t->persmat[2][3]*t->center[2]+ t->persmat[3][3];
zfac = len_v3(t->persinv[0]) * 2.0f/t->ar->winx * zfac * 30.0f;
@@ -1041,10 +1033,10 @@ int getConstraintSpaceDimension(TransInfo *t)
return n;
/*
- Someone willing to do it criptically could do the following instead:
-
- return t->con & (CON_AXIS0|CON_AXIS1|CON_AXIS2);
-
- Based on the assumptions that the axis flags are one after the other and start at 1
-*/
+ * Someone willing to do it cryptically could do the following instead:
+ *
+ * return t->con & (CON_AXIS0|CON_AXIS1|CON_AXIS2);
+ *
+ * Based on the assumptions that the axis flags are one after the other and start at 1
+ */
}
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index d6097615ff6..4dbf87fb500 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -213,7 +213,7 @@ static void sort_trans_data(TransInfo *t)
}
/* distance calculated from not-selected vertex to nearest selected vertex
- warning; this is loops inside loop, has minor N^2 issues, but by sorting list it is OK */
+ * warning; this is loops inside loop, has minor N^2 issues, but by sorting list it is OK */
static void set_prop_dist(TransInfo *t, short with_dist)
{
TransData *tob;
@@ -393,8 +393,8 @@ static short apply_targetless_ik(Object *ob)
int segcount, apply= 0;
/* now we got a difficult situation... we have to find the
- target-less IK pchans, and apply transformation to the all
- pchans that were in the chain */
+ * target-less IK pchans, and apply transformation to the all
+ * pchans that were in the chain */
for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) {
data= has_targetless_ik(pchan);
@@ -717,12 +717,13 @@ static void bone_children_clear_transflag(int mode, short around, ListBase *lb)
{
bone->flag |= BONE_HINGE_CHILD_TRANSFORM;
}
- else if (bone->flag & BONE_TRANSFORM && (mode == TFM_ROTATION || mode == TFM_TRACKBALL) && around == V3D_LOCAL)
+ else if ((bone->flag & BONE_TRANSFORM) &&
+ (mode == TFM_ROTATION || mode == TFM_TRACKBALL) &&
+ (around == V3D_LOCAL))
{
bone->flag |= BONE_TRANSFORM_CHILD;
}
- else
- {
+ else {
bone->flag &= ~BONE_TRANSFORM;
}
@@ -1127,13 +1128,11 @@ static void createTransArmatureVerts(TransInfo *t)
if (ebo->flag & BONE_SELECTED)
t->total++;
}
- else if (t->mode==TFM_BONE_ROLL)
- {
+ else if (t->mode==TFM_BONE_ROLL) {
if (ebo->flag & BONE_SELECTED)
t->total++;
}
- else
- {
+ else {
if (ebo->flag & BONE_TIPSEL)
t->total++;
if (ebo->flag & BONE_ROOTSEL)
@@ -1192,8 +1191,7 @@ static void createTransArmatureVerts(TransInfo *t)
}
}
- else if (t->mode==TFM_BONESIZE)
- {
+ else if (t->mode==TFM_BONESIZE) {
if (ebo->flag & BONE_SELECTED) {
if(arm->drawtype==ARM_ENVELOPE)
{
@@ -1201,8 +1199,7 @@ static void createTransArmatureVerts(TransInfo *t)
td->val= &ebo->dist;
td->ival= ebo->dist;
}
- else
- {
+ else {
// abusive storage of scale in the loc pointer :)
td->loc= &ebo->xwidth;
copy_v3_v3(td->iloc, td->loc);
@@ -1226,8 +1223,7 @@ static void createTransArmatureVerts(TransInfo *t)
td++;
}
}
- else if (t->mode==TFM_BONE_ROLL)
- {
+ else if (t->mode==TFM_BONE_ROLL) {
if (ebo->flag & BONE_SELECTED)
{
td->loc= NULL;
@@ -1243,8 +1239,7 @@ static void createTransArmatureVerts(TransInfo *t)
td++;
}
}
- else
- {
+ else {
if (ebo->flag & BONE_TIPSEL)
{
copy_v3_v3(td->iloc, ebo->tail);
@@ -1426,7 +1421,7 @@ static TransDataCurveHandleFlags *initTransDataCurveHandles(TransData *td, struc
hdata = td->hdata = MEM_mallocN(sizeof(TransDataCurveHandleFlags), "CuHandle Data");
hdata->ih1 = bezt->h1;
hdata->h1 = &bezt->h1;
- hdata->ih2 = bezt->h2; /* incase the second is not selected */
+ hdata->ih2 = bezt->h2; /* in case the second is not selected */
hdata->h2 = &bezt->h2;
return hdata;
}
@@ -1867,10 +1862,10 @@ void flushTransParticles(TransInfo *t)
/* proportional distance based on connectivity */
#define THRESHOLDFACTOR (1.0f-0.0001f)
-/*I did this wrong, it should be a breadth-first search
- but instead it's a depth-first search, fudged
- to report shortest distances. I have no idea how fast
- or slow this is.*/
+/* I did this wrong, it should be a breadth-first search
+ * but instead it's a depth-first search, fudged
+ * to report shortest distances. I have no idea how fast
+ * or slow this is. */
static void editmesh_set_connectivity_distance(BMEditMesh *em, float mtx[][3], float *dists)
{
BMVert **queue = NULL;
@@ -2140,12 +2135,12 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
if(modifiers_getCageIndex(t->scene, t->obedit, NULL, 1)>=0) {
if(modifiers_isCorrectableDeformed(t->obedit)) {
/* check if we can use deform matrices for modifier from the
- start up to stack, they are more accurate than quats */
+ * start up to stack, they are more accurate than quats */
totleft= editbmesh_get_first_deform_matrices(t->scene, t->obedit, em, &defmats, &defcos);
/* if we still have more modifiers, also do crazyspace
- correction with quats, relative to the coordinates after
- the modifiers that support deform matrices (defcos) */
+ * correction with quats, relative to the coordinates after
+ * the modifiers that support deform matrices (defcos) */
if(totleft > 0) {
mappedcos= crazyspace_get_mapped_editverts(t->scene, t->obedit);
quats= MEM_mallocN( (t->total)*sizeof(float)*4, "crazy quats");
@@ -2286,7 +2281,7 @@ void flushTransNodes(TransInfo *t)
/* *** SEQUENCE EDITOR *** */
-/* commented _only_ because the meta may have animaion data which
+/* commented _only_ because the meta may have animation data which
* needs moving too [#28158] */
#define SEQ_TX_NESTED_METAS
@@ -2404,9 +2399,9 @@ static void UVsToTransData(SpaceImage *sima, TransData *td, TransData2D *td2d, f
ED_space_image_uv_aspect(sima, &aspx, &aspy);
/* uv coords are scaled by aspects. this is needed for rotations and
- proportional editing to be consistent with the stretchted uv coords
- that are displayed. this also means that for display and numinput,
- and when the the uv coords are flushed, these are converted each time */
+ * proportional editing to be consistent with the stretched uv coords
+ * that are displayed. this also means that for display and numinput,
+ * and when the the uv coords are flushed, these are converted each time */
td2d->loc[0] = uv[0]*aspx;
td2d->loc[1] = uv[1]*aspy;
td2d->loc[2] = 0.0f;
@@ -2476,7 +2471,7 @@ static void createTransUVs(bContext *C, TransInfo *t)
t->total= (propmode)? count: countsel;
t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(UV Editing)");
/* for each 2d uv coord a 3d vector is allocated, so that they can be
- treated just as if they were 3d verts */
+ * treated just as if they were 3d verts */
t->data2d= MEM_callocN(t->total*sizeof(TransData2D), "TransObData2D(UV Editing)");
if(sima->flag & SI_CLIP_UV)
@@ -2489,7 +2484,6 @@ static void createTransUVs(bContext *C, TransInfo *t)
if (!BM_elem_flag_test(efa, BM_ELEM_TAG))
continue;
- tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
if (!propmode && !uvedit_uv_selected(em, scene, l))
continue;
@@ -3175,7 +3169,7 @@ static void createTransActionData(bContext *C, TransInfo *t)
for (ale= anim_data.first; ale; ale= ale->next) {
AnimData *adt= ANIM_nla_mapping_get(&ac, ale);
- /* convert current-frame to action-time (slightly less accurate, espcially under
+ /* convert current-frame to action-time (slightly less accurate, especially under
* higher scaling ratios, but is faster than converting all points)
*/
if (adt)
@@ -3231,7 +3225,7 @@ static void createTransActionData(bContext *C, TransInfo *t)
AnimData *adt= ANIM_nla_mapping_get(&ac, ale);
FCurve *fcu= (FCurve *)ale->key_data;
- /* convert current-frame to action-time (slightly less accurate, espcially under
+ /* convert current-frame to action-time (slightly less accurate, especially under
* higher scaling ratios, but is faster than converting all points)
*/
if (adt)
@@ -3402,7 +3396,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
AnimData *adt= ANIM_nla_mapping_get(&ac, ale);
FCurve *fcu= (FCurve *)ale->key_data;
- /* convert current-frame to action-time (slightly less accurate, espcially under
+ /* convert current-frame to action-time (slightly less accurate, especially under
* higher scaling ratios, but is faster than converting all points)
*/
if (adt)
@@ -3423,7 +3417,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
if (ELEM3(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE)) {
/* for 'normal' pivots - just include anything that is selected.
- this works a bit differently in translation modes */
+ * this works a bit differently in translation modes */
if (sel2) count++;
else {
if (sel1) count++;
@@ -3493,7 +3487,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
FCurve *fcu= (FCurve *)ale->key_data;
short intvals= (fcu->flag & FCURVE_INT_VALUES);
- /* convert current-frame to action-time (slightly less accurate, espcially under
+ /* convert current-frame to action-time (slightly less accurate, especially under
* higher scaling ratios, but is faster than converting all points)
*/
if (adt)
@@ -3683,7 +3677,7 @@ static void beztmap_to_data (TransInfo *t, FCurve *fcu, BeztMap *bezms, int totv
/* dynamically allocate an array of chars to mark whether an TransData's
* pointers have been fixed already, so that we don't override ones that are
* already done
- */
+ */
adjusted= MEM_callocN(t->total, "beztmap_adjusted_map");
/* for each beztmap item, find if it is used anywhere */
@@ -4459,8 +4453,8 @@ static void set_trans_object_base_flags(TransInfo *t)
View3D *v3d = t->view;
/*
- if Base selected and has parent selected:
- base->flag= BA_WAS_SEL
+ * if Base selected and has parent selected:
+ * base->flag= BA_WAS_SEL
*/
Base *base;
@@ -4864,7 +4858,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
{
Object *ob;
// short redrawipo=0, resetslowpar=1;
- int cancelled= (t->state == TRANS_CANCEL);
+ int canceled= (t->state == TRANS_CANCEL);
short duplicate= (t->mode == TFM_TIME_DUPLICATE);
/* early out when nothing happened */
@@ -4873,12 +4867,12 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
if (t->spacetype==SPACE_VIEW3D) {
if (t->obedit) {
- if (cancelled==0) {
+ if (canceled==0) {
/* we need to delete the temporary faces before automerging */
if(t->mode == TFM_EDGE_SLIDE){
SlideData *sld = t->customData;
- /* handle multires reprojection, done
+ /* handle multires re-projection, done
* on transform completion since it's
* really slow -joeedh */
projectSVData(t, TRUE);
@@ -4889,6 +4883,10 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
}
EDBM_automerge(t->scene, t->obedit, 1);
}
+#if 0
+ /* BMESH_TODO: simply nothing to cancel from here, but when interpolation of
+ * some custom layers would be added this code would eb needed
+ * some details are in comments in projectSVData (sergey) */
else {
if (t->mode == TFM_EDGE_SLIDE) {
SlideData *sld = t->customData;
@@ -4897,6 +4895,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
projectSVData(t, FALSE);
}
}
+#endif
}
}
@@ -4908,7 +4907,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
/* marker transform, not especially nice but we may want to move markers
* at the same time as keyframes in the dope sheet. */
- if ((sseq->flag & SEQ_MARKER_TRANS) && (cancelled == 0)) {
+ if ((sseq->flag & SEQ_MARKER_TRANS) && (canceled == 0)) {
/* cant use , TFM_TIME_EXTEND
* for some reason EXTEND is changed into TRANSLATE, so use frame_side instead */
@@ -4926,7 +4925,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
SpaceNode *snode= (SpaceNode *)t->sa->spacedata.first;
ED_node_update_hierarchy(C, snode->edittree);
- if(cancelled == 0)
+ if(canceled == 0)
ED_node_link_insert(t->sa);
/* clear link line */
@@ -4938,7 +4937,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
if(t->scene->nodetree) {
/* tracks can be used for stabilization nodes,
- flush update for such nodes */
+ * flush update for such nodes */
nodeUpdateID(t->scene->nodetree, &clip->id);
WM_event_add_notifier(C, NC_SCENE|ND_NODES, NULL);
}
@@ -4968,11 +4967,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
/* 3 cases here for curve cleanups:
* 1) NOTRANSKEYCULL on -> cleanup of duplicates shouldn't be done
- * 2) cancelled == 0 -> user confirmed the transform, so duplicates should be removed
- * 3) cancelled + duplicate -> user cancelled the transform, but we made duplicates, so get rid of these
+ * 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
+ * 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
*/
if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
- ((cancelled == 0) || (duplicate)) )
+ ((canceled == 0) || (duplicate)) )
{
if (adt) {
ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1);
@@ -4999,11 +4998,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
/* 3 cases here for curve cleanups:
* 1) NOTRANSKEYCULL on -> cleanup of duplicates shouldn't be done
- * 2) cancelled == 0 -> user confirmed the transform, so duplicates should be removed
- * 3) cancelled + duplicate -> user cancelled the transform, but we made duplicates, so get rid of these
+ * 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
+ * 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
*/
if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
- ((cancelled == 0) || (duplicate)) )
+ ((canceled == 0) || (duplicate)) )
{
posttrans_action_clean(&ac, (bAction *)ac.data);
}
@@ -5012,11 +5011,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
/* remove duplicate frames and also make sure points are in order! */
/* 3 cases here for curve cleanups:
* 1) NOTRANSKEYCULL on -> cleanup of duplicates shouldn't be done
- * 2) cancelled == 0 -> user confirmed the transform, so duplicates should be removed
- * 3) cancelled + duplicate -> user cancelled the transform, but we made duplicates, so get rid of these
+ * 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
+ * 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
*/
if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
- ((cancelled == 0) || (duplicate)) )
+ ((canceled == 0) || (duplicate)) )
{
bGPdata *gpd;
@@ -5032,7 +5031,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
/* marker transform, not especially nice but we may want to move markers
* at the same time as keyframes in the dope sheet.
*/
- if ((saction->flag & SACTION_MARKERS_MOVE) && (cancelled == 0)) {
+ if ((saction->flag & SACTION_MARKERS_MOVE) && (canceled == 0)) {
if (t->mode == TFM_TIME_TRANSLATE) {
#if 0
if (ELEM(t->frame_side, 'L', 'R')) { /* TFM_TIME_EXTEND */
@@ -5081,11 +5080,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
/* 3 cases here for curve cleanups:
* 1) NOTRANSKEYCULL on -> cleanup of duplicates shouldn't be done
- * 2) cancelled == 0 -> user confirmed the transform, so duplicates should be removed
- * 3) cancelled + duplicate -> user cancelled the transform, but we made duplicates, so get rid of these
+ * 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
+ * 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
*/
if ( (sipo->flag & SIPO_NOTRANSKEYCULL)==0 &&
- ((cancelled == 0) || (duplicate)) )
+ ((canceled == 0) || (duplicate)) )
{
if (adt) {
ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 0);
@@ -5106,7 +5105,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
* Note: if the refresh is really needed after cancel then some way
* has to be added to not update handle types (see bug 22289).
*/
- if(!cancelled)
+ if(!canceled)
ANIM_editkeyframes_refresh(&ac);
}
else if (t->spacetype == SPACE_NLA) {
@@ -5167,11 +5166,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
}
/* set BONE_TRANSFORM flags for autokey, manipulator draw might have changed them */
- if (!cancelled && (t->mode != TFM_DUMMY))
+ if (!canceled && (t->mode != TFM_DUMMY))
count_set_pose_transflags(&t->mode, t->around, ob);
/* if target-less IK grabbing, we calculate the pchan transforms and clear flag */
- if (!cancelled && t->mode==TFM_TRANSLATION)
+ if (!canceled && t->mode==TFM_TRANSLATION)
targetless_ik= apply_targetless_ik(ob);
else {
/* not forget to clear the auto flag */
@@ -5184,8 +5183,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
if (t->mode==TFM_TRANSLATION)
pose_grab_with_ik_clear(ob);
- /* automatic inserting of keys and unkeyed tagging - only if transform wasn't cancelled (or TFM_DUMMY) */
- if (!cancelled && (t->mode != TFM_DUMMY)) {
+ /* automatic inserting of keys and unkeyed tagging - only if transform wasn't canceled (or TFM_DUMMY) */
+ if (!canceled && (t->mode != TFM_DUMMY)) {
autokeyframe_pose_cb_func(C, t->scene, (View3D *)t->view, ob, t->mode, targetless_ik);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
@@ -5239,7 +5238,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
DAG_id_tag_update(&ob->id, OB_RECALC_OB);
/* Set autokey if necessary */
- if (!cancelled) {
+ if (!canceled) {
autokeyframe_ob_cb_func(C, t->scene, (View3D *)t->view, ob, t->mode);
/* only calculate paths if there are paths to be recalculated */
@@ -5481,8 +5480,8 @@ static void markerToTransDataInit(TransData *td, TransData2D *td2d,
td->flag = 0;
td->loc = td2d->loc;
- VECCOPY(td->center, td->loc);
- VECCOPY(td->iloc, td->loc);
+ copy_v3_v3(td->center, td->loc);
+ copy_v3_v3(td->iloc, td->loc);
memset(td->axismtx, 0, sizeof(td->axismtx));
td->axismtx[2][2] = 1.0f;
@@ -5627,8 +5626,8 @@ static void markerToTransCurveDataInit(TransData *td, TransData2D *td2d, TransDa
td->flag = 0;
td->loc = td2d->loc;
- VECCOPY(td->center, td->loc);
- VECCOPY(td->iloc, td->loc);
+ copy_v3_v3(td->center, td->loc);
+ copy_v3_v3(td->iloc, td->loc);
memset(td->axismtx, 0, sizeof(td->axismtx));
td->axismtx[2][2] = 1.0f;
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 557a6936f2f..d24081ae472 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -469,7 +469,7 @@ static void recalcData_nla(TransInfo *t)
if ((snla->flag & SNLA_NOREALTIMEUPDATES) == 0)
ANIM_id_update(t->scene, tdn->id);
- /* if cancelling transform, just write the values without validating, then move on */
+ /* if canceling transform, just write the values without validating, then move on */
if (t->state == TRANS_CANCEL) {
/* clear the values by directly overwriting the originals, but also need to restore
* endpoints of neighboring transition-strips
@@ -512,7 +512,7 @@ static void recalcData_nla(TransInfo *t)
if ((pExceeded && nExceeded) || (iter == 4) ) {
/* both endpoints exceeded (or iteration ping-pong'd meaning that we need a compromise)
* - simply crop strip to fit within the bounds of the strips bounding it
- * - if there were no neighbours, clear the transforms (make it default to the strip's current values)
+ * - if there were no neighbors, clear the transforms (make it default to the strip's current values)
*/
if (strip->prev && strip->next) {
tdn->h1[0]= strip->prev->end;
@@ -797,8 +797,7 @@ static void recalcData_view3d(TransInfo *t)
rotation_between_vecs_to_quat(qrot, td->axismtx[1], vec);
mul_qt_v3(qrot, up_axis);
}
- else
- {
+ else {
mul_m3_v3(t->mat, up_axis);
}
@@ -811,8 +810,7 @@ static void recalcData_view3d(TransInfo *t)
transform_armature_mirror_update(t->obedit);
}
- else
- {
+ else {
if(t->state != TRANS_CANCEL) {
applyProject(t);
}
@@ -993,8 +991,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
copy_v2_v2_int(t->imval, event->mval);
t->event_type = event->type;
}
- else
- {
+ else {
t->imval[0] = 0;
t->imval[1] = 0;
}
@@ -1074,8 +1071,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
t->current_orientation = V3D_MANIP_GLOBAL;
}
}
- else
- {
+ else {
t->current_orientation = v3d->twmode;
}
@@ -1102,27 +1098,23 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
}
}
- else if(t->spacetype==SPACE_IMAGE)
- {
+ else if(t->spacetype==SPACE_IMAGE) {
SpaceImage *sima = sa->spacedata.first;
// XXX for now, get View2D from the active region
t->view = &ar->v2d;
t->around = sima->around;
}
- else if(t->spacetype==SPACE_NODE)
- {
+ else if(t->spacetype==SPACE_NODE) {
// XXX for now, get View2D from the active region
t->view = &ar->v2d;
t->around = V3D_CENTER;
}
- else if(t->spacetype==SPACE_IPO)
- {
+ else if(t->spacetype==SPACE_IPO) {
SpaceIpo *sipo= sa->spacedata.first;
t->view = &ar->v2d;
t->around = sipo->around;
}
- else
- {
+ else {
if(ar) {
// XXX for now, get View2D from the active region
t->view = &ar->v2d;
@@ -1141,10 +1133,8 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
t->flag |= T_RELEASE_CONFIRM;
}
}
- else
- {
- if (U.flag & USER_RELEASECONFIRM)
- {
+ else {
+ if (U.flag & USER_RELEASECONFIRM) {
t->flag |= T_RELEASE_CONFIRM;
}
}
@@ -1158,8 +1148,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
}
}
// Need stuff to take it from edit mesh or whatnot here
- else if (t->spacetype == SPACE_VIEW3D)
- {
+ else if (t->spacetype == SPACE_VIEW3D) {
if (t->obedit && t->obedit->type == OB_MESH && (((Mesh *)t->obedit->data)->editflag & ME_EDIT_MIRROR_X))
{
t->flag |= T_MIRROR;
@@ -1181,22 +1170,18 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
break;
}
}
- else
- {
+ else {
/* use settings from scene only if modal */
- if (t->flag & T_MODAL)
- {
- if ((t->options & CTX_NO_PET) == 0)
- {
- if (t->obedit && ts->proportional != PROP_EDIT_OFF)
- {
+ if (t->flag & T_MODAL) {
+ if ((t->options & CTX_NO_PET) == 0) {
+ if (t->obedit && ts->proportional != PROP_EDIT_OFF) {
t->flag |= T_PROP_EDIT;
- if(ts->proportional == PROP_EDIT_CONNECTED)
+ if (ts->proportional == PROP_EDIT_CONNECTED) {
t->flag |= T_PROP_CONNECTED;
+ }
}
- else if (t->obedit == NULL && ts->proportional_objects)
- {
+ else if (t->obedit == NULL && ts->proportional_objects) {
t->flag |= T_PROP_EDIT;
}
}
@@ -1207,8 +1192,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
{
t->prop_size = RNA_float_get(op->ptr, "proportional_size");
}
- else
- {
+ else {
t->prop_size = ts->proportional_size;
}
@@ -1224,8 +1208,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
{
t->prop_mode = RNA_enum_get(op->ptr, "proportional_edit_falloff");
}
- else
- {
+ else {
t->prop_mode = ts->prop_mode;
}
}
@@ -1467,9 +1450,9 @@ void calculateCenterMedian(TransInfo *t)
}
else {
/*
- All the selected elements are at the head of the array
- which means we can stop when it finds unselected data
- */
+ * All the selected elements are at the head of the array
+ * which means we can stop when it finds unselected data
+ */
break;
}
}
@@ -1493,9 +1476,9 @@ void calculateCenterBound(TransInfo *t)
}
else {
/*
- All the selected elements are at the head of the array
- which means we can stop when it finds unselected data
- */
+ * All the selected elements are at the head of the array
+ * which means we can stop when it finds unselected data
+ */
break;
}
}
@@ -1565,8 +1548,7 @@ void calculateCenter(TransInfo *t)
{
Scene *scene = t->scene;
Object *ob= OBACT;
- if(ob)
- {
+ if (ob) {
copy_v3_v3(t->center, ob->obmat[3]);
projectIntView(t, t->center, t->center2d);
}
@@ -1577,23 +1559,19 @@ void calculateCenter(TransInfo *t)
/* setting constraint center */
copy_v3_v3(t->con.center, t->center);
- if(t->flag & (T_EDIT|T_POSE))
- {
+ if (t->flag & (T_EDIT|T_POSE)) {
Object *ob= t->obedit?t->obedit:t->poseobj;
mul_m4_v3(ob->obmat, t->con.center);
}
/* for panning from cameraview */
- if(t->flag & T_OBJECT)
- {
- if(t->spacetype==SPACE_VIEW3D && t->ar && t->ar->regiontype == RGN_TYPE_WINDOW)
- {
+ if (t->flag & T_OBJECT) {
+ if (t->spacetype==SPACE_VIEW3D && t->ar && t->ar->regiontype == RGN_TYPE_WINDOW) {
View3D *v3d = t->view;
Scene *scene = t->scene;
RegionView3D *rv3d = t->ar->regiondata;
- if(v3d->camera == OBACT && rv3d->persp==RV3D_CAMOB)
- {
+ if (v3d->camera == OBACT && rv3d->persp==RV3D_CAMOB) {
float axis[3];
/* persinv is nasty, use viewinv instead, always right */
copy_v3_v3(axis, t->viewinv[2]);
@@ -1616,8 +1594,7 @@ void calculateCenter(TransInfo *t)
}
}
- if(t->spacetype==SPACE_VIEW3D)
- {
+ if (t->spacetype==SPACE_VIEW3D) {
/* initgrabz() defines a factor for perspective depth correction, used in window_to_3d_delta() */
if(t->flag & (T_EDIT|T_POSE)) {
Object *ob= t->obedit?t->obedit:t->poseobj;
@@ -1645,8 +1622,7 @@ void calculatePropRatio(TransInfo *t)
if (td->flag & TD_SELECTED) {
td->factor = 1.0f;
}
- else if (t->flag & T_MIRROR && td->loc[0] * t->mirror < -0.00001f)
- {
+ else if (t->flag & T_MIRROR && td->loc[0] * t->mirror < -0.00001f) {
td->flag |= TD_SKIP;
td->factor = 0.0f;
restoreElement(td);
@@ -1657,9 +1633,9 @@ void calculatePropRatio(TransInfo *t)
(connected == 0 &&
td->rdist > t->prop_size)) {
/*
- The elements are sorted according to their dist member in the array,
- that means we can stop when it finds one element outside of the propsize.
- */
+ * The elements are sorted according to their dist member in the array,
+ * that means we can stop when it finds one element outside of the propsize.
+ */
td->flag |= TD_NOACTION;
td->factor = 0.0f;
restoreElement(td);
diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c
index a4f03e76fd1..3faddeb6639 100644
--- a/source/blender/editors/transform/transform_input.c
+++ b/source/blender/editors/transform/transform_input.c
@@ -44,16 +44,14 @@
static void InputVector(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
{
float vec[3], dvec[3];
- if(mi->precision)
- {
+ if (mi->precision) {
/* calculate the main translation and the precise one separate */
convertViewVec(t, dvec, (mval[0] - mi->precision_mval[0]), (mval[1] - mi->precision_mval[1]));
mul_v3_fl(dvec, 0.1f);
convertViewVec(t, vec, (mi->precision_mval[0] - t->imval[0]), (mi->precision_mval[1] - t->imval[1]));
add_v3_v3v3(output, vec, dvec);
}
- else
- {
+ else {
convertViewVec(t, output, (mval[0] - t->imval[0]), (mval[1] - t->imval[1]));
}
@@ -62,8 +60,7 @@ static void InputVector(TransInfo *t, MouseInput *mi, const int mval[2], float o
static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3])
{
float ratio, precise_ratio, dx, dy;
- if(mi->precision)
- {
+ if (mi->precision) {
/* calculate ratio for shiftkey pos, and for total, and blend these for precision */
dx = (float)(mi->center[0] - mi->precision_mval[0]);
dy = (float)(mi->center[1] - mi->precision_mval[1]);
@@ -75,8 +72,7 @@ static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2],
ratio = (ratio + (precise_ratio - ratio) / 10.0f) / mi->factor;
}
- else
- {
+ else {
dx = (float)(mi->center[0] - mval[0]);
dy = (float)(mi->center[1] - mval[1]);
ratio = (float)sqrt( dx*dx + dy*dy) / mi->factor;
@@ -101,13 +97,11 @@ static void InputSpringFlip(TransInfo *t, MouseInput *mi, const int mval[2], flo
static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3])
{
- if(mi->precision)
- {
+ if (mi->precision) {
output[0] = ( mi->imval[1] - mi->precision_mval[1] ) + ( mi->precision_mval[1] - mval[1] ) * 0.1f;
output[1] = ( mi->precision_mval[0] - mi->imval[0] ) + ( mval[0] - mi->precision_mval[0] ) * 0.1f;
}
- else
- {
+ else {
output[0] = (float)( mi->imval[1] - mval[1] );
output[1] = (float)( mval[0] - mi->imval[0] );
}
@@ -122,8 +116,7 @@ static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const int mval[2]
pad = t->ar->winx / 10;
- if (mi->precision)
- {
+ if (mi->precision) {
/* deal with Shift key by adding motion / 10 to motion before shift press */
x = mi->precision_mval[0] + (float)(mval[0] - mi->precision_mval[0]) / 10.0f;
}
@@ -249,9 +242,8 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2],
* approximate the angle with the opposite side of the normalized triangle
* This is a good approximation here since the smallest acos value seems to be around
* 0.02 degree and lower values don't even have a 0.01% error compared to the approximation
- * */
- if (dphi == 0)
- {
+ */
+ if (dphi == 0) {
double dx, dy;
dx2 /= A;
@@ -267,11 +259,12 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2],
if( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi;
}
- if(mi->precision) dphi = dphi/30.0f;
+ if (mi->precision) {
+ dphi = dphi/30.0f;
+ }
/* if no delta angle, don't update initial position */
- if (dphi != 0)
- {
+ if (dphi != 0) {
mi->imval[0] = mval[0];
mi->imval[1] = mval[1];
}
@@ -385,13 +378,11 @@ void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *, float [3])
void applyMouseInput(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
{
- if (mi->apply != NULL)
- {
+ if (mi->apply != NULL) {
mi->apply(t, mi, mval, output);
}
- if (mi->post)
- {
+ if (mi->post) {
mi->post(t, output);
}
}
@@ -404,16 +395,14 @@ int handleMouseInput(TransInfo *t, MouseInput *mi, wmEvent *event)
{
case LEFTSHIFTKEY:
case RIGHTSHIFTKEY:
- if (event->val==KM_PRESS)
- {
+ if (event->val == KM_PRESS) {
t->modifiers |= MOD_PRECISION;
/* shift is modifier for higher precision transform
* store the mouse position where the normal movement ended */
copy_v2_v2_int(mi->precision_mval, event->mval);
mi->precision = 1;
}
- else
- {
+ else {
t->modifiers &= ~MOD_PRECISION;
mi->precision = 0;
}
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index 296fea75317..9188d048154 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -202,8 +202,7 @@ static int test_rotmode_euler(short rotmode)
int gimbal_axis(Object *ob, float gmat[][3])
{
if (ob) {
- if(ob->mode & OB_MODE_POSE)
- {
+ if (ob->mode & OB_MODE_POSE) {
bPoseChannel *pchan= get_active_posechannel(ob);
if(pchan) {
@@ -222,8 +221,7 @@ int gimbal_axis(Object *ob, float gmat[][3])
/* apply bone transformation */
mul_m3_m3m3(tmat, pchan->bone->bone_mat, mat);
- if (pchan->parent)
- {
+ if (pchan->parent) {
float parent_mat[3][3];
copy_m3_m4(parent_mat, pchan->parent->pose_mat);
@@ -233,8 +231,7 @@ int gimbal_axis(Object *ob, float gmat[][3])
copy_m3_m4(obmat, ob->obmat);
mul_m3_m3m3(gmat, obmat, mat);
}
- else
- {
+ else {
/* needed if object transformation isn't identity */
copy_m3_m4(obmat, ob->obmat);
mul_m3_m3m3(gmat, obmat, tmat);
@@ -255,8 +252,7 @@ int gimbal_axis(Object *ob, float gmat[][3])
return 0;
}
- if (ob->parent)
- {
+ if (ob->parent) {
float parent_mat[3][3];
copy_m3_m4(parent_mat, ob->parent->obmat);
normalize_m3(parent_mat);
@@ -316,8 +312,8 @@ int calc_manipulator_stats(const bContext *C)
BMIter iter;
/* do vertices/edges/faces for center depending on selection
- mode. note we can't use just vertex selection flag because
- it is not flush down on changes */
+ * mode. note we can't use just vertex selection flag because
+ * it is not flush down on changes */
if(ts->selectmode & SCE_SELECT_VERTEX) {
BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
if(!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
@@ -653,14 +649,14 @@ static float screen_aligned(RegionView3D *rv3d, float mat[][4])
}
-/* radring = radius of donut rings
- radhole = radius hole
- start = starting segment (based on nrings)
- end = end segment
- nsides = amount of points in ring
- nrigns = amount of rings
-*/
-static void partial_donut(float radring, float radhole, int start, int end, int nsides, int nrings)
+/* radring = radius of doughnut rings
+ * radhole = radius hole
+ * start = starting segment (based on nrings)
+ * end = end segment
+ * nsides = amount of points in ring
+ * nrigns = amount of rings
+ */
+static void partial_doughnut(float radring, float radhole, int start, int end, int nsides, int nrings)
{
float theta, phi, theta1;
float cos_theta, sin_theta;
@@ -749,10 +745,10 @@ static char axisBlendAngle(float angle)
}
/* three colors can be set;
- grey for ghosting
- moving: in transform theme color
- else the red/green/blue
-*/
+ * grey for ghosting
+ * moving: in transform theme color
+ * else the red/green/blue
+ */
static void manipulator_setcolor(View3D *v3d, char axis, int colcode, unsigned char alpha)
{
unsigned char col[4]= {0};
@@ -883,7 +879,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
if(arcs) {
/* clipplane makes nice handles, calc here because of multmatrix but with translate! */
- VECCOPY(plane, rv3d->viewinv[2]); /* float -> double */
+ copy_v3db_v3fl(plane, rv3d->viewinv[2]);
plane[3]= -0.02f*size; // clip just a bit more
glClipPlane(GL_CLIP_PLANE0, plane);
}
@@ -1024,7 +1020,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
preOrthoFront(ortho, rv3d->twmat, 2);
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
manipulator_setcolor(v3d, 'Z', colcode, 255);
- partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
+ partial_doughnut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
postOrtho(ortho);
}
/* X circle */
@@ -1033,7 +1029,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
glRotatef(90.0, 0.0, 1.0, 0.0);
manipulator_setcolor(v3d, 'X', colcode, 255);
- partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
+ partial_doughnut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
glRotatef(-90.0, 0.0, 1.0, 0.0);
postOrtho(ortho);
}
@@ -1043,7 +1039,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
glRotatef(-90.0, 1.0, 0.0, 0.0);
manipulator_setcolor(v3d, 'Y', colcode, 255);
- partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
+ partial_doughnut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
glRotatef(90.0, 1.0, 0.0, 0.0);
postOrtho(ortho);
}
@@ -1060,7 +1056,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
manipulator_setcolor(v3d, 'Z', colcode, 255);
- partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64);
+ partial_doughnut(0.7f*cusize, 1.0f, 31, 33, 8, 64);
glPopMatrix();
postOrtho(ortho);
@@ -1075,7 +1071,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
glRotatef(90.0, 1.0, 0.0, 0.0);
glRotatef(90.0, 0.0, 0.0, 1.0);
- partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64);
+ partial_doughnut(0.7f*cusize, 1.0f, 31, 33, 8, 64);
glPopMatrix();
postOrtho(ortho);
@@ -1090,7 +1086,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
glRotatef(-90.0, 0.0, 1.0, 0.0);
glRotatef(90.0, 0.0, 0.0, 1.0);
- partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64);
+ partial_doughnut(0.7f*cusize, 1.0f, 31, 33, 8, 64);
glPopMatrix();
postOrtho(ortho);
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 34ded8cdbf8..69d29633972 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -598,9 +598,9 @@ void TRANSFORM_OT_tilt(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Tilt";
- /*optionals -
- "Tilt selected vertices"
- "Specify an extra axis rotation for selected vertices of 3d curve" */
+ /* optionals -
+ * "Tilt selected vertices"
+ * "Specify an extra axis rotation for selected vertices of 3d curve" */
ot->description= "Tilt selected control vertices of 3d curve";
ot->idname = OP_TILT;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 957dce97c02..ee5182c1a5f 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -122,8 +122,7 @@ void BIF_createTransformOrientation(bContext *C, ReportList *reports, char *name
ts = createObjectSpace(C, reports, name, overwrite);
}
- if (use && ts != NULL)
- {
+ if (use && ts != NULL) {
BIF_selectTransformOrientation(C, ts);
}
}
@@ -144,8 +143,7 @@ TransformOrientation *createObjectSpace(bContext *C, ReportList *UNUSED(reports)
normalize_m3(mat);
/* use object name if no name is given */
- if (name[0] == 0)
- {
+ if (name[0] == 0) {
strncpy(name, ob->id.name+2, MAX_ID_NAME-2);
}
@@ -164,8 +162,7 @@ TransformOrientation *createBoneSpace(bContext *C, ReportList *reports, char *na
return NULL;
}
- if (name[0] == 0)
- {
+ if (name[0] == 0) {
strcpy(name, "Bone");
}
@@ -188,8 +185,7 @@ TransformOrientation *createMeshSpace(bContext *C, ReportList *reports, char *na
return NULL;
}
- if (name[0] == 0)
- {
+ if (name[0] == 0) {
strcpy(name, "Vertex");
}
break;
@@ -199,8 +195,7 @@ TransformOrientation *createMeshSpace(bContext *C, ReportList *reports, char *na
return NULL;
}
- if (name[0] == 0)
- {
+ if (name[0] == 0) {
strcpy(name, "Edge");
}
break;
@@ -210,8 +205,7 @@ TransformOrientation *createMeshSpace(bContext *C, ReportList *reports, char *na
return NULL;
}
- if (name[0] == 0)
- {
+ if (name[0] == 0) {
strcpy(name, "Face");
}
break;
@@ -254,8 +248,7 @@ int createSpaceNormalTangent(float mat[3][3], float normal[3], float tangent[3])
}
/* preempt zero length tangent from causing trouble */
- if (tangent[0] == 0 && tangent[1] == 0 && tangent[2] == 0)
- {
+ if (tangent[0] == 0 && tangent[1] == 0 && tangent[2] == 0) {
tangent[2] = 1;
}
@@ -276,18 +269,15 @@ TransformOrientation* addMatrixSpace(bContext *C, float mat[3][3], char name[],
ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces;
TransformOrientation *ts = NULL;
- if (overwrite)
- {
+ if (overwrite) {
ts = findOrientationName(transform_spaces, name);
}
- else
- {
+ else {
uniqueOrientationName(transform_spaces, name);
}
/* if not, create a new one */
- if (ts == NULL)
- {
+ if (ts == NULL) {
ts = MEM_callocN(sizeof(TransformOrientation), "UserTransSpace from matrix");
BLI_addtail(transform_spaces, ts);
strncpy(ts->name, name, sizeof(ts->name));
@@ -536,8 +526,7 @@ void initTransformOrientation(bContext *C, TransInfo *t)
break;
case V3D_MANIP_VIEW:
- if (t->ar->regiontype == RGN_TYPE_WINDOW)
- {
+ if (t->ar->regiontype == RGN_TYPE_WINDOW) {
RegionView3D *rv3d = t->ar->regiondata;
float mat[3][3];
@@ -546,8 +535,7 @@ void initTransformOrientation(bContext *C, TransInfo *t)
normalize_m3(mat);
copy_m3_m3(t->spacemtx, mat);
}
- else
- {
+ else {
unit_m3(t->spacemtx);
}
break;
@@ -569,8 +557,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
normal[0] = normal[1] = normal[2] = 0;
plane[0] = plane[1] = plane[2] = 0;
- if(obedit)
- {
+ if (obedit) {
float imat[3][3], mat[3][3];
/* we need the transpose of the inverse for a normal... */
@@ -581,8 +568,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
ob= obedit;
- if(ob->type==OB_MESH)
- {
+ if (ob->type==OB_MESH) {
Mesh *me= ob->data;
BMEditMesh *em = me->edit_btmesh;
BMVert *eve;
@@ -590,8 +576,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
float vec[3]= {0,0,0};
/* USE LAST SELECTED WITH ACTIVE */
- if (activeOnly && EDBM_get_actSelection(em, &ese))
- {
+ if (activeOnly && EDBM_get_actSelection(em, &ese)) {
EDBM_editselection_normal(normal, &ese);
EDBM_editselection_plane(em, plane, &ese);
@@ -608,10 +593,8 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
break;
}
}
- else
- {
- if (em->bm->totfacesel >= 1)
- {
+ else {
+ if (em->bm->totfacesel >= 1) {
BMFace *efa;
BMIter iter;
@@ -627,8 +610,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
result = ORIENTATION_FACE;
}
- else if (em->bm->totvertsel == 3)
- {
+ else if (em->bm->totvertsel == 3) {
BMVert *v1 = NULL, *v2 = NULL, *v3 = NULL;
BMIter iter;
float cotangent[3];
@@ -653,8 +635,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
}
/* if there's an edge available, use that for the tangent */
- if (em->bm->totedgesel >= 1)
- {
+ if (em->bm->totedgesel >= 1) {
BMEdge *eed = NULL;
BMIter iter;
@@ -668,8 +649,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
result = ORIENTATION_FACE;
}
- else if (em->bm->totedgesel == 1)
- {
+ else if (em->bm->totedgesel == 1) {
BMEdge *eed = NULL;
BMIter iter;
@@ -684,8 +664,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
}
result = ORIENTATION_EDGE;
}
- else if (em->bm->totvertsel == 2)
- {
+ else if (em->bm->totvertsel == 2) {
BMVert *v1 = NULL, *v2 = NULL;
BMIter iter;
@@ -706,8 +685,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
}
result = ORIENTATION_EDGE;
}
- else if (em->bm->totvertsel == 1)
- {
+ else if (em->bm->totvertsel == 1) {
BMIter iter;
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
@@ -718,8 +696,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
}
result = ORIENTATION_VERT;
}
- else if (em->bm->totvertsel > 3)
- {
+ else if (em->bm->totvertsel > 3) {
BMIter iter;
normal[0] = normal[1] = normal[2] = 0.0f;
@@ -733,40 +710,32 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
}
}
} /* end editmesh */
- else if ELEM(obedit->type, OB_CURVE, OB_SURF)
- {
+ else if ELEM(obedit->type, OB_CURVE, OB_SURF) {
Curve *cu= obedit->data;
Nurb *nu;
BezTriple *bezt;
int a;
ListBase *nurbs= curve_editnurbs(cu);
- for (nu = nurbs->first; nu; nu = nu->next)
- {
+ for (nu = nurbs->first; nu; nu = nu->next) {
/* only bezier has a normal */
- if(nu->type == CU_BEZIER)
- {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
while(a--)
{
/* exception */
- if ( (bezt->f1 & SELECT) + (bezt->f2 & SELECT) + (bezt->f3 & SELECT) > SELECT )
- {
+ if ((bezt->f1 & SELECT) + (bezt->f2 & SELECT) + (bezt->f3 & SELECT) > SELECT) {
sub_v3_v3v3(normal, bezt->vec[0], bezt->vec[2]);
}
- else
- {
- if(bezt->f1)
- {
+ else {
+ if (bezt->f1) {
sub_v3_v3v3(normal, bezt->vec[0], bezt->vec[1]);
}
- if(bezt->f2)
- {
+ if (bezt->f2) {
sub_v3_v3v3(normal, bezt->vec[0], bezt->vec[2]);
}
- if(bezt->f3)
- {
+ if (bezt->f3) {
sub_v3_v3v3(normal, bezt->vec[1], bezt->vec[2]);
}
}
@@ -775,36 +744,30 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
}
}
- if (normal[0] != 0 || normal[1] != 0 || normal[2] != 0)
- {
+ if (normal[0] != 0 || normal[1] != 0 || normal[2] != 0) {
result = ORIENTATION_NORMAL;
}
}
- else if(obedit->type==OB_MBALL)
- {
+ else if(obedit->type==OB_MBALL){
#if 0 // XXX
/* editmball.c */
extern ListBase editelems; /* go away ! */
MetaElem *ml, *ml_sel = NULL;
/* loop and check that only one element is selected */
- for (ml = editelems.first; ml; ml = ml->next)
- {
+ for (ml = editelems.first; ml; ml = ml->next) {
if (ml->flag & SELECT) {
- if (ml_sel == NULL)
- {
+ if (ml_sel == NULL) {
ml_sel = ml;
}
- else
- {
+ else {
ml_sel = NULL;
break;
}
}
}
- if (ml_sel)
- {
+ if (ml_sel) {
float mat[4][4];
/* Rotation of MetaElem is stored in quat */
@@ -819,16 +782,13 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
#endif
}
- else if (obedit->type == OB_ARMATURE)
- {
+ else if (obedit->type == OB_ARMATURE) {
bArmature *arm = obedit->data;
EditBone *ebone;
for (ebone = arm->edbo->first; ebone; ebone=ebone->next) {
- if (arm->layer & ebone->layer)
- {
- if (ebone->flag & BONE_SELECTED)
- {
+ if (arm->layer & ebone->layer) {
+ if (ebone->flag & BONE_SELECTED) {
float tmat[3][3];
float vec[3];
sub_v3_v3v3(vec, ebone->tail, ebone->head);
@@ -844,27 +804,23 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
normalize_v3(normal);
normalize_v3(plane);
- if (plane[0] != 0 || plane[1] != 0 || plane[2] != 0)
- {
+ if (plane[0] != 0 || plane[1] != 0 || plane[2] != 0) {
result = ORIENTATION_EDGE;
}
}
/* Vectors from edges don't need the special transpose inverse multiplication */
- if (result == ORIENTATION_EDGE)
- {
+ if (result == ORIENTATION_EDGE) {
mul_mat3_m4_v3(ob->obmat, normal);
mul_mat3_m4_v3(ob->obmat, plane);
}
- else
- {
+ else {
mul_m3_v3(mat, normal);
mul_m3_v3(mat, plane);
}
}
- else if(ob && (ob->mode & OB_MODE_POSE))
- {
+ else if(ob && (ob->mode & OB_MODE_POSE)) {
bArmature *arm= ob->data;
bPoseChannel *pchan;
int totsel;
@@ -893,8 +849,8 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
result = ORIENTATION_EDGE;
}
}
- else if(ob && (ob->mode & (OB_MODE_ALL_PAINT|OB_MODE_PARTICLE_EDIT)))
- {
+ else if(ob && (ob->mode & (OB_MODE_ALL_PAINT|OB_MODE_PARTICLE_EDIT))) {
+ /* pass */
}
else {
/* we need the one selected object, if its not active */
@@ -932,33 +888,28 @@ void ED_getTransformOrientationMatrix(const bContext *C, float orientation_mat[]
switch (type)
{
case ORIENTATION_NORMAL:
- if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0)
- {
+ if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) {
type = ORIENTATION_NONE;
}
break;
case ORIENTATION_VERT:
- if (createSpaceNormal(orientation_mat, normal) == 0)
- {
+ if (createSpaceNormal(orientation_mat, normal) == 0) {
type = ORIENTATION_NONE;
}
break;
case ORIENTATION_EDGE:
- if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0)
- {
+ if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) {
type = ORIENTATION_NONE;
}
break;
case ORIENTATION_FACE:
- if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0)
- {
+ if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) {
type = ORIENTATION_NONE;
}
break;
}
- if (type == ORIENTATION_NONE)
- {
+ if (type == ORIENTATION_NONE) {
unit_m3(orientation_mat);
}
}
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index c17667cd639..c4e871f83c5 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -198,11 +198,9 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
if(v3d->zbuf)
glEnable(GL_DEPTH_TEST);
}
- else if (t->spacetype==SPACE_IMAGE)
- {
- /*This will not draw, and Im nor sure why - campbell */
-
- /*
+ else if (t->spacetype==SPACE_IMAGE) {
+ /* This will not draw, and Im nor sure why - campbell */
+#if 0
float xuser_asp, yuser_asp;
int wi, hi;
float w, h;
@@ -230,7 +228,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
glTranslatef(-t->tsnap.snapPoint[0], -t->tsnap.snapPoint[1], 0.0f);
setlinestyle(0);
- */
+#endif
}
}
@@ -289,8 +287,7 @@ void applyProject(TransInfo *t)
Object *ob = t->obedit?t->obedit:t->poseobj;
mul_m4_v3(ob->obmat, iloc);
}
- else if (t->flag & T_OBJECT)
- {
+ else if (t->flag & T_OBJECT) {
td->ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
object_handle_update(t->scene, td->ob);
copy_v3_v3(iloc, td->ob->obmat[3]);
@@ -328,8 +325,7 @@ void applySnapping(TransInfo *t, float *vec)
t->tsnap.applySnap(t, vec);
}
- else if ((t->tsnap.mode != SCE_SNAP_MODE_INCREMENT) && activeSnap(t))
- {
+ else if ((t->tsnap.mode != SCE_SNAP_MODE_INCREMENT) && activeSnap(t)) {
double current = PIL_check_seconds_timer();
// Time base quirky code to go around findnearest slowness
@@ -389,8 +385,7 @@ static void initSnappingMode(TransInfo *t)
Scene *scene = t->scene;
/* force project off when not supported */
- if (ts->snap_mode != SCE_SNAP_MODE_FACE)
- {
+ if (ts->snap_mode != SCE_SNAP_MODE_FACE) {
t->tsnap.project = 0;
}
@@ -405,12 +400,10 @@ static void initSnappingMode(TransInfo *t)
(obedit != NULL && ELEM4(obedit->type, OB_MESH, OB_ARMATURE, OB_CURVE, OB_LATTICE)) ) // Temporary limited to edit mode meshes, armature, curves
{
/* Exclude editmesh if using proportional edit */
- if ((obedit->type == OB_MESH) && (t->flag & T_PROP_EDIT))
- {
+ if ((obedit->type == OB_MESH) && (t->flag & T_PROP_EDIT)) {
t->tsnap.modeSelect = SNAP_NOT_OBEDIT;
}
- else
- {
+ else {
t->tsnap.modeSelect = t->tsnap.snap_self ? SNAP_ALL : SNAP_NOT_OBEDIT;
}
}
@@ -426,14 +419,12 @@ static void initSnappingMode(TransInfo *t)
{
t->tsnap.modeSelect = SNAP_NOT_SELECTED;
}
- else
- {
+ else {
/* Grid if snap is not possible */
t->tsnap.mode = SCE_SNAP_MODE_INCREMENT;
}
}
- else
- {
+ else {
/* Always grid outside of 3D view */
t->tsnap.mode = SCE_SNAP_MODE_INCREMENT;
}
@@ -484,10 +475,8 @@ void initSnapping(TransInfo *t, wmOperator *op)
}
}
/* use scene defaults only when transform is modal */
- else if (t->flag & T_MODAL)
- {
- if(ELEM(t->spacetype, SPACE_VIEW3D, SPACE_IMAGE))
- {
+ else if (t->flag & T_MODAL) {
+ if(ELEM(t->spacetype, SPACE_VIEW3D, SPACE_IMAGE)) {
if (ts->snap_flag & SCE_SNAP) {
t->modifiers |= MOD_SNAP;
}
@@ -832,23 +821,20 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
}
}
/* otherwise, pair first with second and so on */
- else
- {
+ else {
for (p2 = p1->next; p2 && p2->ob != p1->ob; p2 = p2->next)
{
/* nothing to do here */
}
}
- if (p2)
- {
+ if (p2) {
p2->flag = 1;
add_v3_v3v3(vec, p1->p, p2->p);
mul_v3_fl(vec, 0.5f);
}
- else
- {
+ else {
copy_v3_v3(vec, p1->p);
}
@@ -861,8 +847,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
new_dist = len_v3v3(last_p, vec);
- if (new_dist < max_dist)
- {
+ if (new_dist < max_dist) {
copy_v3_v3(p, vec);
max_dist = new_dist;
}
@@ -881,13 +866,11 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
BLI_freelistN(&depth_peels);
}
- else
- {
+ else {
found = snapObjectsTransform(t, mval, &dist, loc, no, t->tsnap.modeSelect);
}
- if (found == 1)
- {
+ if (found == 1) {
float tangent[3];
sub_v3_v3v3(tangent, loc, t->tsnap.snapPoint);
@@ -903,13 +886,11 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
t->tsnap.status |= POINT_INIT;
}
- else
- {
+ else {
t->tsnap.status &= ~POINT_INIT;
}
}
- else if (t->spacetype == SPACE_IMAGE && t->obedit != NULL && t->obedit->type==OB_MESH)
- { /* same as above but for UV's */
+ else if (t->spacetype == SPACE_IMAGE && t->obedit != NULL && t->obedit->type==OB_MESH) {
/* same as above but for UV's */
Image *ima= ED_space_image(t->sa->spacedata.first);
float aspx, aspy, co[2];
@@ -924,8 +905,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
t->tsnap.status |= POINT_INIT;
}
- else
- {
+ else {
t->tsnap.status &= ~POINT_INIT;
}
}
@@ -978,8 +958,7 @@ static void TargetSnapActive(TransInfo *t)
t->tsnap.status |= TARGET_INIT;
}
/* No active, default to median */
- else
- {
+ else {
t->tsnap.target = SCE_SNAP_TARGET_MEDIAN;
t->tsnap.targetSnap = TargetSnapMedian;
TargetSnapMedian(t);
@@ -1044,8 +1023,7 @@ static void TargetSnapClosest(TransInfo *t)
dist = t->tsnap.distance(t, loc, t->tsnap.snapPoint);
- if (closest == NULL || fabs(dist) < fabs(t->tsnap.dist))
- {
+ if (closest == NULL || fabs(dist) < fabs(t->tsnap.dist)) {
copy_v3_v3(t->tsnap.snapTarget, loc);
closest = td;
t->tsnap.dist = dist;
@@ -1053,8 +1031,7 @@ static void TargetSnapClosest(TransInfo *t)
}
}
/* use element center otherwise */
- else
- {
+ else {
float loc[3];
float dist;
@@ -1071,11 +1048,9 @@ static void TargetSnapClosest(TransInfo *t)
}
}
}
- else
- {
+ else {
int i;
- for(td = t->data, i = 0 ; i < t->total && td->flag & TD_SELECTED ; i++, td++)
- {
+ for(td = t->data, i = 0 ; i < t->total && td->flag & TD_SELECTED ; i++, td++) {
float loc[3];
float dist;
@@ -1325,8 +1300,7 @@ static int snapArmature(short snap_mode, ARegion *ar, Object *ob, bArmature *arm
}
}
}
- else if (ob->pose && ob->pose->chanbase.first)
- {
+ else if (ob->pose && ob->pose->chanbase.first) {
bPoseChannel *pchan;
Bone *bone;
@@ -1447,21 +1421,17 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
if (em != NULL)
{
- if (index_array)
- {
+ if (index_array) {
index = index_array[i];
}
- else
- {
+ else {
index = i;
}
- if (index == ORIGINDEX_NONE)
- {
+ if (index == ORIGINDEX_NONE) {
test = 0;
}
- else
- {
+ else {
efa = EDBM_get_face_for_index(em, index);
if (efa && BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
@@ -1529,23 +1499,18 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
test = 1; /* reset for every vert */
- if (em != NULL)
- {
- if (index_array)
- {
+ if (em != NULL) {
+ if (index_array) {
index = index_array[i];
}
- else
- {
+ else {
index = i;
}
- if (index == ORIGINDEX_NONE)
- {
+ if (index == ORIGINDEX_NONE) {
test = 0;
}
- else
- {
+ else {
eve = EDBM_get_vert_for_index(em, index);
if (eve && (BM_elem_flag_test(eve, BM_ELEM_HIDDEN) || BM_elem_flag_test(eve, BM_ELEM_SELECT)))
@@ -1591,21 +1556,17 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
if (em != NULL)
{
- if (index_array)
- {
+ if (index_array) {
index = index_array[i];
}
- else
- {
+ else {
index = i;
}
- if (index == ORIGINDEX_NONE)
- {
+ if (index == ORIGINDEX_NONE) {
test = 0;
}
- else
- {
+ else {
eed = EDBM_get_edge_for_index(em, index);
if (eed && (BM_elem_flag_test(eed, BM_ELEM_HIDDEN) ||
@@ -1648,14 +1609,12 @@ static int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, flo
BMEditMesh *em;
DerivedMesh *dm;
- if (editobject)
- {
+ if (editobject) {
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 */
}
- else
- {
+ else {
em = NULL;
dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
}
@@ -1664,8 +1623,7 @@ static int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, flo
dm->release(dm);
}
- else if (ob->type == OB_ARMATURE)
- {
+ else if (ob->type == OB_ARMATURE) {
retval = snapArmature(ts->snap_mode, ar, ob, ob->data, obmat, ray_start, ray_normal, mval, r_loc, r_no, r_dist, r_depth);
}
@@ -1682,8 +1640,7 @@ static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, c
ED_view3d_win_to_ray(ar, v3d, mval, ray_start, ray_normal);
- if (mode == SNAP_ALL && obedit)
- {
+ if (mode == SNAP_ALL && obedit) {
Object *ob = obedit;
retval |= snapObject(scene, ar, ob, 1, ob->obmat, ray_start, ray_normal, mval, r_loc, r_no, r_dist, &depth);
@@ -1695,8 +1652,7 @@ static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, c
* To solve that problem, we do it first as an exception.
* */
base= BASACT;
- if(base && base->object && base->object->mode & OB_MODE_PARTICLE_EDIT)
- {
+ if (base && base->object && base->object->mode & OB_MODE_PARTICLE_EDIT) {
Object *ob = base->object;
retval |= snapObject(scene, ar, ob, 0, ob->obmat, ray_start, ray_normal, mval, r_loc, r_no, r_dist, &depth);
}
@@ -1710,8 +1666,7 @@ static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, c
{
Object *ob = base->object;
- if (ob->transflag & OB_DUPLI)
- {
+ if (ob->transflag & OB_DUPLI) {
DupliObject *dupli_ob;
ListBase *lb = object_duplilist(scene, ob);
@@ -1754,12 +1709,10 @@ static int cmpPeel(void *arg1, void *arg2)
DepthPeel *p2 = arg2;
int val = 0;
- if (p1->depth < p2->depth)
- {
+ if (p1->depth < p2->depth) {
val = -1;
}
- else if (p1->depth > p2->depth)
- {
+ else if (p1->depth > p2->depth) {
val = 1;
}
@@ -1773,13 +1726,11 @@ static void removeDoublesPeel(ListBase *depth_peels)
for (peel = depth_peels->first; peel; peel = peel->next)
{
DepthPeel *next_peel = peel->next;
-
- if (next_peel && ABS(peel->depth - next_peel->depth) < 0.0015f)
- {
+
+ if (next_peel && ABS(peel->depth - next_peel->depth) < 0.0015f) {
peel->next = next_peel->next;
- if (next_peel->next)
- {
+ if (next_peel->next) {
next_peel->next->prev = peel;
}
@@ -1875,8 +1826,7 @@ static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4],
addDepthPeel(depth_peels, new_depth, location, normal, ob);
}
- if (f->v4 && result == 0)
- {
+ if (f->v4 && result == 0) {
result = isect_ray_tri_threshold_v3(ray_start_local, ray_normal_local, verts[f->v3].co, verts[f->v4].co, verts[f->v1].co, &lambda, NULL, 0.001);
if (result) {
@@ -1920,12 +1870,11 @@ static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, L
ED_view3d_win_to_ray(ar, v3d, mval, ray_start, ray_normal);
- for ( base = scene->base.first; base != NULL; base = base->next ) {
+ for (base = scene->base.first; base != NULL; base = base->next) {
if ( BASE_SELECTABLE(v3d, base) ) {
Object *ob = base->object;
- if (ob->transflag & OB_DUPLI)
- {
+ if (ob->transflag & OB_DUPLI) {
DupliObject *dupli_ob;
ListBase *lb = object_duplilist(scene, ob);
@@ -1939,14 +1888,12 @@ static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, L
DerivedMesh *dm = NULL;
int val;
- if (dob != obedit)
- {
+ if (dob != obedit) {
dm = mesh_get_derived_final(scene, dob, CD_MASK_BAREMESH);
val = peelDerivedMesh(dob, dm, dob->obmat, ray_start, ray_normal, mval, depth_peels);
}
- else
- {
+ else {
em = ((Mesh *)dob->data)->edit_mesh;
dm = editmesh_get_derived_cage(scene, obedit, em, CD_MASK_BAREMESH);
@@ -1968,14 +1915,12 @@ static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, L
DerivedMesh *dm = NULL;
int val;
- if (ob != obedit)
- {
+ if (ob != obedit) {
dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
val = peelDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, depth_peels);
}
- else
- {
+ else {
em = BMEdit_FromObject(ob);
dm = editbmesh_get_derived_cage(scene, obedit, em, CD_MASK_BAREMESH);
diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c
index 5ead0959d5c..06309293f9a 100644
--- a/source/blender/editors/util/crazyspace.c
+++ b/source/blender/editors/util/crazyspace.c
@@ -80,7 +80,7 @@ static void make_vertexcos__mapFunc(void *userData, int index, float *co, float
vec+= 3*index;
if(!mappedData->flags[index]) {
/* we need coord from prototype vertex, not it clones or images,
- suppose they stored in the beginning of vertex array stored in DM */
+ * suppose they stored in the beginning of vertex array stored in DM */
copy_v3_v3(vec, co);
mappedData->flags[index]= 1;
}
@@ -153,7 +153,7 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float *origcos, float *mapped
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_VERT, v) {
- BMLoop *l2 = BM_face_other_loop(l->e, l->f, v);
+ BMLoop *l2 = BM_face_other_edge_loop(l->f, l->e, v);
/* retrieve mapped coordinates */
v1= mappedcos + 3*BM_elem_index_get(l->v);
@@ -334,8 +334,8 @@ int editbmesh_get_first_deform_matrices(Scene *scene, Object *ob, BMEditMesh *em
md = modifiers_getVirtualModifierList(ob);
/* compute the deformation matrices and coordinates for the first
- modifiers with on cage editing that are enabled and support computing
- deform matrices */
+ * modifiers with on cage editing that are enabled and support computing
+ * deform matrices */
for(i = 0; md && i <= cageIndex; i++, md = md->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
@@ -436,7 +436,7 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3
if(totleft) {
/* there are deformation modifier which doesn't support deformation matrices
- calculation. Need additional crazyspace correction */
+ * calculation. Need additional crazyspace correction */
float (*deformedVerts)[3]= *deformcos;
float (*origVerts)[3]= MEM_dupallocN(deformedVerts);
@@ -452,7 +452,7 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3
if(mti->type==eModifierTypeType_OnlyDeform) {
/* skip leading modifiers which have been already
- handled in sculpt_get_first_deform_matrices */
+ * handled in sculpt_get_first_deform_matrices */
if(mti->deformMatrices && !deformed)
continue;
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index 61b1dece957..15dced2f448 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -73,8 +73,8 @@ void ED_editors_init(bContext *C)
ID *data;
/* toggle on modes for objects that were saved with these enabled. for
- e.g. linked objects we have to ensure that they are actually the
- active object in this scene. */
+ * e.g. linked objects we have to ensure that they are actually the
+ * active object in this scene. */
for(ob=bmain->object.first; ob; ob=ob->id.next) {
int mode= ob->mode;
diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c
index 4776cf0af53..8c0eb06be67 100644
--- a/source/blender/editors/util/editmode_undo.c
+++ b/source/blender/editors/util/editmode_undo.c
@@ -59,25 +59,23 @@
/* ***************** generic editmode undo system ********************* */
/*
+ * Add this in your local code:
+ *
+ * void undo_editmode_push(bContext *C, const char *name,
+ * void * (*getdata)(bContext *C), // use context to retrieve current editdata
+ * void (*freedata)(void *), // pointer to function freeing data
+ * void (*to_editmode)(void *, void *), // data to editmode conversion
+ * void * (*from_editmode)(void *)) // editmode to data conversion
+ * int (*validate_undo)(void *, void *)) // check if undo data is still valid
+ *
+ *
+ * Further exported for UI is:
+ *
+ * void undo_editmode_step(bContext *C, int step); // undo and redo
+ * void undo_editmode_clear(void) // free & clear all data
+ * void undo_editmode_menu(void) // history menu
+ */
-Add this in your local code:
-
-void undo_editmode_push(bContext *C, const char *name,
- void * (*getdata)(bContext *C), // use context to retrieve current editdata
- void (*freedata)(void *), // pointer to function freeing data
- void (*to_editmode)(void *, void *), // data to editmode conversion
- void * (*from_editmode)(void *)) // editmode to data conversion
- int (*validate_undo)(void *, void *)) // check if undo data is still valid
-
-
-Further exported for UI is:
-
-void undo_editmode_step(bContext *C, int step); // undo and redo
-void undo_editmode_clear(void) // free & clear all data
-void undo_editmode_menu(void) // history menu
-
-
-*/
/* ********************************************************************* */
/* ****** XXX ***** */
@@ -128,8 +126,8 @@ void undo_editmode_push(bContext *C, const char *name,
int nr;
uintptr_t memused, totmem, maxmem;
- /* at first here was code to prevent an "original" key to be insterted twice
- this was giving conflicts for example when mesh changed due to keys or apply */
+ /* at first here was code to prevent an "original" key to be inserted twice
+ * this was giving conflicts for example when mesh changed due to keys or apply */
/* remove all undos after (also when curundo==NULL) */
while(undobase.last != curundo) {
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index 52422d37f29..a477a11e6c7 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -148,12 +148,10 @@ void applyNumInput(NumInput *n, float *vec)
vec[j] = 0.0001f;
}
else {
- if (n->inv[i])
- {
+ if (n->inv[i]) {
vec[j] = 1.0f / n->val[i];
}
- else
- {
+ else {
vec[j] = n->val[i];
}
}
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c
index db71f74b8e1..66ba28e70a6 100644
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@ -661,12 +661,14 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
}
glEnd();
- /*glBegin(GL_LINE_STRIP);
+#if 0
+ glBegin(GL_LINE_STRIP);
luv = CustomData_bmesh_get(&em->bm->ldata, efa->lbase->head.data, CD_MLOOPUV);
glVertex2fv(luv->uv);
luv = CustomData_bmesh_get(&em->bm->ldata, efa->lbase->next->head.data, CD_MLOOPUV);
glVertex2fv(luv->uv);
- glEnd();*/
+ glEnd();
+#endif
setlinestyle(0);
}
@@ -900,8 +902,10 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
index += stitch_preview->uvs_per_polygon[i];
}
glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
- /*UI_ThemeColor4(TH_STITCH_PREVIEW_VERT);
- glDrawArrays(GL_TRIANGLES, 0, stitch_preview->num_tris*3);*/
+#if 0
+ UI_ThemeColor4(TH_STITCH_PREVIEW_VERT);
+ glDrawArrays(GL_TRIANGLES, 0, stitch_preview->num_tris*3);
+#endif
glDisable(GL_BLEND);
/* draw vert preview */
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 42e6ec39e46..28981d55793 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -1100,8 +1100,6 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit
select= 1;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
-
a = 0;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
iterv1= uv_vertex_map_get(vmap, efa, a);
@@ -2348,9 +2346,11 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
vmap= EDBM_make_uv_vert_map(em, 0, 0, limit);
/* verts are numbered above in make_uv_vert_map_EM, make sure this stays true! */
- /*for(a=0, eve= em->verts.first; eve; a++, eve= eve->next)
- eve->tmp.l = a; */
-
+ /* BMESH_TODO - why keep this commented? - campbell */
+#if 0
+ for(a=0, eve= em->verts.first; eve; a++, eve= eve->next)
+ eve->tmp.l = a;
+#endif
if(vmap == NULL) {
return;
}
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index 49bfb786f20..d6035b08fd6 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -219,10 +219,10 @@ typedef struct PHandle {
/* PHash
- - special purpose hash that keeps all its elements in a single linked list.
- - after construction, this hash is thrown away, and the list remains.
- - removing elements is not possible efficiently.
-*/
+ * - special purpose hash that keeps all its elements in a single linked list.
+ * - after construction, this hash is thrown away, and the list remains.
+ * - removing elements is not possible efficiently.
+ */
static int PHashSizes[] = {
1, 3, 5, 11, 17, 37, 67, 131, 257, 521, 1031, 2053, 4099, 8209,
@@ -497,7 +497,7 @@ static PBool p_intersect_line_2d(float *v1, float *v2, float *v3, float *v4, flo
if (!p_intersect_line_2d_dir(v1, dir1, v2, dir2, isect)) {
/* parallel - should never happen in theory for polygon kernel, but
- let's give a point nearby in case things go wrong */
+ * let's give a point nearby in case things go wrong */
isect[0] = (v1[0] + v2[0])*0.5f;
isect[1] = (v1[1] + v2[1])*0.5f;
return P_FALSE;
@@ -1121,9 +1121,9 @@ static PBool p_quad_split_direction(PHandle *handle, float **co, PHashKey *vkeys
PBool dir = (fac <= 0.0f);
/* the face exists check is there because of a special case: when
- two quads share three vertices, they can each be split into two
- triangles, resulting in two identical triangles. for example in
- suzanne's nose. */
+ * two quads share three vertices, they can each be split into two
+ * triangles, resulting in two identical triangles. for example in
+ * suzanne's nose. */
if (dir) {
if (p_face_exists(handle,vkeys,0,1,2) || p_face_exists(handle,vkeys,0,2,3))
return !dir;
@@ -1536,8 +1536,8 @@ static void p_vert_harmonic_insert(PVert *v)
if (!p_vert_map_harmonic_weights(v)) {
/* do polygon kernel center insertion: this is quite slow, but should
- only be needed for 0.01 % of verts or so, when insert with harmonic
- weights fails */
+ * only be needed for 0.01 % of verts or so, when insert with harmonic
+ * weights fails */
int npoints = 0, i;
float (*points)[2];
@@ -1759,7 +1759,7 @@ static PBool p_collapse_allowed_topologic(PEdge *edge, PEdge *pair)
return P_FALSE;
}
/* avoid merging two boundaries (oldv and keepv are on the 'other side' of
- the chart) */
+ * the chart) */
else if (!p_vert_interior(oldv) && !p_vert_interior(keepv))
return P_FALSE;
@@ -1870,7 +1870,7 @@ static PBool p_collapse_allowed(PEdge *edge, PEdge *pair)
static float p_collapse_cost(PEdge *edge, PEdge *pair)
{
/* based on volume and boundary optimization from:
- "Fast and Memory Efficient Polygonal Simplification" P. Lindstrom, G. Turk */
+ * "Fast and Memory Efficient Polygonal Simplification" P. Lindstrom, G. Turk */
PVert *oldv, *keepv;
PEdge *e;
@@ -2036,7 +2036,7 @@ static void p_chart_post_collapse_flush(PChart *chart, PEdge *collapsed)
}
/* these are added last so they can be popped of in the right order
- for splitting */
+ * for splitting */
for (e=collapsed; e; e=e->nextlink) {
e->nextlink = e->u.nextcollapse;
laste = e;
@@ -2098,9 +2098,9 @@ static void p_chart_post_split_flush(PChart *chart)
static void p_chart_simplify_compute(PChart *chart)
{
/* Computes a list of edge collapses / vertex splits. The collapsed
- simplices go in the chart->collapsed_* lists, The original and
- collapsed may then be view as stacks, where the next collapse/split
- is at the top of the respective lists. */
+ * simplices go in the chart->collapsed_* lists, The original and
+ * collapsed may then be view as stacks, where the next collapse/split
+ * is at the top of the respective lists. */
Heap *heap = BLI_heap_new();
PVert *v, **wheelverts;
@@ -2320,7 +2320,7 @@ static float p_abf_compute_sin_product(PAbfSystem *sys, PVert *v, int aid)
if (aid == e1->u.id) {
/* we are computing a derivative for this angle,
- so we use cos and drop the other part */
+ * so we use cos and drop the other part */
sin1 *= sys->cosine[e1->u.id];
sin2 = 0.0;
}
@@ -2810,7 +2810,7 @@ static PBool p_chart_symmetry_pins(PChart *chart, PEdge *outer, PVert **pin1, PV
float len1, len2;
/* find longest series of verts split in the chart itself, these are
- marked during construction */
+ * marked during construction */
be = outer;
lastbe = p_boundary_edge_prev(be);
do {
@@ -3406,7 +3406,7 @@ static PBool p_chart_convex_hull(PChart *chart, PVert ***verts, int *nverts, int
static float p_rectangle_area(float *p1, float *dir, float *p2, float *p3, float *p4)
{
/* given 4 points on the rectangle edges and the direction of on edge,
- compute the area of the rectangle */
+ * compute the area of the rectangle */
float orthodir[2], corner1[2], corner2[2], corner3[2];
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.h b/source/blender/editors/uvedit/uvedit_parametrizer.h
index 5adb3074314..00cbbd16073 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.h
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.h
@@ -19,15 +19,15 @@ typedef enum ParamBool {
} ParamBool;
/* Chart construction:
- -------------------
- - faces and seams may only be added between construct_{begin|end}
- - the pointers to co and uv are stored, rather than being copied
- - vertices are implicitly created
- - in construct_end the mesh will be split up according to the seams
- - the resulting charts must be:
- - manifold, connected, open (at least one boundary loop)
- - output will be written to the uv pointers
-*/
+ * -------------------
+ * - faces and seams may only be added between construct_{begin|end}
+ * - the pointers to co and uv are stored, rather than being copied
+ * - vertices are implicitly created
+ * - in construct_end the mesh will be split up according to the seams
+ * - the resulting charts must be:
+ * - manifold, connected, open (at least one boundary loop)
+ * - output will be written to the uv pointers
+ */
ParamHandle *param_construct_begin(void);
@@ -51,15 +51,15 @@ void param_construct_end(ParamHandle *handle, ParamBool fill, ParamBool impl);
void param_delete(ParamHandle *chart);
/* Least Squares Conformal Maps:
- -----------------------------
- - charts with less than two pinned vertices are assigned 2 pins
- - lscm is divided in three steps:
- - begin: compute matrix and it's factorization (expensive)
- - solve using pinned coordinates (cheap)
- - end: clean up
- - uv coordinates are allowed to change within begin/end, for
- quick re-solving
-*/
+ * -----------------------------
+ * - charts with less than two pinned vertices are assigned 2 pins
+ * - lscm is divided in three steps:
+ * - begin: compute matrix and it's factorization (expensive)
+ * - solve using pinned coordinates (cheap)
+ * - end: clean up
+ * - uv coordinates are allowed to change within begin/end, for
+ * quick re-solving
+ */
void param_lscm_begin(ParamHandle *handle, ParamBool live, ParamBool abf);
void param_lscm_solve(ParamHandle *handle);
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c
index c7750fd516b..676701b9c2a 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -185,8 +185,7 @@ static StitchPreviewer * stitch_preview_init(void)
/* destructor...yeah this should be C++ :) */
static void stitch_preview_delete(void)
{
- if(_stitch_preview)
- {
+ if(_stitch_preview) {
if(_stitch_preview->preview_polys){
MEM_freeN(_stitch_preview->preview_polys);
_stitch_preview->preview_polys = NULL;
@@ -383,7 +382,7 @@ static void stitch_island_calculate_edge_rotation(UvEdge *edge, StitchState *sta
index2 = uvfinal_map[element2 - state->element_map->buf];
/* the idea here is to take the directions of the edges and find the rotation between final and initial
- * direction. This, using inner and outer vector products, gives the angle. Directions are differences so... */
+ * direction. This, using inner and outer vector products, gives the angle. Directions are differences so... */
uv1[0] = luv2->uv[0] - luv1->uv[0];
uv1[1] = luv2->uv[1] - luv1->uv[1];
@@ -507,8 +506,7 @@ static void stitch_set_face_preview_buffer_position(BMFace *efa, StitchPreviewer
{
int index = BM_elem_index_get(efa);
- if(preview_position[index].data_position == STITCH_NO_PREVIEW)
- {
+ if(preview_position[index].data_position == STITCH_NO_PREVIEW) {
preview_position[index].data_position = preview->preview_uvs*2;
preview_position[index].polycount_position = preview->num_polys++;
preview->preview_uvs += efa->len;
@@ -1294,8 +1292,7 @@ static void stitch_select(bContext *C, Scene *scene, wmEvent *event, StitchState
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &co[0], &co[1]);
uv_find_nearest_vert(scene, ima, stitch_state->em, co, NULL, &hit);
- if(hit.efa)
- {
+ if (hit.efa) {
/* Add vertex to selection, deselect all common uv's of vert other
* than selected and update the preview. This behavior was decided so that
* you can do stuff like deselect the opposite stitchable vertex and the initial still gets deselected */
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 56d088577b6..cfb0128486a 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -154,7 +154,7 @@ static int uvedit_have_selection(Scene *scene, BMEditMesh *em, short implicit)
MLoopUV *luv;
/* verify if we have any selected uv's before unwrapping,
- so we can cancel the operator early */
+ * so we can cancel the operator early */
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) {
if(BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
@@ -989,12 +989,13 @@ static void correct_uv_aspect(BMEditMesh *em)
BMFace *efa= BM_active_face_get(em->bm, TRUE);
BMLoop *l;
BMIter iter, liter;
- MTexPoly *tf;
MLoopUV *luv;
float scale, aspx= 1.0f, aspy=1.0f;
- if(efa) {
- tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
+ if (efa) {
+ MTexPoly *tf;
+
+ tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
ED_image_uv_aspect(tf->tpage, &aspx, &aspy);
}
@@ -1005,7 +1006,6 @@ static void correct_uv_aspect(BMEditMesh *em)
scale= aspy/aspx;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
if (!BM_elem_flag_test(efa, BM_ELEM_SELECT) || BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
continue;
@@ -1019,7 +1019,6 @@ static void correct_uv_aspect(BMEditMesh *em)
scale= aspx/aspy;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
if (!BM_elem_flag_test(efa, BM_ELEM_SELECT)||BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
continue;
diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h
index b3a317364a9..09314351078 100644
--- a/source/blender/gpu/GPU_buffers.h
+++ b/source/blender/gpu/GPU_buffers.h
@@ -40,6 +40,7 @@
#endif
struct DerivedMesh;
+struct DMFlagMat;
struct DMGridData;
struct GHash;
struct DMGridData;
@@ -61,20 +62,20 @@ typedef struct GPUBufferMaterial {
} GPUBufferMaterial;
/* meshes are split up by material since changing materials requires
- GL state changes that can't occur in the middle of drawing an
- array.
-
- some simplifying assumptions are made:
- * all quads are treated as two triangles.
- * no vertex sharing is used; each triangle gets its own copy of the
- vertices it uses (this makes it easy to deal with a vertex used
- by faces with different properties, such as smooth/solid shading,
- different MCols, etc.)
-
- to avoid confusion between the original MVert vertices and the
- arrays of OpenGL vertices, the latter are referred to here and in
- the source as `points'. similarly, the OpenGL triangles generated
- for MFaces are referred to as triangles rather than faces.
+ * GL state changes that can't occur in the middle of drawing an
+ * array.
+ *
+ * some simplifying assumptions are made:
+ * - all quads are treated as two triangles.
+ * - no vertex sharing is used; each triangle gets its own copy of the
+ * vertices it uses (this makes it easy to deal with a vertex used
+ * by faces with different properties, such as smooth/solid shading,
+ * different MCols, etc.)
+ *
+ * to avoid confusion between the original MVert vertices and the
+ * arrays of OpenGL vertices, the latter are referred to here and in
+ * the source as `points'. similarly, the OpenGL triangles generated
+ * for MFaces are referred to as triangles rather than faces.
*/
typedef struct GPUDrawObject {
GPUBuffer *points;
@@ -106,7 +107,7 @@ typedef struct GPUDrawObject {
int totedge;
/* if there was a failure allocating some buffer, use old
- rendering code */
+ * rendering code */
int legacy;
} GPUDrawObject;
@@ -142,8 +143,6 @@ void GPU_buffer_unlock( GPUBuffer *buffer );
/* upload three unsigned chars, representing RGB colors, for each vertex. Resets dm->drawObject->colType to -1 */
void GPU_color3_upload( struct DerivedMesh *dm, unsigned char *data );
-/* upload four unsigned chars, representing RGBA colors, for each vertex. Resets dm->drawObject->colType to -1 */
-void GPU_color4_upload( struct DerivedMesh *dm, unsigned char *data );
/* switch color rendering on=1/off=0 */
void GPU_color_switch( int mode );
@@ -163,14 +162,15 @@ GPU_Buffers *GPU_build_mesh_buffers(int (*face_vert_indices)[4],
struct MFace *mface, int *face_indices, int totface);
void GPU_update_mesh_buffers(GPU_Buffers *buffers, struct MVert *mvert,
- int *vert_indices, int totvert, int smooth);
+ int *vert_indices, int totvert);
GPU_Buffers *GPU_build_grid_buffers(int totgrid, int gridsize);
void GPU_update_grid_buffers(GPU_Buffers *buffers, struct DMGridData **grids,
- int *grid_indices, int totgrid, int gridsize, int smooth);
+ const struct DMFlagMat *grid_flag_mats,
+ int *grid_indices, int totgrid, int gridsize);
-void GPU_draw_buffers(GPU_Buffers *buffers);
+void GPU_draw_buffers(GPU_Buffers *buffers, DMSetMaterial setMaterial);
void GPU_free_buffers(GPU_Buffers *buffers);
diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h
index 5ec373802a3..5f541e2e8e6 100644
--- a/source/blender/gpu/GPU_extensions.h
+++ b/source/blender/gpu/GPU_extensions.h
@@ -92,18 +92,18 @@ typedef enum GPUDriverType {
int GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver);
/* GPU Texture
- - always returns unsigned char RGBA textures
- - if texture with non square dimensions is created, depending on the
- graphics card capabilities the texture may actually be stored in a
- larger texture with power of two dimensions. the actual dimensions
- may be queried with GPU_texture_opengl_width/height. GPU_texture_coord_2f
- calls glTexCoord2f with the coordinates adjusted for this.
- - can use reference counting:
- - reference counter after GPU_texture_create is 1
- - GPU_texture_ref increases by one
- - GPU_texture_free decreases by one, and frees if 0
- - if created with from_blender, will not free the texture
-*/
+ * - always returns unsigned char RGBA textures
+ * - if texture with non square dimensions is created, depending on the
+ * graphics card capabilities the texture may actually be stored in a
+ * larger texture with power of two dimensions. the actual dimensions
+ * may be queried with GPU_texture_opengl_width/height. GPU_texture_coord_2f
+ * calls glTexCoord2f with the coordinates adjusted for this.
+ * - can use reference counting:
+ * - reference counter after GPU_texture_create is 1
+ * - GPU_texture_ref increases by one
+ * - GPU_texture_free decreases by one, and frees if 0
+ * - if created with from_blender, will not free the texture
+ */
GPUTexture *GPU_texture_create_1D(int w, float *pixels, char err_out[256]);
GPUTexture *GPU_texture_create_2D(int w, int h, float *pixels, char err_out[256]);
@@ -126,11 +126,11 @@ int GPU_texture_opengl_height(GPUTexture *tex);
int GPU_texture_opengl_bindcode(GPUTexture *tex);
/* GPU Framebuffer
- - this is a wrapper for an OpenGL framebuffer object (FBO). in practice
- multiple FBO's may be created, to get around limitations on the number
- of attached textures and the dimension requirements.
- - after any of the GPU_framebuffer_* functions, GPU_framebuffer_restore must
- be called before rendering to the window framebuffer again */
+ * - this is a wrapper for an OpenGL framebuffer object (FBO). in practice
+ * multiple FBO's may be created, to get around limitations on the number
+ * of attached textures and the dimension requirements.
+ * - after any of the GPU_framebuffer_* functions, GPU_framebuffer_restore must
+ * be called before rendering to the window framebuffer again */
GPUFrameBuffer *GPU_framebuffer_create(void);
int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, char err_out[256]);
@@ -142,8 +142,8 @@ void GPU_framebuffer_free(GPUFrameBuffer *fb);
void GPU_framebuffer_restore(void);
/* GPU OffScreen
- - wrapper around framebuffer and texture for simple offscreen drawing
- - changes size if graphics card can't support it */
+ * - wrapper around framebuffer and texture for simple offscreen drawing
+ * - changes size if graphics card can't support it */
GPUOffScreen *GPU_offscreen_create(int width, int height, char err_out[256]);
void GPU_offscreen_free(GPUOffScreen *ofs);
@@ -152,8 +152,8 @@ void GPU_offscreen_unbind(GPUOffScreen *ofs);
void GPU_offscreen_read_pixels(GPUOffScreen *ofs, int type, void *pixels);
/* GPU Shader
- - only for fragment shaders now
- - must call texture bind before setting a texture as uniform! */
+ * - only for fragment shaders now
+ * - must call texture bind before setting a texture as uniform! */
GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, const char *libcode); /*GPUShader *lib);*/
/*GPUShader *GPU_shader_create_lib(const char *code);*/
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index 00e34b41faf..23bc79e4187 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -257,7 +257,7 @@ GPUBuffer *GPU_buffer_alloc(int size)
}
/* release a GPUBuffer; does not free the actual buffer or its data,
- but rather moves it to the pool of recently-free'd buffers for
+ but rather moves it to the pool of recently-freed buffers for
possible re-use*/
void GPU_buffer_free(GPUBuffer *buffer)
{
@@ -1170,18 +1170,6 @@ void GPU_color3_upload(DerivedMesh *dm, unsigned char *data)
GL_ARRAY_BUFFER_ARB, data, GPU_buffer_copy_color3);
}
-/* this is used only in cdDM_drawFacesColored, which I think is no
- longer used, so can probably remove this --nicholas */
-void GPU_color4_upload(DerivedMesh *UNUSED(dm), unsigned char *UNUSED(data))
-{
- /*if(dm->drawObject == 0)
- dm->drawObject = GPU_drawobject_new(dm);
- GPU_buffer_free(dm->drawObject->colors);
- dm->drawObject->colors = gpu_buffer_setup(dm, dm->drawObject, 3,
- sizeof(char)*3*dm->drawObject->tot_triangle_point,
- GL_ARRAY_BUFFER_ARB, data, GPU_buffer_copy_color4);*/
-}
-
void GPU_color_switch(int mode)
{
if(mode) {
@@ -1289,16 +1277,16 @@ struct GPU_Buffers {
/* grid pointers */
DMGridData **grids;
+ const DMFlagMat *grid_flag_mats;
int *grid_indices;
int totgrid;
int gridsize;
unsigned int tot_tri, tot_quad;
- int smooth;
};
void GPU_update_mesh_buffers(GPU_Buffers *buffers, MVert *mvert,
- int *vert_indices, int totvert, int smooth)
+ int *vert_indices, int totvert)
{
VertexBufferFormat *vert_data;
int i;
@@ -1331,7 +1319,6 @@ void GPU_update_mesh_buffers(GPU_Buffers *buffers, MVert *mvert,
}
buffers->mvert = mvert;
- buffers->smooth = smooth;
}
GPU_Buffers *GPU_build_mesh_buffers(int (*face_vert_indices)[4],
@@ -1402,7 +1389,7 @@ GPU_Buffers *GPU_build_mesh_buffers(int (*face_vert_indices)[4],
}
void GPU_update_grid_buffers(GPU_Buffers *buffers, DMGridData **grids,
- int *grid_indices, int totgrid, int gridsize, int smooth)
+ const DMFlagMat *grid_flag_mats, int *grid_indices, int totgrid, int gridsize)
{
DMGridData *vert_data;
int i, j, k, totvert;
@@ -1411,6 +1398,8 @@ void GPU_update_grid_buffers(GPU_Buffers *buffers, DMGridData **grids,
/* Build VBO */
if(buffers->vert_buf) {
+ int smooth = grid_flag_mats[grid_indices[0]].flag & ME_SMOOTH;
+
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buffers->vert_buf);
glBufferDataARB(GL_ARRAY_BUFFER_ARB,
sizeof(DMGridData) * totvert,
@@ -1454,7 +1443,7 @@ void GPU_update_grid_buffers(GPU_Buffers *buffers, DMGridData **grids,
buffers->grid_indices = grid_indices;
buffers->totgrid = totgrid;
buffers->gridsize = gridsize;
- buffers->smooth = smooth;
+ buffers->grid_flag_mats = grid_flag_mats;
//printf("node updated %p\n", buffers);
}
@@ -1464,79 +1453,101 @@ void GPU_update_grid_buffers(GPU_Buffers *buffers, DMGridData **grids,
#define FILL_QUAD_BUFFER(type_) \
{ \
type_ *quad_data; \
- int offset = 0; \
- int i, j, k; \
+ int i, j; \
\
glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, \
- sizeof(type_) * totquad * 4, NULL, \
+ sizeof(type_) * (*totquad) * 4, NULL, \
GL_STATIC_DRAW_ARB); \
\
/* Fill the quad buffer */ \
quad_data = glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, \
GL_WRITE_ONLY_ARB); \
if(quad_data) { \
- for(i = 0; i < totgrid; ++i) { \
+ for(i = 0; i < gridsize-1; ++i) { \
for(j = 0; j < gridsize-1; ++j) { \
- for(k = 0; k < gridsize-1; ++k) { \
- *(quad_data++)= offset + j*gridsize + k+1; \
- *(quad_data++)= offset + j*gridsize + k; \
- *(quad_data++)= offset + (j+1)*gridsize + k; \
- *(quad_data++)= offset + (j+1)*gridsize + k+1; \
- } \
+ *(quad_data++)= i*gridsize + j+1; \
+ *(quad_data++)= i*gridsize + j; \
+ *(quad_data++)= (i+1)*gridsize + j; \
+ *(quad_data++)= (i+1)*gridsize + j+1; \
} \
- \
- offset += gridsize*gridsize; \
} \
glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB); \
} \
else { \
- glDeleteBuffersARB(1, &buffers->index_buf); \
- buffers->index_buf = 0; \
+ glDeleteBuffersARB(1, &buffer); \
+ buffer = 0; \
} \
}
/* end FILL_QUAD_BUFFER */
-GPU_Buffers *GPU_build_grid_buffers(int totgrid, int gridsize)
+static GLuint gpu_get_grid_buffer(int gridsize, GLenum *index_type, unsigned *totquad)
{
- GPU_Buffers *buffers;
- int totquad;
-
- buffers = MEM_callocN(sizeof(GPU_Buffers), "GPU_Buffers");
+ static int prev_gridsize = -1;
+ static GLenum prev_index_type = 0;
+ static GLuint buffer = 0;
+ static unsigned prev_totquad;
+
+ /* VBO is disabled; delete the previous buffer (if it exists) and
+ return an invalid handle */
+ if(!GLEW_ARB_vertex_buffer_object || (U.gameflags & USER_DISABLE_VBO)) {
+ if(buffer)
+ glDeleteBuffersARB(1, &buffer);
+ return 0;
+ }
- /* Count the number of quads */
- totquad= (gridsize-1)*(gridsize-1)*totgrid;
+ /* VBO is already built */
+ if(buffer && prev_gridsize == gridsize) {
+ *index_type = prev_index_type;
+ *totquad = prev_totquad;
+ return buffer;
+ }
- /* Generate index buffer object */
- if(GLEW_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO))
- glGenBuffersARB(1, &buffers->index_buf);
+ /* Build new VBO */
+ glGenBuffersARB(1, &buffer);
+ if(buffer) {
+ *totquad= (gridsize-1)*(gridsize-1);
- if(buffers->index_buf) {
- glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, buffers->index_buf);
+ glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, buffer);
- if(totquad < USHRT_MAX) {
- buffers->index_type = GL_UNSIGNED_SHORT;
+ if(*totquad < USHRT_MAX) {
+ *index_type = GL_UNSIGNED_SHORT;
FILL_QUAD_BUFFER(unsigned short);
}
else {
- buffers->index_type = GL_UNSIGNED_INT;
+ *index_type = GL_UNSIGNED_INT;
FILL_QUAD_BUFFER(unsigned int);
}
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
}
- /* Build VBO */
+ prev_gridsize = gridsize;
+ prev_index_type = *index_type;
+ prev_totquad = *totquad;
+ return buffer;
+}
+
+GPU_Buffers *GPU_build_grid_buffers(int totgrid, int gridsize)
+{
+ GPU_Buffers *buffers;
+
+ buffers = MEM_callocN(sizeof(GPU_Buffers), "GPU_Buffers");
+
+ /* Build index VBO */
+ buffers->index_buf = gpu_get_grid_buffer(gridsize, &buffers->index_type, &buffers->tot_quad);
+ buffers->totgrid = totgrid;
+ buffers->gridsize = gridsize;
+
+ /* Build coord/normal VBO */
if(buffers->index_buf)
glGenBuffersARB(1, &buffers->vert_buf);
- buffers->tot_quad = totquad;
-
return buffers;
}
#undef FILL_QUAD_BUFFER
-static void gpu_draw_buffers_legacy_mesh(GPU_Buffers *buffers)
+static void gpu_draw_buffers_legacy_mesh(GPU_Buffers *buffers, int smooth)
{
const MVert *mvert = buffers->mvert;
int i, j;
@@ -1548,7 +1559,7 @@ static void gpu_draw_buffers_legacy_mesh(GPU_Buffers *buffers)
glBegin((f->v4)? GL_QUADS: GL_TRIANGLES);
- if(buffers->smooth) {
+ if(smooth) {
for(j = 0; j < S; j++) {
glNormal3sv(mvert[fv[j]].no);
glVertex3fv(mvert[fv[j]].co);
@@ -1574,11 +1585,11 @@ static void gpu_draw_buffers_legacy_mesh(GPU_Buffers *buffers)
}
}
-static void gpu_draw_buffers_legacy_grids(GPU_Buffers *buffers)
+static void gpu_draw_buffers_legacy_grids(GPU_Buffers *buffers, int smooth)
{
int i, x, y, gridsize = buffers->gridsize;
- if(buffers->smooth) {
+ if(smooth) {
for(i = 0; i < buffers->totgrid; ++i) {
DMGridData *grid = buffers->grids[buffers->grid_indices[i]];
@@ -1624,8 +1635,27 @@ static void gpu_draw_buffers_legacy_grids(GPU_Buffers *buffers)
}
}
-void GPU_draw_buffers(GPU_Buffers *buffers)
+void GPU_draw_buffers(GPU_Buffers *buffers, DMSetMaterial setMaterial)
{
+ int smooth = 0;
+
+ if(buffers->totface) {
+ const MFace *f = &buffers->mface[buffers->face_indices[0]];
+ if(!setMaterial(f->mat_nr+1, NULL))
+ return;
+
+ smooth = f->flag & ME_SMOOTH;
+ glShadeModel(smooth ? GL_SMOOTH: GL_FLAT);
+ }
+ else if(buffers->totgrid) {
+ const DMFlagMat *f = &buffers->grid_flag_mats[buffers->grid_indices[0]];
+ if(!setMaterial(f->mat_nr+1, NULL))
+ return;
+
+ smooth = f->flag & ME_SMOOTH;
+ glShadeModel(smooth ? GL_SMOOTH: GL_FLAT);
+ }
+
if(buffers->vert_buf && buffers->index_buf) {
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
@@ -1634,10 +1664,16 @@ void GPU_draw_buffers(GPU_Buffers *buffers)
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, buffers->index_buf);
if(buffers->tot_quad) {
- glVertexPointer(3, GL_FLOAT, sizeof(DMGridData), (void*)offsetof(DMGridData, co));
- glNormalPointer(GL_FLOAT, sizeof(DMGridData), (void*)offsetof(DMGridData, no));
-
- glDrawElements(GL_QUADS, buffers->tot_quad * 4, buffers->index_type, 0);
+ unsigned offset = 0;
+ int i;
+ for(i = 0; i < buffers->totgrid; i++) {
+ glVertexPointer(3, GL_FLOAT, sizeof(DMGridData), offset + (char*)offsetof(DMGridData, co));
+ glNormalPointer(GL_FLOAT, sizeof(DMGridData), offset + (char*)offsetof(DMGridData, no));
+
+ glDrawElements(GL_QUADS, buffers->tot_quad * 4, buffers->index_type, 0);
+
+ offset += buffers->gridsize * buffers->gridsize * sizeof(DMGridData);
+ }
}
else {
glVertexPointer(3, GL_FLOAT, sizeof(VertexBufferFormat), (void*)offsetof(VertexBufferFormat, co));
@@ -1654,10 +1690,10 @@ void GPU_draw_buffers(GPU_Buffers *buffers)
}
/* fallbacks if we are out of memory or VBO is disabled */
else if(buffers->totface) {
- gpu_draw_buffers_legacy_mesh(buffers);
+ gpu_draw_buffers_legacy_mesh(buffers, smooth);
}
else if(buffers->totgrid) {
- gpu_draw_buffers_legacy_grids(buffers);
+ gpu_draw_buffers_legacy_grids(buffers, smooth);
}
}
@@ -1666,7 +1702,7 @@ void GPU_free_buffers(GPU_Buffers *buffers)
if(buffers) {
if(buffers->vert_buf)
glDeleteBuffersARB(1, &buffers->vert_buf);
- if(buffers->index_buf)
+ if(buffers->index_buf && buffers->tot_tri)
glDeleteBuffersARB(1, &buffers->index_buf);
MEM_freeN(buffers);
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index bc77d15f76b..07d7568ab95 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -72,8 +72,8 @@ static const char* GPU_DATATYPE_STR[17] = {"", "float", "vec2", "vec3", "vec4",
* These are stored in a hash for lookup when creating a material. */
static GHash *FUNCTION_HASH= NULL;
-/*static char *FUNCTION_PROTOTYPES= NULL;
-static GPUShader *FUNCTION_LIB= NULL;*/
+/* static char *FUNCTION_PROTOTYPES= NULL;
+ * static GPUShader *FUNCTION_LIB= NULL;*/
static int gpu_str_prefix(const char *str, const char *prefix)
{
@@ -631,8 +631,7 @@ static char *code_generate_vertex(ListBase *nodes)
for (node=nodes->first; node; node=node->next)
for (input=node->inputs.first; input; input=input->next)
if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) {
- if(input->attribtype == CD_TANGENT) /* silly exception */
- {
+ if(input->attribtype == CD_TANGENT) { /* silly exception */
BLI_dynstr_appendf(ds, "\tvar%d.xyz = normalize((gl_ModelViewMatrix * vec4(att%d.xyz, 0)).xyz);\n", input->attribid, input->attribid);
BLI_dynstr_appendf(ds, "\tvar%d.w = att%d.w;\n", input->attribid, input->attribid);
}
diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h
index 85bf65232c1..db334b8bf19 100644
--- a/source/blender/gpu/intern/gpu_codegen.h
+++ b/source/blender/gpu/intern/gpu_codegen.h
@@ -61,10 +61,10 @@ typedef struct GPUFunction {
GPUFunction *GPU_lookup_function(const char *name);
/* Pass Generation
- - Takes a list of nodes and a desired output, and makes a pass. This
- will take ownership of the nodes and free them early if unused or
- at the end if used.
-*/
+ * - Takes a list of nodes and a desired output, and makes a pass. This
+ * will take ownership of the nodes and free them early if unused or
+ * at the end if used.
+ */
typedef enum GPUDataSource {
GPU_SOURCE_VEC_UNIFORM,
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 7a61ee2eebc..a5d6c374a42 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -193,9 +193,11 @@ static int is_pow2_limit(int num)
{
/* take texture clamping into account */
- /* XXX: texturepaint not global!
+ /* XXX: texturepaint not global! */
+#if 0
if (G.f & G_TEXTUREPAINT)
return 1;*/
+#endif
if (U.glreslimit != 0 && num > U.glreslimit)
return 0;
@@ -205,10 +207,12 @@ static int is_pow2_limit(int num)
static int smaller_pow2_limit(int num)
{
- /* XXX: texturepaint not global!
+ /* XXX: texturepaint not global! */
+#if 0
if (G.f & G_TEXTUREPAINT)
return 1;*/
-
+#endif
+
/* take texture clamping into account */
if (U.glreslimit != 0 && num > U.glreslimit)
return U.glreslimit;
@@ -278,8 +282,7 @@ static GLenum gpu_get_mipmap_filter(int mag)
/* Anisotropic filtering settings */
void GPU_set_anisotropic(float value)
{
- if (GTS.anisotropic != value)
- {
+ if (GTS.anisotropic != value) {
GPU_free_images();
/* Clamp value to the maximum value the graphics card supports */
@@ -468,7 +471,7 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
if(ibuf->rect_float) {
if(U.use_16bit_textures) {
/* use high precision textures. This is relatively harmless because OpenGL gives us
- a high precision format only if it is available */
+ * a high precision format only if it is available */
use_high_bit_depth = TRUE;
}
@@ -594,7 +597,7 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
}
/* scale if not a power of two. this is not strictly necessary for newer
- GPUs (OpenGL version >= 2.0) since they support non-power-of-two-textures */
+ * GPUs (OpenGL version >= 2.0) since they support non-power-of-two-textures */
if (!is_pow2_limit(rectw) || !is_pow2_limit(recth)) {
rectw= smaller_pow2_limit(rectw);
recth= smaller_pow2_limit(recth);
@@ -715,9 +718,9 @@ int GPU_set_tpage(MTFace *tface, int mipmap, int alphablend)
}
/* these two functions are called on entering and exiting texture paint mode,
- temporary disabling/enabling mipmapping on all images for quick texture
- updates with glTexSubImage2D. images that didn't change don't have to be
- re-uploaded to OpenGL */
+ * temporary disabling/enabling mipmapping on all images for quick texture
+ * updates with glTexSubImage2D. images that didn't change don't have to be
+ * re-uploaded to OpenGL */
void GPU_paint_set_mipmap(int mipmap)
{
Image* ima;
@@ -875,8 +878,7 @@ int GPU_update_image_time(Image *ima, double time)
void GPU_free_smoke(SmokeModifierData *smd)
{
- if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain)
- {
+ if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain) {
if(smd->domain->tex)
GPU_texture_free(smd->domain->tex);
smd->domain->tex = NULL;
@@ -1088,10 +1090,10 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
GMS.gviewinv= rv3d->viewinv;
/* alpha pass setup. there's various cases to handle here:
- * object transparency on: only solid materials draw in the first pass,
- and only transparent in the second 'alpha' pass.
- * object transparency off: for glsl we draw both in a single pass, and
- for solid we don't use transparency at all. */
+ * - object transparency on: only solid materials draw in the first pass,
+ * and only transparent in the second 'alpha' pass.
+ * - object transparency off: for glsl we draw both in a single pass, and
+ * for solid we don't use transparency at all. */
GMS.use_alpha_pass = (do_alpha_after != NULL);
GMS.is_alpha_pass = (v3d && v3d->transp);
if(GMS.use_alpha_pass)
@@ -1238,7 +1240,7 @@ int GPU_enable_material(int nr, void *attribs)
GMS.gboundmat= mat;
/* for glsl use alpha blend mode, unless it's set to solid and
- we are already drawing in an alpha pass */
+ * we are already drawing in an alpha pass */
if(mat->game.alpha_blend != GPU_BLEND_SOLID)
alphablend= mat->game.alpha_blend;
@@ -1301,8 +1303,7 @@ void GPU_end_object_materials(void)
GMS.alphablend= NULL;
/* resetting the texture matrix after the glScale needed for tiled textures */
- if(GTS.tilemode)
- {
+ if(GTS.tilemode) {
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
@@ -1528,8 +1529,8 @@ void GPU_state_init(void)
glDisable(GL_CULL_FACE);
/* calling this makes drawing very slow when AA is not set up in ghost
- on Linux/NVIDIA.
- glDisable(GL_MULTISAMPLE); */
+ * on Linux/NVIDIA. */
+ // glDisable(GL_MULTISAMPLE);
}
/* debugging aid */
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 8129b27a66e..e1d6f64f661 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -56,14 +56,14 @@
/* Extensions support */
/* extensions used:
- - texture border clamp: 1.3 core
- - fragement shader: 2.0 core
- - framebuffer object: ext specification
- - multitexture 1.3 core
- - arb non power of two: 2.0 core
- - pixel buffer objects? 2.1 core
- - arb draw buffers? 2.0 core
-*/
+ * - texture border clamp: 1.3 core
+ * - fragement shader: 2.0 core
+ * - framebuffer object: ext specification
+ * - multitexture 1.3 core
+ * - arb non power of two: 2.0 core
+ * - pixel buffer objects? 2.1 core
+ * - arb draw buffers? 2.0 core
+ */
static struct GPUGlobal {
GLint maxtextures;
@@ -183,12 +183,12 @@ void GPU_extensions_init(void)
* really needed to prevent different unexpected behaviors like with intel gme965 card (sergey) */
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
- GG.os = GPU_OS_UNIX;
#ifdef _WIN32
GG.os = GPU_OS_WIN;
-#endif
-#ifdef __APPLE__
+#elif defined(__APPLE__)
GG.os = GPU_OS_MAC;
+#else
+ GG.os = GPU_OS_UNIX;
#endif
}
@@ -850,7 +850,7 @@ struct GPUOffScreen {
GPUTexture *depth;
/* requested width/height, may be smaller than actual texture size due
- to missing non-power of two support, so we compensate for that */
+ * to missing non-power of two support, so we compensate for that */
int w, h;
};
@@ -1021,8 +1021,10 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, /*GPU
}
}
- /*if(lib && lib->lib)
- glAttachObjectARB(shader->object, lib->lib);*/
+#if 0
+ if(lib && lib->lib)
+ glAttachObjectARB(shader->object, lib->lib);
+#endif
glLinkProgramARB(shader->object);
glGetObjectParameterivARB(shader->object, GL_OBJECT_LINK_STATUS_ARB, &status);
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index 0ddaf07c67e..89b3a7d5f3f 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -672,9 +672,10 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
i = is;
GPU_link(mat, "shade_visifac", i, visifac, shi->refl, &i);
-
- /*if(ma->mode & MA_TANGENT_VN)
- GPU_link(mat, "shade_tangent_v_spec", GPU_attribute(CD_TANGENT, ""), &vn);*/
+#if 0
+ if(ma->mode & MA_TANGENT_VN)
+ GPU_link(mat, "shade_tangent_v_spec", GPU_attribute(CD_TANGENT, ""), &vn);
+#endif
/* this replaces if(i > 0.0) conditional until that is supported */
// done in shade_visifac now, GPU_link(mat, "mtex_value_clamp_positive", i, &i);
@@ -1053,23 +1054,21 @@ static void do_material_tex(GPUShadeInput *shi)
if(mtex->norfac < 0.0f)
GPU_link(mat, "mtex_negate_texnormal", tnor, &tnor);
- if(mtex->normapspace == MTEX_NSPACE_TANGENT)
- {
- if(iFirstTimeNMap!=0)
- {
+ if (mtex->normapspace == MTEX_NSPACE_TANGENT) {
+ if (iFirstTimeNMap != 0) {
// use unnormalized normal (this is how we bake it - closer to gamedev)
GPUNodeLink *vNegNorm;
GPU_link(mat, "vec_math_negate", GPU_builtin(GPU_VIEW_NORMAL), &vNegNorm);
GPU_link(mat, "mtex_nspace_tangent", GPU_attribute(CD_TANGENT, ""), vNegNorm, tnor, &newnor);
iFirstTimeNMap = 0;
}
- else // otherwise use accumulated perturbations
- {
+ else { /* otherwise use accumulated perturbations */
GPU_link(mat, "mtex_nspace_tangent", GPU_attribute(CD_TANGENT, ""), shi->vn, tnor, &newnor);
}
}
- else
+ else {
newnor = tnor;
+ }
norfac = minf(fabsf(mtex->norfac), 1.0f);
@@ -1085,7 +1084,8 @@ static void do_material_tex(GPUShadeInput *shi)
GPU_link(mat, "mtex_blend_normal", tnorfac, shi->vn, newnor, &shi->vn);
}
- } else if( (mtex->texflag & (MTEX_3TAP_BUMP|MTEX_5TAP_BUMP|MTEX_BICUBIC_BUMP)) || found_deriv_map) {
+ }
+ else if( (mtex->texflag & (MTEX_3TAP_BUMP|MTEX_5TAP_BUMP|MTEX_BICUBIC_BUMP)) || found_deriv_map) {
/* ntap bumpmap image */
int iBumpSpace;
float ima_x, ima_y;
@@ -1120,8 +1120,7 @@ static void do_material_tex(GPUShadeInput *shi)
// to inverting the bump map. Should this ever change
// this negate must be removed.
norfac = -hScale * mtex->norfac;
- if(found_deriv_map)
- {
+ if (found_deriv_map) {
float fVirtDim = sqrtf(fabsf(ima_x*mtex->size[0]*ima_y*mtex->size[1]));
norfac /= MAX2(fVirtDim, FLT_EPSILON);
}
@@ -1463,8 +1462,8 @@ GPUMaterial *GPU_material_from_blender(Scene *scene, Material *ma)
GPU_material_construct_end(mat);
/* note that even if building the shader fails in some way, we still keep
- it to avoid trying to compile again and again, and simple do not use
- the actual shader on drawing */
+ * it to avoid trying to compile again and again, and simple do not use
+ * the actual shader on drawing */
link = MEM_callocN(sizeof(LinkData), "GPUMaterialLink");
link->data = mat;
diff --git a/source/blender/ikplugin/intern/iksolver_plugin.c b/source/blender/ikplugin/intern/iksolver_plugin.c
index 34656daaa19..7a96edeaf5f 100644
--- a/source/blender/ikplugin/intern/iksolver_plugin.c
+++ b/source/blender/ikplugin/intern/iksolver_plugin.c
@@ -230,7 +230,7 @@ static void where_is_ik_bone(bPoseChannel *pchan, float ik_mat[][3]) // nr = t
/* called from within the core where_is_pose loop, all animsystems and constraints
-were executed & assigned. Now as last we do an IK pass */
+ * were executed & assigned. Now as last we do an IK pass */
static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
{
float R_parmat[3][3], identity[3][3];
@@ -349,8 +349,8 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
pchan= tree->pchan[0];
if (pchan->parent)
/* transform goal by parent mat, so this rotation is not part of the
- segment's basis. otherwise rotation limits do not work on the
- local transform of the segment itself. */
+ * segment's basis. otherwise rotation limits do not work on the
+ * local transform of the segment itself. */
copy_m4_m4(rootmat, pchan->parent->pose_mat);
else
unit_m4(rootmat);
@@ -539,7 +539,7 @@ void iksolver_execute_tree(struct Scene *scene, struct Object *ob, struct bPose
execute_posetree(scene, ob, tree);
/* 6. apply the differences to the channels,
- we need to calculate the original differences first */
+ * we need to calculate the original differences first */
for(a=0; a<tree->totchannel; a++) {
make_dmats(tree->pchan[a]);
}
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp
index 42a3aace775..5385366f075 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.cpp
+++ b/source/blender/ikplugin/intern/itasc_plugin.cpp
@@ -890,33 +890,32 @@ static int convert_channels(IK_Scene *ikscene, PoseTree *tree)
flag |= IK_TRANSY;
}
/*
- Logic to create the segments:
- RX,RY,RZ = rotational joints with no length
- RY(tip) = rotational joints with a fixed length arm = (0,length,0)
- TY = translational joint on Y axis
- F(pos) = fixed joint with an arm at position pos
- Conversion rule of the above flags:
- - ==> F(tip)
- X ==> RX(tip)
- Y ==> RY(tip)
- Z ==> RZ(tip)
- XY ==> RX+RY(tip)
- XZ ==> RX+RZ(tip)
- YZ ==> RZ+RY(tip)
- XYZ ==> full spherical unless there are limits, in which case RX+RZ+RY(tip)
- In case of stretch, tip=(0,0,0) and there is an additional TY joint
- The frame at last of these joints represents the tail of the bone.
- The head is computed by a reverse translation on Y axis of the bone length
- or in case of TY joint, by the frame at previous joint.
- In case of separation of bones, there is an additional F(head) joint
-
- Computing rest pose and length is complicated: the solver works in world space
- Here is the logic:
- rest position is computed only from bone->bone_mat.
- bone length is computed from bone->length multiplied by the scaling factor of
- the armature. Non-uniform scaling will give bad result!
-
- */
+ * Logic to create the segments:
+ * RX,RY,RZ = rotational joints with no length
+ * RY(tip) = rotational joints with a fixed length arm = (0,length,0)
+ * TY = translational joint on Y axis
+ * F(pos) = fixed joint with an arm at position pos
+ * Conversion rule of the above flags:
+ * - ==> F(tip)
+ * X ==> RX(tip)
+ * Y ==> RY(tip)
+ * Z ==> RZ(tip)
+ * XY ==> RX+RY(tip)
+ * XZ ==> RX+RZ(tip)
+ * YZ ==> RZ+RY(tip)
+ * XYZ ==> full spherical unless there are limits, in which case RX+RZ+RY(tip)
+ * In case of stretch, tip=(0,0,0) and there is an additional TY joint
+ * The frame at last of these joints represents the tail of the bone.
+ * The head is computed by a reverse translation on Y axis of the bone length
+ * or in case of TY joint, by the frame at previous joint.
+ * In case of separation of bones, there is an additional F(head) joint
+ *
+ * Computing rest pose and length is complicated: the solver works in world space
+ * Here is the logic:
+ * rest position is computed only from bone->bone_mat.
+ * bone length is computed from bone->length multiplied by the scaling factor of
+ * the armature. Non-uniform scaling will give bad result!
+ */
switch (flag & (IK_XDOF|IK_YDOF|IK_ZDOF))
{
default:
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h
index c96b0509a27..a68bbb97b62 100644
--- a/source/blender/imbuf/IMB_imbuf.h
+++ b/source/blender/imbuf/IMB_imbuf.h
@@ -52,7 +52,7 @@
* - File I/O must be done externally. The module uses FILE*'s to
* direct input/output.
* - Platform dependency is limited. Some minor patches for
- * amiga and Irix are present. A 'posix-compliancy-patch'
+ * amiga and Irix are present. A 'posix-compliance-patch'
* provides the interface to windows.
*
* \section dependencies Dependencies
@@ -63,7 +63,7 @@
* management.
* - \ref blenlib module
* blenlib handles guarded memory management in blender-style.
- * BLI_winstuff.h makes a few windows specific behaviours
+ * BLI_winstuff.h makes a few windows specific behaviors
* posix-compliant.
*/
@@ -185,18 +185,17 @@ void IMB_rectblend(struct ImBuf *dbuf, struct ImBuf *sbuf, int destx,
typedef enum IMB_Timecode_Type {
IMB_TC_NONE = 0, /* don't use timecode files at all */
- IMB_TC_RECORD_RUN = 1, /* use images in the order as they are recorded
- (currently, this is the only one implemented
- and is a sane default)
- */
+
+ IMB_TC_RECORD_RUN = 1, /* use images in the order as they are recorded
+ * (currently, this is the only one implemented
+ * and is a sane default) */
+
IMB_TC_FREE_RUN = 2, /* use global timestamp written by recording
- device (prosumer camcorders e.g. can do
- that) */
- IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN = 4,
- /* interpolate a global timestamp using the
- record date and time written by recording
- device (*every* consumer camcorder can do
- that :) )*/
+ * device (prosumer camcorders e.g. can do that) */
+ IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN = 4, /* interpolate a global timestamp using the
+ * record date and time written by recording
+ * device (*every* consumer camcorder can do
+ * that :) )*/
IMB_TC_RECORD_RUN_NO_GAPS = 8,
IMB_TC_MAX_SLOT = 4
} IMB_Timecode_Type;
@@ -367,8 +366,8 @@ void IMB_interlace(struct ImBuf *ibuf);
/* create char buffer, color corrected if necessary, for ImBufs that lack one */
void IMB_rect_from_float(struct ImBuf *ibuf);
-/* create char buffer for part of the image, color corrected if necessary,
- Changed part will be stored in buffer. This is expected to be used for texture painting updates */
+/* Create char buffer for part of the image, color corrected if necessary,
+ * Changed part will be stored in buffer. This is expected to be used for texture painting updates */
void IMB_partial_rect_from_float(struct ImBuf *ibuf, float *buffer, int x, int y, int w, int h);
void IMB_float_from_rect(struct ImBuf *ibuf);
void IMB_float_from_rect_simple(struct ImBuf *ibuf); /* no profile conversion */
diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h
index c2b42db447d..076f518585b 100644
--- a/source/blender/imbuf/IMB_imbuf_types.h
+++ b/source/blender/imbuf/IMB_imbuf_types.h
@@ -84,8 +84,8 @@ typedef struct ImBuf {
/* pixels */
unsigned int *rect; /* pixel values stored here */
float *rect_float; /* floating point Rect equivalent
- Linear RGB color space - may need gamma correction to
- sRGB when generating 8bit representations */
+ * Linear RGB color space - may need gamma correction to
+ * sRGB when generating 8bit representations */
/* resolution - pixels per meter */
double ppm[2];
diff --git a/source/blender/imbuf/IMB_moviecache.h b/source/blender/imbuf/IMB_moviecache.h
index 3fa98a04d8d..f6927d4f31d 100644
--- a/source/blender/imbuf/IMB_moviecache.h
+++ b/source/blender/imbuf/IMB_moviecache.h
@@ -36,8 +36,8 @@
#include "BLI_ghash.h"
/* Cache system for movie data - now supports stoting ImBufs only
- Supposed to provide unified cache system for movie clips, sequencer and
- other movie-related areas */
+ * Supposed to provide unified cache system for movie clips, sequencer and
+ * other movie-related areas */
struct ImBuf;
struct MovieCache;
diff --git a/source/blender/imbuf/intern/IMB_indexer.h b/source/blender/imbuf/intern/IMB_indexer.h
index 6546840ea85..dc16b4d7e36 100644
--- a/source/blender/imbuf/intern/IMB_indexer.h
+++ b/source/blender/imbuf/intern/IMB_indexer.h
@@ -33,26 +33,24 @@
#include <stdio.h>
#include "BKE_utildefines.h"
#include "IMB_anim.h"
-
/*
- separate animation index files to solve the following problems:
-
- a) different timecodes within one file (like DTS/PTS, Timecode-Track,
- "implicit" timecodes within DV-files and HDV-files etc.)
- b) seeking difficulties within ffmpeg for files with timestamp holes
- c) broken files that miss several frames / have varying framerates
- d) use proxies accordingly
-
- ... we need index files, that provide us with
-
- the binary(!) position, where we have to seek into the file *and*
- the continuous frame number (ignoring the holes) starting from the
- beginning of the file, so that we know, which proxy frame to serve.
-
- This index has to be only built once for a file and is written into
- the BL_proxy directory structure for later reuse in different blender files.
-
-*/
+ * separate animation index files to solve the following problems:
+ *
+ * a) different timecodes within one file (like DTS/PTS, Timecode-Track,
+ * "implicit" timecodes within DV-files and HDV-files etc.)
+ * b) seeking difficulties within ffmpeg for files with timestamp holes
+ * c) broken files that miss several frames / have varying framerates
+ * d) use proxies accordingly
+ *
+ * ... we need index files, that provide us with
+ *
+ * the binary(!) position, where we have to seek into the file *and*
+ * the continuous frame number (ignoring the holes) starting from the
+ * beginning of the file, so that we know, which proxy frame to serve.
+ *
+ * This index has to be only built once for a file and is written into
+ * the BL_proxy directory structure for later reuse in different blender files.
+ */
typedef struct anim_index_entry {
int frameno;
diff --git a/source/blender/imbuf/intern/IMB_metadata.h b/source/blender/imbuf/intern/IMB_metadata.h
index 8211896b185..336a5f95082 100644
--- a/source/blender/imbuf/intern/IMB_metadata.h
+++ b/source/blender/imbuf/intern/IMB_metadata.h
@@ -42,13 +42,13 @@ typedef struct ImMetaData {
int len;
} ImMetaData;
-/** The metadata is a list of key/value pairs (both char*) that can me
- saved in the header of several image formats.
- Apart from some common keys like
- 'Software' and 'Description' (png standard) we'll use keys within the
- Blender namespace, so should be called 'Blender::StampInfo' or 'Blender::FrameNum'
- etc...
-*/
+/** The metadata is a list of key/value pairs (both char*) that can me
+ * saved in the header of several image formats.
+ * Apart from some common keys like
+ * 'Software' and 'Description' (png standard) we'll use keys within the
+ * Blender namespace, so should be called 'Blender::StampInfo' or 'Blender::FrameNum'
+ * etc...
+ */
/* free blender ImMetaData struct */
@@ -58,7 +58,7 @@ void IMB_metadata_free(struct ImBuf* img);
* \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.
+ * 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
*/
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index 8722ca8e90a..2719f2e296b 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -61,7 +61,7 @@
#endif
#include "BLI_blenlib.h" /* BLI_remlink BLI_filesize BLI_addtail
- BLI_countlist BLI_stringdec */
+ * BLI_countlist BLI_stringdec */
#include "BLI_utildefines.h"
#include "BLI_math_base.h"
@@ -603,10 +603,10 @@ static int startffmpeg(struct anim * anim)
}
/* postprocess the image in anim->pFrame and do color conversion
- and deinterlacing stuff.
-
- Output is anim->last_frame
-*/
+ * and deinterlacing stuff.
+ *
+ * Output is anim->last_frame
+ */
static void ffmpeg_postprocess(struct anim * anim)
{
@@ -621,7 +621,7 @@ static void ffmpeg_postprocess(struct anim * anim)
}
/* This means the data wasnt read properly,
- this check stops crashing */
+ * this check stops crashing */
if (input->data[0]==0 && input->data[1]==0
&& input->data[2]==0 && input->data[3]==0){
fprintf(stderr, "ffmpeg_fetchibuf: "
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c
index 77fc6bdf856..1b6184c8b58 100644
--- a/source/blender/imbuf/intern/bmp.c
+++ b/source/blender/imbuf/intern/bmp.c
@@ -40,9 +40,9 @@
#include "IMB_filetype.h"
/* some code copied from article on microsoft.com, copied
- here for enhanced BMP support in the future
- http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0197/mfcp1/mfcp1.htm&nav=/msj/0197/newnav.htm
-*/
+ * here for enhanced BMP support in the future
+ * http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0197/mfcp1/mfcp1.htm&nav=/msj/0197/newnav.htm
+ */
typedef struct BMPINFOHEADER{
unsigned int biSize;
@@ -129,10 +129,13 @@ struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags)
y = LITTLE_LONG(bmi.biHeight);
depth = LITTLE_SHORT(bmi.biBitCount);
- /* printf("skip: %d, x: %d y: %d, depth: %d (%x)\n", skip, x, y,
- depth, bmi.biBitCount); */
- /* printf("skip: %d, x: %d y: %d, depth: %d (%x)\n", skip, x, y,
- depth, bmi.biBitCount); */
+#if 0
+ printf("skip: %d, x: %d y: %d, depth: %d (%x)\n", skip, x, y,
+ depth, bmi.biBitCount);
+ printf("skip: %d, x: %d y: %d, depth: %d (%x)\n", skip, x, y,
+ depth, bmi.biBitCount);
+#endif
+
if (flags & IB_test) {
ibuf = IMB_allocImBuf(x, y, depth, 0);
} else {
diff --git a/source/blender/imbuf/intern/cache.c b/source/blender/imbuf/intern/cache.c
index 7213979b500..3bac570da4e 100644
--- a/source/blender/imbuf/intern/cache.c
+++ b/source/blender/imbuf/intern/cache.c
@@ -40,13 +40,13 @@
#include "imbuf.h"
/* We use a two level cache here. A per-thread cache with limited number of
- tiles. This can be accessed without locking and so is hoped to lead to most
- tile access being lock-free. The global cache is shared between all threads
- and requires slow locking to access, and contains all tiles.
-
- The per-thread cache should be big enough that one might hope to not fall
- back to the global cache every pixel, but not to big to keep too many tiles
- locked and using memory. */
+ * tiles. This can be accessed without locking and so is hoped to lead to most
+ * tile access being lock-free. The global cache is shared between all threads
+ * and requires slow locking to access, and contains all tiles.
+ *
+ * The per-thread cache should be big enough that one might hope to not fall
+ * back to the global cache every pixel, but not to big to keep too many tiles
+ * locked and using memory. */
#define IB_THREAD_CACHE_SIZE 100
@@ -207,7 +207,7 @@ void imb_tile_cache_init(void)
BLI_mutex_init(&GLOBAL_CACHE.mutex);
/* initialize for one thread, for places that access textures
- outside of rendering (displace modifier, painting, ..) */
+ * outside of rendering (displace modifier, painting, ..) */
IMB_tile_cache_params(0, 0);
GLOBAL_CACHE.initialized = 1;
@@ -286,8 +286,8 @@ static ImGlobalTile *imb_global_cache_get_tile(ImBuf *ibuf, int tx, int ty, ImGl
if(gtile) {
/* found tile. however it may be in the process of being loaded
- by another thread, in that case we do stupid busy loop waiting
- for the other thread to load the tile */
+ * by another thread, in that case we do stupid busy loop waiting
+ * for the other thread to load the tile */
gtile->refcount++;
BLI_mutex_unlock(&GLOBAL_CACHE.mutex);
@@ -428,7 +428,7 @@ void IMB_tiles_to_rect(ImBuf *ibuf)
for(ty=0; ty<mipbuf->ytiles; ty++) {
for(tx=0; tx<mipbuf->xtiles; tx++) {
/* acquire tile through cache, this assumes cache is initialized,
- which it is always now but it's a weak assumption ... */
+ * which it is always now but it's a weak assumption ... */
gtile= imb_global_cache_get_tile(mipbuf, tx, ty, NULL);
/* setup pointers */
diff --git a/source/blender/imbuf/intern/cineon/cineonlib.c b/source/blender/imbuf/intern/cineon/cineonlib.c
index b4da39ac41e..810ed7b26a4 100644
--- a/source/blender/imbuf/intern/cineon/cineonlib.c
+++ b/source/blender/imbuf/intern/cineon/cineonlib.c
@@ -335,10 +335,11 @@ cineonGetRowBytes(CineonFile* cineon, unsigned short* row, int y) {
longsRead = logimage_fread(cineon->lineBuffer, 4, cineon->lineBufferLength, cineon);
if (longsRead != cineon->lineBufferLength) {
- if (verbose)
- { d_printf("Couldn't read line %d length %d\n", y, cineon->lineBufferLength * 4);
- perror("cineonGetRowBytes");
- }
+ if (verbose) {
+ d_printf("Couldn't read line %d length %d\n", y, cineon->lineBufferLength * 4);
+ perror("cineonGetRowBytes");
+ }
+
return 1;
}
diff --git a/source/blender/imbuf/intern/cineon/logmemfile.c b/source/blender/imbuf/intern/cineon/logmemfile.c
index d3a32774efd..289dd0357a4 100644
--- a/source/blender/imbuf/intern/cineon/logmemfile.c
+++ b/source/blender/imbuf/intern/cineon/logmemfile.c
@@ -68,8 +68,8 @@ int logimage_fread(void *buffer, unsigned int size, unsigned int count, void *lo
if (file->file) return fread(buffer, size, count, file->file);
else { /*we're reading from memory*/
int i;
- /*we convert ot uchar just on the off chance some platform can't handle
- pointer arithmetic with type (void*). */
+ /* we convert ot uchar just on the off chance some platform can't handle
+ * pointer arithmetic with type (void*). */
unsigned char *buf = (unsigned char *) buffer;
for (i=0; i<count; i++) {
diff --git a/source/blender/imbuf/intern/dds/Image.h b/source/blender/imbuf/intern/dds/Image.h
index 9c2220567aa..5dcf3011c76 100644
--- a/source/blender/imbuf/intern/dds/Image.h
+++ b/source/blender/imbuf/intern/dds/Image.h
@@ -55,12 +55,12 @@ public:
~Image();
void allocate(uint w, uint h);
- /*
+#if 0
bool load(const char * name);
void wrap(void * data, uint w, uint h);
void unwrap();
- */
+#endif
uint width() const;
uint height() const;
diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c
index 29da7973654..0d821126492 100644
--- a/source/blender/imbuf/intern/filter.c
+++ b/source/blender/imbuf/intern/filter.c
@@ -372,11 +372,14 @@ void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter)
/* build a weights buffer */
n= 1;
- /*k= 0;
+
+#if 0
+ k= 0;
for(i = -n; i <= n; i++)
for(j = -n; j <= n; j++)
weight[k++] = sqrt((float) i * i + j * j);
- */
+#endif
+
weight[0]=1; weight[1]=2; weight[2]=1;
weight[3]=2; weight[4]=0; weight[5]=2;
weight[6]=1; weight[7]=2; weight[8]=1;
diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c
index 9dad21aa728..0462c998e44 100644
--- a/source/blender/imbuf/intern/imageprocess.c
+++ b/source/blender/imbuf/intern/imageprocess.c
@@ -42,12 +42,14 @@
#include <stdlib.h>
+#include "BLI_utildefines.h"
+
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
#include "math.h"
/* This define should be relocated to a global header some where Kent Mein
-I stole it from util.h in the plugins api */
+ * I stole it from util.h in the plugins api */
#define MAX2(x,y) ( (x)>(y) ? (x) : (y) )
/* Only this one is used liberally here, and in imbuf */
@@ -98,16 +100,15 @@ static void pixel_from_buffer(struct ImBuf *ibuf, unsigned char **outI, float **
}
/**************************************************************************
-* INTERPOLATIONS
-*
-* Reference and docs:
-* http://wiki.blender.org/index.php/User:Damiles#Interpolations_Algorithms
-***************************************************************************/
-
-/* BICUBIC Interpolation functions */
-/* More info: http://wiki.blender.org/index.php/User:Damiles#Bicubic_pixel_interpolation
-*/
-/* function assumes out to be zero'ed, only does RGBA */
+ * INTERPOLATIONS
+ *
+ * Reference and docs:
+ * http://wiki.blender.org/index.php/User:Damiles#Interpolations_Algorithms
+ ***************************************************************************/
+
+/* BICUBIC Interpolation functions
+ * More info: http://wiki.blender.org/index.php/User:Damiles#Bicubic_pixel_interpolation
+ * function assumes out to be zero'ed, only does RGBA */
static float P(float k)
{
@@ -134,6 +135,10 @@ void bicubic_interpolation_color(struct ImBuf *in, unsigned char *outI, float *o
unsigned char *dataI;
float a,b,w,wx,wy[4], outR,outG,outB,outA,*dataF;
+ /* sample area entirely outside image? */
+ if (ceil(u)<0 || floor(u)>in->x-1 || ceil(v)<0 || floor(v)>in->y-1)
+ return;
+
/* ImBuf in must have a valid rect or rect_float, assume this is already checked */
i= (int)floor(u);
@@ -153,31 +158,29 @@ void bicubic_interpolation_color(struct ImBuf *in, unsigned char *outI, float *o
for(n= -1; n<= 2; n++){
x1= i+n;
- if (x1>0 && x1 < in->x) {
- wx = P(n-a);
- for(m= -1; m<= 2; m++){
- y1= j+m;
- if (y1>0 && y1<in->y) {
- /* normally we could do this */
- /* w = P(n-a) * P(b-m); */
- /* except that would call P() 16 times per pixel therefor pow() 64 times, better precalc these */
- w = wx * wy[m+1];
-
- if (outF) {
- dataF= in->rect_float + in->x * y1 * 4 + 4*x1;
- outR+= dataF[0] * w;
- outG+= dataF[1] * w;
- outB+= dataF[2] * w;
- outA+= dataF[3] * w;
- }
- if (outI) {
- dataI= (unsigned char*)in->rect + in->x * y1 * 4 + 4*x1;
- outR+= dataI[0] * w;
- outG+= dataI[1] * w;
- outB+= dataI[2] * w;
- outA+= dataI[3] * w;
- }
- }
+ CLAMP(x1, 0, in->x-1);
+ wx = P(n-a);
+ for(m= -1; m<= 2; m++){
+ y1= j+m;
+ CLAMP(y1, 0, in->y-1);
+ /* normally we could do this */
+ /* w = P(n-a) * P(b-m); */
+ /* except that would call P() 16 times per pixel therefor pow() 64 times, better precalc these */
+ w = wx * wy[m+1];
+
+ if (outF) {
+ dataF= in->rect_float + in->x * y1 * 4 + 4*x1;
+ outR+= dataF[0] * w;
+ outG+= dataF[1] * w;
+ outB+= dataF[2] * w;
+ outA+= dataF[3] * w;
+ }
+ if (outI) {
+ dataI= (unsigned char*)in->rect + in->x * y1 * 4 + 4*x1;
+ outR+= dataI[0] * w;
+ outG+= dataI[1] * w;
+ outB+= dataI[2] * w;
+ outA+= dataI[3] * w;
}
}
}
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index 3d88a24ba37..c2bdb44be10 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -68,24 +68,24 @@ int imb_is_a_jp2(unsigned char *buf)
/**
-sample error callback expecting a FILE* client object
-*/
+ * sample error callback expecting a FILE* client object
+ */
static void error_callback(const char *msg, void *client_data)
{
FILE *stream = (FILE*)client_data;
fprintf(stream, "[ERROR] %s", msg);
}
/**
-sample warning callback expecting a FILE* client object
-*/
+ * sample warning callback expecting a FILE* client object
+ */
static void warning_callback(const char *msg, void *client_data)
{
FILE *stream = (FILE*)client_data;
fprintf(stream, "[WARNING] %s", msg);
}
/**
-sample debug callback expecting no client object
-*/
+ * sample debug callback expecting no client object
+ */
static void info_callback(const char *msg, void *client_data)
{
(void)client_data;
@@ -146,7 +146,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
/* decode the stream and fill the image structure */
image = opj_decode(dinfo, cio);
- if(!image) {
+ if (!image) {
fprintf(stderr, "ERROR -> j2k_to_image: failed to decode image!\n");
opj_destroy_decompress(dinfo);
opj_cio_close(cio);
@@ -157,8 +157,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
opj_cio_close(cio);
- if((image->numcomps * image->x1 * image->y1) == 0)
- {
+ if((image->numcomps * image->x1 * image->y1) == 0) {
fprintf(stderr,"\nError: invalid raw image parameters\n");
return NULL;
}
@@ -293,11 +292,11 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
/*
-2048x1080 (2K) at 24 fps or 48 fps, or 4096x2160 (4K) at 24 fps; 3x12 bits per pixel, XYZ color space
-
- * In 2K, for Scope (2.39:1) presentation 2048x858 pixels of the imager is used
- * In 2K, for Flat (1.85:1) presentation 1998x1080 pixels of the imager is used
-*/
+ * 2048x1080 (2K) at 24 fps or 48 fps, or 4096x2160 (4K) at 24 fps; 3x12 bits per pixel, XYZ color space
+ *
+ * - In 2K, for Scope (2.39:1) presentation 2048x858 pixels of the imager is used
+ * - In 2K, for Flat (1.85:1) presentation 1998x1080 pixels of the imager is used
+ */
/* ****************************** COPIED FROM image_to_j2k.c */
@@ -329,7 +328,7 @@ static int initialise_4K_poc(opj_poc_t *POC, int numres)
static void cinema_parameters(opj_cparameters_t *parameters)
{
- parameters->tile_size_on = false;
+ parameters->tile_size_on = FALSE;
parameters->cp_tdx=1;
parameters->cp_tdy=1;
@@ -680,9 +679,9 @@ int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags)
(void)flags; /* unused */
/*
- configure the event callbacks (not required)
- setting of each callback is optionnal
- */
+ * configure the event callbacks (not required)
+ * setting of each callback is optionnal
+ */
memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
event_mgr.error_handler = error_callback;
event_mgr.warning_handler = warning_callback;
@@ -693,7 +692,7 @@ int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags)
/* compression ratio */
/* invert range, from 10-100, 100-1
- * where jpeg see's 1 and highest quality (lossless) and 100 is very low quality*/
+ * where jpeg see's 1 and highest quality (lossless) and 100 is very low quality*/
parameters.tcp_rates[0]= ((100-quality)/90.0f*99.0f) + 1;
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c
index 6c3b7594264..2aab497649a 100644
--- a/source/blender/imbuf/intern/jpeg.c
+++ b/source/blender/imbuf/intern/jpeg.c
@@ -69,11 +69,11 @@ static ImBuf * ibJpegImageFromCinfo(struct jpeg_decompress_struct * cinfo, int f
*
* 1. jpeg - standard printing, u & v at quarter of resulution
* 2. jvid - standaard video, u & v half resolution, frame not interlaced
-
-type 3 is unsupported as of jul 05 2000 Frank.
-
+ *
+ * type 3 is unsupported as of jul 05 2000 Frank.
+ *
* 3. jstr - as 2, but written in 2 separate fields
-
+ *
* 4. jmax - no scaling in the components
*/
@@ -142,8 +142,8 @@ static boolean fill_input_buffer(j_decompress_ptr cinfo)
my_src_ptr src = (my_src_ptr) cinfo->src;
/* Since we have given all we have got already
- * we simply fake an end of file
- */
+ * we simply fake an end of file
+ */
src->pub.next_input_byte = src->terminal;
src->pub.bytes_in_buffer = 2;
@@ -177,8 +177,7 @@ static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, size_t
{
my_src_ptr src;
- if (cinfo->src == NULL)
- { /* first time for this JPEG object? */
+ if (cinfo->src == NULL) { /* first time for this JPEG object? */
cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(my_source_mgr));
}
@@ -406,7 +405,7 @@ static ImBuf * ibJpegImageFromCinfo(struct jpeg_decompress_struct * cinfo, int f
/*
* A little paranoid, but the file maybe
* is broken... and a "extra" check is better
- * that a segfaul ;)
+ * then segfault ;)
*/
if (!key) {
MEM_freeN(str);
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index ad729b34d31..bd79a6ea48b 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -1,8 +1,4 @@
-/** \file blender/imbuf/intern/openexr/openexr_api.cpp
- * \ingroup openexr
- */
/*
-*
* ***** BEGIN GPLLICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -29,6 +25,10 @@
* ***** END GPL LICENSE BLOCK *****
*/
+/** \file blender/imbuf/intern/openexr/openexr_api.cpp
+ * \ingroup openexr
+ */
+
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
@@ -234,34 +234,17 @@ static int imb_save_openexr_half(struct ImBuf *ibuf, const char *name, int flags
if(ibuf->rect_float) {
float *from;
- if(ibuf->profile == IB_PROFILE_LINEAR_RGB) {
- for (int i = ibuf->y-1; i >= 0; i--)
- {
- from= ibuf->rect_float + channels*i*width;
+ for (int i = ibuf->y-1; i >= 0; i--)
+ {
+ from= ibuf->rect_float + channels*i*width;
- for (int j = ibuf->x; j > 0; j--)
- {
- to->r = from[0];
- to->g = from[1];
- to->b = from[2];
- to->a = (channels >= 4)? from[3]: 1.0f;
- to++; from += 4;
- }
- }
- }
- else {
- for (int i = ibuf->y-1; i >= 0; i--)
+ for (int j = ibuf->x; j > 0; j--)
{
- from= ibuf->rect_float + channels*i*width;
-
- for (int j = ibuf->x; j > 0; j--)
- {
- to->r = srgb_to_linearrgb(from[0]);
- to->g = srgb_to_linearrgb(from[1]);
- to->b = srgb_to_linearrgb(from[2]);
- to->a = (channels >= 4)? from[3]: 1.0f;
- to++; from += 4;
- }
+ to->r = from[0];
+ to->g = from[1];
+ to->b = from[2];
+ to->a = (channels >= 4)? from[3]: 1.0f;
+ to++; from += 4;
}
}
}
@@ -401,11 +384,11 @@ int imb_save_openexr(struct ImBuf *ibuf, const char *name, int flags)
/* ********************* Nicer API, MultiLayer and with Tile file support ************************************ */
/* naming rules:
- - parse name from right to left
- - last character is channel ID, 1 char like 'A' 'R' 'G' 'B' 'X' 'Y' 'Z' 'W' 'U' 'V'
- - separated with a dot; the Pass name (like "Depth", "Color", "Diffuse" or "Combined")
- - separated with a dot: the Layer name (like "Lamp1" or "Walls" or "Characters")
-*/
+ * - parse name from right to left
+ * - last character is channel ID, 1 char like 'A' 'R' 'G' 'B' 'X' 'Y' 'Z' 'W' 'U' 'V'
+ * - separated with a dot; the Pass name (like "Depth", "Color", "Diffuse" or "Combined")
+ * - separated with a dot: the Layer name (like "Lamp1" or "Walls" or "Characters")
+ */
static ListBase exrhandles= {NULL, NULL};
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.h b/source/blender/imbuf/intern/openexr/openexr_api.h
index 0d51461c2e8..e0358361713 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.h
+++ b/source/blender/imbuf/intern/openexr/openexr_api.h
@@ -39,7 +39,7 @@ extern "C" {
#include <stdio.h>
- /**
+/**
* Test presence of OpenEXR file.
* \param mem pointer to loaded OpenEXR bitstream
*/
diff --git a/source/blender/imbuf/intern/openexr/openexr_multi.h b/source/blender/imbuf/intern/openexr/openexr_multi.h
index cb18ddd219b..88d8b09675b 100644
--- a/source/blender/imbuf/intern/openexr/openexr_multi.h
+++ b/source/blender/imbuf/intern/openexr/openexr_multi.h
@@ -36,7 +36,7 @@
/* experiment with more advanced exr api */
/* Note: as for now openexr only supports 32 chars in channel names.
- This api also supports max 8 channels per pass now. easy to fix! */
+ * This api also supports max 8 channels per pass now. easy to fix! */
#define EXR_LAY_MAXNAME 19
#define EXR_PASS_MAXNAME 11
#define EXR_TOT_MAXNAME 32
diff --git a/source/blender/imbuf/intern/openexr/openexr_stub.cpp b/source/blender/imbuf/intern/openexr/openexr_stub.cpp
index 29b12a2984b..e896fc58cf3 100644
--- a/source/blender/imbuf/intern/openexr/openexr_stub.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_stub.cpp
@@ -1,8 +1,4 @@
-/** \file blender/imbuf/intern/openexr/openexr_stub.cpp
- * \ingroup openexr
- */
/*
-*
* ***** BEGIN GPLLICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -29,6 +25,9 @@
* ***** END GPL LICENSE BLOCK *****
*/
+/** \file blender/imbuf/intern/openexr/openexr_stub.cpp
+ * \ingroup openexr
+ */
#include "openexr_api.h"
#include "openexr_multi.h"
diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c
index 74047ae74f5..84f3e18591d 100644
--- a/source/blender/imbuf/intern/png.c
+++ b/source/blender/imbuf/intern/png.c
@@ -205,15 +205,15 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
png_init_io(png_ptr, fp);
}
- /*
+#if 0
png_set_filter(png_ptr, 0,
- PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE |
- PNG_FILTER_SUB | PNG_FILTER_VALUE_SUB |
- PNG_FILTER_UP | PNG_FILTER_VALUE_UP |
- PNG_FILTER_AVG | PNG_FILTER_VALUE_AVG |
- PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH|
- PNG_ALL_FILTERS);
- */
+ PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE |
+ PNG_FILTER_SUB | PNG_FILTER_VALUE_SUB |
+ PNG_FILTER_UP | PNG_FILTER_VALUE_UP |
+ PNG_FILTER_AVG | PNG_FILTER_VALUE_AVG |
+ PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH|
+ PNG_ALL_FILTERS);
+#endif
png_set_compression_level(png_ptr, compression);
diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c
index ec63a93ac69..9265da8d8dc 100644
--- a/source/blender/imbuf/intern/radiance_hdr.c
+++ b/source/blender/imbuf/intern/radiance_hdr.c
@@ -30,12 +30,12 @@
*/
/* ----------------------------------------------------------------------
- Radiance High Dynamic Range image file IO
- For description and code for reading/writing of radiance hdr files
- by Greg Ward, refer to:
- http://radsite.lbl.gov/radiance/refer/Notes/picture_format.html
-----------------------------------------------------------------------
-*/
+ * Radiance High Dynamic Range image file IO
+ * For description and code for reading/writing of radiance hdr files
+ * by Greg Ward, refer to:
+ * http://radsite.lbl.gov/radiance/refer/Notes/picture_format.html
+ * ----------------------------------------------------------------------
+ */
#ifdef WIN32
# include <io.h>
@@ -183,8 +183,7 @@ struct ImBuf *imb_loadhdr(unsigned char *mem, size_t size, int flags)
unsigned char* ptr;
char oriY[80], oriX[80];
- if (imb_is_a_hdr((void*)mem))
- {
+ if (imb_is_a_hdr((void *)mem)) {
/* find empty line, next line is resolution info */
for (x=1;x<size;x++) {
if ((mem[x-1]=='\n') && (mem[x]=='\n')) {
diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c
index 97b94ae7b27..492d0af2ac8 100644
--- a/source/blender/imbuf/intern/rectop.c
+++ b/source/blender/imbuf/intern/rectop.c
@@ -47,8 +47,8 @@
static void blend_color_mix(char *cp, char *cp1, char *cp2, int fac)
{
/* this and other blending modes previously used >>8 instead of /255. both
- are not equivalent (>>8 is /256), and the former results in rounding
- errors that can turn colors black fast after repeated blending */
+ * are not equivalent (>>8 is /256), and the former results in rounding
+ * errors that can turn colors black fast after repeated blending */
int mfac= 255-fac;
cp[0]= (mfac*cp1[0]+fac*cp2[0])/255;
@@ -93,7 +93,7 @@ static void blend_color_mul(char *cp, char *cp1, char *cp2, int fac)
static void blend_color_lighten(char *cp, char *cp1, char *cp2, int fac)
{
/* See if are lighter, if so mix, else dont do anything.
- if the paint col is darker then the original, then ignore */
+ * if the paint col is darker then the original, then ignore */
if (cp1[0]+cp1[1]+cp1[2] > cp2[0]+cp2[1]+cp2[2]) {
cp[0]= cp1[0];
cp[1]= cp1[1];
@@ -106,7 +106,7 @@ static void blend_color_lighten(char *cp, char *cp1, char *cp2, int fac)
static void blend_color_darken(char *cp, char *cp1, char *cp2, int fac)
{
/* See if were darker, if so mix, else dont do anything.
- if the paint col is brighter then the original, then ignore */
+ * if the paint col is brighter then the original, then ignore */
if (cp1[0]+cp1[1]+cp1[2] < cp2[0]+cp2[1]+cp2[2]) {
cp[0]= cp1[0];
cp[1]= cp1[1];
@@ -202,7 +202,7 @@ static void blend_color_mul_float(float *cp, float *cp1, float *cp2, float fac)
static void blend_color_lighten_float(float *cp, float *cp1, float *cp2, float fac)
{
/* See if are lighter, if so mix, else dont do anything.
- if the pafloat col is darker then the original, then ignore */
+ * if the pafloat col is darker then the original, then ignore */
if (cp1[0]+cp1[1]+cp1[2] > cp2[0]+cp2[1]+cp2[2]) {
cp[0]= cp1[0];
cp[1]= cp1[1];
@@ -215,7 +215,7 @@ static void blend_color_lighten_float(float *cp, float *cp1, float *cp2, float f
static void blend_color_darken_float(float *cp, float *cp1, float *cp2, float fac)
{
/* See if were darker, if so mix, else dont do anything.
- if the pafloat col is brighter then the original, then ignore */
+ * if the pafloat col is brighter then the original, then ignore */
if (cp1[0]+cp1[1]+cp1[2] < cp2[0]+cp2[1]+cp2[2]) {
cp[0]= cp1[0];
cp[1]= cp1[1];
diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c
index c131d385874..361faa08b29 100644
--- a/source/blender/imbuf/intern/scaling.c
+++ b/source/blender/imbuf/intern/scaling.c
@@ -773,27 +773,27 @@ static void q_scale_float(float* in, float* out, int in_width,
}
}
-/* q_scale_linear_interpolation (derived from ppmqscale, http://libdv.sf.net)
-
- q stands for quick _and_ quality :)
-
- only handles common cases when we either
-
- scale both, x and y or
- shrink both, x and y
-
- but that is pretty fast:
- * does only blit once instead of two passes like the old code
- (fewer cache misses)
- * uses fixed point integer arithmetic for byte buffers
- * doesn't branch in tight loops
-
- Should be comparable in speed to the ImBuf ..._fast functions at least
- for byte-buffers.
-
- NOTE: disabled, due to inacceptable inaccuracy and quality loss, see bug #18609 (ton)
-
-*/
+/**
+ * q_scale_linear_interpolation (derived from ppmqscale, http://libdv.sf.net)
+ *
+ * q stands for quick _and_ quality :)
+ *
+ * only handles common cases when we either
+ *
+ * scale both, x and y or
+ * shrink both, x and y
+ *
+ * but that is pretty fast:
+ * - does only blit once instead of two passes like the old code
+ * (fewer cache misses)
+ * - uses fixed point integer arithmetic for byte buffers
+ * - doesn't branch in tight loops
+ *
+ * Should be comparable in speed to the ImBuf ..._fast functions at least
+ * for byte-buffers.
+ *
+ * NOTE: disabled, due to inacceptable inaccuracy and quality loss, see bug #18609 (ton)
+ */
static int q_scale_linear_interpolation(
struct ImBuf *ibuf, int newx, int newy)
{
@@ -1473,7 +1473,7 @@ struct ImBuf *IMB_scaleImBuf(struct ImBuf * ibuf, unsigned int newx, unsigned in
if (newx == ibuf->x && newy == ibuf->y) { return ibuf; }
/* scaleup / scaledown functions below change ibuf->x and ibuf->y
- so we first scale the Z-buffer (if any) */
+ * so we first scale the Z-buffer (if any) */
scalefast_Z_ImBuf(ibuf, newx, newy);
/* try to scale common cases in a fast way */
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index 808bcbed751..f863fe8de21 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -251,8 +251,8 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im
char tpath[FILE_MAX];
char tdir[FILE_MAX];
char temp[FILE_MAX];
- char mtime[40]= "0"; /* incase we can't stat the file */
- char cwidth[40]= "0"; /* incase images have no data */
+ char mtime[40]= "0"; /* in case we can't stat the file */
+ char cwidth[40]= "0"; /* in case images have no data */
char cheight[40]= "0";
char thumb[40];
short tsize = 128;
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index afc64e1a528..1e6bc216128 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -554,7 +554,7 @@ ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags)
}
/* detect if we are reading a tiled/mipmapped texture, in that case
- we don't read pixels but leave it to the cache to load tiles */
+ * we don't read pixels but leave it to the cache to load tiles */
if(flags & IB_tilecache) {
format= NULL;
TIFFGetField(image, TIFFTAG_PIXAR_TEXTUREFORMAT, &format);
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index 47dad378eb7..b7eba1002c5 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -215,12 +215,10 @@ static int isqtime (const char *name)
void silence_log_ffmpeg(int quiet)
{
- if (quiet)
- {
+ if (quiet) {
av_log_set_level(AV_LOG_QUIET);
}
- else
- {
+ else {
av_log_set_level(AV_LOG_DEBUG);
}
}
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 5908df4b933..5b730029022 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -54,15 +54,14 @@ typedef struct IDProperty {
char type, subtype;
short flag;
char name[64]; /* MAX_IDPROP_NAME */
- int saved; /*saved is used to indicate if this struct has been saved yet.
- seemed like a good idea as a pad var was needed anyway :)*/
+ int saved; /* saved is used to indicate if this struct has been saved yet.
+ * seemed like a good idea as a pad var was needed anyway :)*/
IDPropertyData data; /* note, alignment for 64 bits */
int len; /* array length, also (this is important!) string length + 1.
* the idea is to be able to reuse array realloc functions on strings.*/
/* totallen is total length of allocated array/string, including a buffer.
* Note that the buffering is mild; the code comes from python's list implementation.*/
- int totallen; /*strings and arrays are both buffered, though the buffer isn't
- saved.*/
+ int totallen; /*strings and arrays are both buffered, though the buffer isn't saved.*/
} IDProperty;
#define MAX_IDPROP_NAME 64
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index 4cc45fcd08b..6abda1f711b 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -416,7 +416,7 @@ typedef enum eItasc_Solver {
/* Groups -------------------------------------- */
/* Action-Channel Group (agrp)
-
+ *
* These are stored as a list per-Action, and are only used to
* group that Action's channels in an Animation Editor.
*
diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h
index 41b830847ad..f4e06455c63 100644
--- a/source/blender/makesdna/DNA_actuator_types.h
+++ b/source/blender/makesdna/DNA_actuator_types.h
@@ -199,7 +199,7 @@ typedef struct bTwoDFilterActuator {
/* Tells what type of 2D Filter */
short type;
/* (flag == 0) means 2D filter is activate and
- (flag != 0) means 2D filter is inactive */
+ * (flag != 0) means 2D filter is inactive */
short flag;
int int_arg;
/* a float argument */
@@ -224,6 +224,8 @@ typedef struct bArmatureActuator {
char constraint[64]; /* MAX_NAME */
int type; /* 0=run, 1=enable, 2=disable, 3=set target, 4=set weight */
float weight;
+ float influence;
+ float pad;
struct Object *target;
struct Object *subtarget;
} bArmatureActuator;
@@ -511,8 +513,9 @@ typedef struct bActuator {
#define ACT_ARM_DISABLE 2
#define ACT_ARM_SETTARGET 3
#define ACT_ARM_SETWEIGHT 4
-/* update this define if more type are addedd */
-#define ACT_ARM_MAXTYPE 4
+#define ACT_ARM_SETINFLUENCE 5
+/* update this define if more types are added */
+#define ACT_ARM_MAXTYPE 5
/* stateactuator->type */
#define ACT_STATE_SET 0
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h
index 0f62348f418..c68592e525c 100644
--- a/source/blender/makesdna/DNA_anim_types.h
+++ b/source/blender/makesdna/DNA_anim_types.h
@@ -528,7 +528,7 @@ typedef struct AnimMapPair {
/* Retargetting Information for Actions
*
- * This should only be used if it is strictly necessary (i.e. user will need to explictly
+ * This should only be used if it is strictly necessary (i.e. user will need to explicitly
* add this when they find that some channels do not match, or motion is not going to right
* places). When executing an action, this will be checked to see if it provides any useful
* remaps for the given paths.
@@ -661,7 +661,7 @@ typedef enum eNlaStrip_Type {
/* NLA Track (nlt)
*
- * A track groups a bunch of 'strips', which should form a continous set of
+ * A track groups a bunch of 'strips', which should form a continuous set of
* motion, on top of which other such groups can be layered. This should allow
* for animators to work in a non-destructive manner, layering tweaks, etc. over
* 'rough' blocks of their work.
@@ -761,7 +761,9 @@ typedef struct KeyingSet {
ListBase paths; /* (KS_Path) paths to keyframe to */
+ char idname[64]; /* unique name (for search, etc.) */
char name[64]; /* user-viewable name for KeyingSet (for menus, etc.) */
+ char description[240]; /* (RNA_DYN_DESCR_MAX) short help text. */
char typeinfo[64]; /* name of the typeinfo data used for the relative paths */
short flag; /* settings for KeyingSet */
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index f915b75a77f..b8b1f7d8b70 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -36,13 +36,13 @@
struct AnimData;
/* this system works on different transformation space levels;
-
-1) Bone Space; with each Bone having own (0,0,0) origin
-2) Armature Space; the rest position, in Object space, Bones Spaces are applied hierarchical
-3) Pose Space; the animation position, in Object space
-4) World Space; Object matrix applied to Pose or Armature space
-
-*/
+ *
+ * 1) Bone Space; with each Bone having own (0,0,0) origin
+ * 2) Armature Space; the rest position, in Object space, Bones Spaces are applied hierarchical
+ * 3) Pose Space; the animation position, in Object space
+ * 4) World Space; Object matrix applied to Pose or Armature space
+ *
+ */
typedef struct Bone {
struct Bone *next, *prev; /* Next/prev elements within this list */
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 454008c73a7..9fb24199571 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -131,7 +131,7 @@ typedef struct Brush {
#define BRUSH_FRONTFACE (1<<27)
#define BRUSH_CUSTOM_ICON (1<<28)
-/* temporary flag which sets up autmatically for correct
+/* temporary flag which sets up automatically for correct
* brush drawing when inverted modal operator is running */
#define BRUSH_INVERTED (1<<29)
diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h
index cdf20bd726a..112247f3d66 100644
--- a/source/blender/makesdna/DNA_camera_types.h
+++ b/source/blender/makesdna/DNA_camera_types.h
@@ -59,7 +59,7 @@ typedef struct Camera {
/* yafray: dof params */
/* 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 */
+ * The name was not changed so that no other files need to be modified */
float YF_dofdist;
struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
diff --git a/source/blender/makesdna/DNA_cloth_types.h b/source/blender/makesdna/DNA_cloth_types.h
index 79a1d821543..fd8b08e68c6 100644
--- a/source/blender/makesdna/DNA_cloth_types.h
+++ b/source/blender/makesdna/DNA_cloth_types.h
@@ -33,16 +33,16 @@
#define __DNA_CLOTH_TYPES_H__
/**
-* This struct contains all the global data required to run a simulation.
-* At the time of this writing, this structure contains data appropriate
-* to run a simulation as described in Deformation Constraints in a
-* Mass-Spring Model to Describe Rigid Cloth Behavior by Xavier Provot.
-*
-* I've tried to keep similar, if not exact names for the variables as
-* are presented in the paper. Where I've changed the concept slightly,
-* as in stepsPerFrame comapred to the time step in the paper, I've used
-* variables with different names to minimize confusion.
-**/
+ * This struct contains all the global data required to run a simulation.
+ * At the time of this writing, this structure contains data appropriate
+ * to run a simulation as described in Deformation Constraints in a
+ * Mass-Spring Model to Describe Rigid Cloth Behavior by Xavier Provot.
+ *
+ * I've tried to keep similar, if not exact names for the variables as
+ * are presented in the paper. Where I've changed the concept slightly,
+ * as in stepsPerFrame comapred to the time step in the paper, I've used
+ * variables with different names to minimize confusion.
+ */
typedef struct ClothSimSettings
{
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index e311b6dffea..c9d80476fde 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -92,16 +92,16 @@ typedef struct BevPoint {
*/
/* note: alfa location in struct is abused by Key system */
/* vec in BezTriple looks like this:
- vec[0][0]=x location of handle 1
- vec[0][1]=y location of handle 1
- vec[0][2]=z location of handle 1 (not used for FCurve Points(2d))
- vec[1][0]=x location of control point
- vec[1][1]=y location of control point
- vec[1][2]=z location of control point
- vec[2][0]=x location of handle 2
- vec[2][1]=y location of handle 2
- vec[2][2]=z location of handle 2 (not used for FCurve Points(2d))
-*/
+ * - vec[0][0]=x location of handle 1
+ * - vec[0][1]=y location of handle 1
+ * - vec[0][2]=z location of handle 1 (not used for FCurve Points(2d))
+ * - vec[1][0]=x location of control point
+ * - vec[1][1]=y location of control point
+ * - vec[1][2]=z location of control point
+ * - vec[2][0]=x location of handle 2
+ * - vec[2][1]=y location of handle 2
+ * - vec[2][2]=z location of handle 2 (not used for FCurve Points(2d))
+ */
typedef struct BezTriple {
float vec[3][3];
float alfa, weight, radius; /* alfa: tilt in 3D View, weight: used for softbody goal weight, radius: for bevel tapering */
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index d7358a4df1e..2a8c4c3a74e 100644
--- a/source/blender/makesdna/DNA_customdata_types.h
+++ b/source/blender/makesdna/DNA_customdata_types.h
@@ -59,7 +59,7 @@ typedef struct CustomDataExternal {
} CustomDataExternal;
/** structure which stores custom element data associated with mesh elements
- * (vertices, edges or faces). The custom data is organised into a series of
+ * (vertices, edges or faces). The custom data is organized into a series of
* layers, each with a data type (e.g. MTFace, MDeformVert, etc.). */
typedef struct CustomData {
CustomDataLayer *layers; /* CustomDataLayers, ordered by type */
diff --git a/source/blender/makesdna/DNA_documentation.h b/source/blender/makesdna/DNA_documentation.h
index c1d6ee4aec3..0dd7f37f8b4 100644
--- a/source/blender/makesdna/DNA_documentation.h
+++ b/source/blender/makesdna/DNA_documentation.h
@@ -60,14 +60,14 @@
*
* DNA has no external dependencies (except for a few system
* includes).
-
+ *
* \section dnanote NOTE
-
+ *
* PLEASE READ INSTRUCTIONS ABOUT ADDING VARIABLES IN 'DNA' STRUCTS IN
*
* intern/dna_genfile.c
* (ton)
-
+ *
*/
diff --git a/source/blender/makesdna/DNA_dynamicpaint_types.h b/source/blender/makesdna/DNA_dynamicpaint_types.h
index fedc603fde2..ca1b1bf1725 100644
--- a/source/blender/makesdna/DNA_dynamicpaint_types.h
+++ b/source/blender/makesdna/DNA_dynamicpaint_types.h
@@ -159,7 +159,7 @@ typedef struct DynamicPaintCanvasSettings {
#define MOD_DPAINT_PART_RAD (1<<0) /* use particle radius */
#define MOD_DPAINT_USE_MATERIAL (1<<1) /* use object material */
#define MOD_DPAINT_ABS_ALPHA (1<<2) /* don't increase alpha unless
- paint alpha is higher than existing */
+ * paint alpha is higher than existing */
#define MOD_DPAINT_ERASE (1<<3) /* removes paint */
#define MOD_DPAINT_RAMP_ALPHA (1<<4) /* only read falloff ramp alpha */
diff --git a/source/blender/makesdna/DNA_fileglobal_types.h b/source/blender/makesdna/DNA_fileglobal_types.h
index 0ae5c2465da..7e81041fe4a 100644
--- a/source/blender/makesdna/DNA_fileglobal_types.h
+++ b/source/blender/makesdna/DNA_fileglobal_types.h
@@ -36,7 +36,7 @@ struct bScreen;
struct Scene;
/**
- * FileGlobal stores a part of the current user-unterface settings at
+ * FileGlobal stores a part of the current user-interface settings at
* the moment of saving, and the file-specific settings.
*/
typedef struct FileGlobal {
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index f3dce52d784..e2c2870d305 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -136,7 +136,7 @@ typedef struct Material {
short diff_shader, spec_shader;
float roughness, refrac;
/* XXX param[4] needs review and improvement (shader system as whole anyway)
- This is nasty reused variable for different goals and not easy to RNAify nicely. -jesterKing */
+ * This is nasty reused variable for different goals and not easy to RNAify nicely. -jesterKing */
float param[4]; /* size, smooth, size, smooth, for toonshader, 0 (fac) and 1 (fresnel) also for fresnel shader */
float rms;
float darkness;
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index be7ada5c5f1..4c57cd211dd 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -77,8 +77,8 @@ typedef struct Mesh {
struct MLoopCol *mloopcol;
/* END BMESH ONLY */
- /*mface stores the tessellation (triangulation) of the mesh,
- real faces are now stored in nface.*/
+ /* 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 tessellation */
struct MTFace *mtface; /* store tessellation face UV's and texture here */
struct TFace *tface; /* depecrated, use mtface */
@@ -87,7 +87,7 @@ typedef struct Mesh {
struct MDeformVert *dvert; /* deformgroup vertices */
/* array of colors for the tesselated faces, must be number of tesselated
- faces * 4 in length */
+ * faces * 4 in length */
struct MCol *mcol;
struct MSticky *msticky;
struct Mesh *texcomesh;
@@ -197,27 +197,6 @@ typedef struct TFace {
#define ME_DRAW_FREESTYLE_EDGE (1 << 14)
#define ME_DRAW_FREESTYLE_FACE (1 << 15)
-/* old global flags:
-#define G_DRAWEDGES (1 << 18)
-#define G_DRAWFACES (1 << 7)
-#define G_DRAWNORMALS (1 << 6)
-#define G_DRAW_VNORMALS (1 << 14)
-
-#define G_ALLEDGES (1 << 11)
-#define G_HIDDENEDGES (1 << 21)
-
-#define G_DRAWCREASES (1 << 19)
-#define G_DRAWSEAMS (1 << 20)
-#define G_DRAWSHARP (1 << 28)
-#define G_DRAWBWEIGHTS (1 << 31)
-
-#define G_DRAW_EDGELEN (1 << 22)
-#define G_DRAW_FACEAREA (1 << 23)
-#define G_DRAW_EDGEANG (1 << 24)
-*/
-
-
-
/* Subsurf Type */
#define ME_CC_SUBSURF 0
#define ME_SIMPLE_SUBSURF 1
@@ -230,6 +209,8 @@ typedef struct TFace {
#define USE_BMESH_SAVE_AS_COMPAT
#define USE_BMESH_SAVE_WITHOUT_MFACE
+/* enable this to calculate mpoly normal layer and face origindex mapping */
+// #define USE_BMESH_MPOLY_NORMALS
/* enable this so meshes get tessfaces calculated by default */
// #define USE_TESSFACE_DEFAULT
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index d7be7c0bff6..b4c0fa09047 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -75,8 +75,8 @@ typedef struct MCol {
char a, r, g, b;
} MCol;
-/*new face structure, replaces MFace, which is now
- only used for storing tessellations.*/
+/* new face structure, replaces MFace, which is now
+ * only used for storing tessellations.*/
typedef struct MPoly {
/* offset into loop array and number of loops in the face */
int loopstart;
@@ -85,8 +85,8 @@ typedef struct MPoly {
char flag, pad;
} MPoly;
-/*the e here is because we want to move away from
- relying on edge hashes.*/
+/* the e here is because we want to move away from
+ * relying on edge hashes.*/
typedef struct MLoop {
unsigned int v; /*vertex index*/
unsigned int e; /*edge index*/
diff --git a/source/blender/makesdna/DNA_meta_types.h b/source/blender/makesdna/DNA_meta_types.h
index 9c20b8f644b..2912650c77c 100644
--- a/source/blender/makesdna/DNA_meta_types.h
+++ b/source/blender/makesdna/DNA_meta_types.h
@@ -87,8 +87,8 @@ typedef struct MetaBall {
float wiresize, rendersize; /* display and render res */
/* bias elements to have an offset volume.
- mother ball changes will effect other objects thresholds,
- but these may also have their own thresh as an offset */
+ * mother ball changes will effect other objects thresholds,
+ * but these may also have their own thresh as an offset */
float thresh;
/* used in editmode */
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index a848c3edd49..f00bd338fd5 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -191,33 +191,33 @@ typedef struct ArrayModifierData {
/* the object to use for object offset */
struct Object *offset_ob;
/* a constant duplicate offset;
- 1 means the duplicates are 1 unit apart
- */
+ * 1 means the duplicates are 1 unit apart
+ */
float offset[3];
/* a scaled factor for duplicate offsets;
- 1 means the duplicates are 1 object-width apart
- */
+ * 1 means the duplicates are 1 object-width apart
+ */
float scale[3];
/* the length over which to distribute the duplicates */
float length;
/* the limit below which to merge vertices in adjacent duplicates */
float merge_dist;
/* determines how duplicate count is calculated; one of:
- MOD_ARR_FIXEDCOUNT -> fixed
- MOD_ARR_FITLENGTH -> calculated to fit a set length
- MOD_ARR_FITCURVE -> calculated to fit the length of a Curve object
- */
+ * - MOD_ARR_FIXEDCOUNT -> fixed
+ * - MOD_ARR_FITLENGTH -> calculated to fit a set length
+ * - MOD_ARR_FITCURVE -> calculated to fit the length of a Curve object
+ */
int fit_type;
/* flags specifying how total offset is calculated; binary OR of:
- MOD_ARR_OFF_CONST -> total offset += offset
- MOD_ARR_OFF_RELATIVE -> total offset += relative * object width
- MOD_ARR_OFF_OBJ -> total offset += offset_ob's matrix
- total offset is the sum of the individual enabled offsets
- */
+ * - MOD_ARR_OFF_CONST -> total offset += offset
+ * - MOD_ARR_OFF_RELATIVE -> total offset += relative * object width
+ * - MOD_ARR_OFF_OBJ -> total offset += offset_ob's matrix
+ * total offset is the sum of the individual enabled offsets
+ */
int offset_type;
/* general flags:
- MOD_ARR_MERGE -> merge vertices in adjacent duplicates
- */
+ * MOD_ARR_MERGE -> merge vertices in adjacent duplicates
+ */
int flags;
/* the number of duplicates to generate for MOD_ARR_FIXEDCOUNT */
int count;
@@ -1045,7 +1045,7 @@ typedef struct RemeshModifierData {
ModifierData modifier;
/* floodfill option, controls how small components can be
- before they are removed */
+ * before they are removed */
float threshold;
/* ratio between size of model and grid */
diff --git a/source/blender/makesdna/DNA_movieclip_types.h b/source/blender/makesdna/DNA_movieclip_types.h
index be189e883c7..b4e6c07cec3 100644
--- a/source/blender/makesdna/DNA_movieclip_types.h
+++ b/source/blender/makesdna/DNA_movieclip_types.h
@@ -15,7 +15,7 @@
* 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) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2011 Blender Foundation.
* All rights reserved.
*
* The Original Code is: all of this file.
@@ -78,8 +78,8 @@ typedef struct MovieClip {
struct MovieTracking tracking; /* data for SfM tracking */
void *tracking_context; /* context of tracking job
- used to synchronize data like framenumber
- in SpaceClip clip user */
+ * used to synchronize data like framenumber
+ * in SpaceClip clip user */
struct MovieClipProxy proxy; /* proxy to clip data */
int flag, pad;
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index f0d0a556d92..6caf0a7d8b2 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -238,7 +238,7 @@ typedef struct bNodeTree {
int type, init; /* set init on fileread */
int cur_index; /* sockets in groups have unique identifiers, adding new sockets always
- will increase this counter */
+ * will increase this counter */
int flag;
int update; /* update flags */
@@ -475,7 +475,7 @@ typedef struct NodeTexChecker {
typedef struct NodeTexEnvironment {
NodeTexBase base;
- int color_space, pad;
+ int color_space, projection;
} NodeTexEnvironment;
typedef struct NodeTexGradient {
@@ -582,8 +582,12 @@ typedef struct TexNodeOutput {
#define SHD_WAVE_TRI 2
/* image/environment texture */
-#define SHD_COLORSPACE_LINEAR 0
-#define SHD_COLORSPACE_SRGB 1
+#define SHD_COLORSPACE_NONE 0
+#define SHD_COLORSPACE_COLOR 1
+
+/* environment texture */
+#define SHD_PROJ_EQUIRECTANGULAR 0
+#define SHD_PROJ_MIRROR_BALL 1
/* blur node */
#define CMP_NODE_BLUR_ASPECT_NONE 0
diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h
index 6b11fd0766f..0e70b5d28e3 100644
--- a/source/blender/makesdna/DNA_object_force.h
+++ b/source/blender/makesdna/DNA_object_force.h
@@ -130,7 +130,7 @@ typedef struct EffectorWeights {
* - to add new data types update:
* * BKE_ptcache_data_size()
* * ptcache_file_init_pointers()
-*/
+ */
#define BPHYS_DATA_INDEX 0
#define BPHYS_DATA_LOCATION 1
#define BPHYS_DATA_SMOKE_LOW 1
@@ -276,9 +276,10 @@ typedef struct SoftBody {
/* general options */
float nodemass; /* softbody mass of *vertex* */
- char namedVG_Mass[64]; /* MAX_VGROUP_NAME */ /* along with it introduce mass painting
- starting to fix old bug .. nastyness that VG are indexes
- rather find them by name tag to find it -> jow20090613 */
+ char namedVG_Mass[64]; /* MAX_VGROUP_NAME */
+ /* along with it introduce mass painting
+ * starting to fix old bug .. nastyness that VG are indexes
+ * rather find them by name tag to find it -> jow20090613 */
float grav; /* softbody amount of gravitaion to apply */
float mediafrict; /* friction to env */
float rklimit; /* error limit for ODE solver */
@@ -291,17 +292,19 @@ typedef struct SoftBody {
float maxgoal;
float defgoal; /* default goal for vertices without vgroup */
short vertgroup; /* index starting at 1 */
- char namedVG_Softgoal[64]; /* MAX_VGROUP_NAME */ /* starting to fix old bug .. nastyness that VG are indexes
- rather find them by name tag to find it -> jow20090613 */
+ char namedVG_Softgoal[64]; /* MAX_VGROUP_NAME */
+ /* starting to fix old bug .. nastyness that VG are indexes
+ * rather find them by name tag to find it -> jow20090613 */
short fuzzyness; /* */
/* springs */
float inspring; /* softbody inner springs */
float infrict; /* softbody inner springs friction */
- char namedVG_Spring_K[64]; /* MAX_VGROUP_NAME */ /* along with it introduce Spring_K painting
- starting to fix old bug .. nastyness that VG are indexes
- rather find them by name tag to find it -> jow20090613 */
+ char namedVG_Spring_K[64]; /* MAX_VGROUP_NAME */
+ /* along with it introduce Spring_K painting
+ * starting to fix old bug .. nastyness that VG are indexes
+ * rather find them by name tag to find it -> jow20090613 */
/* baking */
int sfra, efra;
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 2564046bb87..471226ec23d 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -619,7 +619,7 @@ typedef struct GameData {
/*
* bit 3: (gameengine): Activity culling is enabled.
* bit 5: (gameengine) : enable Bullet DBVT tree for view frustrum culling
- */
+ */
int flag;
short mode, matmode;
short occlusionRes; /* resolution of occlusion Z buffer in pixel */
@@ -842,11 +842,12 @@ typedef struct TransformOrientation {
} TransformOrientation;
/* *************************************************************** */
-/* Unified Paint Settings */
+/* Unified Paint Settings
+ */
/* These settings can override the equivalent fields in the active
- Brush for any paint mode; the flag field controls whether these
- values are used */
+ * Brush for any paint mode; the flag field controls whether these
+ * values are used */
typedef struct UnifiedPaintSettings {
/* unified radius of brush in pixels */
int size;
@@ -866,12 +867,12 @@ typedef enum {
UNIFIED_PAINT_ALPHA = (1<<1),
/* only used if unified size is enabled, mirros the brush flags
- BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */
+ * BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */
UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1<<2),
UNIFIED_PAINT_BRUSH_SIZE_PRESSURE = (1<<3),
/* only used if unified alpha is enabled, mirrors the brush flag
- BRUSH_ALPHA_PRESSURE */
+ * BRUSH_ALPHA_PRESSURE */
UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE = (1<<4)
} UnifiedPaintSettingsFlags;
@@ -1000,7 +1001,7 @@ typedef struct ToolSettings {
int uv_sculpt_tool;
int uv_relax_method;
/* XXX: these sculpt_paint_* fields are deprecated, use the
- unified_paint_settings field instead! */
+ * unified_paint_settings field instead! */
short sculpt_paint_settings DNA_DEPRECATED; short pad1;
int sculpt_paint_unified_size DNA_DEPRECATED;
float sculpt_paint_unified_unprojected_radius DNA_DEPRECATED;
diff --git a/source/blender/makesdna/DNA_sdna_types.h b/source/blender/makesdna/DNA_sdna_types.h
index 97b65235a29..ec02db192fd 100644
--- a/source/blender/makesdna/DNA_sdna_types.h
+++ b/source/blender/makesdna/DNA_sdna_types.h
@@ -48,14 +48,14 @@ typedef struct SDNA {
short *typelens; /* type lengths */
int nr_structs; /* number of struct types */
- short **structs; /* sp= structs[a] is the address of a struct definintion
- sp[0] is struct type number, sp[1] amount of members
-
- (sp[2], sp[3]), (sp[4], sp[5]), .. are the member
- type and name numbers respectively */
+ short **structs; /* sp = structs[a] is the address of a struct definintion
+ * sp[0] is struct type number, sp[1] amount of members
+ *
+ * (sp[2], sp[3]), (sp[4], sp[5]), .. are the member
+ * type and name numbers respectively */
struct GHash *structs_map; /* ghash for faster lookups,
- requires WITH_DNA_GHASH to be used for now */
+ * requires WITH_DNA_GHASH to be used for now */
/* wrong place for this really, its a simple
* cache for findstruct_nr.
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index 894e1135c0d..053c0c8f7d3 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -109,8 +109,7 @@ typedef struct SmokeDomainSettings {
/* flags */
#define MOD_SMOKE_FLOW_ABSOLUTE (1<<1) /*old style emission*/
-#define MOD_SMOKE_FLOW_INITVELOCITY (1<<2) /* passes particles speed to
- the smoke*/
+#define MOD_SMOKE_FLOW_INITVELOCITY (1<<2) /* passes particles speed to the smoke */
typedef struct SmokeFlowSettings {
@@ -128,11 +127,10 @@ typedef struct SmokeFlowSettings {
int flags; /* absolute emission etc*/
} SmokeFlowSettings;
-/*
- struct BVHTreeFromMesh *bvh;
- float mat[4][4];
- float mat_old[4][4];
- */
+
+// struct BVHTreeFromMesh *bvh;
+// float mat[4][4];
+// float mat_old[4][4];
/* collision objects (filled with smoke) */
typedef struct SmokeCollSettings {
diff --git a/source/blender/makesdna/DNA_sound_types.h b/source/blender/makesdna/DNA_sound_types.h
index 1fab63f9d63..6f67f1fd3c9 100644
--- a/source/blender/makesdna/DNA_sound_types.h
+++ b/source/blender/makesdna/DNA_sound_types.h
@@ -75,8 +75,9 @@ typedef struct bSound {
int flags;
int pad;
-/** currently int type;
- struct bSound *child_sound;*/
+ /* unused currently
+ int type;
+ struct bSound *child_sound; */
/**
* The audaspace handle for cache.
@@ -94,17 +95,19 @@ typedef struct bSound {
*/
void *playback_handle;
-/** XXX unused currently // SOUND_TYPE_LIMITER
- float start, end;*/
+ /* XXX unused currently (SOUND_TYPE_LIMITER) */
+ /* float start, end; */
} bSound;
-/* XXX unused currently
+/* XXX unused currently */
+#if 0
typedef enum eSound_Type {
SOUND_TYPE_INVALID = -1,
SOUND_TYPE_FILE = 0,
SOUND_TYPE_BUFFER,
SOUND_TYPE_LIMITER
-} eSound_Type;*/
+} eSound_Type;
+#endif
/* spacesound->flag */
#define SND_DRAWFRAMES 1
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index bcdeff6cf1b..128c1422ed6 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -215,10 +215,10 @@ typedef struct SpaceFile {
ListBase *folders_next; /* holds the list of next directories (pushed from previous) to show */
/* operator that is invoking fileselect
- op->exec() will be called on the 'Load' button.
- if operator provides op->cancel(), then this will be invoked
- on the cancel button.
- */
+ * op->exec() will be called on the 'Load' button.
+ * if operator provides op->cancel(), then this will be invoked
+ * on the cancel button.
+ */
struct wmOperator *op;
struct wmTimer *smoothscroll_timer;
@@ -516,8 +516,8 @@ typedef struct SpaceClip {
/* current stabilization data */
float loc[2], scale, angle; /* pre-composed stabilization data */
int pad;
- float stabmat[4][4], unistabmat[4][4]; /* current stabilization matrix and the same matrix in unified space,
- defined when drawing and used for mouse position calculation */
+ float stabmat[4][4], unistabmat[4][4]; /* current stabilization matrix and the same matrix in unified space,
+ * defined when drawing and used for mouse position calculation */
/* movie postprocessing */
int postproc_flag;
@@ -866,7 +866,7 @@ enum {
/* sseq->flag */
#define SEQ_DRAWFRAMES 1
#define SEQ_MARKER_TRANS 2
-#define SEQ_DRAW_COLOR_SEPERATED 4
+#define SEQ_DRAW_COLOR_SEPARATED 4
#define SEQ_DRAW_SAFE_MARGINS 8
#define SEQ_DRAW_GPENCIL 16
#define SEQ_NO_DRAW_CFRANUM 32
diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h
index 03e731cf765..9c0f63028c1 100644
--- a/source/blender/makesdna/DNA_tracking_types.h
+++ b/source/blender/makesdna/DNA_tracking_types.h
@@ -15,7 +15,7 @@
* 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) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2011 Blender Foundation.
* All rights reserved.
*
* The Original Code is: all of this file.
@@ -218,6 +218,7 @@ enum {
#define MARKER_TRACKED (1<<1)
#define MARKER_GRAPH_SEL_X (1<<2)
#define MARKER_GRAPH_SEL_Y (1<<3)
+#define MARKER_GRAPH_SEL (MARKER_GRAPH_SEL_X|MARKER_GRAPH_SEL_Y)
/* MovieTrackingTrack->flag */
#define TRACK_HAS_BUNDLE (1<<1)
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 7fa3f0fd0ce..1db858b2741 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -618,13 +618,13 @@ extern UserDef U; /* from blenkernel blender.c */
#define NDOF_SHOULD_ZOOM (1 << 4)
#define NDOF_SHOULD_ROTATE (1 << 5)
/* orbit navigation modes
- * only two options, so it's sort of a hyrbrid bool/enum
+ * only two options, so it's sort of a hybrid bool/enum
* if ((U.ndof_flag & NDOF_ORBIT_MODE) == NDOF_OM_OBJECT)... */
-/*
-#define NDOF_ORBIT_MODE (1 << 6)
-#define NDOF_OM_TARGETCAMERA 0
-#define NDOF_OM_OBJECT NDOF_ORBIT_MODE
-*/
+
+// #define NDOF_ORBIT_MODE (1 << 6)
+// #define NDOF_OM_TARGETCAMERA 0
+// #define NDOF_OM_OBJECT NDOF_ORBIT_MODE
+
/* actually... users probably don't care about what the mode
* is called, just that it feels right */
/* zoom is up/down if this flag is set (otherwise forward/backward) */
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 0758e6e1713..610513ca860 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -94,42 +94,45 @@ typedef struct RegionView3D {
float viewmatob[4][4];
float persmatob[4][4];
- /* transform widget matrix */
- float twmat[4][4];
- float viewquat[4]; /* view rotation, must be kept normalized */
- float dist; /* distance from 'ofs' along -viewinv[2] vector, where result is negative as is 'ofs' */
- float zfac; /* initgrabz() result */
- float camdx, camdy; /* camera view offsets, 1.0 = viewplane moves entire width/height */
- float pixsize; /* runtime only */
- float ofs[3]; /* view center & orbit pivot, negative of worldspace location,
- * also matches -viewinv[3][0:3] in ortho mode.*/
- short camzoom; /* viewport zoom on the camera frame, see BKE_screen_view3d_zoom_to_fac */
- short twdrawflag;
- char is_persp; /* check if persp/ortho view, since 'persp' cant be used for this since
- * it can have cameras assigned as well. (only set in setwinmatrixview3d) */
- char pad[3];
-
- short rflag, viewlock;
- short persp;
- short view;
-
/* user defined clipping planes */
float clip[6][4];
float clip_local[6][4]; /* clip in object space, means we can test for clipping in editmode without first going into worldspace */
- struct BoundBox *clipbb;
-
+ struct BoundBox *clipbb;
+
struct bGPdata *gpd; /* Grease-Pencil Data (annotation layers) */
-
+
struct RegionView3D *localvd; /* allocated backup of its self while in localview */
struct RenderInfo *ri;
struct RenderEngine *render_engine;
struct ViewDepths *depths;
-
+
/* animated smooth view */
struct SmoothViewStore *sms;
struct wmTimer *smooth_timer;
+
+
+ /* transform widget matrix */
+ float twmat[4][4];
+
+ float viewquat[4]; /* view rotation, must be kept normalized */
+ float dist; /* distance from 'ofs' along -viewinv[2] vector, where result is negative as is 'ofs' */
+ float zfac; /* initgrabz() result */
+ float camdx, camdy; /* camera view offsets, 1.0 = viewplane moves entire width/height */
+ float pixsize; /* runtime only */
+ float ofs[3]; /* view center & orbit pivot, negative of worldspace location,
+ * also matches -viewinv[3][0:3] in ortho mode.*/
+ float camzoom; /* viewport zoom on the camera frame, see BKE_screen_view3d_zoom_to_fac */
+ char is_persp; /* check if persp/ortho view, since 'persp' cant be used for this since
+ * it can have cameras assigned as well. (only set in setwinmatrixview3d) */
+ char persp;
+ char view;
+ char viewlock;
+
+ short twdrawflag;
+ short rflag;
+
/* last view */
float lviewquat[4];
short lpersp, lview; /* lpersp can never be set to 'RV3D_CAMOB' */
@@ -137,11 +140,10 @@ typedef struct RegionView3D {
float twangle[3];
+
/* active rotation from NDOF or elsewhere */
float rot_angle;
float rot_axis[3];
-
- char pad2[4];
} RegionView3D;
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index 3e6c46ba8b1..cdb6d8d053c 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -197,7 +197,7 @@ typedef struct wmWindow {
ListBase gesture; /* gesture stuff */
} wmWindow;
-/* should be somthing like DNA_EXCLUDE
+/* should be something like DNA_EXCLUDE
* but the preprocessor first removes all comments, spaces etc */
#
diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c
index a332c77c402..2148bc96c04 100644
--- a/source/blender/makesdna/intern/dna_genfile.c
+++ b/source/blender/makesdna/intern/dna_genfile.c
@@ -51,90 +51,90 @@
/* gcc 4.1 on mingw was complaining that __int64 was already defined
-actually is saw the line below as typedef long long long long...
-Anyhow, since its already defined, its safe to do an ifndef here- Campbell */
+ * actually is saw the line below as typedef long long long long...
+ * Anyhow, since its already defined, its safe to do an ifndef here- Campbell */
#ifdef FREE_WINDOWS
-#ifndef __int64
+# ifndef __int64
typedef long long __int64;
-#endif
+# endif
#endif
/*
* - please note: no builtin security to detect input of double structs
* - if you want a struct not to be in DNA file: add two hash marks above it (#<enter>#<enter>)
-
-Structure DNA data is added to each blender file and to each executable, this to detect
-in .blend files new veriables in structs, changed array sizes, etc. It's also used for
-converting endian and pointer size (32-64 bits)
-As an extra, Python uses a call to detect run-time the contents of a blender struct.
-
-Create a structDNA: only needed when one of the input include (.h) files change.
-File Syntax:
- SDNA (4 bytes) (magic number)
- NAME (4 bytes)
- <nr> (4 bytes) amount of names (int)
- <string>
- <string>
- ...
- ...
- TYPE (4 bytes)
- <nr> amount of types (int)
- <string>
- <string>
- ...
- ...
- TLEN (4 bytes)
- <len> (short) the lengths of types
- <len>
- ...
- ...
- STRC (4 bytes)
- <nr> amount of structs (int)
- <typenr><nr_of_elems> <typenr><namenr> <typenr><namenr> ...
-
-!!Remember to read/write integer and short aligned!!
-
- While writing a file, the names of a struct is indicated with a type number,
- to be found with: type= findstruct_nr(SDNA *, char *)
- The value of 'type' corresponds with the the index within the structs array
-
- For the moment: the complete DNA file is included in a .blend file. For
- the future we can think of smarter methods, like only included the used
- structs. Only needed to keep a file short though...
-
-ALLOWED AND TESTED CHANGES IN STRUCTS:
- - type change (a char to float will be divided by 255)
- - location within a struct (everthing can be randomly mixed up)
- - struct within struct (within struct etc), this is recursive
- - adding new elements, will be default initialized zero
- - remving elements
- - change of array sizes
- - change of a pointer type: when the name doesn't change the contents is copied
-
-NOT YET:
- - array (vec[3]) to float struct (vec3f)
-
-DONE:
- - endian compatibility
- - pointer conversion (32-64 bits)
-
-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, 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:
- - short: 2 aligned
- - int: 4 aligned
- - float: 4 aligned
- - double: 8 aligned
- - long: 8 aligned
- - struct: 8 aligned
- - the sdna functions have several error prints builtin, always check blender running from a console.
-
-*/
+ *
+ * Structure DNA data is added to each blender file and to each executable, this to detect
+ * in .blend files new veriables in structs, changed array sizes, etc. It's also used for
+ * converting endian and pointer size (32-64 bits)
+ * As an extra, Python uses a call to detect run-time the contents of a blender struct.
+ *
+ * Create a structDNA: only needed when one of the input include (.h) files change.
+ * File Syntax:
+ * SDNA (4 bytes) (magic number)
+ * NAME (4 bytes)
+ * <nr> (4 bytes) amount of names (int)
+ * <string>
+ * <string>
+ * ...
+ * ...
+ * TYPE (4 bytes)
+ * <nr> amount of types (int)
+ * <string>
+ * <string>
+ * ...
+ * ...
+ * TLEN (4 bytes)
+ * <len> (short) the lengths of types
+ * <len>
+ * ...
+ * ...
+ * STRC (4 bytes)
+ * <nr> amount of structs (int)
+ * <typenr><nr_of_elems> <typenr><namenr> <typenr><namenr> ...
+ *
+ * !!Remember to read/write integer and short aligned!!
+ *
+ * While writing a file, the names of a struct is indicated with a type number,
+ * to be found with: type= findstruct_nr(SDNA *, char *)
+ * The value of 'type' corresponds with the the index within the structs array
+ *
+ * For the moment: the complete DNA file is included in a .blend file. For
+ * the future we can think of smarter methods, like only included the used
+ * structs. Only needed to keep a file short though...
+ *
+ * ALLOWED AND TESTED CHANGES IN STRUCTS:
+ * - type change (a char to float will be divided by 255)
+ * - location within a struct (everthing can be randomly mixed up)
+ * - struct within struct (within struct etc), this is recursive
+ * - adding new elements, will be default initialized zero
+ * - remving elements
+ * - change of array sizes
+ * - change of a pointer type: when the name doesn't change the contents is copied
+ *
+ * NOT YET:
+ * - array (vec[3]) to float struct (vec3f)
+ *
+ * DONE:
+ * - endian compatibility
+ * - pointer conversion (32-64 bits)
+ *
+ * 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, 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:
+ * - short: 2 aligned
+ * - int: 4 aligned
+ * - float: 4 aligned
+ * - double: 8 aligned
+ * - long: 8 aligned
+ * - struct: 8 aligned
+ * - the sdna functions have several error prints builtin, always check blender running from a console.
+ *
+ */
/* local */
static int le_int(int temp);
@@ -351,8 +351,8 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
sdna->names[nr]= cp;
/* "float gravity [3]" was parsed wrong giving both "gravity" and
- "[3]" members. we rename "[3]", and later set the type of
- "gravity" to "void" so the offsets work out correct */
+ * "[3]" members. we rename "[3]", and later set the type of
+ * "gravity" to "void" so the offsets work out correct */
if(*cp == '[' && strcmp(cp, "[3]")==0) {
if(nr && strcmp(sdna->names[nr-1], "Cvi") == 0) {
sdna->names[nr]= "gravity[3]";
@@ -644,14 +644,14 @@ char *DNA_struct_get_compareflags(SDNA *sdna, SDNA *newsdna)
if(compflags[a]==2) recurs_test_compflags(sdna, compflags, a);
}
-/*
+#if 0
for(a=0; a<sdna->nr_structs; a++) {
if(compflags[a]==2) {
spold= sdna->structs[a];
printf("changed: %s\n", sdna->types[ spold[0] ]);
}
}
-*/
+#endif
return compflags;
}
@@ -843,14 +843,14 @@ static void reconstruct_elem(SDNA *newsdna, SDNA *oldsdna,
char *type, const char *name, char *curdata, short *old, char *olddata)
{
/* rules: test for NAME:
- - name equal:
- - cast type
- - name partially equal (array differs)
- - type equal: memcpy
- - types casten
- (nzc 2-4-2001 I want the 'unsigned' bit to be parsed as well. Where
- can I force this?)
- */
+ * - name equal:
+ * - cast type
+ * - name partially equal (array differs)
+ * - type equal: memcpy
+ * - types casten
+ * (nzc 2-4-2001 I want the 'unsigned' bit to be parsed as well. Where
+ * can I force this?)
+ */
int a, elemcount, len, array, oldsize, cursize, mul;
char *otype;
const char *oname, *cp;
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 9cfa01204ab..7dc51446ddc 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -46,9 +46,7 @@
* There is a facility to get verbose output from sdna. Search for
* \ref debugSDNA. This int can be set to 0 (no output) to some int. Higher
* numbers give more output.
- * */
-
-#define DNA_VERSION_DATE "FIXME-DNA_VERSION_DATE"
+ */
#include <string.h>
#include <stdlib.h>
@@ -150,9 +148,9 @@ static char **types, *typedata; /* at address types[a] is string a */
static short *typelens; /* at typelens[a] is de length of type a */
static short *alphalens; /* contains sizes as they are calculated on the DEC Alpha (64 bits), infact any 64bit system */
static short **structs, *structdata;/* at sp= structs[a] is the first address of a struct definition
- sp[0] is type number
- sp[1] is amount of elements
- sp[2] sp[3] is typenr, namenr (etc) */
+ * sp[0] is type number
+ * sp[1] is amount of elements
+ * sp[2] sp[3] is typenr, namenr (etc) */
/**
* Variable to control debug output of makesdna.
* debugSDNA:
@@ -231,7 +229,15 @@ static int add_type(const char *str, int len)
int nr;
char *cp;
- if(str[0]==0) return -1;
+ /* first do validity check */
+ if(str[0]==0) {
+ return -1;
+ }
+ else if (strchr(str, '*')) {
+ /* note: this is valid C syntax but we can't parse, complain!
+ * 'struct SomeStruct* somevar;' <-- correct but we cant handle right now. */
+ return -1;
+ }
/* search through type array */
for(nr=0; nr<nr_types; nr++) {
@@ -285,9 +291,9 @@ static int add_name(const char *str)
if (str[0] == '(' && str[1] == '*') {
/* we handle function pointer and special array cases here, e.g.
- void (*function)(...) and float (*array)[..]. the array case
- name is still converted to (array*)() though because it is that
- way in old dna too, and works correct with elementsize() */
+ * void (*function)(...) and float (*array)[..]. the array case
+ * name is still converted to (array*)() though because it is that
+ * way in old dna too, and works correct with elementsize() */
int isfuncptr = (strchr(str+1, '(')) != NULL;
if (debugSDNA > 3) printf("\t\t\t\t*** Function pointer or multidim array pointer found\n");
@@ -535,8 +541,8 @@ static void *read_file_data(char *filename, int *len_r)
static int convert_include(char *filename)
{
/* read include file, skip structs with a '#' before it.
- store all data in temporal arrays.
- */
+ * store all data in temporal arrays.
+ */
int filelen, count, overslaan, slen, type, name, strct;
short *structpoin, *sp;
char *maindata, *mainend, *md, *md1;
@@ -574,8 +580,12 @@ static int convert_include(char *filename)
/* we've got a struct name when... */
if( strncmp(md1-7, "struct", 6)==0 ) {
-
- strct= add_type(md1, 0);
+ strct = add_type(md1, 0);
+ if (strct == -1) {
+ printf("File '%s' contains struct we cant parse \"%s\"\n", filename, md1);
+ return 1;
+ }
+
structpoin= add_struct(strct);
sp= structpoin+2;
@@ -603,6 +613,10 @@ static int convert_include(char *filename)
/* we've got a type! */
type= add_type(md1, 0);
+ if (type == -1) {
+ printf("File '%s' contains struct we can't parse \"%s\"\n", filename, md1);
+ return 1;
+ }
if (debugSDNA > 1) printf("\t|\t|\tfound type %s (", md1);
@@ -846,7 +860,7 @@ static int calculate_structlens(int firststruct)
structpoin= structs[a];
structtype= structpoin[0];
- /* length unkown yet */
+ /* length unknown yet */
if(typelens[structtype]==0) {
printf(" %s\n", types[structtype]);
}
@@ -913,7 +927,6 @@ static int make_structDNA(char *baseDirectory, FILE *file)
if (debugSDNA > -1) {
fflush(stdout);
printf("Running makesdna at debug level %d\n", debugSDNA);
- printf("\tProgram version: %s\n", DNA_VERSION_DATE);
}
/* the longest known struct is 50k, so we assume 100k is sufficent! */
@@ -967,8 +980,7 @@ static int make_structDNA(char *baseDirectory, FILE *file)
}
/* FOR DEBUG */
- if (debugSDNA > 1)
- {
+ if (debugSDNA > 1) {
int a,b;
/* short *elem; */
short num_types;
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h
index 95f988b470b..d6c3422c8d4 100644
--- a/source/blender/makesrna/RNA_define.h
+++ b/source/blender/makesrna/RNA_define.h
@@ -100,10 +100,10 @@ PropertyRNA *RNA_def_float_rotation(StructOrFunctionRNA *cont, const char *ident
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
PropertyRNA *RNA_def_float_array(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value,
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
- /*
-PropertyRNA *RNA_def_float_dynamic_array(StructOrFunctionRNA *cont, const char *identifier, float hardmin, float hardmax,
- const char *ui_name, const char *ui_description, float softmin, float softmax, unsigned int dimension, unsigned short dim_size[]);
- */
+
+//PropertyRNA *RNA_def_float_dynamic_array(StructOrFunctionRNA *cont, const char *identifier, float hardmin, float hardmax,
+// const char *ui_name, const char *ui_description, float softmin, float softmax, unsigned int dimension, unsigned short dim_size[]);
+
PropertyRNA *RNA_def_float_percentage(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax,
const char *ui_name, const char *ui_description, float softmin, float softmax);
PropertyRNA *RNA_def_float_factor(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax,
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index ee9c6b26e2f..8a668f68761 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -152,9 +152,9 @@ typedef enum PropertyFlag {
* for editing. */
PROP_LIB_EXCEPTION = 1<<16,
- /* animateable means the property can be driven by some
+ /* animatable means the property can be driven by some
* other input, be it animation curves, expressions, ..
- * properties are animateable by default except for pointers
+ * properties are animatable by default except for pointers
* and collections */
PROP_ANIMATABLE = 1<<1,
@@ -191,7 +191,7 @@ typedef enum PropertyFlag {
* this exposes the flag as multiple options in python and the UI.
*
* note: these can't be animated so use with care.
- */
+ */
PROP_ENUM_FLAG = 1<<21,
/* need context for update function */
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index ac5718a27f6..84f1fc23931 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -282,6 +282,7 @@ set(SRC
rna_internal.h
rna_internal_types.h
rna_nodetree_types.h
+ rna_mesh_utils.h
)
blender_add_lib(bf_rna "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 7955c25aa98..194a50df307 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -40,8 +40,6 @@
#include "rna_internal.h"
-#define RNA_VERSION_DATE "FIXME-RNA_VERSION_DATE"
-
#ifdef _WIN32
# ifndef snprintf
# define snprintf _snprintf
@@ -62,34 +60,34 @@
static int file_older(const char *file1, const char *file2)
{
struct stat st1, st2;
- // printf("compare: %s %s\n", file1, file2);
+ /* printf("compare: %s %s\n", file1, file2); */
- if(stat(file1, &st1)) return 0;
- if(stat(file2, &st2)) return 0;
+ if (stat(file1, &st1)) return 0;
+ if (stat(file2, &st2)) return 0;
return (st1.st_mtime < st2.st_mtime);
}
-static const char *makesrna_path= NULL;
+static const char *makesrna_path = NULL;
static int replace_if_different(char *tmpfile, const char *dep_files[])
{
- // return 0; // use for testing had edited rna
+ /* return 0; *//* use for testing had edited rna */
#define REN_IF_DIFF \
{ \
- FILE *file_test= fopen(orgfile, "rb"); \
- if(file_test) { \
+ FILE *file_test = fopen(orgfile, "rb"); \
+ if (file_test) { \
fclose(file_test); \
- if(fp_org) fclose(fp_org); \
- if(fp_new) fclose(fp_new); \
- if(remove(orgfile) != 0) { \
+ if (fp_org) fclose(fp_org); \
+ if (fp_new) fclose(fp_new); \
+ if (remove(orgfile) != 0) { \
fprintf(stderr, "%s:%d, Remove Error (%s): \"%s\"\n", \
__FILE__, __LINE__, strerror(errno), orgfile); \
return -1; \
} \
} \
} \
- if(rename(tmpfile, orgfile) != 0) { \
+ if (rename(tmpfile, orgfile) != 0) { \
fprintf(stderr, "%s:%d, Rename Error (%s): \"%s\" -> \"%s\"\n", \
__FILE__, __LINE__, strerror(errno), tmpfile, orgfile); \
return -1; \
@@ -100,7 +98,7 @@ static int replace_if_different(char *tmpfile, const char *dep_files[])
/* end REN_IF_DIFF */
- FILE *fp_new= NULL, *fp_org= NULL;
+ FILE *fp_new = NULL, *fp_org = NULL;
int len_new, len_org;
char *arr_new, *arr_org;
int cmp;
@@ -110,9 +108,9 @@ static int replace_if_different(char *tmpfile, const char *dep_files[])
strcpy(orgfile, tmpfile);
orgfile[strlen(orgfile) - strlen(TMP_EXT)] = '\0'; /* strip '.tmp' */
- fp_org= fopen(orgfile, "rb");
+ fp_org = fopen(orgfile, "rb");
- if(fp_org==NULL) {
+ if (fp_org == NULL) {
REN_IF_DIFF;
}
@@ -120,30 +118,30 @@ static int replace_if_different(char *tmpfile, const char *dep_files[])
/* 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) {
+ if (1) {
/* first check if makesrna.c is newer then generated files
* for development on makesrna.c you may want to disable this */
- if(file_older(orgfile, __FILE__)) {
+ if (file_older(orgfile, __FILE__)) {
REN_IF_DIFF;
}
- if(file_older(orgfile, makesrna_path)) {
+ if (file_older(orgfile, makesrna_path)) {
REN_IF_DIFF;
}
/* now check if any files we depend on are newer then any generated files */
- if(dep_files) {
+ if (dep_files) {
int pass;
- for(pass=0; dep_files[pass]; pass++) {
- char from_path[4096]= __FILE__;
+ for (pass = 0; dep_files[pass]; pass++) {
+ char from_path[4096] = __FILE__;
char *p1, *p2;
/* dir only */
- p1= strrchr(from_path, '/');
- p2= strrchr(from_path, '\\');
+ p1 = strrchr(from_path, '/');
+ p2 = strrchr(from_path, '\\');
strcpy((p1 > p2 ? p1 : p2)+1, dep_files[pass]);
/* account for build deps, if makesrna.c (this file) is newer */
- if(file_older(orgfile, from_path)) {
+ if (file_older(orgfile, from_path)) {
REN_IF_DIFF;
}
}
@@ -152,9 +150,9 @@ static int replace_if_different(char *tmpfile, const char *dep_files[])
/* XXX end dep trick */
- fp_new= fopen(tmpfile, "rb");
+ fp_new = fopen(tmpfile, "rb");
- if(fp_new==NULL) {
+ if (fp_new == NULL) {
/* shouldn't happen, just to be safe */
fprintf(stderr, "%s:%d, open error: \"%s\"\n", __FILE__, __LINE__, tmpfile);
fclose(fp_org);
@@ -165,30 +163,30 @@ static int replace_if_different(char *tmpfile, const char *dep_files[])
fseek(fp_org, 0L, SEEK_END); len_org = ftell(fp_org); fseek(fp_org, 0L, SEEK_SET);
- if(len_new != len_org) {
+ if (len_new != len_org) {
fclose(fp_new);
fclose(fp_org);
REN_IF_DIFF;
}
/* now compare the files... */
- arr_new= MEM_mallocN(sizeof(char)*len_new, "rna_cmp_file_new");
- arr_org= MEM_mallocN(sizeof(char)*len_org, "rna_cmp_file_org");
+ arr_new = MEM_mallocN(sizeof(char)*len_new, "rna_cmp_file_new");
+ arr_org = MEM_mallocN(sizeof(char)*len_org, "rna_cmp_file_org");
- if(fread(arr_new, sizeof(char), len_new, fp_new) != len_new)
+ if (fread(arr_new, sizeof(char), len_new, fp_new) != len_new)
fprintf(stderr, "%s:%d, error reading file %s for comparison.\n", __FILE__, __LINE__, tmpfile);
- if(fread(arr_org, sizeof(char), len_org, fp_org) != len_org)
+ if (fread(arr_org, sizeof(char), len_org, fp_org) != len_org)
fprintf(stderr, "%s:%d, error reading file %s for comparison.\n", __FILE__, __LINE__, orgfile);
fclose(fp_new);
fclose(fp_org);
- cmp= memcmp(arr_new, arr_org, len_new);
+ cmp = memcmp(arr_new, arr_org, len_new);
MEM_freeN(arr_new);
MEM_freeN(arr_org);
- if(cmp) {
+ if (cmp) {
REN_IF_DIFF;
}
else {
@@ -203,9 +201,9 @@ static int replace_if_different(char *tmpfile, const char *dep_files[])
static const char *rna_safe_id(const char *id)
{
- if(strcmp(id, "default") == 0)
+ if (strcmp(id, "default") == 0)
return "default_value";
- else if(strcmp(id, "operator") == 0)
+ else if (strcmp(id, "operator") == 0)
return "operator_value";
return id;
@@ -215,38 +213,38 @@ static const char *rna_safe_id(const char *id)
static int cmp_struct(const void *a, const void *b)
{
- const StructRNA *structa= *(const StructRNA**)a;
- const StructRNA *structb= *(const StructRNA**)b;
+ const StructRNA *structa = *(const StructRNA**)a;
+ const StructRNA *structb = *(const StructRNA**)b;
return strcmp(structa->identifier, structb->identifier);
}
static int cmp_property(const void *a, const void *b)
{
- const PropertyRNA *propa= *(const PropertyRNA**)a;
- const PropertyRNA *propb= *(const PropertyRNA**)b;
+ const PropertyRNA *propa = *(const PropertyRNA**)a;
+ const PropertyRNA *propb = *(const PropertyRNA**)b;
- if(strcmp(propa->identifier, "rna_type") == 0) return -1;
- else if(strcmp(propb->identifier, "rna_type") == 0) return 1;
+ if (strcmp(propa->identifier, "rna_type") == 0) return -1;
+ else if (strcmp(propb->identifier, "rna_type") == 0) return 1;
- if(strcmp(propa->identifier, "name") == 0) return -1;
- else if(strcmp(propb->identifier, "name") == 0) return 1;
+ if (strcmp(propa->identifier, "name") == 0) return -1;
+ else if (strcmp(propb->identifier, "name") == 0) return 1;
return strcmp(propa->name, propb->name);
}
static int cmp_def_struct(const void *a, const void *b)
{
- const StructDefRNA *dsa= *(const StructDefRNA**)a;
- const StructDefRNA *dsb= *(const StructDefRNA**)b;
+ const StructDefRNA *dsa = *(const StructDefRNA**)a;
+ const StructDefRNA *dsb = *(const StructDefRNA**)b;
return cmp_struct(&dsa->srna, &dsb->srna);
}
static int cmp_def_property(const void *a, const void *b)
{
- const PropertyDefRNA *dpa= *(const PropertyDefRNA**)a;
- const PropertyDefRNA *dpb= *(const PropertyDefRNA**)b;
+ const PropertyDefRNA *dpa = *(const PropertyDefRNA**)a;
+ const PropertyDefRNA *dpb = *(const PropertyDefRNA**)b;
return cmp_property(&dpa->prop, &dpb->prop);
}
@@ -257,22 +255,22 @@ static void rna_sortlist(ListBase *listbase, int(*cmp)(const void*, const void*)
void **array;
int a, size;
- if(listbase->first == listbase->last)
+ if (listbase->first == listbase->last)
return;
- for(size=0, link=listbase->first; link; link=link->next)
+ for (size = 0, link = listbase->first; link; link = link->next)
size++;
- array= MEM_mallocN(sizeof(void*)*size, "rna_sortlist");
- for(a=0, link=listbase->first; link; link=link->next, a++)
- array[a]= link;
+ array = MEM_mallocN(sizeof(void*)*size, "rna_sortlist");
+ for (a = 0, link = listbase->first; link; link = link->next, a++)
+ array[a] = link;
qsort(array, size, sizeof(void*), cmp);
- listbase->first= listbase->last= NULL;
- for(a=0; a<size; a++) {
- link= array[a];
- link->next= link->prev= NULL;
+ listbase->first = listbase->last = NULL;
+ for (a = 0; a<size; a++) {
+ link = array[a];
+ link->next = link->prev = NULL;
rna_addtail(listbase, link);
}
@@ -286,18 +284,18 @@ static void rna_print_c_string(FILE *f, const char *str)
static const char *escape[] = {"\''", "\"\"", "\??", "\\\\","\aa", "\bb", "\ff", "\nn", "\rr", "\tt", "\vv", NULL};
int i, j;
- if(!str) {
+ if (!str) {
fprintf(f, "NULL");
return;
}
fprintf(f, "\"");
- for(i=0; str[i]; i++) {
- for(j=0; escape[j]; j++)
- if(str[i] == escape[j][0])
+ for (i = 0; str[i]; i++) {
+ for (j = 0; escape[j]; j++)
+ if (str[i] == escape[j][0])
break;
- if(escape[j]) fprintf(f, "\\%c", escape[j][1]);
+ if (escape[j]) fprintf(f, "\\%c", escape[j][1]);
else fprintf(f, "%c", str[i]);
}
fprintf(f, "\"");
@@ -305,7 +303,7 @@ static void rna_print_c_string(FILE *f, const char *str)
static void rna_print_data_get(FILE *f, PropertyDefRNA *dp)
{
- if(dp->dnastructfromname && dp->dnastructfromprop)
+ if (dp->dnastructfromname && dp->dnastructfromprop)
fprintf(f, " %s *data= (%s*)(((%s*)ptr->data)->%s);\n", dp->dnastructname, dp->dnastructname, dp->dnastructfromname, dp->dnastructfromprop);
else
fprintf(f, " %s *data= (%s*)(ptr->data);\n", dp->dnastructname, dp->dnastructname);
@@ -323,11 +321,11 @@ static char *rna_alloc_function_name(const char *structname, const char *propnam
char *result;
snprintf(buffer, sizeof(buffer), "%s_%s_%s", structname, propname, type);
- result= MEM_callocN(sizeof(char)*strlen(buffer)+1, "rna_alloc_function_name");
+ result = MEM_callocN(sizeof(char)*strlen(buffer)+1, "rna_alloc_function_name");
strcpy(result, buffer);
- alloc= MEM_callocN(sizeof(AllocDefRNA), "AllocDefRNA");
- alloc->mem= result;
+ alloc = MEM_callocN(sizeof(AllocDefRNA), "AllocDefRNA");
+ alloc->mem = result;
rna_addtail(&DefRNA.allocs, alloc);
return result;
@@ -337,8 +335,8 @@ static StructRNA *rna_find_struct(const char *identifier)
{
StructDefRNA *ds;
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
- if(strcmp(ds->srna->identifier, identifier)==0)
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
+ if (strcmp(ds->srna->identifier, identifier) == 0)
return ds->srna;
return NULL;
@@ -348,8 +346,8 @@ static const char *rna_find_type(const char *type)
{
StructDefRNA *ds;
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
- if(ds->dnaname && strcmp(ds->dnaname, type)==0)
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
+ if (ds->dnaname && strcmp(ds->dnaname, type) == 0)
return ds->srna->identifier;
return NULL;
@@ -359,8 +357,8 @@ static const char *rna_find_dna_type(const char *type)
{
StructDefRNA *ds;
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
- if(strcmp(ds->srna->identifier, type)==0)
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
+ if (strcmp(ds->srna->identifier, type) == 0)
return ds->dnaname;
return NULL;
@@ -368,7 +366,7 @@ static const char *rna_find_dna_type(const char *type)
static const char *rna_type_type_name(PropertyRNA *prop)
{
- switch(prop->type) {
+ switch (prop->type) {
case PROP_BOOLEAN:
case PROP_INT:
case PROP_ENUM:
@@ -376,7 +374,7 @@ static const char *rna_type_type_name(PropertyRNA *prop)
case PROP_FLOAT:
return "float";
case PROP_STRING:
- if(prop->flag & PROP_THICK_WRAP) {
+ if (prop->flag & PROP_THICK_WRAP) {
return "char*";
}
else {
@@ -391,9 +389,9 @@ static const char *rna_type_type(PropertyRNA *prop)
{
const char *type;
- type= rna_type_type_name(prop);
+ type = rna_type_type_name(prop);
- if(type)
+ if (type)
return type;
return "PointerRNA";
@@ -403,9 +401,9 @@ static const char *rna_type_struct(PropertyRNA *prop)
{
const char *type;
- type= rna_type_type_name(prop);
+ type = rna_type_type_name(prop);
- if(type)
+ if (type)
return "";
return "struct ";
@@ -415,16 +413,16 @@ static const char *rna_parameter_type_name(PropertyRNA *parm)
{
const char *type;
- type= rna_type_type_name(parm);
+ type = rna_type_type_name(parm);
- if(type)
+ if (type)
return type;
- switch(parm->type) {
+ switch (parm->type) {
case PROP_POINTER: {
- PointerPropertyRNA *pparm= (PointerPropertyRNA*)parm;
+ PointerPropertyRNA *pparm = (PointerPropertyRNA*)parm;
- if(parm->flag & PROP_RNAPTR)
+ if (parm->flag & PROP_RNAPTR)
return "PointerRNA";
else
return rna_find_dna_type((const char *)pparm->type);
@@ -439,12 +437,12 @@ static const char *rna_parameter_type_name(PropertyRNA *parm)
static int rna_enum_bitmask(PropertyRNA *prop)
{
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
- int a, mask= 0;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
+ int a, mask = 0;
- if(eprop->item) {
- for(a=0; a<eprop->totitem; a++)
- if(eprop->item[a].identifier[0])
+ if (eprop->item) {
+ for (a = 0; a<eprop->totitem; a++)
+ if (eprop->item[a].identifier[0])
mask |= eprop->item[a].value;
}
@@ -454,7 +452,7 @@ static int rna_enum_bitmask(PropertyRNA *prop)
static int rna_color_quantize(PropertyRNA *prop, PropertyDefRNA *dp)
{
return ( (prop->type == PROP_FLOAT) &&
- (prop->subtype==PROP_COLOR || prop->subtype==PROP_COLOR_GAMMA) &&
+ (prop->subtype == PROP_COLOR || prop->subtype == PROP_COLOR_GAMMA) &&
(IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) );
}
@@ -465,16 +463,16 @@ static const char *rna_function_string(void *func)
static void rna_float_print(FILE *f, float num)
{
- if(num == -FLT_MAX) fprintf(f, "-FLT_MAX");
- else if(num == FLT_MAX) fprintf(f, "FLT_MAX");
- else if((int)num == num) fprintf(f, "%.1ff", num);
+ if (num == -FLT_MAX) fprintf(f, "-FLT_MAX");
+ else if (num == FLT_MAX) fprintf(f, "FLT_MAX");
+ else if ((int)num == num) fprintf(f, "%.1ff", num);
else fprintf(f, "%.10ff", num);
}
static void rna_int_print(FILE *f, int num)
{
- if(num == INT_MIN) fprintf(f, "INT_MIN");
- else if(num == INT_MAX) fprintf(f, "INT_MAX");
+ if (num == INT_MIN) fprintf(f, "INT_MIN");
+ else if (num == INT_MAX) fprintf(f, "INT_MAX");
else fprintf(f, "%d", num);
}
@@ -482,35 +480,35 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
{
char *func;
- if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL)
+ if (prop->flag & PROP_IDPROPERTY && manualfunc == NULL)
return NULL;
- if(!manualfunc) {
- if(!dp->dnastructname || !dp->dnaname) {
+ if (!manualfunc) {
+ if (!dp->dnastructname || !dp->dnaname) {
fprintf(stderr, "%s (0): %s.%s has no valid dna info.\n",
__func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return NULL;
}
/* typecheck, */
- if(dp->dnatype && *dp->dnatype) {
+ if (dp->dnatype && *dp->dnatype) {
- if(prop->type == PROP_FLOAT) {
- if(IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) {
- if(prop->subtype != PROP_COLOR_GAMMA) { /* colors are an exception. these get translated */
+ if (prop->type == PROP_FLOAT) {
+ if (IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) {
+ if (prop->subtype != PROP_COLOR_GAMMA) { /* colors are an exception. these get translated */
fprintf(stderr, "%s (1): %s.%s is a '%s' but wrapped as type '%s'.\n",
__func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
- DefRNA.error= 1;
+ DefRNA.error = 1;
return NULL;
}
}
}
- else if(prop->type == PROP_INT || prop->type == PROP_BOOLEAN || prop->type == PROP_ENUM) {
- if(IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) {
+ else if (prop->type == PROP_INT || prop->type == PROP_BOOLEAN || prop->type == PROP_ENUM) {
+ if (IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) {
fprintf(stderr, "%s (2): %s.%s is a '%s' but wrapped as type '%s'.\n",
__func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
- DefRNA.error= 1;
+ DefRNA.error = 1;
return NULL;
}
}
@@ -518,26 +516,26 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
}
- func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get");
+ func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get");
- switch(prop->type) {
+ switch (prop->type) {
case PROP_STRING: {
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
fprintf(f, "void %s(PointerRNA *ptr, char *value)\n", func);
fprintf(f, "{\n");
- if(manualfunc) {
+ if (manualfunc) {
fprintf(f, " %s(ptr, value);\n", manualfunc);
}
else {
- const PropertySubType subtype= prop->subtype;
- const char *string_copy_func= (subtype==PROP_FILEPATH ||
- subtype==PROP_DIRPATH ||
- subtype==PROP_FILENAME ||
- subtype==PROP_BYTESTRING) ?
+ const PropertySubType subtype = prop->subtype;
+ const char *string_copy_func = (subtype == PROP_FILEPATH ||
+ subtype == PROP_DIRPATH ||
+ subtype == PROP_FILENAME ||
+ subtype == PROP_BYTESTRING) ?
"BLI_strncpy" : "BLI_strncpy_utf8";
rna_print_data_get(f, dp);
- if(sprop->maxlength)
+ if (sprop->maxlength)
fprintf(f, " %s(value, data->%s, %d);\n", string_copy_func, dp->dnaname, sprop->maxlength);
else
fprintf(f, " %s(value, data->%s, sizeof(data->%s));\n", string_copy_func, dp->dnaname, dp->dnaname);
@@ -548,13 +546,13 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
case PROP_POINTER: {
fprintf(f, "PointerRNA %s(PointerRNA *ptr)\n", func);
fprintf(f, "{\n");
- if(manualfunc) {
+ if (manualfunc) {
fprintf(f, " return %s(ptr);\n", manualfunc);
}
else {
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
rna_print_data_get(f, dp);
- if(dp->dnapointerlevel == 0)
+ if (dp->dnapointerlevel == 0)
fprintf(f, " return rna_pointer_inherit_refine(ptr, &RNA_%s, &data->%s);\n", (const char*)pprop->type, dp->dnaname);
else
fprintf(f, " return rna_pointer_inherit_refine(ptr, &RNA_%s, data->%s);\n", (const char*)pprop->type, dp->dnaname);
@@ -563,12 +561,12 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
break;
}
case PROP_COLLECTION: {
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
fprintf(f, "static PointerRNA %s(CollectionPropertyIterator *iter)\n", func);
fprintf(f, "{\n");
- if(manualfunc) {
- if(strcmp(manualfunc, "rna_iterator_listbase_get") == 0 ||
+ if (manualfunc) {
+ if (strcmp(manualfunc, "rna_iterator_listbase_get") == 0 ||
strcmp(manualfunc, "rna_iterator_array_get") == 0 ||
strcmp(manualfunc, "rna_iterator_array_dereference_get") == 0)
fprintf(f, " return rna_pointer_inherit_refine(&iter->parent, &RNA_%s, %s(iter));\n", (cprop->item_type)? (const char*)cprop->item_type: "UnknownType", manualfunc);
@@ -579,21 +577,21 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
break;
}
default:
- if(prop->arraydimension) {
- if(prop->flag & PROP_DYNAMIC)
+ if (prop->arraydimension) {
+ if (prop->flag & PROP_DYNAMIC)
fprintf(f, "void %s(PointerRNA *ptr, %s values[])\n", func, rna_type_type(prop));
else
fprintf(f, "void %s(PointerRNA *ptr, %s values[%u])\n", func, rna_type_type(prop), prop->totarraylength);
fprintf(f, "{\n");
- if(manualfunc) {
+ if (manualfunc) {
fprintf(f, " %s(ptr, values);\n", manualfunc);
}
else {
rna_print_data_get(f, dp);
- if(prop->flag & PROP_DYNAMIC) {
- char *lenfunc= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get_length");
+ if (prop->flag & PROP_DYNAMIC) {
+ char *lenfunc = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get_length");
fprintf(f, " int i, arraylen[RNA_MAX_ARRAY_DIMENSION];\n");
fprintf(f, " int len= %s(ptr, arraylen);\n\n", lenfunc);
fprintf(f, " for(i=0; i<len; i++) {\n");
@@ -604,21 +602,21 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
fprintf(f, " for(i=0; i<%u; i++) {\n", prop->totarraylength);
}
- if(dp->dnaarraylength == 1) {
- if(prop->type == PROP_BOOLEAN && dp->booleanbit)
+ if (dp->dnaarraylength == 1) {
+ if (prop->type == PROP_BOOLEAN && dp->booleanbit)
fprintf(f, " values[i]= %s((data->%s & (%d<<i)) != 0);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit);
else
fprintf(f, " values[i]= (%s)%s((&data->%s)[i]);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname);
}
else {
- if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
+ if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
fprintf(f, " values[i]= %s((data->%s[i] & ", (dp->booleannegative)? "!": "", dp->dnaname);
rna_int_print(f, dp->booleanbit);
fprintf(f, ") != 0);\n");
}
- else if(rna_color_quantize(prop, dp))
+ else if (rna_color_quantize(prop, dp))
fprintf(f, " values[i]= (%s)(data->%s[i]*(1.0f/255.0f));\n", rna_type_type(prop), dp->dnaname);
- else if(dp->dnatype)
+ else if (dp->dnatype)
fprintf(f, " values[i]= (%s)%s(((%s*)data->%s)[i]);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnatype, dp->dnaname);
else
fprintf(f, " values[i]= (%s)%s((data->%s)[i]);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname);
@@ -631,17 +629,17 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
fprintf(f, "%s %s(PointerRNA *ptr)\n", rna_type_type(prop), func);
fprintf(f, "{\n");
- if(manualfunc) {
+ if (manualfunc) {
fprintf(f, " return %s(ptr);\n", manualfunc);
}
else {
rna_print_data_get(f, dp);
- if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
+ if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
fprintf(f, " return %s(((data->%s) & ", (dp->booleannegative)? "!": "", dp->dnaname);
rna_int_print(f, dp->booleanbit);
fprintf(f, ") != 0);\n");
}
- else if(prop->type == PROP_ENUM && dp->enumbitflags) {
+ else if (prop->type == PROP_ENUM && dp->enumbitflags) {
fprintf(f, " return ((data->%s) & ", dp->dnaname);
rna_int_print(f, rna_enum_bitmask(prop));
fprintf(f, ");\n");
@@ -661,16 +659,16 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
/* defined min/max variables to be used by rna_clamp_value() */
static void rna_clamp_value_range(FILE *f, PropertyRNA *prop)
{
- if(prop->type == PROP_FLOAT) {
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
- if(fprop->range) {
+ if (prop->type == PROP_FLOAT) {
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
+ if (fprop->range) {
fprintf(f, " float prop_clamp_min, prop_clamp_max;\n");
fprintf(f, " %s(ptr, &prop_clamp_min, &prop_clamp_max);\n", rna_function_string(fprop->range));
}
}
- else if(prop->type == PROP_INT) {
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
- if(iprop->range) {
+ else if (prop->type == PROP_INT) {
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
+ if (iprop->range) {
fprintf(f, " int prop_clamp_min, prop_clamp_max;\n");
fprintf(f, " %s(ptr, &prop_clamp_min, &prop_clamp_max);\n", rna_function_string(iprop->range));
}
@@ -679,13 +677,13 @@ static void rna_clamp_value_range(FILE *f, PropertyRNA *prop)
static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array)
{
- if(prop->type == PROP_INT) {
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ if (prop->type == PROP_INT) {
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
- if(iprop->hardmin != INT_MIN || iprop->hardmax != INT_MAX) {
- if(array) fprintf(f, "CLAMPIS(values[i], ");
+ if (iprop->hardmin != INT_MIN || iprop->hardmax != INT_MAX) {
+ if (array) fprintf(f, "CLAMPIS(values[i], ");
else fprintf(f, "CLAMPIS(value, ");
- if(iprop->range) {
+ if (iprop->range) {
fprintf(f, "prop_clamp_min, prop_clamp_max);");
}
else {
@@ -695,13 +693,13 @@ static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array)
return;
}
}
- else if(prop->type == PROP_FLOAT) {
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ else if (prop->type == PROP_FLOAT) {
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
- if(fprop->hardmin != -FLT_MAX || fprop->hardmax != FLT_MAX) {
- if(array) fprintf(f, "CLAMPIS(values[i], ");
+ if (fprop->hardmin != -FLT_MAX || fprop->hardmax != FLT_MAX) {
+ if (array) fprintf(f, "CLAMPIS(values[i], ");
else fprintf(f, "CLAMPIS(value, ");
- if(fprop->range) {
+ if (fprop->range) {
fprintf(f, "prop_clamp_min, prop_clamp_max);");
}
else {
@@ -712,7 +710,7 @@ static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array)
}
}
- if(array)
+ if (array)
fprintf(f, "values[i];\n");
else
fprintf(f, "value;\n");
@@ -722,42 +720,42 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
{
char *func;
- if(!(prop->flag & PROP_EDITABLE))
+ if (!(prop->flag & PROP_EDITABLE))
return NULL;
- if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL)
+ if (prop->flag & PROP_IDPROPERTY && manualfunc == NULL)
return NULL;
- if(!manualfunc) {
- if(!dp->dnastructname || !dp->dnaname) {
- if(prop->flag & PROP_EDITABLE) {
+ if (!manualfunc) {
+ if (!dp->dnastructname || !dp->dnaname) {
+ if (prop->flag & PROP_EDITABLE) {
fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
__func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
return NULL;
}
}
- func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "set");
+ func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "set");
- switch(prop->type) {
+ switch (prop->type) {
case PROP_STRING: {
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
fprintf(f, "void %s(PointerRNA *ptr, const char *value)\n", func);
fprintf(f, "{\n");
- if(manualfunc) {
+ if (manualfunc) {
fprintf(f, " %s(ptr, value);\n", manualfunc);
}
else {
- const PropertySubType subtype= prop->subtype;
- const char *string_copy_func= (subtype==PROP_FILEPATH ||
- subtype==PROP_DIRPATH ||
- subtype==PROP_FILENAME ||
- subtype==PROP_BYTESTRING) ?
+ const PropertySubType subtype = prop->subtype;
+ const char *string_copy_func = (subtype == PROP_FILEPATH ||
+ subtype == PROP_DIRPATH ||
+ subtype == PROP_FILENAME ||
+ subtype == PROP_BYTESTRING) ?
"BLI_strncpy" : "BLI_strncpy_utf8";
rna_print_data_get(f, dp);
- if(sprop->maxlength)
+ if (sprop->maxlength)
fprintf(f, " %s(data->%s, value, %d);\n", string_copy_func, dp->dnaname, sprop->maxlength);
else
fprintf(f, " %s(data->%s, value, sizeof(data->%s));\n", string_copy_func, dp->dnaname, dp->dnaname);
@@ -768,27 +766,27 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
case PROP_POINTER: {
fprintf(f, "void %s(PointerRNA *ptr, PointerRNA value)\n", func);
fprintf(f, "{\n");
- if(manualfunc) {
+ if (manualfunc) {
fprintf(f, " %s(ptr, value);\n", manualfunc);
}
else {
rna_print_data_get(f, dp);
- if(prop->flag & PROP_ID_SELF_CHECK) {
+ if (prop->flag & PROP_ID_SELF_CHECK) {
rna_print_id_get(f, dp);
fprintf(f, " if(id==value.data) return;\n\n");
}
- if(prop->flag & PROP_ID_REFCOUNT) {
+ if (prop->flag & PROP_ID_REFCOUNT) {
fprintf(f, "\n if(data->%s)\n", dp->dnaname);
fprintf(f, " id_us_min((ID*)data->%s);\n", dp->dnaname);
fprintf(f, " if(value.data)\n");
fprintf(f, " id_us_plus((ID*)value.data);\n\n");
}
else {
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
- StructRNA *type= rna_find_struct((const char*)pprop->type);
- if(type && (type->flag & STRUCT_ID)) {
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)dp->prop;
+ StructRNA *type = rna_find_struct((const char*)pprop->type);
+ if (type && (type->flag & STRUCT_ID)) {
fprintf(f, " if(value.data)\n");
fprintf(f, " id_lib_extern((ID*)value.data);\n\n");
}
@@ -801,21 +799,21 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
break;
}
default:
- if(prop->arraydimension) {
- if(prop->flag & PROP_DYNAMIC)
+ if (prop->arraydimension) {
+ if (prop->flag & PROP_DYNAMIC)
fprintf(f, "void %s(PointerRNA *ptr, const %s values[])\n", func, rna_type_type(prop));
else
fprintf(f, "void %s(PointerRNA *ptr, const %s values[%u])\n", func, rna_type_type(prop), prop->totarraylength);
fprintf(f, "{\n");
- if(manualfunc) {
+ if (manualfunc) {
fprintf(f, " %s(ptr, values);\n", manualfunc);
}
else {
rna_print_data_get(f, dp);
- if(prop->flag & PROP_DYNAMIC) {
- char *lenfunc= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "set_length");
+ if (prop->flag & PROP_DYNAMIC) {
+ char *lenfunc = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "set_length");
fprintf(f, " int i, arraylen[RNA_MAX_ARRAY_DIMENSION];\n");
fprintf(f, " int len= %s(ptr, arraylen);\n\n", lenfunc);
rna_clamp_value_range(f, prop);
@@ -828,8 +826,8 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
fprintf(f, " for(i=0; i<%u; i++) {\n", prop->totarraylength);
}
- if(dp->dnaarraylength == 1) {
- if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
+ if (dp->dnaarraylength == 1) {
+ if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
fprintf(f, " if(%svalues[i]) data->%s |= (%d<<i);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit);
fprintf(f, " else data->%s &= ~(%d<<i);\n", dp->dnaname, dp->booleanbit);
}
@@ -839,7 +837,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
}
}
else {
- if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
+ if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
fprintf(f, " if(%svalues[i]) data->%s[i] |= ", (dp->booleannegative)? "!": "", dp->dnaname);
rna_int_print(f, dp->booleanbit);
fprintf(f, ";\n");
@@ -847,11 +845,11 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
rna_int_print(f, dp->booleanbit);
fprintf(f, ";\n");
}
- else if(rna_color_quantize(prop, dp)) {
+ else if (rna_color_quantize(prop, dp)) {
fprintf(f, " data->%s[i]= FTOCHAR(values[i]);\n", dp->dnaname);
}
else {
- if(dp->dnatype)
+ if (dp->dnatype)
fprintf(f, " ((%s*)data->%s)[i]= %s", dp->dnatype, dp->dnaname, (dp->booleannegative)? "!": "");
else
fprintf(f, " (data->%s)[i]= %s", dp->dnaname, (dp->booleannegative)? "!": "");
@@ -866,12 +864,12 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
fprintf(f, "void %s(PointerRNA *ptr, %s value)\n", func, rna_type_type(prop));
fprintf(f, "{\n");
- if(manualfunc) {
+ if (manualfunc) {
fprintf(f, " %s(ptr, value);\n", manualfunc);
}
else {
rna_print_data_get(f, dp);
- if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
+ if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
fprintf(f, " if(%svalue) data->%s |= ", (dp->booleannegative)? "!": "", dp->dnaname);
rna_int_print(f, dp->booleanbit);
fprintf(f, ";\n");
@@ -879,7 +877,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
rna_int_print(f, dp->booleanbit);
fprintf(f, ";\n");
}
- else if(prop->type == PROP_ENUM && dp->enumbitflags) {
+ else if (prop->type == PROP_ENUM && dp->enumbitflags) {
fprintf(f, " data->%s &= ~", dp->dnaname);
rna_int_print(f, rna_enum_bitmask(prop));
fprintf(f, ";\n");
@@ -901,26 +899,26 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
{
- char *func= NULL;
+ char *func = NULL;
- if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL)
+ if (prop->flag & PROP_IDPROPERTY && manualfunc == NULL)
return NULL;
- if(prop->type == PROP_STRING) {
- if(!manualfunc) {
- if(!dp->dnastructname || !dp->dnaname) {
+ if (prop->type == PROP_STRING) {
+ if (!manualfunc) {
+ if (!dp->dnastructname || !dp->dnaname) {
fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
__func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return NULL;
}
}
- func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "length");
+ func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "length");
fprintf(f, "int %s(PointerRNA *ptr)\n", func);
fprintf(f, "{\n");
- if(manualfunc) {
+ if (manualfunc) {
fprintf(f, " return %s(ptr);\n", manualfunc);
}
else {
@@ -929,26 +927,26 @@ static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA
}
fprintf(f, "}\n\n");
}
- else if(prop->type == PROP_COLLECTION) {
- if(!manualfunc) {
- if(prop->type == PROP_COLLECTION && (!(dp->dnalengthname || dp->dnalengthfixed)|| !dp->dnaname)) {
+ else if (prop->type == PROP_COLLECTION) {
+ if (!manualfunc) {
+ if (prop->type == PROP_COLLECTION && (!(dp->dnalengthname || dp->dnalengthfixed)|| !dp->dnaname)) {
fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
__func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return NULL;
}
}
- func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "length");
+ func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "length");
fprintf(f, "int %s(PointerRNA *ptr)\n", func);
fprintf(f, "{\n");
- if(manualfunc) {
+ if (manualfunc) {
fprintf(f, " return %s(ptr);\n", manualfunc);
}
else {
rna_print_data_get(f, dp);
- if(dp->dnalengthname)
+ if (dp->dnalengthname)
fprintf(f, " return (data->%s == NULL)? 0: data->%s;\n", dp->dnaname, dp->dnalengthname);
else
fprintf(f, " return (data->%s == NULL)? 0: %d;\n", dp->dnaname, dp->dnalengthfixed);
@@ -963,51 +961,51 @@ static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA *
{
char *func, *getfunc;
- if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL)
+ if (prop->flag & PROP_IDPROPERTY && manualfunc == NULL)
return NULL;
- if(!manualfunc) {
- if(!dp->dnastructname || !dp->dnaname) {
+ if (!manualfunc) {
+ if (!dp->dnastructname || !dp->dnaname) {
fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
__func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return NULL;
}
}
- func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "begin");
+ func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "begin");
fprintf(f, "void %s(CollectionPropertyIterator *iter, PointerRNA *ptr)\n", func);
fprintf(f, "{\n");
- if(!manualfunc)
+ if (!manualfunc)
rna_print_data_get(f, dp);
fprintf(f, "\n memset(iter, 0, sizeof(*iter));\n");
fprintf(f, " iter->parent= *ptr;\n");
fprintf(f, " iter->prop= (PropertyRNA*)&rna_%s_%s;\n", srna->identifier, prop->identifier);
- if(dp->dnalengthname || dp->dnalengthfixed) {
- if(manualfunc) {
+ if (dp->dnalengthname || dp->dnalengthfixed) {
+ if (manualfunc) {
fprintf(f, "\n %s(iter, ptr);\n", manualfunc);
}
else {
- if(dp->dnalengthname)
+ if (dp->dnalengthname)
fprintf(f, "\n rna_iterator_array_begin(iter, data->%s, sizeof(data->%s[0]), data->%s, 0, NULL);\n", dp->dnaname, dp->dnaname, dp->dnalengthname);
else
fprintf(f, "\n rna_iterator_array_begin(iter, data->%s, sizeof(data->%s[0]), %d, 0, NULL);\n", dp->dnaname, dp->dnaname, dp->dnalengthfixed);
}
}
else {
- if(manualfunc)
+ if (manualfunc)
fprintf(f, "\n %s(iter, ptr);\n", manualfunc);
- else if(dp->dnapointerlevel == 0)
+ else if (dp->dnapointerlevel == 0)
fprintf(f, "\n rna_iterator_listbase_begin(iter, &data->%s, NULL);\n", dp->dnaname);
else
fprintf(f, "\n rna_iterator_listbase_begin(iter, data->%s, NULL);\n", dp->dnaname);
}
- getfunc= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get");
+ getfunc = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get");
fprintf(f, "\n if(iter->valid)\n");
fprintf(f, " iter->ptr= %s(iter);\n", getfunc);
@@ -1024,25 +1022,25 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
* so the the index can only be checked against the length when there is no 'skip' funcion. */
char *func;
- if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL)
+ if (prop->flag & PROP_IDPROPERTY && manualfunc == NULL)
return NULL;
- if(!manualfunc) {
- if(!dp->dnastructname || !dp->dnaname)
+ if (!manualfunc) {
+ if (!dp->dnastructname || !dp->dnaname)
return NULL;
/* only supported in case of standard next functions */
- if(strcmp(nextfunc, "rna_iterator_array_next") == 0);
- else if(strcmp(nextfunc, "rna_iterator_listbase_next") == 0);
+ if (strcmp(nextfunc, "rna_iterator_array_next") == 0);
+ else if (strcmp(nextfunc, "rna_iterator_listbase_next") == 0);
else return NULL;
}
- func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "lookup_int");
+ func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "lookup_int");
fprintf(f, "int %s(PointerRNA *ptr, int index, PointerRNA *r_ptr)\n", func);
fprintf(f, "{\n");
- if(manualfunc) {
+ if (manualfunc) {
fprintf(f, "\n return %s(ptr, index, r_ptr);\n", manualfunc);
fprintf(f, "}\n\n");
return func;
@@ -1054,7 +1052,7 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
fprintf(f, " %s_%s_begin(&iter, ptr);\n\n", srna->identifier, rna_safe_id(prop->identifier));
fprintf(f, " if(iter.valid){\n");
- if(strcmp(nextfunc, "rna_iterator_array_next") == 0) {
+ if (strcmp(nextfunc, "rna_iterator_array_next") == 0) {
fprintf(f, " ArrayIterator *internal= iter.internal;\n");
fprintf(f, " if(index < 0 || index >= internal->length) {\n");
fprintf(f, "#ifdef __GNUC__\n");
@@ -1074,7 +1072,7 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
fprintf(f, " found= 1;\n");
fprintf(f, " }\n");
}
- else if(strcmp(nextfunc, "rna_iterator_listbase_next") == 0) {
+ else if (strcmp(nextfunc, "rna_iterator_listbase_next") == 0) {
fprintf(f, " ListBaseIterator *internal= iter.internal;\n");
fprintf(f, " if(internal->skip) {\n");
fprintf(f, " while(index-- > 0 && iter.valid) {\n");
@@ -1097,16 +1095,16 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
#if 0
rna_print_data_get(f, dp);
- item_type= (cprop->item_type)? (const char*)cprop->item_type: "UnknownType";
+ item_type = (cprop->item_type)? (const char*)cprop->item_type: "UnknownType";
- if(dp->dnalengthname || dp->dnalengthfixed) {
- if(dp->dnalengthname)
+ if (dp->dnalengthname || dp->dnalengthfixed) {
+ if (dp->dnalengthname)
fprintf(f, "\n rna_array_lookup_int(ptr, &RNA_%s, data->%s, sizeof(data->%s[0]), data->%s, index);\n", item_type, dp->dnaname, dp->dnaname, dp->dnalengthname);
else
fprintf(f, "\n rna_array_lookup_int(ptr, &RNA_%s, data->%s, sizeof(data->%s[0]), %d, index);\n", item_type, dp->dnaname, dp->dnaname, dp->dnalengthfixed);
}
else {
- if(dp->dnapointerlevel == 0)
+ if (dp->dnapointerlevel == 0)
fprintf(f, "\n return rna_listbase_lookup_int(ptr, &RNA_%s, &data->%s, index);\n", item_type, dp->dnaname);
else
fprintf(f, "\n return rna_listbase_lookup_int(ptr, &RNA_%s, data->%s, index);\n", item_type, dp->dnaname);
@@ -1122,19 +1120,19 @@ static char *rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *p
{
char *func, *getfunc;
- if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL)
+ if (prop->flag & PROP_IDPROPERTY && manualfunc == NULL)
return NULL;
- if(!manualfunc)
+ if (!manualfunc)
return NULL;
- func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "next");
+ func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "next");
fprintf(f, "void %s(CollectionPropertyIterator *iter)\n", func);
fprintf(f, "{\n");
fprintf(f, " %s(iter);\n", manualfunc);
- getfunc= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get");
+ getfunc = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get");
fprintf(f, "\n if(iter->valid)\n");
fprintf(f, " iter->ptr= %s(iter);\n", getfunc);
@@ -1148,14 +1146,14 @@ static char *rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *pr
{
char *func;
- if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL)
+ if (prop->flag & PROP_IDPROPERTY && manualfunc == NULL)
return NULL;
- func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "end");
+ func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "end");
fprintf(f, "void %s(CollectionPropertyIterator *iter)\n", func);
fprintf(f, "{\n");
- if(manualfunc)
+ if (manualfunc)
fprintf(f, " %s(iter);\n", manualfunc);
fprintf(f, "}\n\n");
@@ -1164,36 +1162,36 @@ static char *rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *pr
static void rna_set_raw_property(PropertyDefRNA *dp, PropertyRNA *prop)
{
- if(dp->dnapointerlevel != 0)
+ if (dp->dnapointerlevel != 0)
return;
- if(!dp->dnatype || !dp->dnaname || !dp->dnastructname)
+ if (!dp->dnatype || !dp->dnaname || !dp->dnastructname)
return;
- if(strcmp(dp->dnatype, "char") == 0) {
- prop->rawtype= PROP_RAW_CHAR;
+ if (strcmp(dp->dnatype, "char") == 0) {
+ prop->rawtype = PROP_RAW_CHAR;
prop->flag |= PROP_RAW_ACCESS;
}
- else if(strcmp(dp->dnatype, "short") == 0) {
- prop->rawtype= PROP_RAW_SHORT;
+ else if (strcmp(dp->dnatype, "short") == 0) {
+ prop->rawtype = PROP_RAW_SHORT;
prop->flag |= PROP_RAW_ACCESS;
}
- else if(strcmp(dp->dnatype, "int") == 0) {
- prop->rawtype= PROP_RAW_INT;
+ else if (strcmp(dp->dnatype, "int") == 0) {
+ prop->rawtype = PROP_RAW_INT;
prop->flag |= PROP_RAW_ACCESS;
}
- else if(strcmp(dp->dnatype, "float") == 0) {
- prop->rawtype= PROP_RAW_FLOAT;
+ else if (strcmp(dp->dnatype, "float") == 0) {
+ prop->rawtype = PROP_RAW_FLOAT;
prop->flag |= PROP_RAW_ACCESS;
}
- else if(strcmp(dp->dnatype, "double") == 0) {
- prop->rawtype= PROP_RAW_DOUBLE;
+ else if (strcmp(dp->dnatype, "double") == 0) {
+ prop->rawtype = PROP_RAW_DOUBLE;
prop->flag |= PROP_RAW_ACCESS;
}
}
static void rna_set_raw_offset(FILE *f, StructRNA *srna, PropertyRNA *prop)
{
- PropertyDefRNA *dp= rna_find_struct_property_def(srna, prop);
+ PropertyDefRNA *dp = rna_find_struct_property_def(srna, prop);
fprintf(f, "\toffsetof(%s, %s), %d", dp->dnastructname, dp->dnaname, prop->rawtype);
}
@@ -1202,132 +1200,132 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
{
PropertyRNA *prop;
- prop= dp->prop;
+ prop = dp->prop;
- switch(prop->type) {
+ switch (prop->type) {
case PROP_BOOLEAN: {
- BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+ BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
- if(!prop->arraydimension) {
- if(!bprop->get && !bprop->set && !dp->booleanbit)
+ if (!prop->arraydimension) {
+ if (!bprop->get && !bprop->set && !dp->booleanbit)
rna_set_raw_property(dp, prop);
- bprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)bprop->get);
- bprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)bprop->set);
+ bprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)bprop->get);
+ bprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)bprop->set);
}
else {
- bprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)bprop->getarray);
- bprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)bprop->setarray);
+ bprop->getarray = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)bprop->getarray);
+ bprop->setarray = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)bprop->setarray);
}
break;
}
case PROP_INT: {
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
- if(!prop->arraydimension) {
- if(!iprop->get && !iprop->set)
+ if (!prop->arraydimension) {
+ if (!iprop->get && !iprop->set)
rna_set_raw_property(dp, prop);
- iprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)iprop->get);
- iprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)iprop->set);
+ iprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)iprop->get);
+ iprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)iprop->set);
}
else {
- if(!iprop->getarray && !iprop->setarray)
+ if (!iprop->getarray && !iprop->setarray)
rna_set_raw_property(dp, prop);
- iprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)iprop->getarray);
- iprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)iprop->setarray);
+ iprop->getarray = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)iprop->getarray);
+ iprop->setarray = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)iprop->setarray);
}
break;
}
case PROP_FLOAT: {
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
- if(!prop->arraydimension) {
- if(!fprop->get && !fprop->set)
+ if (!prop->arraydimension) {
+ if (!fprop->get && !fprop->set)
rna_set_raw_property(dp, prop);
- fprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)fprop->get);
- fprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)fprop->set);
+ fprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)fprop->get);
+ fprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)fprop->set);
}
else {
- if(!fprop->getarray && !fprop->setarray)
+ if (!fprop->getarray && !fprop->setarray)
rna_set_raw_property(dp, prop);
- fprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)fprop->getarray);
- fprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)fprop->setarray);
+ fprop->getarray = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)fprop->getarray);
+ fprop->setarray = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)fprop->setarray);
}
break;
}
case PROP_ENUM: {
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
- eprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)eprop->get);
- eprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)eprop->set);
+ eprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)eprop->get);
+ eprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)eprop->set);
break;
}
case PROP_STRING: {
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
- sprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)sprop->get);
- sprop->length= (void*)rna_def_property_length_func(f, srna, prop, dp, (const char*)sprop->length);
- sprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)sprop->set);
+ sprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)sprop->get);
+ sprop->length = (void*)rna_def_property_length_func(f, srna, prop, dp, (const char*)sprop->length);
+ sprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)sprop->set);
break;
}
case PROP_POINTER: {
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
- pprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)pprop->get);
- pprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)pprop->set);
- if(!pprop->type) {
+ pprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)pprop->get);
+ pprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)pprop->set);
+ if (!pprop->type) {
fprintf(stderr, "%s: %s.%s, pointer must have a struct type.\n",
__func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
break;
}
case PROP_COLLECTION: {
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
- const char *nextfunc= (const char*)cprop->next;
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
+ const char *nextfunc = (const char*)cprop->next;
- if(dp->dnatype && strcmp(dp->dnatype, "ListBase")==0);
- else if(dp->dnalengthname || dp->dnalengthfixed)
- cprop->length= (void*)rna_def_property_length_func(f, srna, prop, dp, (const char*)cprop->length);
+ if (dp->dnatype && strcmp(dp->dnatype, "ListBase") == 0);
+ else if (dp->dnalengthname || dp->dnalengthfixed)
+ cprop->length = (void*)rna_def_property_length_func(f, srna, prop, dp, (const char*)cprop->length);
/* test if we can allow raw array access, if it is using our standard
* array get/next function, we can be sure it is an actual array */
- if(cprop->next && cprop->get)
- if(strcmp((const char*)cprop->next, "rna_iterator_array_next") == 0 &&
+ if (cprop->next && cprop->get)
+ if (strcmp((const char*)cprop->next, "rna_iterator_array_next") == 0 &&
strcmp((const char*)cprop->get, "rna_iterator_array_get") == 0)
prop->flag |= PROP_RAW_ARRAY;
- cprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)cprop->get);
- cprop->begin= (void*)rna_def_property_begin_func(f, srna, prop, dp, (const char*)cprop->begin);
- cprop->next= (void*)rna_def_property_next_func(f, srna, prop, dp, (const char*)cprop->next);
- cprop->end= (void*)rna_def_property_end_func(f, srna, prop, dp, (const char*)cprop->end);
- cprop->lookupint= (void*)rna_def_property_lookup_int_func(f, srna, prop, dp, (const char*)cprop->lookupint, nextfunc);
+ cprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)cprop->get);
+ cprop->begin = (void*)rna_def_property_begin_func(f, srna, prop, dp, (const char*)cprop->begin);
+ cprop->next = (void*)rna_def_property_next_func(f, srna, prop, dp, (const char*)cprop->next);
+ cprop->end = (void*)rna_def_property_end_func(f, srna, prop, dp, (const char*)cprop->end);
+ cprop->lookupint = (void*)rna_def_property_lookup_int_func(f, srna, prop, dp, (const char*)cprop->lookupint, nextfunc);
- if(!(prop->flag & PROP_IDPROPERTY)) {
- if(!cprop->begin) {
+ if (!(prop->flag & PROP_IDPROPERTY)) {
+ if (!cprop->begin) {
fprintf(stderr, "%s: %s.%s, collection must have a begin function.\n",
__func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
- if(!cprop->next) {
+ if (!cprop->next) {
fprintf(stderr, "%s: %s.%s, collection must have a next function.\n",
__func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
- if(!cprop->get) {
+ if (!cprop->get) {
fprintf(stderr, "%s: %s.%s, collection must have a get function.\n",
__func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
}
- if(!cprop->item_type) {
+ if (!cprop->item_type) {
fprintf(stderr, "%s: %s.%s, collection must have a struct type.\n",
__func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
break;
}
@@ -1339,89 +1337,89 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR
PropertyRNA *prop;
char *func;
- prop= dp->prop;
+ prop = dp->prop;
- if(prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN))
+ if (prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN))
return;
- func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "");
+ func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "");
- switch(prop->type) {
+ switch (prop->type) {
case PROP_BOOLEAN:
case PROP_INT: {
- if(!prop->arraydimension) {
+ if (!prop->arraydimension) {
fprintf(f, "int %sget(PointerRNA *ptr);\n", func);
- //fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func);
+ /*fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func); */
}
- else if(prop->arraydimension && prop->totarraylength) {
+ else if (prop->arraydimension && prop->totarraylength) {
fprintf(f, "void %sget(PointerRNA *ptr, int values[%u]);\n", func, prop->totarraylength);
- //fprintf(f, "void %sset(PointerRNA *ptr, const int values[%d]);\n", func, prop->arraylength);
+ /*fprintf(f, "void %sset(PointerRNA *ptr, const int values[%d]);\n", func, prop->arraylength); */
}
else {
fprintf(f, "void %sget(PointerRNA *ptr, int values[]);\n", func);
- //fprintf(f, "void %sset(PointerRNA *ptr, const int values[]);\n", func);
+ /*fprintf(f, "void %sset(PointerRNA *ptr, const int values[]);\n", func); */
}
break;
}
case PROP_FLOAT: {
- if(!prop->arraydimension) {
+ if (!prop->arraydimension) {
fprintf(f, "float %sget(PointerRNA *ptr);\n", func);
- //fprintf(f, "void %sset(PointerRNA *ptr, float value);\n", func);
+ /*fprintf(f, "void %sset(PointerRNA *ptr, float value);\n", func); */
}
- else if(prop->arraydimension && prop->totarraylength) {
+ else if (prop->arraydimension && prop->totarraylength) {
fprintf(f, "void %sget(PointerRNA *ptr, float values[%u]);\n", func, prop->totarraylength);
- //fprintf(f, "void %sset(PointerRNA *ptr, const float values[%d]);\n", func, prop->arraylength);
+ /*fprintf(f, "void %sset(PointerRNA *ptr, const float values[%d]);\n", func, prop->arraylength); */
}
else {
fprintf(f, "void %sget(PointerRNA *ptr, float values[]);\n", func);
- //fprintf(f, "void %sset(PointerRNA *ptr, const float values[]);\n", func);
+ /*fprintf(f, "void %sset(PointerRNA *ptr, const float values[]);\n", func); */
}
break;
}
case PROP_ENUM: {
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
int i;
- if(eprop->item) {
+ if (eprop->item) {
fprintf(f, "enum {\n");
- for(i=0; i<eprop->totitem; i++)
- if(eprop->item[i].identifier[0])
+ for (i = 0; i<eprop->totitem; i++)
+ if (eprop->item[i].identifier[0])
fprintf(f, "\t%s_%s_%s = %d,\n", srna->identifier, prop->identifier, eprop->item[i].identifier, eprop->item[i].value);
fprintf(f, "};\n\n");
}
fprintf(f, "int %sget(PointerRNA *ptr);\n", func);
- //fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func);
+ /*fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func); */
break;
}
case PROP_STRING: {
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
- if(sprop->maxlength) {
+ if (sprop->maxlength) {
fprintf(f, "#define %s_%s_MAX %d\n\n", srna->identifier, prop->identifier, sprop->maxlength);
}
fprintf(f, "void %sget(PointerRNA *ptr, char *value);\n", func);
fprintf(f, "int %slength(PointerRNA *ptr);\n", func);
- //fprintf(f, "void %sset(PointerRNA *ptr, const char *value);\n", func);
+ /*fprintf(f, "void %sset(PointerRNA *ptr, const char *value);\n", func); */
break;
}
case PROP_POINTER: {
fprintf(f, "PointerRNA %sget(PointerRNA *ptr);\n", func);
- //fprintf(f, "void %sset(PointerRNA *ptr, PointerRNA value);\n", func);
+ /*fprintf(f, "void %sset(PointerRNA *ptr, PointerRNA value);\n", func); */
break;
}
case PROP_COLLECTION: {
fprintf(f, "void %sbegin(CollectionPropertyIterator *iter, PointerRNA *ptr);\n", func);
fprintf(f, "void %snext(CollectionPropertyIterator *iter);\n", func);
fprintf(f, "void %send(CollectionPropertyIterator *iter);\n", func);
- //fprintf(f, "int %slength(PointerRNA *ptr);\n", func);
- //fprintf(f, "void %slookup_int(PointerRNA *ptr, int key, StructRNA **type);\n", func);
- //fprintf(f, "void %slookup_string(PointerRNA *ptr, const char *key, StructRNA **type);\n", func);
+ /*fprintf(f, "int %slength(PointerRNA *ptr);\n", func); */
+ /*fprintf(f, "void %slookup_int(PointerRNA *ptr, int key, StructRNA **type);\n", func); */
+ /*fprintf(f, "void %slookup_string(PointerRNA *ptr, const char *key, StructRNA **type);\n", func); */
break;
}
}
@@ -1433,49 +1431,49 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property
{
PropertyRNA *prop;
- prop= dp->prop;
+ prop = dp->prop;
- if(prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN))
+ if (prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN))
return;
- if(prop->name && prop->description && prop->description[0] != '\0')
+ if (prop->name && prop->description && prop->description[0] != '\0')
fprintf(f, "\t/* %s: %s */\n", prop->name, prop->description);
- else if(prop->name)
+ else if (prop->name)
fprintf(f, "\t/* %s */\n", prop->name);
else
fprintf(f, "\t/* */\n");
- switch(prop->type) {
+ switch (prop->type) {
case PROP_BOOLEAN: {
- if(!prop->arraydimension)
+ if (!prop->arraydimension)
fprintf(f, "\tinline bool %s(void);", rna_safe_id(prop->identifier));
- else if(prop->totarraylength)
+ else if (prop->totarraylength)
fprintf(f, "\tinline Array<int, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
break;
}
case PROP_INT: {
- if(!prop->arraydimension)
+ if (!prop->arraydimension)
fprintf(f, "\tinline int %s(void);", rna_safe_id(prop->identifier));
- else if(prop->totarraylength)
+ else if (prop->totarraylength)
fprintf(f, "\tinline Array<int, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
break;
}
case PROP_FLOAT: {
- if(!prop->arraydimension)
+ if (!prop->arraydimension)
fprintf(f, "\tinline float %s(void);", rna_safe_id(prop->identifier));
- else if(prop->totarraylength)
+ else if (prop->totarraylength)
fprintf(f, "\tinline Array<float, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
break;
}
case PROP_ENUM: {
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
int i;
- if(eprop->item) {
+ if (eprop->item) {
fprintf(f, "\tenum %s_enum {\n", rna_safe_id(prop->identifier));
- for(i=0; i<eprop->totitem; i++)
- if(eprop->item[i].identifier[0])
+ for (i = 0; i<eprop->totitem; i++)
+ if (eprop->item[i].identifier[0])
fprintf(f, "\t\t%s_%s = %d,\n", rna_safe_id(prop->identifier), eprop->item[i].identifier, eprop->item[i].value);
fprintf(f, "\t};\n");
@@ -1489,18 +1487,18 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property
break;
}
case PROP_POINTER: {
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)dp->prop;
- if(pprop->type)
+ if (pprop->type)
fprintf(f, "\tinline %s %s(void);", (const char*)pprop->type, rna_safe_id(prop->identifier));
else
fprintf(f, "\tinline %s %s(void);", "UnknownType", rna_safe_id(prop->identifier));
break;
}
case PROP_COLLECTION: {
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop;
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)dp->prop;
- if(cprop->item_type)
+ if (cprop->item_type)
fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (const char*)cprop->item_type, srna->identifier, rna_safe_id(prop->identifier));
else
fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, rna_safe_id(prop->identifier));
@@ -1515,30 +1513,30 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
{
PropertyRNA *prop;
- prop= dp->prop;
+ prop = dp->prop;
- if(prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN))
+ if (prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN))
return;
- switch(prop->type) {
+ switch (prop->type) {
case PROP_BOOLEAN: {
- if(!prop->arraydimension)
+ if (!prop->arraydimension)
fprintf(f, "\tBOOLEAN_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
- else if(prop->totarraylength)
+ else if (prop->totarraylength)
fprintf(f, "\tBOOLEAN_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
break;
}
case PROP_INT: {
- if(!prop->arraydimension)
+ if (!prop->arraydimension)
fprintf(f, "\tINT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
- else if(prop->totarraylength)
+ else if (prop->totarraylength)
fprintf(f, "\tINT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
break;
}
case PROP_FLOAT: {
- if(!prop->arraydimension)
+ if (!prop->arraydimension)
fprintf(f, "\tFLOAT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
- else if(prop->totarraylength)
+ else if (prop->totarraylength)
fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
break;
}
@@ -1552,21 +1550,23 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
break;
}
case PROP_POINTER: {
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)dp->prop;
- if(pprop->type)
+ if (pprop->type)
fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", (const char*)pprop->type, srna->identifier, rna_safe_id(prop->identifier));
else
fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, rna_safe_id(prop->identifier));
break;
}
case PROP_COLLECTION: {
- /*CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop;
+#if 0
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop;
if(cprop->type)
fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (const char*)cprop->type, srna->identifier, prop->identifier);
else
- fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, prop->identifier);*/
+ fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, prop->identifier);
+#endif
break;
}
}
@@ -1582,16 +1582,16 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
PropertyType type;
const char *funcname, *valstr;
const char *ptrstr;
- const short has_data= (dfunc->cont.properties.first != NULL);
+ const short has_data = (dfunc->cont.properties.first != NULL);
int flag, pout, cptr, first;
- srna= dsrna->srna;
- func= dfunc->func;
+ srna = dsrna->srna;
+ func = dfunc->func;
- if(!dfunc->call)
+ if (!dfunc->call)
return;
- funcname= rna_alloc_function_name(srna->identifier, func->identifier, "call");
+ funcname = rna_alloc_function_name(srna->identifier, func->identifier, "call");
/* function definition */
fprintf(f, "void %s(bContext *C, ReportList *reports, PointerRNA *_ptr, ParameterList *_parms)", funcname);
@@ -1599,35 +1599,35 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
/* variable definitions */
- if(func->flag & FUNC_USE_SELF_ID) {
+ if (func->flag & FUNC_USE_SELF_ID) {
fprintf(f, "\tstruct ID *_selfid;\n");
}
- if((func->flag & FUNC_NO_SELF)==0) {
- if(dsrna->dnaname) fprintf(f, "\tstruct %s *_self;\n", dsrna->dnaname);
+ if ((func->flag & FUNC_NO_SELF) == 0) {
+ if (dsrna->dnaname) fprintf(f, "\tstruct %s *_self;\n", dsrna->dnaname);
else fprintf(f, "\tstruct %s *_self;\n", srna->identifier);
}
- dparm= dfunc->cont.properties.first;
- for(; dparm; dparm= dparm->next) {
+ dparm = dfunc->cont.properties.first;
+ for (; dparm; dparm = dparm->next) {
type = dparm->prop->type;
flag = dparm->prop->flag;
pout = (flag & PROP_OUTPUT);
cptr = ((type == PROP_POINTER) && !(flag & PROP_RNAPTR));
- if(dparm->prop==func->c_ret)
- ptrstr= cptr || dparm->prop->arraydimension ? "*" : "";
+ if (dparm->prop == func->c_ret)
+ ptrstr = cptr || dparm->prop->arraydimension ? "*" : "";
/* XXX only arrays and strings are allowed to be dynamic, is this checked anywhere? */
else if (cptr || (flag & PROP_DYNAMIC))
- ptrstr= pout ? "**" : "*";
+ ptrstr = pout ? "**" : "*";
/* fixed size arrays and RNA pointers are pre-allocated on the ParameterList stack, pass a pointer to it */
else if (type == PROP_POINTER || dparm->prop->arraydimension)
- ptrstr= "*";
+ ptrstr = "*";
/* PROP_THICK_WRAP strings are pre-allocated on the ParameterList stack, but type name for string props is already char*, so leave empty */
else if (type == PROP_STRING && (flag & PROP_THICK_WRAP))
- ptrstr= "";
+ ptrstr = "";
else
- ptrstr= pout ? "*" : "";
+ ptrstr = pout ? "*" : "";
/* for dynamic parameters we pass an additional int for the length of the parameter */
if (flag & PROP_DYNAMIC)
@@ -1636,62 +1636,62 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
fprintf(f, "\t%s%s %s%s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, dparm->prop->identifier);
}
- if(has_data) {
+ if (has_data) {
fprintf(f, "\tchar *_data");
- if(func->c_ret) fprintf(f, ", *_retdata");
+ if (func->c_ret) fprintf(f, ", *_retdata");
fprintf(f, ";\n");
fprintf(f, "\t\n");
}
/* assign self */
- if(func->flag & FUNC_USE_SELF_ID) {
+ if (func->flag & FUNC_USE_SELF_ID) {
fprintf(f, "\t_selfid= (struct ID*)_ptr->id.data;\n");
}
- if((func->flag & FUNC_NO_SELF)==0) {
- if(dsrna->dnaname) fprintf(f, "\t_self= (struct %s *)_ptr->data;\n", dsrna->dnaname);
+ if ((func->flag & FUNC_NO_SELF) == 0) {
+ if (dsrna->dnaname) fprintf(f, "\t_self= (struct %s *)_ptr->data;\n", dsrna->dnaname);
else fprintf(f, "\t_self= (struct %s *)_ptr->data;\n", srna->identifier);
}
- if(has_data) {
+ if (has_data) {
fprintf(f, "\t_data= (char *)_parms->data;\n");
}
- dparm= dfunc->cont.properties.first;
- for(; dparm; dparm= dparm->next) {
+ dparm = dfunc->cont.properties.first;
+ for (; dparm; dparm = dparm->next) {
type = dparm->prop->type;
flag = dparm->prop->flag;
pout = (flag & PROP_OUTPUT);
cptr = ((type == PROP_POINTER) && !(flag & PROP_RNAPTR));
- if(dparm->prop==func->c_ret)
+ if (dparm->prop == func->c_ret)
fprintf(f, "\t_retdata= _data;\n");
else {
const char *data_str;
if (cptr || (flag & PROP_DYNAMIC)) {
- ptrstr= "**";
- valstr= "*";
+ ptrstr = "**";
+ valstr = "*";
}
else if (type == PROP_POINTER || dparm->prop->arraydimension) {
- ptrstr= "*";
- valstr= "";
+ ptrstr = "*";
+ valstr = "";
}
else if (type == PROP_STRING && (flag & PROP_THICK_WRAP)) {
- ptrstr= "";
- valstr= "";
+ ptrstr = "";
+ valstr = "";
}
else {
- ptrstr= "*";
- valstr= "*";
+ ptrstr = "*";
+ valstr = "*";
}
/* this must be kept in sync with RNA_parameter_length_get_data, we could just call the function directly, but this is faster */
if (flag & PROP_DYNAMIC) {
fprintf(f, "\t%s_len= %s((int *)_data);\n", dparm->prop->identifier, pout ? "" : "*");
- data_str= "(&(((char *)_data)[sizeof(void *)]))";
+ data_str = "(&(((char *)_data)[sizeof(void *)]))";
}
else {
- data_str= "_data";
+ data_str = "_data";
}
fprintf(f, "\t%s= ", dparm->prop->identifier);
@@ -1701,54 +1701,54 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
fprintf(f, "((%s%s%s)%s);\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, data_str);
}
- if(dparm->next)
+ if (dparm->next)
fprintf(f, "\t_data+= %d;\n", rna_parameter_size_alloc(dparm->prop));
}
- if(dfunc->call) {
+ if (dfunc->call) {
fprintf(f, "\t\n");
fprintf(f, "\t");
- if(func->c_ret) fprintf(f, "%s= ", func->c_ret->identifier);
+ if (func->c_ret) fprintf(f, "%s= ", func->c_ret->identifier);
fprintf(f, "%s(", dfunc->call);
- first= 1;
+ first = 1;
- if(func->flag & FUNC_USE_SELF_ID) {
+ if (func->flag & FUNC_USE_SELF_ID) {
fprintf(f, "_selfid");
- first= 0;
+ first = 0;
}
- if((func->flag & FUNC_NO_SELF)==0) {
- if(!first) fprintf(f, ", ");
+ if ((func->flag & FUNC_NO_SELF) == 0) {
+ if (!first) fprintf(f, ", ");
fprintf(f, "_self");
- first= 0;
+ first = 0;
}
- if(func->flag & FUNC_USE_MAIN) {
- if(!first) fprintf(f, ", ");
- first= 0;
+ if (func->flag & FUNC_USE_MAIN) {
+ if (!first) fprintf(f, ", ");
+ first = 0;
fprintf(f, "CTX_data_main(C)"); /* may have direct access later */
}
- if(func->flag & FUNC_USE_CONTEXT) {
- if(!first) fprintf(f, ", ");
- first= 0;
+ if (func->flag & FUNC_USE_CONTEXT) {
+ if (!first) fprintf(f, ", ");
+ first = 0;
fprintf(f, "C");
}
- if(func->flag & FUNC_USE_REPORTS) {
- if(!first) fprintf(f, ", ");
- first= 0;
+ if (func->flag & FUNC_USE_REPORTS) {
+ if (!first) fprintf(f, ", ");
+ first = 0;
fprintf(f, "reports");
}
- dparm= dfunc->cont.properties.first;
- for(; dparm; dparm= dparm->next) {
- if(dparm->prop==func->c_ret)
+ dparm = dfunc->cont.properties.first;
+ for (; dparm; dparm = dparm->next) {
+ if (dparm->prop == func->c_ret)
continue;
- if(!first) fprintf(f, ", ");
- first= 0;
+ if (!first) fprintf(f, ", ");
+ first = 0;
if (dparm->prop->flag & PROP_DYNAMIC)
fprintf(f, "%s_len, %s", dparm->prop->identifier, dparm->prop->identifier);
@@ -1758,16 +1758,16 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
fprintf(f, ");\n");
- if(func->c_ret) {
- dparm= rna_find_parameter_def(func->c_ret);
- ptrstr= (((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR)) || (dparm->prop->arraydimension))? "*": "";
+ if (func->c_ret) {
+ dparm = rna_find_parameter_def(func->c_ret);
+ ptrstr = (((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR)) || (dparm->prop->arraydimension))? "*": "";
fprintf(f, "\t*((%s%s%s*)_retdata)= %s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, func->c_ret->identifier);
}
}
fprintf(f, "}\n\n");
- dfunc->gencall= funcname;
+ dfunc->gencall = funcname;
}
static void rna_auto_types(void)
@@ -1775,34 +1775,34 @@ static void rna_auto_types(void)
StructDefRNA *ds;
PropertyDefRNA *dp;
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next) {
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
/* DNA name for Screen is patched in 2.5, we do the reverse here .. */
- if(ds->dnaname && strcmp(ds->dnaname, "Screen") == 0)
- ds->dnaname= "bScreen";
+ if (ds->dnaname && strcmp(ds->dnaname, "Screen") == 0)
+ ds->dnaname = "bScreen";
- for(dp=ds->cont.properties.first; dp; dp=dp->next) {
- if(dp->dnastructname && strcmp(dp->dnastructname, "Screen") == 0)
- dp->dnastructname= "bScreen";
+ for (dp = ds->cont.properties.first; dp; dp = dp->next) {
+ if (dp->dnastructname && strcmp(dp->dnastructname, "Screen") == 0)
+ dp->dnastructname = "bScreen";
- if(dp->dnatype) {
- if(dp->prop->type == PROP_POINTER) {
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
+ if (dp->dnatype) {
+ if (dp->prop->type == PROP_POINTER) {
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)dp->prop;
StructRNA *type;
- if(!pprop->type && !pprop->get)
- pprop->type= (StructRNA*)rna_find_type(dp->dnatype);
+ if (!pprop->type && !pprop->get)
+ pprop->type = (StructRNA*)rna_find_type(dp->dnatype);
- if(pprop->type) {
- type= rna_find_struct((const char*)pprop->type);
- if(type && (type->flag & STRUCT_ID_REFCOUNT))
+ if (pprop->type) {
+ type = rna_find_struct((const char*)pprop->type);
+ if (type && (type->flag & STRUCT_ID_REFCOUNT))
pprop->property.flag |= PROP_ID_REFCOUNT;
}
}
- else if(dp->prop->type== PROP_COLLECTION) {
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop;
+ else if (dp->prop->type == PROP_COLLECTION) {
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)dp->prop;
- if(!cprop->item_type && !cprop->get && strcmp(dp->dnatype, "ListBase")==0)
- cprop->item_type= (StructRNA*)rna_find_type(dp->dnatype);
+ if (!cprop->item_type && !cprop->get && strcmp(dp->dnatype, "ListBase") == 0)
+ cprop->item_type = (StructRNA*)rna_find_type(dp->dnatype);
}
}
}
@@ -1817,16 +1817,16 @@ static void rna_sort(BlenderRNA *brna)
rna_sortlist(&brna->structs, cmp_struct);
rna_sortlist(&DefRNA.structs, cmp_def_struct);
- for(srna=brna->structs.first; srna; srna=srna->cont.next)
+ for (srna = brna->structs.first; srna; srna = srna->cont.next)
rna_sortlist(&srna->cont.properties, cmp_property);
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
rna_sortlist(&ds->cont.properties, cmp_def_property);
}
static const char *rna_property_structname(PropertyType type)
{
- switch(type) {
+ switch (type) {
case PROP_BOOLEAN: return "BoolPropertyRNA";
case PROP_INT: return "IntPropertyRNA";
case PROP_FLOAT: return "FloatPropertyRNA";
@@ -1840,7 +1840,7 @@ static const char *rna_property_structname(PropertyType type)
static const char *rna_property_subtypename(PropertySubType type)
{
- switch(type) {
+ switch (type) {
case PROP_NONE: return "PROP_NONE";
case PROP_FILEPATH: return "PROP_FILEPATH";
case PROP_FILENAME: return "PROP_FILENAME";
@@ -1868,8 +1868,8 @@ static const char *rna_property_subtypename(PropertySubType type)
case PROP_LAYER: return "PROP_LAYER";
case PROP_LAYER_MEMBER: return "PROP_LAYER_MEMBER";
default: {
- /* incase we dont have a type preset that includes the subtype */
- if(RNA_SUBTYPE_UNIT(type)) {
+ /* in case we dont have a type preset that includes the subtype */
+ if (RNA_SUBTYPE_UNIT(type)) {
return rna_property_subtypename(type & ~RNA_SUBTYPE_UNIT(type));
}
else {
@@ -1881,7 +1881,7 @@ static const char *rna_property_subtypename(PropertySubType type)
static const char *rna_property_subtype_unit(PropertySubType type)
{
- switch(RNA_SUBTYPE_UNIT(type)) {
+ switch (RNA_SUBTYPE_UNIT(type)) {
case PROP_UNIT_NONE: return "PROP_UNIT_NONE";
case PROP_UNIT_LENGTH: return "PROP_UNIT_LENGTH";
case PROP_UNIT_AREA: return "PROP_UNIT_AREA";
@@ -1899,7 +1899,7 @@ static void rna_generate_prototypes(BlenderRNA *brna, FILE *f)
{
StructRNA *srna;
- for(srna=brna->structs.first; srna; srna=srna->cont.next)
+ for (srna = brna->structs.first; srna; srna = srna->cont.next)
fprintf(f, "extern StructRNA RNA_%s;\n", srna->identifier);
fprintf(f, "\n");
}
@@ -1910,12 +1910,12 @@ static void rna_generate_blender(BlenderRNA *brna, FILE *f)
fprintf(f, "BlenderRNA BLENDER_RNA = {");
- srna= brna->structs.first;
- if(srna) fprintf(f, "{&RNA_%s, ", srna->identifier);
+ srna = brna->structs.first;
+ if (srna) fprintf(f, "{&RNA_%s, ", srna->identifier);
else fprintf(f, "{NULL, ");
- srna= brna->structs.last;
- if(srna) fprintf(f, "&RNA_%s}", srna->identifier);
+ srna = brna->structs.last;
+ if (srna) fprintf(f, "&RNA_%s}", srna->identifier);
else fprintf(f, "NULL}");
fprintf(f, "};\n\n");
@@ -1926,18 +1926,18 @@ static void rna_generate_property_prototypes(BlenderRNA *brna, StructRNA *srna,
PropertyRNA *prop;
StructRNA *base;
- base= srna->base;
+ base = srna->base;
while (base) {
fprintf(f, "\n");
- for(prop=base->cont.properties.first; prop; prop=prop->next)
+ for (prop = base->cont.properties.first; prop; prop = prop->next)
fprintf(f, "%s%s rna_%s_%s;\n", "extern ", rna_property_structname(prop->type), base->identifier, prop->identifier);
- base= base->base;
+ base = base->base;
}
- if(srna->cont.properties.first)
+ if (srna->cont.properties.first)
fprintf(f, "\n");
- for(prop=srna->cont.properties.first; prop; prop=prop->next)
+ for (prop = srna->cont.properties.first; prop; prop = prop->next)
fprintf(f, "%s%s rna_%s_%s;\n", (prop->flag & PROP_EXPORT)? "": "", rna_property_structname(prop->type), srna->identifier, prop->identifier);
fprintf(f, "\n");
}
@@ -1946,10 +1946,10 @@ static void rna_generate_parameter_prototypes(BlenderRNA *brna, StructRNA *srna,
{
PropertyRNA *parm;
- for(parm= func->cont.properties.first; parm; parm= parm->next)
+ for (parm = func->cont.properties.first; parm; parm = parm->next)
fprintf(f, "%s%s rna_%s_%s_%s;\n", "extern ", rna_property_structname(parm->type), srna->identifier, func->identifier, parm->identifier);
- if(func->cont.properties.first)
+ if (func->cont.properties.first)
fprintf(f, "\n");
}
@@ -1958,25 +1958,25 @@ static void rna_generate_function_prototypes(BlenderRNA *brna, StructRNA *srna,
FunctionRNA *func;
StructRNA *base;
- base= srna->base;
+ base = srna->base;
while (base) {
- for(func= base->functions.first; func; func= func->cont.next) {
+ for (func = base->functions.first; func; func = func->cont.next) {
fprintf(f, "%s%s rna_%s_%s_func;\n", "extern ", "FunctionRNA", base->identifier, func->identifier);
rna_generate_parameter_prototypes(brna, base, func, f);
}
- if(base->functions.first)
+ if (base->functions.first)
fprintf(f, "\n");
- base= base->base;
+ base = base->base;
}
- for(func= srna->functions.first; func; func= func->cont.next) {
+ for (func = srna->functions.first; func; func = func->cont.next) {
fprintf(f, "%s%s rna_%s_%s_func;\n", "extern ", "FunctionRNA", srna->identifier, func->identifier);
rna_generate_parameter_prototypes(brna, srna, func, f);
}
- if(srna->functions.first)
+ if (srna->functions.first)
fprintf(f, "\n");
}
@@ -1989,15 +1989,15 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA
int flag, pout, cptr, first;
const char *ptrstr;
- dsrna= rna_find_struct_def(srna);
- func= dfunc->func;
+ dsrna = rna_find_struct_def(srna);
+ func = dfunc->func;
/* return type */
- for(dparm= dfunc->cont.properties.first; dparm; dparm= dparm->next) {
- if(dparm->prop==func->c_ret) {
- if(dparm->prop->arraydimension)
+ for (dparm = dfunc->cont.properties.first; dparm; dparm = dparm->next) {
+ if (dparm->prop == func->c_ret) {
+ if (dparm->prop->arraydimension)
fprintf(f, "XXX no array return types yet"); /* XXX not supported */
- else if(dparm->prop->type == PROP_POINTER && !(dparm->prop->flag & PROP_RNAPTR))
+ else if (dparm->prop->type == PROP_POINTER && !(dparm->prop->flag & PROP_RNAPTR))
fprintf(f, "%s%s *", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop));
else
fprintf(f, "%s%s ", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop));
@@ -2007,71 +2007,71 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA
}
/* void if nothing to return */
- if(!dparm)
+ if (!dparm)
fprintf(f, "void ");
/* function name */
fprintf(f, "%s(", dfunc->call);
- first= 1;
+ first = 1;
/* self, context and reports parameters */
- if(func->flag & FUNC_USE_SELF_ID) {
+ if (func->flag & FUNC_USE_SELF_ID) {
fprintf(f, "struct ID *_selfid");
- first= 0;
+ first = 0;
}
- if((func->flag & FUNC_NO_SELF)==0) {
- if(!first) fprintf(f, ", ");
- if(dsrna->dnaname) fprintf(f, "struct %s *_self", dsrna->dnaname);
+ if ((func->flag & FUNC_NO_SELF) == 0) {
+ if (!first) fprintf(f, ", ");
+ if (dsrna->dnaname) fprintf(f, "struct %s *_self", dsrna->dnaname);
else fprintf(f, "struct %s *_self", srna->identifier);
- first= 0;
+ first = 0;
}
- if(func->flag & FUNC_USE_MAIN) {
- if(!first) fprintf(f, ", ");
- first= 0;
+ if (func->flag & FUNC_USE_MAIN) {
+ if (!first) fprintf(f, ", ");
+ first = 0;
fprintf(f, "Main *bmain");
}
- if(func->flag & FUNC_USE_CONTEXT) {
- if(!first) fprintf(f, ", ");
- first= 0;
+ if (func->flag & FUNC_USE_CONTEXT) {
+ if (!first) fprintf(f, ", ");
+ first = 0;
fprintf(f, "bContext *C");
}
- if(func->flag & FUNC_USE_REPORTS) {
- if(!first) fprintf(f, ", ");
- first= 0;
+ if (func->flag & FUNC_USE_REPORTS) {
+ if (!first) fprintf(f, ", ");
+ first = 0;
fprintf(f, "ReportList *reports");
}
/* defined parameters */
- for(dparm= dfunc->cont.properties.first; dparm; dparm= dparm->next) {
+ for (dparm = dfunc->cont.properties.first; dparm; dparm = dparm->next) {
type = dparm->prop->type;
flag = dparm->prop->flag;
pout = (flag & PROP_OUTPUT);
cptr = ((type == PROP_POINTER) && !(flag & PROP_RNAPTR));
- if(dparm->prop==func->c_ret)
+ if (dparm->prop == func->c_ret)
continue;
if (cptr || (flag & PROP_DYNAMIC))
- ptrstr= pout ? "**" : "*";
+ ptrstr = pout ? "**" : "*";
else if (type == PROP_POINTER || dparm->prop->arraydimension)
- ptrstr= "*";
+ ptrstr = "*";
else if (type == PROP_STRING && (flag & PROP_THICK_WRAP))
- ptrstr= "";
+ ptrstr = "";
else
- ptrstr= pout ? "*" : "";
+ ptrstr = pout ? "*" : "";
- if(!first) fprintf(f, ", ");
- first= 0;
+ if (!first) fprintf(f, ", ");
+ first = 0;
if (flag & PROP_DYNAMIC)
fprintf(f, "int %s%s_len, ", pout ? "*" : "", dparm->prop->identifier);
- if(!(flag & PROP_DYNAMIC) && dparm->prop->arraydimension)
+ if (!(flag & PROP_DYNAMIC) && dparm->prop->arraydimension)
fprintf(f, "%s%s %s[%u]", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier, dparm->prop->totarraylength);
else
fprintf(f, "%s%s %s%s", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, dparm->prop->identifier);
@@ -2085,15 +2085,15 @@ static void rna_generate_static_function_prototypes(BlenderRNA *brna, StructRNA
{
FunctionRNA *func;
FunctionDefRNA *dfunc;
- int first= 1;
+ int first = 1;
- for(func= srna->functions.first; func; func= func->cont.next) {
- dfunc= rna_find_function_def(func);
+ for (func = srna->functions.first; func; func = func->cont.next) {
+ dfunc = rna_find_function_def(func);
- if(dfunc->call) {
- if(first) {
+ if (dfunc->call) {
+ if (first) {
fprintf(f, "/* Repeated prototypes to detect errors */\n\n");
- first= 0;
+ first = 0;
}
rna_generate_static_parameter_prototypes(brna, srna, dfunc, f);
@@ -2105,43 +2105,43 @@ static void rna_generate_static_function_prototypes(BlenderRNA *brna, StructRNA
static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, PropertyRNA *prop)
{
- char *strnest= "", *errnest= "";
- int len, freenest= 0;
+ char *strnest = "", *errnest = "";
+ int len, freenest = 0;
- if(nest != NULL) {
- len= strlen(nest);
+ if (nest != NULL) {
+ len = strlen(nest);
- strnest= MEM_mallocN(sizeof(char)*(len+2), "rna_generate_property -> strnest");
- errnest= MEM_mallocN(sizeof(char)*(len+2), "rna_generate_property -> errnest");
+ strnest = MEM_mallocN(sizeof(char)*(len+2), "rna_generate_property -> strnest");
+ errnest = MEM_mallocN(sizeof(char)*(len+2), "rna_generate_property -> errnest");
strcpy(strnest, "_"); strcat(strnest, nest);
strcpy(errnest, "."); strcat(errnest, nest);
- freenest= 1;
+ freenest = 1;
}
- switch(prop->type) {
+ switch (prop->type) {
case PROP_ENUM: {
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
- int i, defaultfound= 0, totflag= 0;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
+ int i, defaultfound = 0, totflag = 0;
- if(eprop->item) {
+ if (eprop->item) {
fprintf(f, "static EnumPropertyItem rna_%s%s_%s_items[%d] = {\n\t", srna->identifier, strnest, prop->identifier, eprop->totitem+1);
- for(i=0; i<eprop->totitem; i++) {
+ for (i = 0; i<eprop->totitem; i++) {
fprintf(f, "{%d, ", eprop->item[i].value);
rna_print_c_string(f, eprop->item[i].identifier); fprintf(f, ", ");
fprintf(f, "%d, ", eprop->item[i].icon);
rna_print_c_string(f, eprop->item[i].name); fprintf(f, ", ");
rna_print_c_string(f, eprop->item[i].description); fprintf(f, "},\n\t");
- if(eprop->item[i].identifier[0]) {
- if(prop->flag & PROP_ENUM_FLAG) {
+ if (eprop->item[i].identifier[0]) {
+ if (prop->flag & PROP_ENUM_FLAG) {
totflag |= eprop->item[i].value;
}
else {
- if(eprop->defaultvalue == eprop->item[i].value) {
- defaultfound= 1;
+ if (eprop->defaultvalue == eprop->item[i].value) {
+ defaultfound = 1;
}
}
}
@@ -2149,41 +2149,41 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
fprintf(f, "{0, NULL, 0, NULL, NULL}\n};\n\n");
- if(prop->flag & PROP_ENUM_FLAG) {
- if(eprop->defaultvalue & ~totflag) {
+ if (prop->flag & PROP_ENUM_FLAG) {
+ if (eprop->defaultvalue & ~totflag) {
fprintf(stderr, "%s: %s%s.%s, enum default includes unused bits (%d).\n",
__func__, srna->identifier, errnest, prop->identifier, eprop->defaultvalue & ~totflag);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
}
else {
- if(!defaultfound) {
+ if (!defaultfound) {
fprintf(stderr, "%s: %s%s.%s, enum default is not in items.\n",
__func__, srna->identifier, errnest, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
}
}
else {
fprintf(stderr, "%s: %s%s.%s, enum must have items defined.\n",
__func__, srna->identifier, errnest, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
break;
}
case PROP_BOOLEAN: {
- BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+ BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
unsigned int i;
- if(prop->arraydimension && prop->totarraylength) {
+ if (prop->arraydimension && prop->totarraylength) {
fprintf(f, "static int rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength);
- for(i=0; i<prop->totarraylength; i++) {
- if(bprop->defaultarray)
+ for (i = 0; i<prop->totarraylength; i++) {
+ if (bprop->defaultarray)
fprintf(f, "%d", bprop->defaultarray[i]);
else
fprintf(f, "%d", bprop->defaultvalue);
- if(i != prop->totarraylength-1)
+ if (i != prop->totarraylength-1)
fprintf(f, ",\n\t");
}
@@ -2192,18 +2192,18 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
break;
}
case PROP_INT: {
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
unsigned int i;
- if(prop->arraydimension && prop->totarraylength) {
+ if (prop->arraydimension && prop->totarraylength) {
fprintf(f, "static int rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength);
- for(i=0; i<prop->totarraylength; i++) {
- if(iprop->defaultarray)
+ for (i = 0; i<prop->totarraylength; i++) {
+ if (iprop->defaultarray)
fprintf(f, "%d", iprop->defaultarray[i]);
else
fprintf(f, "%d", iprop->defaultvalue);
- if(i != prop->totarraylength-1)
+ if (i != prop->totarraylength-1)
fprintf(f, ",\n\t");
}
@@ -2212,18 +2212,18 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
break;
}
case PROP_FLOAT: {
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
unsigned int i;
- if(prop->arraydimension && prop->totarraylength) {
+ if (prop->arraydimension && prop->totarraylength) {
fprintf(f, "static float rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength);
- for(i=0; i<prop->totarraylength; i++) {
- if(fprop->defaultarray)
+ for (i = 0; i<prop->totarraylength; i++) {
+ if (fprop->defaultarray)
rna_float_print(f, fprop->defaultarray[i]);
else
rna_float_print(f, fprop->defaultvalue);
- if(i != prop->totarraylength-1)
+ if (i != prop->totarraylength-1)
fprintf(f, ",\n\t");
}
@@ -2237,9 +2237,9 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
fprintf(f, "%s%s rna_%s%s_%s = {\n", (prop->flag & PROP_EXPORT)? "": "", rna_property_structname(prop->type), srna->identifier, strnest, prop->identifier);
- if(prop->next) fprintf(f, "\t{(PropertyRNA*)&rna_%s%s_%s, ", srna->identifier, strnest, prop->next->identifier);
+ if (prop->next) fprintf(f, "\t{(PropertyRNA*)&rna_%s%s_%s, ", srna->identifier, strnest, prop->next->identifier);
else fprintf(f, "\t{NULL, ");
- if(prop->prev) fprintf(f, "(PropertyRNA*)&rna_%s%s_%s,\n", srna->identifier, strnest, prop->prev->identifier);
+ if (prop->prev) fprintf(f, "(PropertyRNA*)&rna_%s%s_%s,\n", srna->identifier, strnest, prop->prev->identifier);
else fprintf(f, "NULL,\n");
fprintf(f, "\t%d, ", prop->magic);
rna_print_c_string(f, prop->identifier);
@@ -2251,25 +2251,25 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
fprintf(f, "\t%s, %s|%s, %s, %u, {%u, %u, %u}, %u,\n", RNA_property_typename(prop->type), rna_property_subtypename(prop->subtype), rna_property_subtype_unit(prop->subtype), rna_function_string(prop->getlength), prop->arraydimension, prop->arraylength[0], prop->arraylength[1], prop->arraylength[2], prop->totarraylength);
fprintf(f, "\t%s%s, %d, %s, %s,\n", (prop->flag & PROP_CONTEXT_UPDATE)? "(UpdateFunc)": "", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable), rna_function_string(prop->itemeditable));
- if(prop->flag & PROP_RAW_ACCESS) rna_set_raw_offset(f, srna, prop);
+ if (prop->flag & PROP_RAW_ACCESS) rna_set_raw_offset(f, srna, prop);
else fprintf(f, "\t0, -1");
/* our own type - collections/arrays only */
- if(prop->srna) fprintf(f, ", &RNA_%s", (const char*)prop->srna);
+ if (prop->srna) fprintf(f, ", &RNA_%s", (const char*)prop->srna);
else fprintf(f, ", NULL");
fprintf(f, "},\n");
- switch(prop->type) {
+ switch (prop->type) {
case PROP_BOOLEAN: {
- BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+ BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
fprintf(f, "\t%s, %s, %s, %s, %d, ", rna_function_string(bprop->get), rna_function_string(bprop->set), rna_function_string(bprop->getarray), rna_function_string(bprop->setarray), bprop->defaultvalue);
- if(prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier);
+ if (prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier);
else fprintf(f, "NULL\n");
break;
}
case PROP_INT: {
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
fprintf(f, "\t%s, %s, %s, %s, %s,\n\t", rna_function_string(iprop->get), rna_function_string(iprop->set), rna_function_string(iprop->getarray), rna_function_string(iprop->setarray), rna_function_string(iprop->range));
rna_int_print(f, iprop->softmin); fprintf(f, ", ");
rna_int_print(f, iprop->softmax); fprintf(f, ", ");
@@ -2277,12 +2277,12 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
rna_int_print(f, iprop->hardmax); fprintf(f, ", ");
rna_int_print(f, iprop->step); fprintf(f, ", ");
rna_int_print(f, iprop->defaultvalue); fprintf(f, ", ");
- if(prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier);
+ if (prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier);
else fprintf(f, "NULL\n");
break;
}
case PROP_FLOAT: {
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
fprintf(f, "\t%s, %s, %s, %s, %s, ", rna_function_string(fprop->get), rna_function_string(fprop->set), rna_function_string(fprop->getarray), rna_function_string(fprop->setarray), rna_function_string(fprop->range));
rna_float_print(f, fprop->softmin); fprintf(f, ", ");
rna_float_print(f, fprop->softmax); fprintf(f, ", ");
@@ -2291,20 +2291,20 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
rna_float_print(f, fprop->step); fprintf(f, ", ");
rna_int_print(f, (int)fprop->precision); fprintf(f, ", ");
rna_float_print(f, fprop->defaultvalue); fprintf(f, ", ");
- if(prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier);
+ if (prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier);
else fprintf(f, "NULL\n");
break;
}
case PROP_STRING: {
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
fprintf(f, "\t%s, %s, %s, %d, ", rna_function_string(sprop->get), rna_function_string(sprop->length), rna_function_string(sprop->set), sprop->maxlength);
rna_print_c_string(f, sprop->defaultvalue); fprintf(f, "\n");
break;
}
case PROP_ENUM: {
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
fprintf(f, "\t%s, %s, %s, NULL, ", rna_function_string(eprop->get), rna_function_string(eprop->set), rna_function_string(eprop->itemf));
- if(eprop->item)
+ if (eprop->item)
fprintf(f, "rna_%s%s_%s_items, ", srna->identifier, strnest, prop->identifier);
else
fprintf(f, "NULL, ");
@@ -2312,16 +2312,16 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
break;
}
case PROP_POINTER: {
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
fprintf(f, "\t%s, %s, %s, %s,", rna_function_string(pprop->get), rna_function_string(pprop->set), rna_function_string(pprop->typef), rna_function_string(pprop->poll));
- if(pprop->type) fprintf(f, "&RNA_%s\n", (const char*)pprop->type);
+ if (pprop->type) fprintf(f, "&RNA_%s\n", (const char*)pprop->type);
else fprintf(f, "NULL\n");
break;
}
case PROP_COLLECTION: {
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, %s, ", rna_function_string(cprop->begin), rna_function_string(cprop->next), rna_function_string(cprop->end), rna_function_string(cprop->get), rna_function_string(cprop->length), rna_function_string(cprop->lookupint), rna_function_string(cprop->lookupstring), rna_function_string(cprop->assignint));
- if(cprop->item_type) fprintf(f, "&RNA_%s\n", (const char*)cprop->item_type);
+ if (cprop->item_type) fprintf(f, "&RNA_%s\n", (const char*)cprop->item_type);
else fprintf(f, "NULL\n");
break;
}
@@ -2329,7 +2329,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
fprintf(f, "};\n\n");
- if(freenest) {
+ if (freenest) {
MEM_freeN(strnest);
MEM_freeN(errnest);
}
@@ -2344,28 +2344,28 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
fprintf(f, "/* %s */\n", srna->name);
- for(prop= srna->cont.properties.first; prop; prop= prop->next)
+ for (prop = srna->cont.properties.first; prop; prop = prop->next)
rna_generate_property(f, srna, NULL, prop);
- for(func= srna->functions.first; func; func= func->cont.next) {
- for(parm= func->cont.properties.first; parm; parm= parm->next)
+ for (func = srna->functions.first; func; func = func->cont.next) {
+ for (parm = func->cont.properties.first; parm; parm = parm->next)
rna_generate_property(f, srna, func->identifier, parm);
fprintf(f, "%s%s rna_%s_%s_func = {\n", "", "FunctionRNA", srna->identifier, func->identifier);
- if(func->cont.next) fprintf(f, "\t{(FunctionRNA*)&rna_%s_%s_func, ", srna->identifier, ((FunctionRNA*)func->cont.next)->identifier);
+ if (func->cont.next) fprintf(f, "\t{(FunctionRNA*)&rna_%s_%s_func, ", srna->identifier, ((FunctionRNA*)func->cont.next)->identifier);
else fprintf(f, "\t{NULL, ");
- if(func->cont.prev) fprintf(f, "(FunctionRNA*)&rna_%s_%s_func,\n", srna->identifier, ((FunctionRNA*)func->cont.prev)->identifier);
+ if (func->cont.prev) fprintf(f, "(FunctionRNA*)&rna_%s_%s_func,\n", srna->identifier, ((FunctionRNA*)func->cont.prev)->identifier);
else fprintf(f, "NULL,\n");
fprintf(f, "\tNULL,\n");
- parm= func->cont.properties.first;
- if(parm) fprintf(f, "\t{(PropertyRNA*)&rna_%s_%s_%s, ", srna->identifier, func->identifier, parm->identifier);
+ parm = func->cont.properties.first;
+ if (parm) fprintf(f, "\t{(PropertyRNA*)&rna_%s_%s_%s, ", srna->identifier, func->identifier, parm->identifier);
else fprintf(f, "\t{NULL, ");
- parm= func->cont.properties.last;
- if(parm) fprintf(f, "(PropertyRNA*)&rna_%s_%s_%s}},\n", srna->identifier, func->identifier, parm->identifier);
+ parm = func->cont.properties.last;
+ if (parm) fprintf(f, "(PropertyRNA*)&rna_%s_%s_%s}},\n", srna->identifier, func->identifier, parm->identifier);
else fprintf(f, "NULL}},\n");
fprintf(f, "\t");
@@ -2373,11 +2373,11 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
fprintf(f, ", %d, ", func->flag);
rna_print_c_string(f, func->description); fprintf(f, ",\n");
- dfunc= rna_find_function_def(func);
- if(dfunc->gencall) fprintf(f, "\t%s,\n", dfunc->gencall);
+ dfunc = rna_find_function_def(func);
+ if (dfunc->gencall) fprintf(f, "\t%s,\n", dfunc->gencall);
else fprintf(f, "\tNULL,\n");
- if(func->c_ret) fprintf(f, "\t(PropertyRNA*)&rna_%s_%s_%s\n", srna->identifier, func->identifier, func->c_ret->identifier);
+ if (func->c_ret) fprintf(f, "\t(PropertyRNA*)&rna_%s_%s_%s\n", srna->identifier, func->identifier, func->c_ret->identifier);
else fprintf(f, "\tNULL\n");
fprintf(f, "};\n");
@@ -2386,19 +2386,19 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
fprintf(f, "StructRNA RNA_%s = {\n", srna->identifier);
- if(srna->cont.next) fprintf(f, "\t{(ContainerRNA *)&RNA_%s, ", ((StructRNA*)srna->cont.next)->identifier);
+ if (srna->cont.next) fprintf(f, "\t{(ContainerRNA *)&RNA_%s, ", ((StructRNA*)srna->cont.next)->identifier);
else fprintf(f, "\t{NULL, ");
- if(srna->cont.prev) fprintf(f, "(ContainerRNA *)&RNA_%s,\n", ((StructRNA*)srna->cont.prev)->identifier);
+ if (srna->cont.prev) fprintf(f, "(ContainerRNA *)&RNA_%s,\n", ((StructRNA*)srna->cont.prev)->identifier);
else fprintf(f, "NULL,\n");
fprintf(f, "\tNULL,\n");
- prop= srna->cont.properties.first;
- if(prop) fprintf(f, "\t{(PropertyRNA*)&rna_%s_%s, ", srna->identifier, prop->identifier);
+ prop = srna->cont.properties.first;
+ if (prop) fprintf(f, "\t{(PropertyRNA*)&rna_%s_%s, ", srna->identifier, prop->identifier);
else fprintf(f, "\t{NULL, ");
- prop= srna->cont.properties.last;
- if(prop) fprintf(f, "(PropertyRNA*)&rna_%s_%s}},\n", srna->identifier, prop->identifier);
+ prop = srna->cont.properties.last;
+ if (prop) fprintf(f, "(PropertyRNA*)&rna_%s_%s}},\n", srna->identifier, prop->identifier);
else fprintf(f, "NULL}},\n");
fprintf(f, "\t");
rna_print_c_string(f, srna->identifier);
@@ -2409,26 +2409,26 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
rna_print_c_string(f, srna->description);
fprintf(f, ",\n\t%d,\n", srna->icon);
- prop= srna->nameproperty;
- if(prop) {
- base= srna;
- while (base->base && base->base->nameproperty==prop)
- base= base->base;
+ prop = srna->nameproperty;
+ if (prop) {
+ base = srna;
+ while (base->base && base->base->nameproperty == prop)
+ base = base->base;
fprintf(f, "\t(PropertyRNA*)&rna_%s_%s, ", base->identifier, prop->identifier);
}
else fprintf(f, "\tNULL, ");
- prop= srna->iteratorproperty;
- base= srna;
- while (base->base && base->base->iteratorproperty==prop)
- base= base->base;
+ prop = srna->iteratorproperty;
+ base = srna;
+ while (base->base && base->base->iteratorproperty == prop)
+ base = base->base;
fprintf(f, "(PropertyRNA*)&rna_%s_rna_properties,\n", base->identifier);
- if(srna->base) fprintf(f, "\t&RNA_%s,\n", srna->base->identifier);
+ if (srna->base) fprintf(f, "\t&RNA_%s,\n", srna->base->identifier);
else fprintf(f, "\tNULL,\n");
- if(srna->nested) fprintf(f, "\t&RNA_%s,\n", srna->nested->identifier);
+ if (srna->nested) fprintf(f, "\t&RNA_%s,\n", srna->nested->identifier);
else fprintf(f, "\tNULL,\n");
fprintf(f, "\t%s,\n", rna_function_string(srna->refine));
@@ -2438,18 +2438,18 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
fprintf(f, "\t%s,\n", rna_function_string(srna->instance));
fprintf(f, "\t%s,\n", rna_function_string(srna->idproperties));
- if(srna->reg && !srna->refine) {
+ if (srna->reg && !srna->refine) {
fprintf(stderr, "%s: %s has a register function, must also have refine function.\n",
__func__, srna->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
- func= srna->functions.first;
- if(func) fprintf(f, "\t{(FunctionRNA*)&rna_%s_%s_func, ", srna->identifier, func->identifier);
+ func = srna->functions.first;
+ if (func) fprintf(f, "\t{(FunctionRNA*)&rna_%s_%s_func, ", srna->identifier, func->identifier);
else fprintf(f, "\t{NULL, ");
- func= srna->functions.last;
- if(func) fprintf(f, "(FunctionRNA*)&rna_%s_%s_func}\n", srna->identifier, func->identifier);
+ func = srna->functions.last;
+ if (func) fprintf(f, "(FunctionRNA*)&rna_%s_%s_func}\n", srna->identifier, func->identifier);
else fprintf(f, "NULL}\n");
fprintf(f, "};\n");
@@ -2463,7 +2463,7 @@ typedef struct RNAProcessItem {
void (*define)(BlenderRNA *brna);
} RNAProcessItem;
-static RNAProcessItem PROCESS_ITEMS[]= {
+static RNAProcessItem PROCESS_ITEMS[] = {
{"rna_rna.c", NULL, RNA_def_rna},
{"rna_ID.c", NULL, RNA_def_ID},
{"rna_texture.c", "rna_texture_api.c", RNA_def_texture},
@@ -2532,9 +2532,11 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const
PropertyDefRNA *dp;
FunctionDefRNA *dfunc;
- fprintf(f, "\n/* Automatically generated struct definitions for the Data API.\n"
- " Do not edit manually, changes will be overwritten. */\n\n"
- "#define RNA_RUNTIME\n\n");
+ fprintf(f,
+ "\n"
+ "/* Automatically generated struct definitions for the Data API.\n"
+ " * Do not edit manually, changes will be overwritten. */\n\n"
+ "#define RNA_RUNTIME\n\n");
fprintf(f, "#include <float.h>\n");
fprintf(f, "#include <stdio.h>\n");
@@ -2560,38 +2562,38 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const
rna_generate_prototypes(brna, f);
fprintf(f, "#include \"%s\"\n", filename);
- if(api_filename)
+ if (api_filename)
fprintf(f, "#include \"%s\"\n", api_filename);
fprintf(f, "\n");
fprintf(f, "/* Autogenerated Functions */\n\n");
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next) {
- if(!filename || ds->filename == filename) {
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
+ if (!filename || ds->filename == filename) {
rna_generate_property_prototypes(brna, ds->srna, f);
rna_generate_function_prototypes(brna, ds->srna, f);
}
}
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
- if(!filename || ds->filename == filename)
- for(dp=ds->cont.properties.first; dp; dp=dp->next)
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
+ if (!filename || ds->filename == filename)
+ for (dp = ds->cont.properties.first; dp; dp = dp->next)
rna_def_property_funcs(f, ds->srna, dp);
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next) {
- if(!filename || ds->filename == filename) {
- for(dfunc=ds->functions.first; dfunc; dfunc= dfunc->cont.next)
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
+ if (!filename || ds->filename == filename) {
+ for (dfunc = ds->functions.first; dfunc; dfunc = dfunc->cont.next)
rna_def_function_funcs(f, ds, dfunc);
rna_generate_static_function_prototypes(brna, ds->srna, f);
}
}
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
- if(!filename || ds->filename == filename)
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
+ if (!filename || ds->filename == filename)
rna_generate_struct(brna, ds->srna, f);
- if(strcmp(filename, "rna_ID.c") == 0) {
+ if (strcmp(filename, "rna_ID.c") == 0) {
/* this is ugly, but we cannot have c files compiled for both
* makesrna and blender with some build systems at the moment */
fprintf(f, "#include \"rna_define.c\"\n\n");
@@ -2609,8 +2611,9 @@ static void rna_generate_header(BlenderRNA *brna, FILE *f)
fprintf(f, "\n#ifndef __RNA_BLENDER_H__\n");
fprintf(f, "#define __RNA_BLENDER_H__\n\n");
- fprintf(f, "/* Automatically generated function declarations for the Data API.\n"
- " Do not edit manually, changes will be overwritten. */\n\n");
+ fprintf(f,
+ "/* Automatically generated function declarations for the Data API.\n"
+ " * Do not edit manually, changes will be overwritten. */\n\n");
fprintf(f, "#include \"RNA_types.h\"\n\n");
@@ -2627,18 +2630,18 @@ static void rna_generate_header(BlenderRNA *brna, FILE *f)
fprintf(f, " property##_end(&rna_macro_iter); \\\n");
fprintf(f, " }\n\n");
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next) {
- srna= ds->srna;
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
+ srna = ds->srna;
fprintf(f, "/**************** %s ****************/\n\n", srna->name);
- while(srna) {
+ while (srna) {
fprintf(f, "extern StructRNA RNA_%s;\n", srna->identifier);
- srna= srna->base;
+ srna = srna->base;
}
fprintf(f, "\n");
- for(dp=ds->cont.properties.first; dp; dp=dp->next)
+ for (dp = ds->cont.properties.first; dp; dp = dp->next)
rna_def_property_funcs_header(f, ds->srna, dp);
}
@@ -2771,8 +2774,9 @@ static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f)
fprintf(f, "\n#ifndef __RNA_BLENDER_CPP_H__\n");
fprintf(f, "#define __RNA_BLENDER_CPP_H__\n\n");
- fprintf(f, "/* Automatically generated classes for the Data API.\n"
- " Do not edit manually, changes will be overwritten. */\n\n");
+ fprintf(f,
+ "/* Automatically generated classes for the Data API.\n"
+ " * Do not edit manually, changes will be overwritten. */\n\n");
fprintf(f, "#include \"RNA_blender.h\"\n");
fprintf(f, "#include \"RNA_types.h\"\n");
@@ -2782,25 +2786,25 @@ static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f)
fprintf(f, "/**************** Declarations ****************/\n\n");
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
fprintf(f, "class %s;\n", ds->srna->identifier);
fprintf(f, "\n");
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next) {
- srna= ds->srna;
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
+ srna = ds->srna;
fprintf(f, "/**************** %s ****************/\n\n", srna->name);
fprintf(f, "class %s : public %s {\n", srna->identifier, (srna->base)? srna->base->identifier: "Pointer");
fprintf(f, "public:\n");
fprintf(f, "\t%s(const PointerRNA& ptr) :\n\t\t%s(ptr)", srna->identifier, (srna->base)? srna->base->identifier: "Pointer");
- for(dp=ds->cont.properties.first; dp; dp=dp->next)
- if(!(dp->prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN)))
- if(dp->prop->type == PROP_COLLECTION)
+ for (dp = ds->cont.properties.first; dp; dp = dp->next)
+ if (!(dp->prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN)))
+ if (dp->prop->type == PROP_COLLECTION)
fprintf(f, ",\n\t\t%s(ptr)", dp->prop->identifier);
fprintf(f, "\n\t\t{}\n\n");
- for(dp=ds->cont.properties.first; dp; dp=dp->next)
+ for (dp = ds->cont.properties.first; dp; dp = dp->next)
rna_def_property_funcs_header_cpp(f, ds->srna, dp);
fprintf(f, "};\n\n");
}
@@ -2808,8 +2812,8 @@ static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f)
fprintf(f, "/**************** Implementation ****************/\n");
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next) {
- for(dp=ds->cont.properties.first; dp; dp=dp->next)
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
+ for (dp = ds->cont.properties.first; dp; dp = dp->next)
rna_def_property_funcs_impl_cpp(f, ds->srna, dp);
fprintf(f, "\n");
@@ -2820,7 +2824,7 @@ static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f)
static void make_bad_file(const char *file, int line)
{
- FILE *fp= fopen(file, "w");
+ FILE *fp = fopen(file, "w");
fprintf(fp, "#error \"Error! can't make correct RNA file from %s:%d, STUPID!\"\n", __FILE__, line);
fclose(fp);
}
@@ -2835,15 +2839,15 @@ static int rna_preprocess(const char *outfile)
const char *deps[3]; /* expand as needed */
/* define rna */
- brna= RNA_create();
+ brna = RNA_create();
- for(i=0; PROCESS_ITEMS[i].filename; i++) {
- if(PROCESS_ITEMS[i].define) {
+ for (i = 0; PROCESS_ITEMS[i].filename; i++) {
+ if (PROCESS_ITEMS[i].define) {
PROCESS_ITEMS[i].define(brna);
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
- if(!ds->filename)
- ds->filename= PROCESS_ITEMS[i].filename;
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
+ if (!ds->filename)
+ ds->filename = PROCESS_ITEMS[i].filename;
}
}
@@ -2854,22 +2858,22 @@ static int rna_preprocess(const char *outfile)
strcpy(deffile, outfile);
strcat(deffile, "RNA_blender_cpp.h" TMP_EXT);
- status= (DefRNA.error != 0);
+ status = (DefRNA.error != 0);
- if(status) {
+ if (status) {
make_bad_file(deffile, __LINE__);
}
else {
file = fopen(deffile, "w");
- if(!file) {
+ if (!file) {
fprintf(stderr, "Unable to open file: %s\n", deffile);
status = 1;
}
else {
rna_generate_header_cpp(brna, file);
fclose(file);
- status= (DefRNA.error != 0);
+ status = (DefRNA.error != 0);
}
}
@@ -2878,33 +2882,33 @@ static int rna_preprocess(const char *outfile)
rna_sort(brna);
/* create rna_gen_*.c files */
- for(i=0; PROCESS_ITEMS[i].filename; i++) {
+ for (i = 0; PROCESS_ITEMS[i].filename; i++) {
strcpy(deffile, outfile);
strcat(deffile, PROCESS_ITEMS[i].filename);
deffile[strlen(deffile)-2] = '\0';
strcat(deffile, "_gen.c" TMP_EXT);
- if(status) {
+ if (status) {
make_bad_file(deffile, __LINE__);
}
else {
file = fopen(deffile, "w");
- if(!file) {
+ if (!file) {
fprintf(stderr, "Unable to open file: %s\n", deffile);
status = 1;
}
else {
rna_generate(brna, file, PROCESS_ITEMS[i].filename, PROCESS_ITEMS[i].api_filename);
fclose(file);
- status= (DefRNA.error != 0);
+ status = (DefRNA.error != 0);
}
}
/* avoid unneeded rebuilds */
- deps[0]= PROCESS_ITEMS[i].filename;
- deps[1]= PROCESS_ITEMS[i].api_filename;
- deps[2]= NULL;
+ deps[0] = PROCESS_ITEMS[i].filename;
+ deps[1] = PROCESS_ITEMS[i].api_filename;
+ deps[2] = NULL;
replace_if_different(deffile, deps);
}
@@ -2913,20 +2917,20 @@ static int rna_preprocess(const char *outfile)
strcpy(deffile, outfile);
strcat(deffile, "RNA_blender.h" TMP_EXT);
- if(status) {
+ if (status) {
make_bad_file(deffile, __LINE__);
}
else {
file = fopen(deffile, "w");
- if(!file) {
+ if (!file) {
fprintf(stderr, "Unable to open file: %s\n", deffile);
status = 1;
}
else {
rna_generate_header(brna, file);
fclose(file);
- status= (DefRNA.error != 0);
+ status = (DefRNA.error != 0);
}
}
@@ -2949,18 +2953,18 @@ int main(int argc, char **argv)
{
int totblock, return_status = 0;
- if(argc<2) {
+ if (argc<2) {
fprintf(stderr, "Usage: %s outdirectory/\n", argv[0]);
return_status = 1;
}
else {
- fprintf(stderr, "Running makesrna, program versions %s\n", RNA_VERSION_DATE);
- makesrna_path= argv[0];
- return_status= rna_preprocess(argv[1]);
+ fprintf(stderr, "Running makesrna");
+ makesrna_path = argv[0];
+ return_status = rna_preprocess(argv[1]);
}
- totblock= MEM_get_memory_blocks_in_use();
- if(totblock!=0) {
+ totblock = MEM_get_memory_blocks_in_use();
+ if (totblock != 0) {
fprintf(stderr, "Error Totblock: %d\n",totblock);
MEM_set_error_callback(mem_error_cb);
MEM_printmemlist();
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 917cac0196c..41775978026 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -85,30 +85,30 @@ EnumPropertyItem id_type_items[] = {
/* name functions that ignore the first two ID characters */
void rna_ID_name_get(PointerRNA *ptr, char *value)
{
- ID *id= (ID*)ptr->data;
+ ID *id = (ID*)ptr->data;
BLI_strncpy(value, id->name+2, sizeof(id->name)-2);
}
int rna_ID_name_length(PointerRNA *ptr)
{
- ID *id= (ID*)ptr->data;
+ ID *id = (ID*)ptr->data;
return strlen(id->name+2);
}
void rna_ID_name_set(PointerRNA *ptr, const char *value)
{
- ID *id= (ID*)ptr->data;
+ ID *id = (ID*)ptr->data;
BLI_strncpy_utf8(id->name+2, value, sizeof(id->name)-2);
test_idbutton(id->name+2);
}
static int rna_ID_name_editable(PointerRNA *ptr)
{
- ID *id= (ID*)ptr->data;
+ ID *id = (ID*)ptr->data;
if (GS(id->name) == ID_VF) {
- VFont *vf= (VFont *)id;
- if (strcmp(vf->name, FO_BUILTIN_NAME)==0)
+ VFont *vf = (VFont *)id;
+ if (strcmp(vf->name, FO_BUILTIN_NAME) == 0)
return 0;
}
@@ -117,42 +117,42 @@ static int rna_ID_name_editable(PointerRNA *ptr)
short RNA_type_to_ID_code(StructRNA *type)
{
- if(RNA_struct_is_a(type, &RNA_Action)) return ID_AC;
- if(RNA_struct_is_a(type, &RNA_Armature)) return ID_AR;
- if(RNA_struct_is_a(type, &RNA_Brush)) return ID_BR;
- if(RNA_struct_is_a(type, &RNA_Camera)) return ID_CA;
- if(RNA_struct_is_a(type, &RNA_Curve)) return ID_CU;
- if(RNA_struct_is_a(type, &RNA_GreasePencil)) return ID_GD;
- if(RNA_struct_is_a(type, &RNA_Group)) return ID_GR;
- if(RNA_struct_is_a(type, &RNA_Image)) return ID_IM;
- if(RNA_struct_is_a(type, &RNA_Key)) return ID_KE;
- if(RNA_struct_is_a(type, &RNA_Lamp)) return ID_LA;
- if(RNA_struct_is_a(type, &RNA_Library)) return ID_LI;
- if(RNA_struct_is_a(type, &RNA_FreestyleLineStyle)) return ID_LS;
- if(RNA_struct_is_a(type, &RNA_Lattice)) return ID_LT;
- if(RNA_struct_is_a(type, &RNA_Material)) return ID_MA;
- if(RNA_struct_is_a(type, &RNA_MetaBall)) return ID_MB;
- if(RNA_struct_is_a(type, &RNA_NodeTree)) return ID_NT;
- if(RNA_struct_is_a(type, &RNA_Mesh)) return ID_ME;
- if(RNA_struct_is_a(type, &RNA_Object)) return ID_OB;
- if(RNA_struct_is_a(type, &RNA_ParticleSettings)) return ID_PA;
- if(RNA_struct_is_a(type, &RNA_Scene)) return ID_SCE;
- if(RNA_struct_is_a(type, &RNA_Screen)) return ID_SCR;
- if(RNA_struct_is_a(type, &RNA_Speaker)) return ID_SPK;
- if(RNA_struct_is_a(type, &RNA_Sound)) return ID_SO;
- if(RNA_struct_is_a(type, &RNA_Text)) return ID_TXT;
- if(RNA_struct_is_a(type, &RNA_Texture)) return ID_TE;
- if(RNA_struct_is_a(type, &RNA_VectorFont)) return ID_VF;
- if(RNA_struct_is_a(type, &RNA_World)) return ID_WO;
- if(RNA_struct_is_a(type, &RNA_WindowManager)) return ID_WM;
- if(RNA_struct_is_a(type, &RNA_MovieClip)) return ID_MC;
+ if (RNA_struct_is_a(type, &RNA_Action)) return ID_AC;
+ if (RNA_struct_is_a(type, &RNA_Armature)) return ID_AR;
+ if (RNA_struct_is_a(type, &RNA_Brush)) return ID_BR;
+ if (RNA_struct_is_a(type, &RNA_Camera)) return ID_CA;
+ if (RNA_struct_is_a(type, &RNA_Curve)) return ID_CU;
+ if (RNA_struct_is_a(type, &RNA_GreasePencil)) return ID_GD;
+ if (RNA_struct_is_a(type, &RNA_Group)) return ID_GR;
+ if (RNA_struct_is_a(type, &RNA_Image)) return ID_IM;
+ if (RNA_struct_is_a(type, &RNA_Key)) return ID_KE;
+ if (RNA_struct_is_a(type, &RNA_Lamp)) return ID_LA;
+ if (RNA_struct_is_a(type, &RNA_Library)) return ID_LI;
+ if (RNA_struct_is_a(type, &RNA_FreestyleLineStyle)) return ID_LS;
+ if (RNA_struct_is_a(type, &RNA_Lattice)) return ID_LT;
+ if (RNA_struct_is_a(type, &RNA_Material)) return ID_MA;
+ if (RNA_struct_is_a(type, &RNA_MetaBall)) return ID_MB;
+ if (RNA_struct_is_a(type, &RNA_NodeTree)) return ID_NT;
+ if (RNA_struct_is_a(type, &RNA_Mesh)) return ID_ME;
+ if (RNA_struct_is_a(type, &RNA_Object)) return ID_OB;
+ if (RNA_struct_is_a(type, &RNA_ParticleSettings)) return ID_PA;
+ if (RNA_struct_is_a(type, &RNA_Scene)) return ID_SCE;
+ if (RNA_struct_is_a(type, &RNA_Screen)) return ID_SCR;
+ if (RNA_struct_is_a(type, &RNA_Speaker)) return ID_SPK;
+ if (RNA_struct_is_a(type, &RNA_Sound)) return ID_SO;
+ if (RNA_struct_is_a(type, &RNA_Text)) return ID_TXT;
+ if (RNA_struct_is_a(type, &RNA_Texture)) return ID_TE;
+ if (RNA_struct_is_a(type, &RNA_VectorFont)) return ID_VF;
+ if (RNA_struct_is_a(type, &RNA_World)) return ID_WO;
+ if (RNA_struct_is_a(type, &RNA_WindowManager)) return ID_WM;
+ if (RNA_struct_is_a(type, &RNA_MovieClip)) return ID_MC;
return 0;
}
StructRNA *ID_code_to_RNA_type(short idcode)
{
- switch(idcode) {
+ switch (idcode) {
case ID_AC: return &RNA_Action;
case ID_AR: return &RNA_Armature;
case ID_BR: return &RNA_Brush;
@@ -188,7 +188,7 @@ StructRNA *ID_code_to_RNA_type(short idcode)
StructRNA *rna_ID_refine(PointerRNA *ptr)
{
- ID *id= (ID*)ptr->data;
+ ID *id = (ID*)ptr->data;
return ID_code_to_RNA_type(GS(id->name));
}
@@ -200,13 +200,13 @@ IDProperty *rna_ID_idprops(PointerRNA *ptr, int create)
void rna_ID_fake_user_set(PointerRNA *ptr, int value)
{
- ID *id= (ID*)ptr->data;
+ ID *id = (ID*)ptr->data;
- if(value && !(id->flag & LIB_FAKEUSER)) {
+ if (value && !(id->flag & LIB_FAKEUSER)) {
id->flag |= LIB_FAKEUSER;
id_us_plus(id);
}
- else if(!value && (id->flag & LIB_FAKEUSER)) {
+ else if (!value && (id->flag & LIB_FAKEUSER)) {
id->flag &= ~LIB_FAKEUSER;
id_us_min(id);
}
@@ -230,19 +230,19 @@ StructRNA *rna_PropertyGroup_register(Main *UNUSED(bmain), ReportList *reports,
RNA_pointer_create(NULL, &RNA_PropertyGroup, NULL, &dummyptr);
/* validate the python class */
- if(validate(&dummyptr, data, NULL) != 0)
+ if (validate(&dummyptr, data, NULL) != 0)
return NULL;
/* note: it looks like there is no length limit on the srna id since its
* just a char pointer, but take care here, also be careful that python
* owns the string pointer which it could potentially free while blender
* is running. */
- if(BLI_strnlen(identifier, MAX_IDPROP_NAME) == MAX_IDPROP_NAME) {
+ if (BLI_strnlen(identifier, MAX_IDPROP_NAME) == MAX_IDPROP_NAME) {
BKE_reportf(reports, RPT_ERROR, "registering id property class: '%s' is too long, maximum length is " STRINGIFY(MAX_IDPROP_NAME), identifier);
return NULL;
}
- return RNA_def_struct(&BLENDER_RNA, identifier, "PropertyGroup"); // XXX
+ return RNA_def_struct(&BLENDER_RNA, identifier, "PropertyGroup"); /* XXX */
}
StructRNA* rna_PropertyGroup_refine(PointerRNA *ptr)
@@ -254,8 +254,8 @@ ID *rna_ID_copy(ID *id)
{
ID *newid;
- if(id_copy(id, &newid, 0)) {
- if(newid) id_us_min(newid);
+ if (id_copy(id, &newid, 0)) {
+ if (newid) id_us_min(newid);
return newid;
}
@@ -265,31 +265,35 @@ ID *rna_ID_copy(ID *id)
static void rna_ID_update_tag(ID *id, ReportList *reports, int flag)
{
/* XXX, new function for this! */
- /*if (ob->type == OB_FONT) {
+#if 0
+ if (ob->type == OB_FONT) {
Curve *cu = ob->data;
freedisplist(&cu->disp);
BKE_text_to_curve(sce, ob, CU_LEFT);
- }*/
+ }
+#endif
- if(flag == 0) {
+ if (flag == 0) {
/* pass */
}
else {
/* ensure flag us correct for the type */
- switch(GS(id->name)) {
+ switch (GS(id->name)) {
case ID_OB:
- if(flag & ~(OB_RECALC_ALL)) {
+ if (flag & ~(OB_RECALC_ALL)) {
BKE_report(reports, RPT_ERROR, "'refresh' incompatible with Object ID type");
return;
}
break;
/* Could add particle updates later */
-/* case ID_PA:
+#if 0
+ case ID_PA:
if(flag & ~(OB_RECALC_ALL|PSYS_RECALC)) {
BKE_report(reports, RPT_ERROR, "'refresh' incompatible with ParticleSettings ID type");
return;
}
- break; */
+ break;
+#endif
default:
BKE_report(reports, RPT_ERROR, "This ID type is not compatible with any 'refresh' options");
return;
@@ -301,28 +305,28 @@ static void rna_ID_update_tag(ID *id, ReportList *reports, int flag)
void rna_ID_user_clear(ID *id)
{
- id->us= 0; /* dont save */
+ id->us = 0; /* dont save */
id->flag &= ~LIB_FAKEUSER;
}
static void rna_IDPArray_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- IDProperty *prop= (IDProperty *)ptr->data;
+ IDProperty *prop = (IDProperty *)ptr->data;
rna_iterator_array_begin(iter, IDP_IDPArray(prop), sizeof(IDProperty), prop->len, 0, NULL);
}
static int rna_IDPArray_length(PointerRNA *ptr)
{
- IDProperty *prop= (IDProperty *)ptr->data;
+ IDProperty *prop = (IDProperty *)ptr->data;
return prop->len;
}
int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assign_ptr)
{
- ID *id= ptr->id.data;
- short *totcol= give_totcolp_id(id);
- Material *mat_id= assign_ptr->id.data;
- if(totcol && (key >= 0 && key < *totcol)) {
+ ID *id = ptr->id.data;
+ short *totcol = give_totcolp_id(id);
+ Material *mat_id = assign_ptr->id.data;
+ if (totcol && (key >= 0 && key < *totcol)) {
assign_material_id(id, mat_id, key + 1);
return 1;
}
@@ -333,7 +337,7 @@ int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assig
void rna_Library_filepath_set(PointerRNA *ptr, const char *value)
{
- Library *lib= (Library*)ptr->data;
+ Library *lib = (Library*)ptr->data;
BKE_library_filepath_set(lib, value);
}
@@ -346,56 +350,56 @@ static void rna_def_ID_properties(BlenderRNA *brna)
/* this is struct is used for holding the virtual
* PropertyRNA's for ID properties */
- srna= RNA_def_struct(brna, "PropertyGroupItem", NULL);
+ srna = RNA_def_struct(brna, "PropertyGroupItem", NULL);
RNA_def_struct_sdna(srna, "IDProperty");
RNA_def_struct_ui_text(srna, "ID Property", "Property that stores arbitrary, user defined properties");
/* IDP_STRING */
- prop= RNA_def_property(srna, "string", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "string", PROP_STRING, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
/* IDP_INT */
- prop= RNA_def_property(srna, "int", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "int", PROP_INT, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
- prop= RNA_def_property(srna, "int_array", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "int_array", PROP_INT, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_array(prop, 1);
/* IDP_FLOAT */
- prop= RNA_def_property(srna, "float", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "float", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
- prop= RNA_def_property(srna, "float_array", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "float_array", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_array(prop, 1);
/* IDP_DOUBLE */
- prop= RNA_def_property(srna, "double", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "double", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
- prop= RNA_def_property(srna, "double_array", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "double_array", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_array(prop, 1);
/* IDP_GROUP */
- prop= RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "PropertyGroup");
- prop= RNA_def_property(srna, "collection", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "collection", PROP_COLLECTION, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_struct_type(prop, "PropertyGroup");
- prop= RNA_def_property(srna, "idp_array", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "idp_array", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "PropertyGroup");
RNA_def_property_collection_funcs(prop, "rna_IDPArray_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_IDPArray_length", NULL, NULL, NULL);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
- // never tested, maybe its useful to have this?
+ /* never tested, maybe its useful to have this? */
#if 0
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Name", "Unique name used in the code and scripting");
@@ -407,7 +411,7 @@ static void rna_def_ID_properties(BlenderRNA *brna)
/* ID property groups > level 0, since level 0 group is merged
* with native RNA properties. the builtin_properties will take
* care of the properties here */
- srna= RNA_def_struct(brna, "PropertyGroup", NULL);
+ srna = RNA_def_struct(brna, "PropertyGroup", NULL);
RNA_def_struct_sdna(srna, "IDPropertyGroup");
RNA_def_struct_ui_text(srna, "ID Property Group", "Group of ID properties");
RNA_def_struct_idprops_func(srna, "rna_PropertyGroup_idprops");
@@ -417,9 +421,9 @@ static void rna_def_ID_properties(BlenderRNA *brna)
/* important so python types can have their name used in list views
* however this isnt prefect because it overrides how python would set the name
* when we only really want this so RNA_def_struct_name_property() is set to something useful */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
- //RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ /*RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_ui_text(prop, "Name", "Unique name used in the code and scripting");
RNA_def_struct_name_property(srna, prop);
}
@@ -432,21 +436,21 @@ static void rna_def_ID_materials(BlenderRNA *brna)
PropertyRNA *parm;
/* for mesh/mball/curve materials */
- srna= RNA_def_struct(brna, "IDMaterials", NULL);
+ srna = RNA_def_struct(brna, "IDMaterials", NULL);
RNA_def_struct_sdna(srna, "ID");
RNA_def_struct_ui_text(srna, "ID Materials", "Collection of materials");
- func= RNA_def_function(srna, "append", "material_append_id");
+ func = RNA_def_function(srna, "append", "material_append_id");
RNA_def_function_ui_description(func, "Add a new material to the data block");
- parm= RNA_def_pointer(func, "material", "Material", "", "Material to add");
+ parm = RNA_def_pointer(func, "material", "Material", "", "Material to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "pop", "material_pop_id");
+ func = RNA_def_function(srna, "pop", "material_pop_id");
RNA_def_function_ui_description(func, "Remove a material from the data block");
- parm= RNA_def_int(func, "index", 0, 0, MAXMAT, "", "Index of material to remove", 0, MAXMAT);
+ parm = RNA_def_int(func, "index", 0, 0, MAXMAT, "", "Index of material to remove", 0, MAXMAT);
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_boolean(func, "update_data", 0, "", "Update data by re-adjusting the material slots assigned");
- parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove");
+ parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove");
RNA_def_function_return(func, parm);
}
@@ -462,13 +466,13 @@ static void rna_def_ID(BlenderRNA *brna)
{OB_RECALC_TIME, "TIME", 0, "Time", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ID", NULL);
+ srna = RNA_def_struct(brna, "ID", NULL);
RNA_def_struct_ui_text(srna, "ID", "Base type for datablocks, defining a unique name, linking from other libraries and garbage collection");
RNA_def_struct_flag(srna, STRUCT_ID|STRUCT_ID_REFCOUNT);
RNA_def_struct_refine_func(srna, "rna_ID_refine");
RNA_def_struct_idprops_func(srna, "rna_ID_idprops");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Unique datablock ID name");
RNA_def_property_string_funcs(prop, "rna_ID_name_get", "rna_ID_name_length", "rna_ID_name_set");
RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2);
@@ -476,55 +480,55 @@ static void rna_def_ID(BlenderRNA *brna)
RNA_def_property_update(prop, NC_ID|NA_RENAME, NULL);
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "users", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "users", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "us");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Users", "Number of times this datablock is referenced");
- prop= RNA_def_property(srna, "use_fake_user", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_fake_user", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_FAKEUSER);
RNA_def_property_ui_text(prop, "Fake User", "Save this datablock even if it has no users");
RNA_def_property_boolean_funcs(prop, NULL, "rna_ID_fake_user_set");
- prop= RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_DOIT);
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
RNA_def_property_ui_text(prop, "Tag", "Tools can use this to tag data (initial state is undefined)");
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_ID_RECALC);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Is Updated", "Datablock is tagged for recalculation");
- prop= RNA_def_property(srna, "is_updated_data", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated_data", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_ID_RECALC_DATA);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Is Updated Data", "Datablock data is tagged for recalculation");
- prop= RNA_def_property(srna, "library", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "library", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "lib");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Library", "Library file the datablock is linked from");
/* functions */
- func= RNA_def_function(srna, "copy", "rna_ID_copy");
+ func = RNA_def_function(srna, "copy", "rna_ID_copy");
RNA_def_function_ui_description(func, "Create a copy of this datablock (not supported for all datablocks)");
- parm= RNA_def_pointer(func, "id", "ID", "", "New copy of the ID");
+ parm = RNA_def_pointer(func, "id", "ID", "", "New copy of the ID");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "user_clear", "rna_ID_user_clear");
+ func = RNA_def_function(srna, "user_clear", "rna_ID_user_clear");
RNA_def_function_ui_description(func, "Clear the user count of a datablock so its not saved, "
"on reload the data will be removed");
- func= RNA_def_function(srna, "animation_data_create", "BKE_id_add_animdata");
+ func = RNA_def_function(srna, "animation_data_create", "BKE_id_add_animdata");
RNA_def_function_ui_description(func, "Create animation data to this ID, note that not all ID types support this");
- parm= RNA_def_pointer(func, "anim_data", "AnimData", "", "New animation data or NULL");
+ parm = RNA_def_pointer(func, "anim_data", "AnimData", "", "New animation data or NULL");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "animation_data_clear", "BKE_free_animdata");
+ func = RNA_def_function(srna, "animation_data_clear", "BKE_free_animdata");
RNA_def_function_ui_description(func, "Clear animation on this this ID");
- func= RNA_def_function(srna, "update_tag", "rna_ID_update_tag");
+ func = RNA_def_function(srna, "update_tag", "rna_ID_update_tag");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Tag the ID to update its display data");
RNA_def_enum_flag(func, "refresh", update_flag_items, 0, "", "Type of updates to perform");
@@ -535,16 +539,16 @@ static void rna_def_library(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Library", "ID");
+ srna = RNA_def_struct(brna, "Library", "ID");
RNA_def_struct_ui_text(srna, "Library", "External .blend file from which data is linked");
RNA_def_struct_ui_icon(srna, ICON_LIBRARY_DATA_DIRECT);
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ 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", "Path to the library .blend file");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Library_filepath_set");
- prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Library");
RNA_def_property_ui_text(prop, "Parent", "");
}
@@ -553,11 +557,11 @@ void RNA_def_ID(BlenderRNA *brna)
StructRNA *srna;
/* built-in unknown type */
- srna= RNA_def_struct(brna, "UnknownType", NULL);
+ srna = RNA_def_struct(brna, "UnknownType", NULL);
RNA_def_struct_ui_text(srna, "Unknown Type", "Stub RNA type used for pointers to unknown or internal data");
/* built-in any type */
- srna= RNA_def_struct(brna, "AnyType", NULL);
+ srna = RNA_def_struct(brna, "AnyType", NULL);
RNA_def_struct_ui_text(srna, "Any Type", "RNA type used for pointers to any possible data");
rna_def_ID(brna);
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 0df8a625caf..2ccd7d293d3 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -63,7 +63,7 @@
#include "rna_internal.h"
-const PointerRNA PointerRNA_NULL= {{NULL}};
+const PointerRNA PointerRNA_NULL = {{NULL}};
/* Init/Exit */
@@ -72,12 +72,12 @@ void RNA_init(void)
StructRNA *srna;
PropertyRNA *prop;
- for(srna=BLENDER_RNA.structs.first; srna; srna=srna->cont.next) {
- if(!srna->cont.prophash) {
- srna->cont.prophash= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "RNA_init gh");
+ for (srna = BLENDER_RNA.structs.first; srna; srna = srna->cont.next) {
+ if (!srna->cont.prophash) {
+ srna->cont.prophash = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "RNA_init gh");
- for(prop=srna->cont.properties.first; prop; prop=prop->next)
- if(!(prop->flag & PROP_BUILTIN))
+ for (prop = srna->cont.properties.first; prop; prop = prop->next)
+ if (!(prop->flag & PROP_BUILTIN))
BLI_ghash_insert(srna->cont.prophash, (void*)prop->identifier, prop);
}
}
@@ -89,10 +89,10 @@ void RNA_exit(void)
RNA_property_update_cache_free();
- for(srna=BLENDER_RNA.structs.first; srna; srna=srna->cont.next) {
- if(srna->cont.prophash) {
+ for (srna = BLENDER_RNA.structs.first; srna; srna = srna->cont.next) {
+ if (srna->cont.prophash) {
BLI_ghash_free(srna->cont.prophash, NULL, NULL);
- srna->cont.prophash= NULL;
+ srna->cont.prophash = NULL;
}
}
@@ -103,95 +103,95 @@ void RNA_exit(void)
void RNA_main_pointer_create(struct Main *main, PointerRNA *r_ptr)
{
- r_ptr->id.data= NULL;
- r_ptr->type= &RNA_BlendData;
- r_ptr->data= main;
+ r_ptr->id.data = NULL;
+ r_ptr->type = &RNA_BlendData;
+ r_ptr->data = main;
}
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
{
- StructRNA *type, *idtype= NULL;
+ StructRNA *type, *idtype = NULL;
- if(id) {
- PointerRNA tmp= {{NULL}};
- tmp.data= id;
- idtype= rna_ID_refine(&tmp);
+ if (id) {
+ PointerRNA tmp = {{NULL}};
+ tmp.data = id;
+ idtype = rna_ID_refine(&tmp);
- while(idtype->refine) {
- type= idtype->refine(&tmp);
+ while (idtype->refine) {
+ type = idtype->refine(&tmp);
- if(type == idtype)
+ if (type == idtype)
break;
else
- idtype= type;
+ idtype = type;
}
}
- r_ptr->id.data= id;
- r_ptr->type= idtype;
- r_ptr->data= id;
+ r_ptr->id.data = id;
+ r_ptr->type = idtype;
+ r_ptr->data = id;
}
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
{
#if 0 /* UNUSED */
- StructRNA *idtype= NULL;
+ StructRNA *idtype = NULL;
- if(id) {
- PointerRNA tmp= {{0}};
- tmp.data= id;
- idtype= rna_ID_refine(&tmp);
+ if (id) {
+ PointerRNA tmp = {{0}};
+ tmp.data = id;
+ idtype = rna_ID_refine(&tmp);
}
#endif
- r_ptr->id.data= id;
- r_ptr->type= type;
- r_ptr->data= data;
+ r_ptr->id.data = id;
+ r_ptr->type = type;
+ r_ptr->data = data;
- if(data) {
- while(r_ptr->type && r_ptr->type->refine) {
- StructRNA *rtype= r_ptr->type->refine(r_ptr);
+ if (data) {
+ while (r_ptr->type && r_ptr->type->refine) {
+ StructRNA *rtype = r_ptr->type->refine(r_ptr);
- if(rtype == r_ptr->type)
+ if (rtype == r_ptr->type)
break;
else
- r_ptr->type= rtype;
+ r_ptr->type = rtype;
}
}
}
static void rna_pointer_inherit_id(StructRNA *type, PointerRNA *parent, PointerRNA *ptr)
{
- if(type && type->flag & STRUCT_ID) {
- ptr->id.data= ptr->data;
+ if (type && type->flag & STRUCT_ID) {
+ ptr->id.data = ptr->data;
}
else {
- ptr->id.data= parent->id.data;
+ ptr->id.data = parent->id.data;
}
}
void RNA_blender_rna_pointer_create(PointerRNA *r_ptr)
{
- r_ptr->id.data= NULL;
- r_ptr->type= &RNA_BlenderRNA;
- r_ptr->data= &BLENDER_RNA;
+ r_ptr->id.data = NULL;
+ r_ptr->type = &RNA_BlenderRNA;
+ r_ptr->data = &BLENDER_RNA;
}
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
{
- if(data) {
+ if (data) {
PointerRNA result;
- result.data= data;
- result.type= type;
+ result.data = data;
+ result.type = type;
rna_pointer_inherit_id(type, ptr, &result);
- while(result.type->refine) {
- type= result.type->refine(&result);
+ while (result.type->refine) {
+ type = result.type->refine(&result);
- if(type == result.type)
+ if (type == result.type)
break;
else
- result.type= type;
+ result.type = type;
}
return result;
}
@@ -203,8 +203,8 @@ PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *da
/**/
void RNA_pointer_recast(PointerRNA *ptr, PointerRNA *r_ptr)
{
-#if 0 // works but this case if covered by more general code below.
- if(RNA_struct_is_ID(ptr->type)) {
+#if 0 /* works but this case if covered by more general code below. */
+ if (RNA_struct_is_ID(ptr->type)) {
/* simple case */
RNA_id_pointer_create(ptr->id.data, r_ptr);
}
@@ -213,12 +213,12 @@ void RNA_pointer_recast(PointerRNA *ptr, PointerRNA *r_ptr)
{
StructRNA *base;
PointerRNA t_ptr;
- *r_ptr= *ptr; /* initialize as the same incase cant recast */
+ *r_ptr = *ptr; /* initialize as the same in case cant recast */
- for(base=ptr->type->base; base; base=base->base) {
- t_ptr= rna_pointer_inherit_refine(ptr, base, ptr->data);
- if(t_ptr.type && t_ptr.type != ptr->type) {
- *r_ptr= t_ptr;
+ for (base = ptr->type->base; base; base = base->base) {
+ t_ptr = rna_pointer_inherit_refine(ptr, base, ptr->data);
+ if (t_ptr.type && t_ptr.type != ptr->type) {
+ *r_ptr = t_ptr;
}
}
}
@@ -237,14 +237,14 @@ IDProperty *rna_idproperty_ui(PropertyRNA *prop)
{
IDProperty *idprop;
- for(idprop= ((IDProperty *)prop)->prev; idprop; idprop= idprop->prev) {
- if (strcmp(RNA_IDP_UI, idprop->name)==0)
+ for (idprop = ((IDProperty *)prop)->prev; idprop; idprop = idprop->prev) {
+ if (strcmp(RNA_IDP_UI, idprop->name) == 0)
break;
}
- if(idprop==NULL) {
- for(idprop= ((IDProperty *)prop)->next; idprop; idprop= idprop->next) {
- if (strcmp(RNA_IDP_UI, idprop->name)==0)
+ if (idprop == NULL) {
+ for (idprop = ((IDProperty *)prop)->next; idprop; idprop = idprop->next) {
+ if (strcmp(RNA_IDP_UI, idprop->name) == 0)
break;
}
}
@@ -258,9 +258,9 @@ IDProperty *rna_idproperty_ui(PropertyRNA *prop)
IDProperty *RNA_struct_idprops(PointerRNA *ptr, int create)
{
- StructRNA *type= ptr->type;
+ StructRNA *type = ptr->type;
- if(type && type->idproperties)
+ if (type && type->idproperties)
return type->idproperties(ptr, create);
return NULL;
@@ -273,9 +273,9 @@ int RNA_struct_idprops_check(StructRNA *srna)
static IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name)
{
- IDProperty *group= RNA_struct_idprops(ptr, 0);
+ IDProperty *group = RNA_struct_idprops(ptr, 0);
- if(group)
+ if (group)
return IDP_GetPropertyFromGroup(group, name);
return NULL;
@@ -283,14 +283,14 @@ static IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name)
static int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
{
- if(prop->magic == RNA_MAGIC) {
+ if (prop->magic == RNA_MAGIC) {
int arraylen[RNA_MAX_ARRAY_DIMENSION];
return (prop->getlength && ptr->data)? prop->getlength(ptr, arraylen): prop->totarraylength;
}
else {
- IDProperty *idprop= (IDProperty*)prop;
+ IDProperty *idprop = (IDProperty*)prop;
- if(idprop->type == IDP_ARRAY)
+ if (idprop->type == IDP_ARRAY)
return idprop->len;
else
return 0;
@@ -299,11 +299,11 @@ static int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
static int rna_ensure_property_array_check(PropertyRNA *prop)
{
- if(prop->magic == RNA_MAGIC) {
+ if (prop->magic == RNA_MAGIC) {
return (prop->getlength || prop->totarraylength) ? 1:0;
}
else {
- IDProperty *idprop= (IDProperty*)prop;
+ IDProperty *idprop = (IDProperty*)prop;
return idprop->type == IDP_ARRAY ? 1:0;
}
@@ -311,19 +311,19 @@ static int rna_ensure_property_array_check(PropertyRNA *prop)
static void rna_ensure_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int length[])
{
- if(prop->magic == RNA_MAGIC) {
- if(prop->getlength)
+ if (prop->magic == RNA_MAGIC) {
+ if (prop->getlength)
prop->getlength(ptr, length);
else
memcpy(length, prop->arraylength, prop->arraydimension*sizeof(int));
}
else {
- IDProperty *idprop= (IDProperty*)prop;
+ IDProperty *idprop = (IDProperty*)prop;
- if(idprop->type == IDP_ARRAY)
- length[0]= idprop->len;
+ if (idprop->type == IDP_ARRAY)
+ length[0] = idprop->len;
else
- length[0]= 0;
+ length[0] = 0;
}
}
@@ -334,36 +334,36 @@ static int rna_idproperty_verify_valid(PointerRNA *ptr, PropertyRNA *prop, IDPro
* rna property access is type safe, e.g. if you defined the rna
* to have a certain array length you can count on that staying so */
- switch(idprop->type) {
+ switch (idprop->type) {
case IDP_IDPARRAY:
- if(prop->type != PROP_COLLECTION)
+ if (prop->type != PROP_COLLECTION)
return 0;
break;
case IDP_ARRAY:
- if(rna_ensure_property_array_length(ptr, prop) != idprop->len)
+ if (rna_ensure_property_array_length(ptr, prop) != idprop->len)
return 0;
- if(idprop->subtype == IDP_FLOAT && prop->type != PROP_FLOAT)
+ if (idprop->subtype == IDP_FLOAT && prop->type != PROP_FLOAT)
return 0;
- if(idprop->subtype == IDP_INT && !ELEM3(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM))
+ if (idprop->subtype == IDP_INT && !ELEM3(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM))
return 0;
break;
case IDP_INT:
- if(!ELEM3(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM))
+ if (!ELEM3(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM))
return 0;
break;
case IDP_FLOAT:
case IDP_DOUBLE:
- if(prop->type != PROP_FLOAT)
+ if (prop->type != PROP_FLOAT)
return 0;
break;
case IDP_STRING:
- if(prop->type != PROP_STRING)
+ if (prop->type != PROP_STRING)
return 0;
break;
case IDP_GROUP:
- if(prop->type != PROP_POINTER)
+ if (prop->type != PROP_POINTER)
return 0;
break;
default:
@@ -398,12 +398,12 @@ IDProperty *rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr)
* we look up an IDP PropertyRNA based on the type, and set the data
* pointer to the IDProperty. */
- if((*prop)->magic == RNA_MAGIC) {
- if((*prop)->flag & PROP_IDPROPERTY) {
- IDProperty *idprop= rna_idproperty_find(ptr, (*prop)->identifier);
+ if ((*prop)->magic == RNA_MAGIC) {
+ if ((*prop)->flag & PROP_IDPROPERTY) {
+ IDProperty *idprop = rna_idproperty_find(ptr, (*prop)->identifier);
- if(idprop && !rna_idproperty_verify_valid(ptr, *prop, idprop)) {
- IDProperty *group= RNA_struct_idprops(ptr, 0);
+ if (idprop && !rna_idproperty_verify_valid(ptr, *prop, idprop)) {
+ IDProperty *group = RNA_struct_idprops(ptr, 0);
IDP_RemFromGroup(group, idprop);
IDP_FreeProperty(idprop);
@@ -418,12 +418,12 @@ IDProperty *rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr)
}
{
- IDProperty *idprop= (IDProperty*)(*prop);
+ IDProperty *idprop = (IDProperty*)(*prop);
- if(idprop->type == IDP_ARRAY)
- *prop= arraytypemap[(int)(idprop->subtype)];
- else
- *prop= typemap[(int)(idprop->type)];
+ if (idprop->type == IDP_ARRAY)
+ *prop = arraytypemap[(int)(idprop->subtype)];
+ else
+ *prop = typemap[(int)(idprop->type)];
return idprop;
}
@@ -433,22 +433,22 @@ static PropertyRNA *rna_ensure_property(PropertyRNA *prop)
{
/* the quick version if we don't need the idproperty */
- if(prop->magic == RNA_MAGIC)
+ if (prop->magic == RNA_MAGIC)
return prop;
{
- IDProperty *idprop= (IDProperty*)prop;
+ IDProperty *idprop = (IDProperty*)prop;
- if(idprop->type == IDP_ARRAY)
+ if (idprop->type == IDP_ARRAY)
return arraytypemap[(int)(idprop->subtype)];
- else
+ else
return typemap[(int)(idprop->type)];
}
}
static const char *rna_ensure_property_identifier(PropertyRNA *prop)
{
- if(prop->magic == RNA_MAGIC)
+ if (prop->magic == RNA_MAGIC)
return prop->identifier;
else
return ((IDProperty*)prop)->name;
@@ -456,27 +456,27 @@ static const char *rna_ensure_property_identifier(PropertyRNA *prop)
static const char *rna_ensure_property_description(PropertyRNA *prop)
{
- const char *description= NULL;
+ const char *description = NULL;
- if(prop->magic == RNA_MAGIC)
- description= prop->description;
+ if (prop->magic == RNA_MAGIC)
+ description = prop->description;
else {
/* attempt to get the local ID values */
- IDProperty *idp_ui= rna_idproperty_ui(prop);
+ IDProperty *idp_ui = rna_idproperty_ui(prop);
- if(idp_ui) {
- IDProperty *item= IDP_GetPropertyTypeFromGroup(idp_ui, "description", IDP_STRING);
- if(item)
- description= IDP_String(item);
+ if (idp_ui) {
+ IDProperty *item = IDP_GetPropertyTypeFromGroup(idp_ui, "description", IDP_STRING);
+ if (item)
+ description = IDP_String(item);
}
- if(description == NULL)
- description= ((IDProperty*)prop)->name; /* XXX - not correct */
+ if (description == NULL)
+ description = ((IDProperty*)prop)->name; /* XXX - not correct */
}
#ifdef WITH_INTERNATIONAL
- if(description && BLF_translate_tooltips())
- description= BLF_gettext(description);
+ if (description && BLF_translate_tooltips())
+ description = BLF_gettext(description);
#endif
return description;
@@ -486,14 +486,14 @@ static const char *rna_ensure_property_name(PropertyRNA *prop)
{
const char *name;
- if(prop->magic == RNA_MAGIC)
- name= prop->name;
+ if (prop->magic == RNA_MAGIC)
+ name = prop->name;
else
- name= ((IDProperty*)prop)->name;
+ name = ((IDProperty*)prop)->name;
#ifdef WITH_INTERNATIONAL
- if(BLF_translate_iface()) {
- if(prop->translation_context)
+ if (BLF_translate_iface()) {
+ if (prop->translation_context)
name = BLF_pgettext(prop->translation_context, name);
else
name = BLF_gettext(name);
@@ -510,7 +510,7 @@ StructRNA *RNA_struct_find(const char *identifier)
StructRNA *type;
if (identifier) {
for (type = BLENDER_RNA.structs.first; type; type = type->cont.next)
- if (strcmp(type->identifier, identifier)==0)
+ if (strcmp(type->identifier, identifier) == 0)
return type;
}
return NULL;
@@ -528,7 +528,7 @@ const char *RNA_struct_ui_name(StructRNA *type)
int RNA_struct_ui_icon(StructRNA *type)
{
- if(type)
+ if (type)
return type->icon;
else
return ICON_DOT;
@@ -572,11 +572,11 @@ int RNA_struct_idprops_register_check(StructRNA *type)
/* remove an id-property */
int RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier)
{
- IDProperty *group= RNA_struct_idprops(ptr, 0);
+ IDProperty *group = RNA_struct_idprops(ptr, 0);
- if(group) {
- IDProperty *idp= IDP_GetPropertyFromGroup(group, identifier);
- if(idp) {
+ if (group) {
+ IDProperty *idp = IDP_GetPropertyFromGroup(group, identifier);
+ if (idp) {
IDP_RemFromGroup(group, idp);
IDP_FreeProperty(idp);
MEM_freeN(idp);
@@ -591,12 +591,12 @@ int RNA_struct_is_a(StructRNA *type, StructRNA *srna)
{
StructRNA *base;
- if(!type)
+ if (!type)
return 0;
/* ptr->type is always maximally refined */
- for(base=type; base; base=base->base)
- if(base == srna)
+ for (base = type; base; base = base->base)
+ if (base == srna)
return 1;
return 0;
@@ -604,19 +604,19 @@ int RNA_struct_is_a(StructRNA *type, StructRNA *srna)
PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
{
- if(identifier[0]=='[' && identifier[1]=='"') { // " (dummy comment to avoid confusing some function lists in text editors)
+ if (identifier[0] =='[' && identifier[1] =='"') { /* " (dummy comment to avoid confusing some function lists in text editors) */
/* id prop lookup, not so common */
- PropertyRNA *r_prop= NULL;
+ PropertyRNA *r_prop = NULL;
PointerRNA r_ptr; /* only support single level props */
- if(RNA_path_resolve(ptr, identifier, &r_ptr, &r_prop) && r_ptr.type==ptr->type && r_ptr.data==ptr->data)
+ if (RNA_path_resolve(ptr, identifier, &r_ptr, &r_prop) && r_ptr.type == ptr->type && r_ptr.data == ptr->data)
return r_prop;
}
else {
/* most common case */
- PropertyRNA *iterprop= RNA_struct_iterator_property(ptr->type);
+ PropertyRNA *iterprop = RNA_struct_iterator_property(ptr->type);
PointerRNA propptr;
- if(RNA_property_collection_lookup_string(ptr, iterprop, identifier, &propptr))
+ if (RNA_property_collection_lookup_string(ptr, iterprop, identifier, &propptr))
return propptr.data;
}
@@ -626,12 +626,12 @@ PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
/* Find the property which uses the given nested struct */
PropertyRNA *RNA_struct_find_nested(PointerRNA *ptr, StructRNA *srna)
{
- PropertyRNA *prop= NULL;
+ PropertyRNA *prop = NULL;
RNA_STRUCT_BEGIN(ptr, iprop) {
/* This assumes that there can only be one user of this nested struct */
if (RNA_property_pointer_type(ptr, iprop) == srna) {
- prop= iprop;
+ prop = iprop;
break;
}
}
@@ -646,14 +646,14 @@ int RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test)
/* validate the RNA is ok */
PropertyRNA *iterprop;
- int found= FALSE;
+ int found = FALSE;
- iterprop= RNA_struct_iterator_property(ptr->type);
+ iterprop = RNA_struct_iterator_property(ptr->type);
RNA_PROP_BEGIN(ptr, itemptr, iterprop) {
/* PropertyRNA *prop= itemptr.data; */
- if(prop_test == (PropertyRNA *)itemptr.data) {
- found= TRUE;
+ if (prop_test == (PropertyRNA *)itemptr.data) {
+ found = TRUE;
break;
}
}
@@ -678,9 +678,9 @@ FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier)
#if 1
FunctionRNA *func;
StructRNA *type;
- for(type= ptr->type; type; type= type->base) {
- func= (FunctionRNA *)BLI_findstring_ptr(&type->functions, identifier, offsetof(FunctionRNA, identifier));
- if(func) {
+ for (type = ptr->type; type; type = type->base) {
+ func = (FunctionRNA *)BLI_findstring_ptr(&type->functions, identifier, offsetof(FunctionRNA, identifier));
+ if (func) {
return func;
}
}
@@ -693,13 +693,13 @@ FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier)
FunctionRNA *func;
RNA_pointer_create(NULL, &RNA_Struct, ptr->type, &tptr);
- iterprop= RNA_struct_find_property(&tptr, "functions");
+ iterprop = RNA_struct_find_property(&tptr, "functions");
- func= NULL;
+ func = NULL;
RNA_PROP_BEGIN(&tptr, funcptr, iterprop) {
- if(strcmp(identifier, RNA_function_identifier(funcptr.data)) == 0) {
- func= funcptr.data;
+ if (strcmp(identifier, RNA_function_identifier(funcptr.data)) == 0) {
+ func = funcptr.data;
break;
}
}
@@ -722,21 +722,21 @@ StructRegisterFunc RNA_struct_register(StructRNA *type)
StructUnregisterFunc RNA_struct_unregister(StructRNA *type)
{
do {
- if(type->unreg)
+ if (type->unreg)
return type->unreg;
- } while((type=type->base));
+ } while ((type = type->base));
return NULL;
}
void **RNA_struct_instance(PointerRNA *ptr)
{
- StructRNA *type= ptr->type;
+ StructRNA *type = ptr->type;
do {
- if(type->instance)
+ if (type->instance)
return type->instance(ptr);
- } while((type=type->base));
+ } while ((type = type->base));
return NULL;
}
@@ -748,7 +748,7 @@ void *RNA_struct_py_type_get(StructRNA *srna)
void RNA_struct_py_type_set(StructRNA *srna, void *py_type)
{
- srna->py_type= py_type;
+ srna->py_type = py_type;
}
void *RNA_struct_blender_type_get(StructRNA *srna)
@@ -758,14 +758,14 @@ void *RNA_struct_blender_type_get(StructRNA *srna)
void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type)
{
- srna->blender_type= blender_type;
+ srna->blender_type = blender_type;
}
char *RNA_struct_name_get_alloc(PointerRNA *ptr, char *fixedbuf, int fixedlen, int *r_len)
{
PropertyRNA *nameprop;
- if(ptr->data && (nameprop = RNA_struct_name_property(ptr->type)))
+ if (ptr->data && (nameprop = RNA_struct_name_property(ptr->type)))
return RNA_property_string_get_alloc(ptr, nameprop, fixedbuf, fixedlen, r_len);
return NULL;
@@ -821,9 +821,9 @@ int RNA_property_array_check(PropertyRNA *prop)
/* used by BPY to make an array from the python object */
int RNA_property_array_dimension(PointerRNA *ptr, PropertyRNA *prop, int length[])
{
- PropertyRNA *rprop= rna_ensure_property(prop);
+ PropertyRNA *rprop = rna_ensure_property(prop);
- if(length)
+ if (length)
rna_ensure_property_multi_array_length(ptr, prop, length);
return rprop->arraydimension;
@@ -841,16 +841,16 @@ int RNA_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int dim)
char RNA_property_array_item_char(PropertyRNA *prop, int index)
{
- const char *vectoritem= "XYZW";
- const char *quatitem= "WXYZ";
- const char *coloritem= "RGBA";
- PropertySubType subtype= rna_ensure_property(prop)->subtype;
+ const char *vectoritem = "XYZW";
+ const char *quatitem = "WXYZ";
+ const char *coloritem = "RGBA";
+ PropertySubType subtype = rna_ensure_property(prop)->subtype;
/* get string to use for array index */
if ((index < 4) && ELEM(subtype, PROP_QUATERNION, PROP_AXISANGLE)) {
return quatitem[index];
}
- else if((index < 4) && ELEM8(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_XYZ_LENGTH,
+ else if ((index < 4) && ELEM8(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_XYZ_LENGTH,
PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION, PROP_COORDS))
{
return vectoritem[index];
@@ -864,7 +864,7 @@ char RNA_property_array_item_char(PropertyRNA *prop, int index)
int RNA_property_array_item_index(PropertyRNA *prop, char name)
{
- PropertySubType subtype= rna_ensure_property(prop)->subtype;
+ PropertySubType subtype = rna_ensure_property(prop)->subtype;
/* get index based on string name/alias */
/* maybe a function to find char index in string would be better than all the switches */
@@ -880,7 +880,7 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name)
return 3;
}
}
- else if(ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ,
+ else if (ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ,
PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION))
{
switch (name) {
@@ -913,142 +913,142 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name)
void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
{
- IntPropertyRNA *iprop= (IntPropertyRNA*)rna_ensure_property(prop);
+ IntPropertyRNA *iprop = (IntPropertyRNA*)rna_ensure_property(prop);
- if(prop->magic != RNA_MAGIC) {
+ if (prop->magic != RNA_MAGIC) {
/* attempt to get the local ID values */
- IDProperty *idp_ui= rna_idproperty_ui(prop);
+ IDProperty *idp_ui = rna_idproperty_ui(prop);
- if(idp_ui) {
+ if (idp_ui) {
IDProperty *item;
- item= IDP_GetPropertyTypeFromGroup(idp_ui, "min", IDP_INT);
- *hardmin= item ? IDP_Int(item) : INT_MIN;
+ item = IDP_GetPropertyTypeFromGroup(idp_ui, "min", IDP_INT);
+ *hardmin = item ? IDP_Int(item) : INT_MIN;
- item= IDP_GetPropertyTypeFromGroup(idp_ui, "max", IDP_INT);
- *hardmax= item ? IDP_Int(item) : INT_MAX;
+ item = IDP_GetPropertyTypeFromGroup(idp_ui, "max", IDP_INT);
+ *hardmax = item ? IDP_Int(item) : INT_MAX;
return;
}
}
- if(iprop->range) {
+ if (iprop->range) {
iprop->range(ptr, hardmin, hardmax);
}
else {
- *hardmin= iprop->hardmin;
- *hardmax= iprop->hardmax;
+ *hardmin = iprop->hardmin;
+ *hardmax = iprop->hardmax;
}
}
void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, int *softmax, int *step)
{
- IntPropertyRNA *iprop= (IntPropertyRNA*)rna_ensure_property(prop);
+ IntPropertyRNA *iprop = (IntPropertyRNA*)rna_ensure_property(prop);
int hardmin, hardmax;
- if(prop->magic != RNA_MAGIC) {
+ if (prop->magic != RNA_MAGIC) {
/* attempt to get the local ID values */
- IDProperty *idp_ui= rna_idproperty_ui(prop);
+ IDProperty *idp_ui = rna_idproperty_ui(prop);
- if(idp_ui) {
+ if (idp_ui) {
IDProperty *item;
- item= IDP_GetPropertyTypeFromGroup(idp_ui, "soft_min", IDP_INT);
- *softmin= item ? IDP_Int(item) : INT_MIN;
+ item = IDP_GetPropertyTypeFromGroup(idp_ui, "soft_min", IDP_INT);
+ *softmin = item ? IDP_Int(item) : INT_MIN;
- item= IDP_GetPropertyTypeFromGroup(idp_ui, "soft_max", IDP_INT);
- *softmax= item ? IDP_Int(item) : INT_MAX;
+ item = IDP_GetPropertyTypeFromGroup(idp_ui, "soft_max", IDP_INT);
+ *softmax = item ? IDP_Int(item) : INT_MAX;
- item= IDP_GetPropertyTypeFromGroup(idp_ui, "step", IDP_INT);
- *step= item ? IDP_Int(item) : 1;
+ item = IDP_GetPropertyTypeFromGroup(idp_ui, "step", IDP_INT);
+ *step = item ? IDP_Int(item) : 1;
return;
}
}
- if(iprop->range) {
+ if (iprop->range) {
iprop->range(ptr, &hardmin, &hardmax);
- *softmin= MAX2(iprop->softmin, hardmin);
- *softmax= MIN2(iprop->softmax, hardmax);
+ *softmin = MAX2(iprop->softmin, hardmin);
+ *softmax = MIN2(iprop->softmax, hardmax);
}
else {
- *softmin= iprop->softmin;
- *softmax= iprop->softmax;
+ *softmin = iprop->softmin;
+ *softmax = iprop->softmax;
}
- *step= iprop->step;
+ *step = iprop->step;
}
void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax)
{
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)rna_ensure_property(prop);
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)rna_ensure_property(prop);
- if(prop->magic != RNA_MAGIC) {
+ if (prop->magic != RNA_MAGIC) {
/* attempt to get the local ID values */
- IDProperty *idp_ui= rna_idproperty_ui(prop);
+ IDProperty *idp_ui = rna_idproperty_ui(prop);
- if(idp_ui) {
+ if (idp_ui) {
IDProperty *item;
- item= IDP_GetPropertyTypeFromGroup(idp_ui, "min", IDP_DOUBLE);
- *hardmin= item ? (float)IDP_Double(item) : FLT_MIN;
+ item = IDP_GetPropertyTypeFromGroup(idp_ui, "min", IDP_DOUBLE);
+ *hardmin = item ? (float)IDP_Double(item) : FLT_MIN;
- item= IDP_GetPropertyTypeFromGroup(idp_ui, "max", IDP_DOUBLE);
- *hardmax= item ? (float)IDP_Double(item) : FLT_MAX;
+ item = IDP_GetPropertyTypeFromGroup(idp_ui, "max", IDP_DOUBLE);
+ *hardmax = item ? (float)IDP_Double(item) : FLT_MAX;
return;
}
}
- if(fprop->range) {
+ if (fprop->range) {
fprop->range(ptr, hardmin, hardmax);
}
else {
- *hardmin= fprop->hardmin;
- *hardmax= fprop->hardmax;
+ *hardmin = fprop->hardmin;
+ *hardmax = fprop->hardmax;
}
}
void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision)
{
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)rna_ensure_property(prop);
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)rna_ensure_property(prop);
float hardmin, hardmax;
- if(prop->magic != RNA_MAGIC) {
+ if (prop->magic != RNA_MAGIC) {
/* attempt to get the local ID values */
- IDProperty *idp_ui= rna_idproperty_ui(prop);
+ IDProperty *idp_ui = rna_idproperty_ui(prop);
- if(idp_ui) {
+ if (idp_ui) {
IDProperty *item;
- item= IDP_GetPropertyTypeFromGroup(idp_ui, "soft_min", IDP_DOUBLE);
- *softmin= item ? (float)IDP_Double(item) : FLT_MIN;
+ item = IDP_GetPropertyTypeFromGroup(idp_ui, "soft_min", IDP_DOUBLE);
+ *softmin = item ? (float)IDP_Double(item) : FLT_MIN;
- item= IDP_GetPropertyTypeFromGroup(idp_ui, "soft_max", IDP_DOUBLE);
- *softmax= item ? (float)IDP_Double(item) : FLT_MAX;
+ item = IDP_GetPropertyTypeFromGroup(idp_ui, "soft_max", IDP_DOUBLE);
+ *softmax = item ? (float)IDP_Double(item) : FLT_MAX;
- item= IDP_GetPropertyTypeFromGroup(idp_ui, "step", IDP_DOUBLE);
- *step= item ? (float)IDP_Double(item) : 1.0f;
+ item = IDP_GetPropertyTypeFromGroup(idp_ui, "step", IDP_DOUBLE);
+ *step = item ? (float)IDP_Double(item) : 1.0f;
- item= IDP_GetPropertyTypeFromGroup(idp_ui, "precision", IDP_DOUBLE);
- *precision= item ? (float)IDP_Double(item) : 3.0f;
+ item = IDP_GetPropertyTypeFromGroup(idp_ui, "precision", IDP_DOUBLE);
+ *precision = item ? (float)IDP_Double(item) : 3.0f;
return;
}
}
- if(fprop->range) {
+ if (fprop->range) {
fprop->range(ptr, &hardmin, &hardmax);
- *softmin= MAX2(fprop->softmin, hardmin);
- *softmax= MIN2(fprop->softmax, hardmax);
+ *softmin = MAX2(fprop->softmin, hardmin);
+ *softmax = MIN2(fprop->softmax, hardmax);
}
else {
- *softmin= fprop->softmin;
- *softmax= fprop->softmax;
+ *softmin = fprop->softmin;
+ *softmax = fprop->softmax;
}
- *step= fprop->step;
- *precision= (float)fprop->precision;
+ *step = fprop->step;
+ *precision = (float)fprop->precision;
}
int RNA_property_float_clamp(PointerRNA *ptr, PropertyRNA *prop, float *value)
@@ -1057,12 +1057,12 @@ int RNA_property_float_clamp(PointerRNA *ptr, PropertyRNA *prop, float *value)
RNA_property_float_range(ptr, prop, &min, &max);
- if(*value < min) {
- *value= min;
+ if (*value < min) {
+ *value = min;
return -1;
}
- else if(*value > max) {
- *value= max;
+ else if (*value > max) {
+ *value = max;
return 1;
}
else {
@@ -1076,12 +1076,12 @@ int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value)
RNA_property_int_range(ptr, prop, &min, &max);
- if(*value < min) {
- *value= min;
+ if (*value < min) {
+ *value = min;
return -1;
}
- else if(*value > max) {
- *value= max;
+ else if (*value > max) {
+ *value = max;
return 1;
}
else {
@@ -1093,26 +1093,26 @@ int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value)
* '0' used when their is no maximum */
int RNA_property_string_maxlength(PropertyRNA *prop)
{
- StringPropertyRNA *sprop= (StringPropertyRNA*)rna_ensure_property(prop);
+ StringPropertyRNA *sprop = (StringPropertyRNA*)rna_ensure_property(prop);
return sprop->maxlength;
}
StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
{
- prop= rna_ensure_property(prop);
+ prop = rna_ensure_property(prop);
- if(prop->type == PROP_POINTER) {
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ if (prop->type == PROP_POINTER) {
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
- if(pprop->typef)
+ if (pprop->typef)
return pprop->typef(ptr);
- else if(pprop->type)
+ else if (pprop->type)
return pprop->type;
}
- else if(prop->type == PROP_COLLECTION) {
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+ else if (prop->type == PROP_COLLECTION) {
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
- if(cprop->item_type)
+ if (cprop->item_type)
return cprop->item_type;
}
/* ignore other types, RNA_struct_find_nested calls with unchecked props */
@@ -1122,11 +1122,11 @@ StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_pointer_poll(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *value)
{
- prop= rna_ensure_property(prop);
+ prop = rna_ensure_property(prop);
- if(prop->type == PROP_POINTER) {
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
- if(pprop->poll)
+ if (prop->type == PROP_POINTER) {
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
+ if (pprop->poll)
return pprop->poll(ptr, *value);
return 1;
@@ -1149,31 +1149,31 @@ EnumPropertyItem DummyRNA_DEFAULT_items[] = {
void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free)
{
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)rna_ensure_property(prop);
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)rna_ensure_property(prop);
- *free= 0;
+ *free = 0;
- if(eprop->itemf && (C != NULL || (prop->flag & PROP_ENUM_NO_CONTEXT))) {
- int tot= 0;
+ if (eprop->itemf && (C != NULL || (prop->flag & PROP_ENUM_NO_CONTEXT))) {
+ int tot = 0;
if (prop->flag & PROP_ENUM_NO_CONTEXT)
- *item= eprop->itemf(NULL, ptr, prop, free);
+ *item = eprop->itemf(NULL, ptr, prop, free);
else
- *item= eprop->itemf(C, ptr, prop, free);
+ *item = eprop->itemf(C, ptr, prop, free);
- if(totitem) {
- if(*item) {
- for( ; (*item)[tot].identifier; tot++);
+ if (totitem) {
+ if (*item) {
+ for ( ; (*item)[tot].identifier; tot++);
}
- *totitem= tot;
+ *totitem = tot;
}
}
else {
- *item= eprop->item;
- if(totitem)
- *totitem= eprop->totitem;
+ *item = eprop->item;
+ if (totitem)
+ *totitem = eprop->totitem;
}
}
@@ -1182,67 +1182,67 @@ void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA
RNA_property_enum_items(C, ptr, prop, item, totitem, free);
#ifdef WITH_INTERNATIONAL
- if(BLF_translate_iface()) {
+ if (BLF_translate_iface()) {
int i;
EnumPropertyItem *nitem;
- if(*free) {
- nitem= *item;
+ if (*free) {
+ nitem = *item;
} else {
- int totitem= 0;
+ int totitem = 0;
/* count */
- for(i=0; (*item)[i].identifier; i++)
+ for (i = 0; (*item)[i].identifier; i++)
totitem++;
- nitem= MEM_callocN(sizeof(EnumPropertyItem)*(totitem+1), "enum_items_gettexted");
+ nitem = MEM_callocN(sizeof(EnumPropertyItem)*(totitem+1), "enum_items_gettexted");
- for(i=0; (*item)[i].identifier; i++)
- nitem[i]= (*item)[i];
+ for (i = 0; (*item)[i].identifier; i++)
+ nitem[i] = (*item)[i];
- *free= 1;
+ *free = 1;
}
- for(i=0; nitem[i].identifier; i++) {
- if( nitem[i].name ) {
- if(prop->translation_context)
+ for (i = 0; nitem[i].identifier; i++) {
+ if ( nitem[i].name ) {
+ if (prop->translation_context)
nitem[i].name = BLF_pgettext(prop->translation_context, nitem[i].name);
else
nitem[i].name = BLF_gettext(nitem[i].name);
}
- if( nitem[i].description )
+ if ( nitem[i].description )
nitem[i].description = BLF_gettext(nitem[i].description);
}
- *item= nitem;
+ *item = nitem;
}
#endif
}
int RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value)
-{
+{
EnumPropertyItem *item, *item_array;
int free, found;
RNA_property_enum_items(C, ptr, prop, &item_array, NULL, &free);
- if(item_array) {
- for(item= item_array; item->identifier; item++) {
- if(item->identifier[0] && strcmp(item->identifier, identifier)==0) {
+ if (item_array) {
+ for (item = item_array; item->identifier; item++) {
+ if (item->identifier[0] && strcmp(item->identifier, identifier) == 0) {
*value = item->value;
break;
}
}
- found= (item->identifier != NULL); /* could be alloc'd, assign before free */
+ found = (item->identifier != NULL); /* could be alloc'd, assign before free */
- if(free) {
+ if (free) {
MEM_freeN(item_array);
}
}
else {
- found= 0;
+ found = 0;
}
return found;
}
@@ -1250,7 +1250,7 @@ int RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, con
int RNA_enum_identifier(EnumPropertyItem *item, const int value, const char **identifier)
{
for (; item->identifier; item++) {
- if(item->identifier[0] && item->value==value) {
+ if (item->identifier[0] && item->value == value) {
*identifier = item->identifier;
return 1;
}
@@ -1260,20 +1260,20 @@ int RNA_enum_identifier(EnumPropertyItem *item, const int value, const char **id
int RNA_enum_bitflag_identifiers(EnumPropertyItem *item, const int value, const char **identifier)
{
- int index= 0;
+ int index = 0;
for (; item->identifier; item++) {
- if(item->identifier[0] && item->value & value) {
+ if (item->identifier[0] && item->value & value) {
identifier[index++] = item->identifier;
}
}
- identifier[index]= NULL;
+ identifier[index] = NULL;
return index;
}
int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name)
{
for (; item->identifier; item++) {
- if(item->identifier[0] && item->value==value) {
+ if (item->identifier[0] && item->value == value) {
*name = item->name;
return 1;
}
@@ -1284,7 +1284,7 @@ int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name)
int RNA_enum_description(EnumPropertyItem *item, const int value, const char **description)
{
for (; item->identifier; item++) {
- if(item->identifier[0] && item->value==value) {
+ if (item->identifier[0] && item->value == value) {
*description = item->description;
return 1;
}
@@ -1293,14 +1293,14 @@ int RNA_enum_description(EnumPropertyItem *item, const int value, const char **d
}
int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
-{
- EnumPropertyItem *item= NULL;
+{
+ EnumPropertyItem *item = NULL;
int result, free;
RNA_property_enum_items(C, ptr, prop, &item, NULL, &free);
- if(item) {
- result= RNA_enum_identifier(item, value, identifier);
- if(free)
+ if (item) {
+ result = RNA_enum_identifier(item, value, identifier);
+ if (free)
MEM_freeN(item);
return result;
@@ -1309,14 +1309,14 @@ int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop
}
int RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **name)
-{
- EnumPropertyItem *item= NULL;
+{
+ EnumPropertyItem *item = NULL;
int result, free;
RNA_property_enum_items(C, ptr, prop, &item, NULL, &free);
- if(item) {
- result= RNA_enum_name(item, value, name);
- if(free)
+ if (item) {
+ result = RNA_enum_name(item, value, name);
+ if (free)
MEM_freeN(item);
return result;
@@ -1326,13 +1326,13 @@ int RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, cons
int RNA_property_enum_bitflag_identifiers(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
{
- EnumPropertyItem *item= NULL;
+ EnumPropertyItem *item = NULL;
int result, free;
RNA_property_enum_items(C, ptr, prop, &item, NULL, &free);
- if(item) {
- result= RNA_enum_bitflag_identifiers(item, value, identifier);
- if(free)
+ if (item) {
+ result = RNA_enum_bitflag_identifiers(item, value, identifier);
+ if (free)
MEM_freeN(item);
return result;
@@ -1357,11 +1357,11 @@ int RNA_property_ui_icon(PropertyRNA *prop)
int RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop)
{
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
int flag;
- prop= rna_ensure_property(prop);
- flag= prop->editable ? prop->editable(ptr) : prop->flag;
+ prop = rna_ensure_property(prop);
+ flag = prop->editable ? prop->editable(ptr) : prop->flag;
return (flag & PROP_EDITABLE) && (!id || !id->lib || (prop->flag & PROP_LIB_EXCEPTION));
}
@@ -1369,8 +1369,8 @@ int RNA_property_editable_flag(PointerRNA *ptr, PropertyRNA *prop)
{
int flag;
- prop= rna_ensure_property(prop);
- flag= prop->editable ? prop->editable(ptr) : prop->flag;
+ prop = rna_ensure_property(prop);
+ flag = prop->editable ? prop->editable(ptr) : prop->flag;
return (flag & PROP_EDITABLE);
}
@@ -1380,17 +1380,17 @@ int RNA_property_editable_index(PointerRNA *ptr, PropertyRNA *prop, int index)
ID *id;
int flag;
- prop= rna_ensure_property(prop);
+ prop = rna_ensure_property(prop);
- flag= prop->flag;
+ flag = prop->flag;
- if(prop->editable)
+ if (prop->editable)
flag &= prop->editable(ptr);
if (prop->itemeditable)
flag &= prop->itemeditable(ptr, index);
- id= ptr->id.data;
+ id = ptr->id.data;
return (flag & PROP_EDITABLE) && (!id || !id->lib || (prop->flag & PROP_LIB_EXCEPTION));
}
@@ -1401,9 +1401,9 @@ int RNA_property_animateable(PointerRNA *ptr, PropertyRNA *prop)
if (!id_type_can_have_animdata(ptr->id.data))
return 0;
- prop= rna_ensure_property(prop);
+ prop = rna_ensure_property(prop);
- if(!(prop->flag & PROP_ANIMATABLE))
+ if (!(prop->flag & PROP_ANIMATABLE))
return 0;
return (prop->flag & PROP_EDITABLE);
@@ -1421,17 +1421,17 @@ int RNA_property_animated(PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop))
* its slow so dont call in a loop */
int RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop)
{
- char *path= RNA_path_from_ID_to_property(ptr, prop);
- int ret= 0;
+ char *path = RNA_path_from_ID_to_property(ptr, prop);
+ int ret = 0;
- if(path) {
+ if (path) {
PointerRNA id_ptr;
PointerRNA r_ptr;
PropertyRNA *r_prop;
RNA_id_pointer_create(ptr->id.data, &id_ptr);
RNA_path_resolve(&id_ptr, path, &r_ptr, &r_prop);
- ret= (prop == r_prop);
+ ret = (prop == r_prop);
MEM_freeN(path);
}
@@ -1442,15 +1442,15 @@ int RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop)
static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
{
int is_rna = (prop->magic == RNA_MAGIC);
- prop= rna_ensure_property(prop);
+ prop = rna_ensure_property(prop);
- if(is_rna) {
- if(prop->update) {
+ if (is_rna) {
+ if (prop->update) {
/* ideally no context would be needed for update, but there's some
- parts of the code that need it still, so we have this exception */
- if(prop->flag & PROP_CONTEXT_UPDATE) {
- if(C) {
- if(prop->flag & PROP_CONTEXT_PROPERTY_UPDATE) {
+ * parts of the code that need it still, so we have this exception */
+ if (prop->flag & PROP_CONTEXT_UPDATE) {
+ if (C) {
+ if (prop->flag & PROP_CONTEXT_PROPERTY_UPDATE) {
((ContextPropUpdateFunc)prop->update)(C, ptr, prop);
}
else {
@@ -1461,11 +1461,11 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR
else
prop->update(bmain, scene, ptr);
}
- if(prop->noteflag)
+ if (prop->noteflag)
WM_main_add_notifier(prop->noteflag, ptr->id.data);
}
- if(!is_rna || (prop->flag & PROP_IDPROPERTY)) {
+ if (!is_rna || (prop->flag & PROP_IDPROPERTY)) {
/* WARNING! This is so property drivers update the display!
* not especially nice */
DAG_id_tag_update(ptr->id.data, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME);
@@ -1530,7 +1530,7 @@ void RNA_property_update_cache_add(PointerRNA *ptr, PropertyRNA *prop)
if (ELEM(NULL, ptr, prop))
return;
- prop= rna_ensure_property(prop);
+ prop = rna_ensure_property(prop);
/* we can only handle update calls with no context args for now (makes animsys updates easier) */
if ((is_rna == 0) || (prop->update == NULL) || (prop->flag & PROP_CONTEXT_UPDATE))
@@ -1568,7 +1568,7 @@ void RNA_property_update_cache_flush(Main *bmain, Scene *scene)
{
tRnaUpdateCacheElem *uce;
- // TODO: should we check that bmain and scene are valid? The above stuff doesn't!
+ /* TODO: should we check that bmain and scene are valid? The above stuff doesn't! */
/* execute the cached updates */
for (uce = rna_updates_cache.first; uce; uce = uce->next) {
@@ -1602,15 +1602,15 @@ void RNA_property_update_cache_free(void)
int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
{
- BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+ BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
BLI_assert(RNA_property_array_check(prop) == 0);
- if((idprop=rna_idproperty_check(&prop, ptr)))
+ if ((idprop = rna_idproperty_check(&prop, ptr)))
return IDP_Int(idprop);
- else if(bprop->get)
+ else if (bprop->get)
return bprop->get(ptr);
else
return bprop->defaultvalue;
@@ -1618,52 +1618,52 @@ int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value)
{
- BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+ BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
BLI_assert(RNA_property_array_check(prop) == 0);
- /* just incase other values are passed */
- if(value) value= 1;
+ /* just in case other values are passed */
+ if (value) value = 1;
- if((idprop=rna_idproperty_check(&prop, ptr))) {
- IDP_Int(idprop)= value;
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ IDP_Int(idprop) = value;
rna_idproperty_touch(idprop);
}
- else if(bprop->set)
+ else if (bprop->set)
bprop->set(ptr, value);
- else if(prop->flag & PROP_EDITABLE) {
+ else if (prop->flag & PROP_EDITABLE) {
IDPropertyTemplate val = {0};
IDProperty *group;
- val.i= value;
+ val.i = value;
- group= RNA_struct_idprops(ptr, 1);
- if(group)
+ group = RNA_struct_idprops(ptr, 1);
+ if (group)
IDP_AddToGroup(group, IDP_New(IDP_INT, &val, prop->identifier));
}
}
void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
{
- BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+ BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
BLI_assert(RNA_property_array_check(prop) != 0);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
- if(prop->arraydimension == 0)
- values[0]= RNA_property_boolean_get(ptr, prop);
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ if (prop->arraydimension == 0)
+ values[0] = RNA_property_boolean_get(ptr, prop);
else
memcpy(values, IDP_Array(idprop), sizeof(int)*idprop->len);
}
- else if(prop->arraydimension == 0)
- values[0]= RNA_property_boolean_get(ptr, prop);
- else if(bprop->getarray)
+ else if (prop->arraydimension == 0)
+ values[0] = RNA_property_boolean_get(ptr, prop);
+ else if (bprop->getarray)
bprop->getarray(ptr, values);
- else if(bprop->defaultarray)
+ else if (bprop->defaultarray)
memcpy(values, bprop->defaultarray, sizeof(int)*prop->totarraylength);
else
memset(values, 0, sizeof(int)*prop->totarraylength);
@@ -1672,21 +1672,21 @@ void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, int *val
int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
{
int tmp[RNA_MAX_ARRAY_LENGTH];
- int len= rna_ensure_property_array_length(ptr, prop);
+ int len = rna_ensure_property_array_length(ptr, prop);
BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
BLI_assert(RNA_property_array_check(prop) != 0);
- if(len <= RNA_MAX_ARRAY_LENGTH) {
+ if (len <= RNA_MAX_ARRAY_LENGTH) {
RNA_property_boolean_get_array(ptr, prop, tmp);
return tmp[index];
}
else {
int *tmparray, value;
- tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_index");
+ tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_index");
RNA_property_boolean_get_array(ptr, prop, tmparray);
- value= tmparray[index];
+ value = tmparray[index];
MEM_freeN(tmparray);
return value;
@@ -1695,34 +1695,34 @@ int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index
void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values)
{
- BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+ BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
BLI_assert(RNA_property_array_check(prop) != 0);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
- if(prop->arraydimension == 0)
- IDP_Int(idprop)= values[0];
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ if (prop->arraydimension == 0)
+ IDP_Int(idprop) = values[0];
else
memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);
rna_idproperty_touch(idprop);
}
- else if(prop->arraydimension == 0)
+ else if (prop->arraydimension == 0)
RNA_property_boolean_set(ptr, prop, values[0]);
- else if(bprop->setarray)
+ else if (bprop->setarray)
bprop->setarray(ptr, values);
- else if(prop->flag & PROP_EDITABLE) {
+ else if (prop->flag & PROP_EDITABLE) {
IDPropertyTemplate val = {0};
IDProperty *group;
- val.array.len= prop->totarraylength;
- val.array.type= IDP_INT;
+ val.array.len = prop->totarraylength;
+ val.array.type = IDP_INT;
- group= RNA_struct_idprops(ptr, 1);
- if(group) {
- idprop= IDP_New(IDP_ARRAY, &val, prop->identifier);
+ group = RNA_struct_idprops(ptr, 1);
+ if (group) {
+ idprop = IDP_New(IDP_ARRAY, &val, prop->identifier);
IDP_AddToGroup(group, idprop);
memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);
}
@@ -1732,22 +1732,22 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in
void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int value)
{
int tmp[RNA_MAX_ARRAY_LENGTH];
- int len= rna_ensure_property_array_length(ptr, prop);
+ int len = rna_ensure_property_array_length(ptr, prop);
BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
BLI_assert(RNA_property_array_check(prop) != 0);
- if(len <= RNA_MAX_ARRAY_LENGTH) {
+ if (len <= RNA_MAX_ARRAY_LENGTH) {
RNA_property_boolean_get_array(ptr, prop, tmp);
- tmp[index]= value;
+ tmp[index] = value;
RNA_property_boolean_set_array(ptr, prop, tmp);
}
else {
int *tmparray;
- tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_index");
+ tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_index");
RNA_property_boolean_get_array(ptr, prop, tmparray);
- tmparray[index]= value;
+ tmparray[index] = value;
RNA_property_boolean_set_array(ptr, prop, tmparray);
MEM_freeN(tmparray);
}
@@ -1755,7 +1755,7 @@ void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int inde
int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
{
- BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+ BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
BLI_assert(RNA_property_array_check(prop) == 0);
@@ -1765,14 +1765,14 @@ int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
void RNA_property_boolean_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, int *values)
{
- BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+ BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
BLI_assert(RNA_property_array_check(prop) != 0);
- if(prop->arraydimension == 0)
- values[0]= bprop->defaultvalue;
- else if(bprop->defaultarray)
+ if (prop->arraydimension == 0)
+ values[0] = bprop->defaultvalue;
+ else if (bprop->defaultarray)
memcpy(values, bprop->defaultarray, sizeof(int)*prop->totarraylength);
else
memset(values, 0, sizeof(int)*prop->totarraylength);
@@ -1781,21 +1781,21 @@ void RNA_property_boolean_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA
int RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
{
int tmp[RNA_MAX_ARRAY_LENGTH];
- int len= rna_ensure_property_array_length(ptr, prop);
+ int len = rna_ensure_property_array_length(ptr, prop);
BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
BLI_assert(RNA_property_array_check(prop) != 0);
- if(len <= RNA_MAX_ARRAY_LENGTH) {
+ if (len <= RNA_MAX_ARRAY_LENGTH) {
RNA_property_boolean_get_default_array(ptr, prop, tmp);
return tmp[index];
}
else {
int *tmparray, value;
- tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_default_index");
+ tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_default_index");
RNA_property_boolean_get_default_array(ptr, prop, tmparray);
- value= tmparray[index];
+ value = tmparray[index];
MEM_freeN(tmparray);
return value;
@@ -1804,15 +1804,15 @@ int RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
{
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_INT);
BLI_assert(RNA_property_array_check(prop) == 0);
- if((idprop=rna_idproperty_check(&prop, ptr)))
+ if ((idprop = rna_idproperty_check(&prop, ptr)))
return IDP_Int(idprop);
- else if(iprop->get)
+ else if (iprop->get)
return iprop->get(ptr);
else
return iprop->defaultvalue;
@@ -1820,7 +1820,7 @@ int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
{
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_INT);
@@ -1828,43 +1828,43 @@ void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
/* useful to check on bad values but set function should clamp */
/* BLI_assert(RNA_property_int_clamp(ptr, prop, &value) == 0); */
- if((idprop=rna_idproperty_check(&prop, ptr))) {
- IDP_Int(idprop)= value;
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ IDP_Int(idprop) = value;
rna_idproperty_touch(idprop);
}
- else if(iprop->set)
+ else if (iprop->set)
iprop->set(ptr, value);
- else if(prop->flag & PROP_EDITABLE) {
+ else if (prop->flag & PROP_EDITABLE) {
IDPropertyTemplate val = {0};
IDProperty *group;
- val.i= value;
+ val.i = value;
- group= RNA_struct_idprops(ptr, 1);
- if(group)
+ group = RNA_struct_idprops(ptr, 1);
+ if (group)
IDP_AddToGroup(group, IDP_New(IDP_INT, &val, prop->identifier));
}
}
void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
{
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_INT);
BLI_assert(RNA_property_array_check(prop) != 0);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
- if(prop->arraydimension == 0)
- values[0]= RNA_property_int_get(ptr, prop);
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ if (prop->arraydimension == 0)
+ values[0] = RNA_property_int_get(ptr, prop);
else
memcpy(values, IDP_Array(idprop), sizeof(int)*idprop->len);
}
- else if(prop->arraydimension == 0)
- values[0]= RNA_property_int_get(ptr, prop);
- else if(iprop->getarray)
+ else if (prop->arraydimension == 0)
+ values[0] = RNA_property_int_get(ptr, prop);
+ else if (iprop->getarray)
iprop->getarray(ptr, values);
- else if(iprop->defaultarray)
+ else if (iprop->defaultarray)
memcpy(values, iprop->defaultarray, sizeof(int)*prop->totarraylength);
else
memset(values, 0, sizeof(int)*prop->totarraylength);
@@ -1872,36 +1872,36 @@ void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
void RNA_property_int_get_array_range(PointerRNA *ptr, PropertyRNA *prop, int values[2])
{
- const int array_len= RNA_property_array_length(ptr, prop);
+ const int array_len = RNA_property_array_length(ptr, prop);
- if(array_len <= 0) {
- values[0]= 0;
- values[1]= 0;
+ if (array_len <= 0) {
+ values[0] = 0;
+ values[1] = 0;
}
else if (array_len == 1) {
RNA_property_int_get_array(ptr, prop, values);
- values[1]= values[0];
+ values[1] = values[0];
}
else {
int arr_stack[32];
int *arr;
int i;
- if(array_len > 32) {
- arr= MEM_mallocN(sizeof(int) * array_len, "RNA_property_int_get_array_range");
+ if (array_len > 32) {
+ arr = MEM_mallocN(sizeof(int) * array_len, "RNA_property_int_get_array_range");
}
else {
- arr= arr_stack;
+ arr = arr_stack;
}
RNA_property_int_get_array(ptr, prop, arr);
- values[0]= values[1]= arr[0];
- for(i= 1; i < array_len; i++) {
- values[0]= MIN2(values[0], arr[i]);
- values[1]= MAX2(values[1], arr[i]);
+ values[0] = values[1] = arr[0];
+ for (i = 1; i < array_len; i++) {
+ values[0] = MIN2(values[0], arr[i]);
+ values[1] = MAX2(values[1], arr[i]);
}
- if(arr != arr_stack) {
+ if (arr != arr_stack) {
MEM_freeN(arr);
}
}
@@ -1910,21 +1910,21 @@ void RNA_property_int_get_array_range(PointerRNA *ptr, PropertyRNA *prop, int va
int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
{
int tmp[RNA_MAX_ARRAY_LENGTH];
- int len= rna_ensure_property_array_length(ptr, prop);
+ int len = rna_ensure_property_array_length(ptr, prop);
BLI_assert(RNA_property_type(prop) == PROP_INT);
BLI_assert(RNA_property_array_check(prop) != 0);
- if(len <= RNA_MAX_ARRAY_LENGTH) {
+ if (len <= RNA_MAX_ARRAY_LENGTH) {
RNA_property_int_get_array(ptr, prop, tmp);
return tmp[index];
}
else {
int *tmparray, value;
- tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_int_get_index");
+ tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_int_get_index");
RNA_property_int_get_array(ptr, prop, tmparray);
- value= tmparray[index];
+ value = tmparray[index];
MEM_freeN(tmparray);
return value;
@@ -1933,34 +1933,34 @@ int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values)
{
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_INT);
BLI_assert(RNA_property_array_check(prop) != 0);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
- if(prop->arraydimension == 0)
- IDP_Int(idprop)= values[0];
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ if (prop->arraydimension == 0)
+ IDP_Int(idprop) = values[0];
else
memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);
rna_idproperty_touch(idprop);
}
- else if(prop->arraydimension == 0)
+ else if (prop->arraydimension == 0)
RNA_property_int_set(ptr, prop, values[0]);
- else if(iprop->setarray)
+ else if (iprop->setarray)
iprop->setarray(ptr, values);
- else if(prop->flag & PROP_EDITABLE) {
+ else if (prop->flag & PROP_EDITABLE) {
IDPropertyTemplate val = {0};
IDProperty *group;
- val.array.len= prop->totarraylength;
- val.array.type= IDP_INT;
+ val.array.len = prop->totarraylength;
+ val.array.type = IDP_INT;
- group= RNA_struct_idprops(ptr, 1);
- if(group) {
- idprop= IDP_New(IDP_ARRAY, &val, prop->identifier);
+ group = RNA_struct_idprops(ptr, 1);
+ if (group) {
+ idprop = IDP_New(IDP_ARRAY, &val, prop->identifier);
IDP_AddToGroup(group, idprop);
memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);
}
@@ -1970,22 +1970,22 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v
void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int value)
{
int tmp[RNA_MAX_ARRAY_LENGTH];
- int len= rna_ensure_property_array_length(ptr, prop);
+ int len = rna_ensure_property_array_length(ptr, prop);
BLI_assert(RNA_property_type(prop) == PROP_INT);
BLI_assert(RNA_property_array_check(prop) != 0);
- if(len <= RNA_MAX_ARRAY_LENGTH) {
+ if (len <= RNA_MAX_ARRAY_LENGTH) {
RNA_property_int_get_array(ptr, prop, tmp);
- tmp[index]= value;
+ tmp[index] = value;
RNA_property_int_set_array(ptr, prop, tmp);
}
else {
int *tmparray;
- tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_int_get_index");
+ tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_int_get_index");
RNA_property_int_get_array(ptr, prop, tmparray);
- tmparray[index]= value;
+ tmparray[index] = value;
RNA_property_int_set_array(ptr, prop, tmparray);
MEM_freeN(tmparray);
}
@@ -1993,20 +1993,20 @@ void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, i
int RNA_property_int_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
{
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
return iprop->defaultvalue;
}
void RNA_property_int_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, int *values)
{
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
BLI_assert(RNA_property_type(prop) == PROP_INT);
BLI_assert(RNA_property_array_check(prop) != 0);
- if(prop->arraydimension == 0)
- values[0]= iprop->defaultvalue;
- else if(iprop->defaultarray)
+ if (prop->arraydimension == 0)
+ values[0] = iprop->defaultvalue;
+ else if (iprop->defaultarray)
memcpy(values, iprop->defaultarray, sizeof(int)*prop->totarraylength);
else
memset(values, 0, sizeof(int)*prop->totarraylength);
@@ -2015,18 +2015,18 @@ void RNA_property_int_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *pr
int RNA_property_int_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
{
int tmp[RNA_MAX_ARRAY_LENGTH];
- int len= rna_ensure_property_array_length(ptr, prop);
+ int len = rna_ensure_property_array_length(ptr, prop);
- if(len <= RNA_MAX_ARRAY_LENGTH) {
+ if (len <= RNA_MAX_ARRAY_LENGTH) {
RNA_property_int_get_default_array(ptr, prop, tmp);
return tmp[index];
}
else {
int *tmparray, value;
- tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_int_get_default_index");
+ tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_int_get_default_index");
RNA_property_int_get_default_array(ptr, prop, tmparray);
- value= tmparray[index];
+ value = tmparray[index];
MEM_freeN(tmparray);
return value;
@@ -2035,19 +2035,19 @@ int RNA_property_int_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int i
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
{
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_FLOAT);
BLI_assert(RNA_property_array_check(prop) == 0);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
- if(idprop->type == IDP_FLOAT)
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ if (idprop->type == IDP_FLOAT)
return IDP_Float(idprop);
else
return (float)IDP_Double(idprop);
}
- else if(fprop->get)
+ else if (fprop->get)
return fprop->get(ptr);
else
return fprop->defaultvalue;
@@ -2055,7 +2055,7 @@ float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
{
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_FLOAT);
@@ -2063,54 +2063,54 @@ void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
/* useful to check on bad values but set function should clamp */
/* BLI_assert(RNA_property_float_clamp(ptr, prop, &value) == 0); */
- if((idprop=rna_idproperty_check(&prop, ptr))) {
- if(idprop->type == IDP_FLOAT)
- IDP_Float(idprop)= value;
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ if (idprop->type == IDP_FLOAT)
+ IDP_Float(idprop) = value;
else
- IDP_Double(idprop)= value;
+ IDP_Double(idprop) = value;
rna_idproperty_touch(idprop);
}
- else if(fprop->set) {
+ else if (fprop->set) {
fprop->set(ptr, value);
}
- else if(prop->flag & PROP_EDITABLE) {
+ else if (prop->flag & PROP_EDITABLE) {
IDPropertyTemplate val = {0};
IDProperty *group;
- val.f= value;
+ val.f = value;
- group= RNA_struct_idprops(ptr, 1);
- if(group)
+ group = RNA_struct_idprops(ptr, 1);
+ if (group)
IDP_AddToGroup(group, IDP_New(IDP_FLOAT, &val, prop->identifier));
}
}
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
{
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
IDProperty *idprop;
int i;
BLI_assert(RNA_property_type(prop) == PROP_FLOAT);
BLI_assert(RNA_property_array_check(prop) != 0);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
- if(prop->arraydimension == 0)
- values[0]= RNA_property_float_get(ptr, prop);
- else if(idprop->subtype == IDP_FLOAT) {
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ if (prop->arraydimension == 0)
+ values[0] = RNA_property_float_get(ptr, prop);
+ else if (idprop->subtype == IDP_FLOAT) {
memcpy(values, IDP_Array(idprop), sizeof(float)*idprop->len);
}
else {
- for(i=0; i<idprop->len; i++)
- values[i]= (float)(((double*)IDP_Array(idprop))[i]);
+ for (i = 0; i<idprop->len; i++)
+ values[i] = (float)(((double*)IDP_Array(idprop))[i]);
}
}
- else if(prop->arraydimension == 0)
- values[0]= RNA_property_float_get(ptr, prop);
- else if(fprop->getarray)
+ else if (prop->arraydimension == 0)
+ values[0] = RNA_property_float_get(ptr, prop);
+ else if (fprop->getarray)
fprop->getarray(ptr, values);
- else if(fprop->defaultarray)
+ else if (fprop->defaultarray)
memcpy(values, fprop->defaultarray, sizeof(float)*prop->totarraylength);
else
memset(values, 0, sizeof(float)*prop->totarraylength);
@@ -2118,36 +2118,36 @@ void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *val
void RNA_property_float_get_array_range(PointerRNA *ptr, PropertyRNA *prop, float values[2])
{
- const int array_len= RNA_property_array_length(ptr, prop);
+ const int array_len = RNA_property_array_length(ptr, prop);
- if(array_len <= 0) {
- values[0]= 0.0f;
- values[1]= 0.0f;
+ if (array_len <= 0) {
+ values[0] = 0.0f;
+ values[1] = 0.0f;
}
else if (array_len == 1) {
RNA_property_float_get_array(ptr, prop, values);
- values[1]= values[0];
+ values[1] = values[0];
}
else {
float arr_stack[32];
float *arr;
int i;
- if(array_len > 32) {
- arr= MEM_mallocN(sizeof(float) * array_len, "RNA_property_float_get_array_range");
+ if (array_len > 32) {
+ arr = MEM_mallocN(sizeof(float) * array_len, "RNA_property_float_get_array_range");
}
else {
- arr= arr_stack;
+ arr = arr_stack;
}
RNA_property_float_get_array(ptr, prop, arr);
- values[0]= values[1]= arr[0];
- for(i= 1; i < array_len; i++) {
- values[0]= MIN2(values[0], arr[i]);
- values[1]= MAX2(values[1], arr[i]);
+ values[0] = values[1] = arr[0];
+ for (i = 1; i < array_len; i++) {
+ values[0] = MIN2(values[0], arr[i]);
+ values[1] = MAX2(values[1], arr[i]);
}
- if(arr != arr_stack) {
+ if (arr != arr_stack) {
MEM_freeN(arr);
}
}
@@ -2156,21 +2156,21 @@ void RNA_property_float_get_array_range(PointerRNA *ptr, PropertyRNA *prop, floa
float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
{
float tmp[RNA_MAX_ARRAY_LENGTH];
- int len= rna_ensure_property_array_length(ptr, prop);
+ int len = rna_ensure_property_array_length(ptr, prop);
BLI_assert(RNA_property_type(prop) == PROP_FLOAT);
BLI_assert(RNA_property_array_check(prop) != 0);
- if(len <= RNA_MAX_ARRAY_LENGTH) {
+ if (len <= RNA_MAX_ARRAY_LENGTH) {
RNA_property_float_get_array(ptr, prop, tmp);
return tmp[index];
}
else {
float *tmparray, value;
- tmparray= MEM_callocN(sizeof(float)*len, "RNA_property_float_get_index");
+ tmparray = MEM_callocN(sizeof(float)*len, "RNA_property_float_get_index");
RNA_property_float_get_array(ptr, prop, tmparray);
- value= tmparray[index];
+ value = tmparray[index];
MEM_freeN(tmparray);
return value;
@@ -2180,45 +2180,45 @@ float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index
void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const float *values)
{
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
IDProperty *idprop;
int i;
BLI_assert(RNA_property_type(prop) == PROP_FLOAT);
BLI_assert(RNA_property_array_check(prop) != 0);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
- if(prop->arraydimension == 0) {
- if(idprop->type == IDP_FLOAT)
- IDP_Float(idprop)= values[0];
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ if (prop->arraydimension == 0) {
+ if (idprop->type == IDP_FLOAT)
+ IDP_Float(idprop) = values[0];
else
- IDP_Double(idprop)= values[0];
+ IDP_Double(idprop) = values[0];
}
- else if(idprop->subtype == IDP_FLOAT) {
+ else if (idprop->subtype == IDP_FLOAT) {
memcpy(IDP_Array(idprop), values, sizeof(float)*idprop->len);
}
else {
- for(i=0; i<idprop->len; i++)
- ((double*)IDP_Array(idprop))[i]= values[i];
+ for (i = 0; i<idprop->len; i++)
+ ((double*)IDP_Array(idprop))[i] = values[i];
}
rna_idproperty_touch(idprop);
}
- else if(prop->arraydimension == 0)
+ else if (prop->arraydimension == 0)
RNA_property_float_set(ptr, prop, values[0]);
- else if(fprop->setarray) {
+ else if (fprop->setarray) {
fprop->setarray(ptr, values);
}
- else if(prop->flag & PROP_EDITABLE) {
+ else if (prop->flag & PROP_EDITABLE) {
IDPropertyTemplate val = {0};
IDProperty *group;
- val.array.len= prop->totarraylength;
- val.array.type= IDP_FLOAT;
+ val.array.len = prop->totarraylength;
+ val.array.type = IDP_FLOAT;
- group= RNA_struct_idprops(ptr, 1);
- if(group) {
- idprop= IDP_New(IDP_ARRAY, &val, prop->identifier);
+ group = RNA_struct_idprops(ptr, 1);
+ if (group) {
+ idprop = IDP_New(IDP_ARRAY, &val, prop->identifier);
IDP_AddToGroup(group, idprop);
memcpy(IDP_Array(idprop), values, sizeof(float)*idprop->len);
}
@@ -2228,22 +2228,22 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa
void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, float value)
{
float tmp[RNA_MAX_ARRAY_LENGTH];
- int len= rna_ensure_property_array_length(ptr, prop);
+ int len = rna_ensure_property_array_length(ptr, prop);
BLI_assert(RNA_property_type(prop) == PROP_FLOAT);
BLI_assert(RNA_property_array_check(prop) != 0);
- if(len <= RNA_MAX_ARRAY_LENGTH) {
+ if (len <= RNA_MAX_ARRAY_LENGTH) {
RNA_property_float_get_array(ptr, prop, tmp);
- tmp[index]= value;
+ tmp[index] = value;
RNA_property_float_set_array(ptr, prop, tmp);
}
else {
float *tmparray;
- tmparray= MEM_callocN(sizeof(float)*len, "RNA_property_float_get_index");
+ tmparray = MEM_callocN(sizeof(float)*len, "RNA_property_float_get_index");
RNA_property_float_get_array(ptr, prop, tmparray);
- tmparray[index]= value;
+ tmparray[index] = value;
RNA_property_float_set_array(ptr, prop, tmparray);
MEM_freeN(tmparray);
}
@@ -2251,7 +2251,7 @@ void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index,
float RNA_property_float_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
{
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
BLI_assert(RNA_property_type(prop) == PROP_FLOAT);
BLI_assert(RNA_property_array_check(prop) == 0);
@@ -2261,14 +2261,14 @@ float RNA_property_float_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
void RNA_property_float_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, float *values)
{
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
BLI_assert(RNA_property_type(prop) == PROP_FLOAT);
BLI_assert(RNA_property_array_check(prop) != 0);
- if(prop->arraydimension == 0)
- values[0]= fprop->defaultvalue;
- else if(fprop->defaultarray)
+ if (prop->arraydimension == 0)
+ values[0] = fprop->defaultvalue;
+ else if (fprop->defaultarray)
memcpy(values, fprop->defaultarray, sizeof(float)*prop->totarraylength);
else
memset(values, 0, sizeof(float)*prop->totarraylength);
@@ -2277,21 +2277,21 @@ void RNA_property_float_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *
float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
{
float tmp[RNA_MAX_ARRAY_LENGTH];
- int len= rna_ensure_property_array_length(ptr, prop);
+ int len = rna_ensure_property_array_length(ptr, prop);
BLI_assert(RNA_property_type(prop) == PROP_FLOAT);
BLI_assert(RNA_property_array_check(prop) != 0);
- if(len <= RNA_MAX_ARRAY_LENGTH) {
+ if (len <= RNA_MAX_ARRAY_LENGTH) {
RNA_property_float_get_default_array(ptr, prop, tmp);
return tmp[index];
}
else {
float *tmparray, value;
- tmparray= MEM_callocN(sizeof(float)*len, "RNA_property_float_get_default_index");
+ tmparray = MEM_callocN(sizeof(float)*len, "RNA_property_float_get_default_index");
RNA_property_float_get_default_array(ptr, prop, tmparray);
- value= tmparray[index];
+ value = tmparray[index];
MEM_freeN(tmparray);
return value;
@@ -2300,23 +2300,23 @@ float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i
void RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop, char *value)
{
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_STRING);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
/* editing bytes is not 100% supported
* since they can contain NIL chars */
if (idprop->subtype == IDP_STRING_SUB_BYTE) {
memcpy(value, IDP_String(idprop), idprop->len);
- value[idprop->len]= '\0';
+ value[idprop->len] = '\0';
}
else {
memcpy(value, IDP_String(idprop), idprop->len);
}
}
- else if(sprop->get) {
+ else if (sprop->get) {
sprop->get(ptr, value);
}
else {
@@ -2332,16 +2332,16 @@ char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop,
BLI_assert(RNA_property_type(prop) == PROP_STRING);
- length= RNA_property_string_length(ptr, prop);
+ length = RNA_property_string_length(ptr, prop);
- if(length+1 < fixedlen)
- buf= fixedbuf;
+ if (length+1 < fixedlen)
+ buf = fixedbuf;
else
- buf= MEM_mallocN(sizeof(char)*(length+1), "RNA_string_get_alloc");
+ buf = MEM_mallocN(sizeof(char)*(length+1), "RNA_string_get_alloc");
#ifndef NDEBUG
/* safety check to ensure the string is actually set */
- buf[length]= 255;
+ buf[length] = 255;
#endif
RNA_property_string_get(ptr, prop, buf);
@@ -2351,7 +2351,7 @@ char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop,
#endif
if (r_len) {
- *r_len= length;
+ *r_len = length;
}
return buf;
@@ -2360,12 +2360,12 @@ char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop,
/* this is the length without \0 terminator */
int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop)
{
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_STRING);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
if (idprop->subtype == IDP_STRING_SUB_BYTE) {
return idprop->len;
}
@@ -2377,7 +2377,7 @@ int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop)
return idprop->len - 1;
}
}
- else if(sprop->length)
+ else if (sprop->length)
return sprop->length(ptr);
else
return strlen(sprop->defaultvalue);
@@ -2385,30 +2385,30 @@ int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
{
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_STRING);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
/* both IDP_STRING_SUB_BYTE / IDP_STRING_SUB_UTF8 */
IDP_AssignString(idprop, value, RNA_property_string_maxlength(prop) - 1);
rna_idproperty_touch(idprop);
}
- else if(sprop->set)
+ else if (sprop->set)
sprop->set(ptr, value); /* set function needs to clamp its self */
- else if(prop->flag & PROP_EDITABLE) {
+ else if (prop->flag & PROP_EDITABLE) {
IDProperty *group;
- group= RNA_struct_idprops(ptr, 1);
- if(group)
+ group = RNA_struct_idprops(ptr, 1);
+ if (group)
IDP_AddToGroup(group, IDP_NewString(value, prop->identifier, RNA_property_string_maxlength(prop) - 1));
}
}
void RNA_property_string_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop, char *value)
{
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
BLI_assert(RNA_property_type(prop) == PROP_STRING);
@@ -2422,12 +2422,12 @@ char *RNA_property_string_get_default_alloc(PointerRNA *ptr, PropertyRNA *prop,
BLI_assert(RNA_property_type(prop) == PROP_STRING);
- length= RNA_property_string_default_length(ptr, prop);
+ length = RNA_property_string_default_length(ptr, prop);
- if(length+1 < fixedlen)
- buf= fixedbuf;
+ if (length+1 < fixedlen)
+ buf = fixedbuf;
else
- buf= MEM_callocN(sizeof(char)*(length+1), "RNA_string_get_alloc");
+ buf = MEM_callocN(sizeof(char)*(length+1), "RNA_string_get_alloc");
RNA_property_string_get_default(ptr, prop, buf);
@@ -2437,7 +2437,7 @@ char *RNA_property_string_get_default_alloc(PointerRNA *ptr, PropertyRNA *prop,
/* this is the length without \0 terminator */
int RNA_property_string_default_length(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
{
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
BLI_assert(RNA_property_type(prop) == PROP_STRING);
@@ -2446,14 +2446,14 @@ int RNA_property_string_default_length(PointerRNA *UNUSED(ptr), PropertyRNA *pro
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
{
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_ENUM);
- if((idprop=rna_idproperty_check(&prop, ptr)))
+ if ((idprop = rna_idproperty_check(&prop, ptr)))
return IDP_Int(idprop);
- else if(eprop->get)
+ else if (eprop->get)
return eprop->get(ptr);
else
return eprop->defaultvalue;
@@ -2461,33 +2461,33 @@ int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
{
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_ENUM);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
- IDP_Int(idprop)= value;
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ IDP_Int(idprop) = value;
rna_idproperty_touch(idprop);
}
- else if(eprop->set) {
+ else if (eprop->set) {
eprop->set(ptr, value);
}
- else if(prop->flag & PROP_EDITABLE) {
+ else if (prop->flag & PROP_EDITABLE) {
IDPropertyTemplate val = {0};
IDProperty *group;
- val.i= value;
+ val.i = value;
- group= RNA_struct_idprops(ptr, 1);
- if(group)
+ group = RNA_struct_idprops(ptr, 1);
+ if (group)
IDP_AddToGroup(group, IDP_New(IDP_INT, &val, prop->identifier));
}
}
int RNA_property_enum_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
{
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
BLI_assert(RNA_property_type(prop) == PROP_ENUM);
@@ -2496,7 +2496,7 @@ int RNA_property_enum_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
void *RNA_property_enum_py_data_get(PropertyRNA *prop)
{
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
BLI_assert(RNA_property_type(prop) == PROP_ENUM);
@@ -2505,23 +2505,23 @@ void *RNA_property_enum_py_data_get(PropertyRNA *prop)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
{
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_POINTER);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
- pprop= (PointerPropertyRNA*)prop;
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ pprop = (PointerPropertyRNA*)prop;
/* for groups, data is idprop itself */
return rna_pointer_inherit_refine(ptr, pprop->type, idprop);
}
- else if(pprop->get) {
+ else if (pprop->get) {
return pprop->get(ptr);
}
- else if(prop->flag & PROP_IDPROPERTY) {
+ else if (prop->flag & PROP_IDPROPERTY) {
/* XXX temporary hack to add it automatically, reading should
- never do any write ops, to ensure thread safety etc .. */
+ * never do any write ops, to ensure thread safety etc .. */
RNA_property_pointer_add(ptr, prop);
return RNA_property_pointer_get(ptr, prop);
}
@@ -2536,14 +2536,14 @@ void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr
BLI_assert(RNA_property_type(prop) == PROP_POINTER);
- if((/*idprop=*/ rna_idproperty_check(&prop, ptr))) {
+ if ((/*idprop=*/ rna_idproperty_check(&prop, ptr))) {
/* not supported */
/* rna_idproperty_touch(idprop); */
}
else {
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
- if( pprop->set &&
+ if ( pprop->set &&
!((prop->flag & PROP_NEVER_NULL) && ptr_value.data == NULL) &&
!((prop->flag & PROP_ID_SELF_CHECK) && ptr->id.data == ptr_value.id.data)
) {
@@ -2554,11 +2554,11 @@ void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr
PointerRNA RNA_property_pointer_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop))
{
- //PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ /*PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop; */
- // BLI_assert(RNA_property_type(prop) == PROP_POINTER);
+ /* BLI_assert(RNA_property_type(prop) == PROP_POINTER); */
- return PointerRNA_NULL; // FIXME: there has to be a way...
+ return PointerRNA_NULL; /* FIXME: there has to be a way... */
}
void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop)
@@ -2567,17 +2567,17 @@ void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop)
BLI_assert(RNA_property_type(prop) == PROP_POINTER);
- if((/*idprop=*/rna_idproperty_check(&prop, ptr))) {
+ if ((/*idprop=*/rna_idproperty_check(&prop, ptr))) {
/* already exists */
}
- else if(prop->flag & PROP_IDPROPERTY) {
+ else if (prop->flag & PROP_IDPROPERTY) {
IDPropertyTemplate val = {0};
IDProperty *group;
- val.i= 0;
+ val.i = 0;
- group= RNA_struct_idprops(ptr, 1);
- if(group)
+ group = RNA_struct_idprops(ptr, 1);
+ if (group)
IDP_AddToGroup(group, IDP_New(IDP_GROUP, &val, prop->identifier));
}
else
@@ -2590,10 +2590,10 @@ void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop)
BLI_assert(RNA_property_type(prop) == PROP_POINTER);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
- group= RNA_struct_idprops(ptr, 0);
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ group = RNA_struct_idprops(ptr, 0);
- if(group) {
+ if (group) {
IDP_RemFromGroup(group, idprop);
IDP_FreeProperty(idprop);
MEM_freeN(idprop);
@@ -2605,10 +2605,10 @@ void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop)
static void rna_property_collection_get_idp(CollectionPropertyIterator *iter)
{
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)iter->prop;
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)iter->prop;
- iter->ptr.data= rna_iterator_array_get(iter);
- iter->ptr.type= cprop->item_type;
+ iter->ptr.data = rna_iterator_array_get(iter);
+ iter->ptr.type = cprop->item_type;
rna_pointer_inherit_id(cprop->item_type, &iter->parent, &iter->ptr);
}
@@ -2620,34 +2620,34 @@ void RNA_property_collection_begin(PointerRNA *ptr, PropertyRNA *prop, Collectio
memset(iter, 0, sizeof(*iter));
- if((idprop=rna_idproperty_check(&prop, ptr)) || (prop->flag & PROP_IDPROPERTY)) {
- iter->parent= *ptr;
- iter->prop= prop;
+ if ((idprop = rna_idproperty_check(&prop, ptr)) || (prop->flag & PROP_IDPROPERTY)) {
+ iter->parent = *ptr;
+ iter->prop = prop;
- if(idprop)
+ if (idprop)
rna_iterator_array_begin(iter, IDP_IDPArray(idprop), sizeof(IDProperty), idprop->len, 0, NULL);
else
rna_iterator_array_begin(iter, NULL, sizeof(IDProperty), 0, 0, NULL);
- if(iter->valid)
+ if (iter->valid)
rna_property_collection_get_idp(iter);
- iter->idprop= 1;
+ iter->idprop = 1;
}
else {
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
cprop->begin(iter, ptr);
}
}
void RNA_property_collection_next(CollectionPropertyIterator *iter)
{
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)rna_ensure_property(iter->prop);
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)rna_ensure_property(iter->prop);
- if(iter->idprop) {
+ if (iter->idprop) {
rna_iterator_array_next(iter);
- if(iter->valid)
+ if (iter->valid)
rna_property_collection_get_idp(iter);
}
else
@@ -2656,9 +2656,9 @@ void RNA_property_collection_next(CollectionPropertyIterator *iter)
void RNA_property_collection_end(CollectionPropertyIterator *iter)
{
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)rna_ensure_property(iter->prop);
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)rna_ensure_property(iter->prop);
- if(iter->idprop)
+ if (iter->idprop)
rna_iterator_array_end(iter);
else
cprop->end(iter);
@@ -2666,23 +2666,23 @@ void RNA_property_collection_end(CollectionPropertyIterator *iter)
int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
{
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
IDProperty *idprop;
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
return idprop->len;
}
- else if(cprop->length) {
+ else if (cprop->length) {
return cprop->length(ptr);
}
else {
CollectionPropertyIterator iter;
- int length= 0;
+ int length = 0;
RNA_property_collection_begin(ptr, prop, &iter);
- for(; iter.valid; RNA_property_collection_next(&iter))
+ for (; iter.valid; RNA_property_collection_next(&iter))
length++;
RNA_property_collection_end(&iter);
@@ -2693,39 +2693,39 @@ int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr)
{
IDProperty *idprop;
-// CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+/* CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; */
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
IDPropertyTemplate val = {0};
IDProperty *item;
- item= IDP_New(IDP_GROUP, &val, "");
+ item = IDP_New(IDP_GROUP, &val, "");
IDP_AppendArray(idprop, item);
- // IDP_FreeProperty(item); // IDP_AppendArray does a shallow copy (memcpy), only free memory
+ /* IDP_FreeProperty(item); *//* IDP_AppendArray does a shallow copy (memcpy), only free memory */
MEM_freeN(item);
}
- else if(prop->flag & PROP_IDPROPERTY) {
+ else if (prop->flag & PROP_IDPROPERTY) {
IDProperty *group, *item;
IDPropertyTemplate val = {0};
- group= RNA_struct_idprops(ptr, 1);
- if(group) {
- idprop= IDP_NewIDPArray(prop->identifier);
+ group = RNA_struct_idprops(ptr, 1);
+ if (group) {
+ idprop = IDP_NewIDPArray(prop->identifier);
IDP_AddToGroup(group, idprop);
- item= IDP_New(IDP_GROUP, &val, "");
+ item = IDP_New(IDP_GROUP, &val, "");
IDP_AppendArray(idprop, item);
- // IDP_FreeProperty(item); // IDP_AppendArray does a shallow copy (memcpy), only free memory
+ /* IDP_FreeProperty(item); *//* IDP_AppendArray does a shallow copy (memcpy), only free memory */
MEM_freeN(item);
}
}
/* py api calls directly */
#if 0
- else if(cprop->add){
- if(!(cprop->add->flag & FUNC_USE_CONTEXT)) { /* XXX check for this somewhere else */
+ else if (cprop->add){
+ if (!(cprop->add->flag & FUNC_USE_CONTEXT)) { /* XXX check for this somewhere else */
ParameterList params;
RNA_parameter_list_create(&params, ptr, cprop->add);
RNA_function_call(NULL, NULL, ptr, cprop->add, &params);
@@ -2736,12 +2736,12 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA
printf("%s %s.%s: not implemented for this property.\n", __func__, ptr->type->identifier, prop->identifier);*/
#endif
- if(r_ptr) {
- if(idprop) {
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+ if (r_ptr) {
+ if (idprop) {
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
- r_ptr->data= IDP_GetIndexArray(idprop, idprop->len-1);
- r_ptr->type= cprop->item_type;
+ r_ptr->data = IDP_GetIndexArray(idprop, idprop->len-1);
+ r_ptr->type = cprop->item_type;
rna_pointer_inherit_id(NULL, ptr, r_ptr);
}
else
@@ -2752,19 +2752,19 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA
int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key)
{
IDProperty *idprop;
-// CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+/* CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; */
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
IDProperty tmp, *array;
int len;
- len= idprop->len;
- array= IDP_IDPArray(idprop);
+ len = idprop->len;
+ array = IDP_IDPArray(idprop);
- if(key >= 0 && key < len) {
- if(key+1 < len) {
+ if (key >= 0 && key < len) {
+ if (key+1 < len) {
/* move element to be removed to the back */
memcpy(&tmp, &array[key], sizeof(IDProperty));
memmove(array+key, array+key+1, sizeof(IDProperty)*(len-(key+1)));
@@ -2776,13 +2776,13 @@ int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key)
return 1;
}
- else if(prop->flag & PROP_IDPROPERTY)
+ else if (prop->flag & PROP_IDPROPERTY)
return 1;
/* py api calls directly */
#if 0
- else if(cprop->remove){
- if(!(cprop->remove->flag & FUNC_USE_CONTEXT)) { /* XXX check for this somewhere else */
+ else if (cprop->remove){
+ if (!(cprop->remove->flag & FUNC_USE_CONTEXT)) { /* XXX check for this somewhere else */
ParameterList params;
RNA_parameter_list_create(&params, ptr, cprop->remove);
RNA_function_call(NULL, NULL, ptr, cprop->remove, &params);
@@ -2803,16 +2803,16 @@ int RNA_property_collection_move(PointerRNA *ptr, PropertyRNA *prop, int key, in
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
- if((idprop=rna_idproperty_check(&prop, ptr))) {
+ if ((idprop = rna_idproperty_check(&prop, ptr))) {
IDProperty tmp, *array;
int len;
- len= idprop->len;
- array= IDP_IDPArray(idprop);
+ len = idprop->len;
+ array = IDP_IDPArray(idprop);
- if(key >= 0 && key < len && pos >= 0 && pos < len && key != pos) {
+ if (key >= 0 && key < len && pos >= 0 && pos < len && key != pos) {
memcpy(&tmp, &array[key], sizeof(IDProperty));
- if(pos < key)
+ if (pos < key)
memmove(array+pos+1, array+pos, sizeof(IDProperty)*(key - pos));
else
memmove(array+key, array+key+1, sizeof(IDProperty)*(pos - key));
@@ -2821,7 +2821,7 @@ int RNA_property_collection_move(PointerRNA *ptr, PropertyRNA *prop, int key, in
return 1;
}
- else if(prop->flag & PROP_IDPROPERTY)
+ else if (prop->flag & PROP_IDPROPERTY)
return 1;
return 0;
@@ -2833,19 +2833,19 @@ void RNA_property_collection_clear(PointerRNA *ptr, PropertyRNA *prop)
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
- if((idprop=rna_idproperty_check(&prop, ptr)))
+ if ((idprop = rna_idproperty_check(&prop, ptr)))
IDP_ResizeIDPArray(idprop, 0);
}
int RNA_property_collection_lookup_index(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *t_ptr)
{
CollectionPropertyIterator iter;
- int index= 0;
+ int index = 0;
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
RNA_property_collection_begin(ptr, prop, &iter);
- for(index=0; iter.valid; RNA_property_collection_next(&iter), index++) {
+ for (index = 0; iter.valid; RNA_property_collection_next(&iter), index++) {
if (iter.ptr.data == t_ptr->data)
break;
}
@@ -2860,11 +2860,11 @@ int RNA_property_collection_lookup_index(PointerRNA *ptr, PropertyRNA *prop, Poi
int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr)
{
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)rna_ensure_property(prop);
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)rna_ensure_property(prop);
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
- if(cprop->lookupint) {
+ if (cprop->lookupint) {
/* we have a callback defined, use it */
return cprop->lookupint(ptr, key, r_ptr);
}
@@ -2874,15 +2874,15 @@ int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int k
int i;
RNA_property_collection_begin(ptr, prop, &iter);
- for(i=0; iter.valid; RNA_property_collection_next(&iter), i++) {
- if(i == key) {
- *r_ptr= iter.ptr;
+ for (i = 0; iter.valid; RNA_property_collection_next(&iter), i++) {
+ if (i == key) {
+ *r_ptr = iter.ptr;
break;
}
}
RNA_property_collection_end(&iter);
- if(!iter.valid)
+ if (!iter.valid)
memset(r_ptr, 0, sizeof(*r_ptr));
return iter.valid;
@@ -2891,11 +2891,11 @@ int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int k
int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr)
{
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)rna_ensure_property(prop);
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)rna_ensure_property(prop);
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
- if(cprop->lookupstring) {
+ if (cprop->lookupstring) {
/* we have a callback defined, use it */
return cprop->lookupstring(ptr, key, r_ptr);
}
@@ -2904,32 +2904,32 @@ int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, co
CollectionPropertyIterator iter;
PropertyRNA *nameprop;
char name[256], *nameptr;
- int found= 0;
- int keylen= strlen(key);
+ int found = 0;
+ int keylen = strlen(key);
int namelen;
RNA_property_collection_begin(ptr, prop, &iter);
- for(; iter.valid; RNA_property_collection_next(&iter)) {
- if(iter.ptr.data && iter.ptr.type->nameproperty) {
- nameprop= iter.ptr.type->nameproperty;
+ for (; iter.valid; RNA_property_collection_next(&iter)) {
+ if (iter.ptr.data && iter.ptr.type->nameproperty) {
+ nameprop = iter.ptr.type->nameproperty;
- nameptr= RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name), &namelen);
+ nameptr = RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name), &namelen);
- if((keylen == namelen) && (strcmp(nameptr, key) == 0)) {
- *r_ptr= iter.ptr;
- found= 1;
+ if ((keylen == namelen) && (strcmp(nameptr, key) == 0)) {
+ *r_ptr = iter.ptr;
+ found = 1;
}
- if((char *)&name != nameptr)
+ if ((char *)&name != nameptr)
MEM_freeN(nameptr);
- if(found)
+ if (found)
break;
}
}
RNA_property_collection_end(&iter);
- if(!iter.valid)
+ if (!iter.valid)
memset(r_ptr, 0, sizeof(*r_ptr));
return iter.valid;
@@ -2939,11 +2939,11 @@ int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, co
/* zero return is an assignment error */
int RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const int key, const PointerRNA *assign_ptr)
{
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)rna_ensure_property(prop);
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)rna_ensure_property(prop);
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
- if(cprop->assignint) {
+ if (cprop->assignint) {
/* we have a callback defined, use it */
return cprop->assignint(ptr, key, assign_ptr);
}
@@ -2955,7 +2955,7 @@ int RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, Pointer
{
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
- *r_ptr= *ptr;
+ *r_ptr = *ptr;
return ((r_ptr->type = rna_ensure_property(prop)->srna) ? 1:0);
}
@@ -2967,26 +2967,26 @@ int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, Proper
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
- if(!(prop->flag & PROP_RAW_ARRAY) || !(itemprop->flag & PROP_RAW_ACCESS))
+ if (!(prop->flag & PROP_RAW_ARRAY) || !(itemprop->flag & PROP_RAW_ACCESS))
return 0;
RNA_property_collection_begin(ptr, prop, &iter);
- if(iter.valid) {
+ if (iter.valid) {
/* get data from array iterator and item property */
- internal= iter.internal;
- arrayp= (iter.valid)? iter.ptr.data: NULL;
+ internal = iter.internal;
+ arrayp = (iter.valid)? iter.ptr.data: NULL;
- if(internal->skip || !RNA_property_editable(&iter.ptr, itemprop)) {
+ if (internal->skip || !RNA_property_editable(&iter.ptr, itemprop)) {
/* we might skip some items, so it's not a proper array */
RNA_property_collection_end(&iter);
return 0;
}
- array->array= arrayp + itemprop->rawoffset;
- array->stride= internal->itemsize;
- array->len= ((char*)internal->endptr - arrayp)/internal->itemsize;
- array->type= itemprop->rawtype;
+ array->array = arrayp + itemprop->rawoffset;
+ array->stride = internal->itemsize;
+ array->len = ((char*)internal->endptr - arrayp)/internal->itemsize;
+ array->type = itemprop->rawtype;
}
else
memset(array, 0, sizeof(RawArray));
@@ -2998,7 +2998,7 @@ int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, Proper
#define RAW_GET(dtype, var, raw, a) \
{ \
- switch(raw.type) { \
+ switch (raw.type) { \
case PROP_RAW_CHAR: var = (dtype)((char*)raw.array)[a]; break; \
case PROP_RAW_SHORT: var = (dtype)((short*)raw.array)[a]; break; \
case PROP_RAW_INT: var = (dtype)((int*)raw.array)[a]; break; \
@@ -3010,7 +3010,7 @@ int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, Proper
#define RAW_SET(dtype, raw, a, var) \
{ \
- switch(raw.type) { \
+ switch (raw.type) { \
case PROP_RAW_CHAR: ((char*)raw.array)[a] = (char)var; break; \
case PROP_RAW_SHORT: ((short*)raw.array)[a] = (short)var; break; \
case PROP_RAW_INT: ((int*)raw.array)[a] = (int)var; break; \
@@ -3022,7 +3022,7 @@ int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, Proper
int RNA_raw_type_sizeof(RawPropertyType type)
{
- switch(type) {
+ switch (type) {
case PROP_RAW_CHAR: return sizeof(char);
case PROP_RAW_SHORT: return sizeof(short);
case PROP_RAW_INT: return sizeof(int);
@@ -3037,59 +3037,59 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
StructRNA *ptype;
PointerRNA itemptr;
PropertyRNA *itemprop, *iprop;
- PropertyType itemtype=0;
+ PropertyType itemtype = 0;
RawArray in;
- int itemlen= 0;
+ int itemlen = 0;
/* initialize in array, stride assumed 0 in following code */
- in.array= inarray;
- in.type= intype;
- in.len= inlen;
- in.stride= 0;
+ in.array = inarray;
+ in.type = intype;
+ in.len = inlen;
+ in.stride = 0;
- ptype= RNA_property_pointer_type(ptr, prop);
+ ptype = RNA_property_pointer_type(ptr, prop);
/* try to get item property pointer */
RNA_pointer_create(NULL, ptype, NULL, &itemptr);
- itemprop= RNA_struct_find_property(&itemptr, propname);
+ itemprop = RNA_struct_find_property(&itemptr, propname);
- if(itemprop) {
+ if (itemprop) {
/* we have item property pointer */
RawArray out;
/* check type */
- itemtype= RNA_property_type(itemprop);
+ itemtype = RNA_property_type(itemprop);
- if(!ELEM3(itemtype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
+ if (!ELEM3(itemtype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
BKE_report(reports, RPT_ERROR, "Only boolean, int and float properties supported");
return 0;
}
/* check item array */
- itemlen= RNA_property_array_length(&itemptr, itemprop);
+ itemlen = RNA_property_array_length(&itemptr, itemprop);
/* try to access as raw array */
- if(RNA_property_collection_raw_array(ptr, prop, itemprop, &out)) {
+ if (RNA_property_collection_raw_array(ptr, prop, itemprop, &out)) {
int arraylen = (itemlen == 0) ? 1 : itemlen;
- if(in.len != arraylen*out.len) {
+ if (in.len != arraylen*out.len) {
BKE_reportf(reports, RPT_ERROR, "Array length mismatch (expected %d, got %d)", out.len*arraylen, in.len);
return 0;
}
/* matching raw types */
- if(out.type == in.type) {
- void *inp= in.array;
- void *outp= out.array;
+ if (out.type == in.type) {
+ void *inp = in.array;
+ void *outp = out.array;
int a, size;
- size= RNA_raw_type_sizeof(out.type) * arraylen;
+ size = RNA_raw_type_sizeof(out.type) * arraylen;
- for(a=0; a<out.len; a++) {
- if(set) memcpy(outp, inp, size);
+ for (a = 0; a<out.len; a++) {
+ if (set) memcpy(outp, inp, size);
else memcpy(inp, outp, size);
- inp= (char*)inp + size;
- outp= (char*)outp + out.stride;
+ inp = (char*)inp + size;
+ outp = (char*)outp + out.stride;
}
return 1;
@@ -3101,9 +3101,9 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
}
{
- void *tmparray= NULL;
- int tmplen= 0;
- int err= 0, j, a= 0;
+ void *tmparray = NULL;
+ int tmplen = 0;
+ int err = 0, j, a = 0;
int needconv = 1;
if (((itemtype == PROP_BOOLEAN || itemtype == PROP_INT) && in.type == PROP_RAW_INT) ||
@@ -3114,44 +3114,44 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
/* no item property pointer, can still be id property, or
* property of a type derived from the collection pointer type */
RNA_PROP_BEGIN(ptr, itemptr, prop) {
- if(itemptr.data) {
- if(itemprop) {
+ if (itemptr.data) {
+ if (itemprop) {
/* we got the property already */
- iprop= itemprop;
+ iprop = itemprop;
}
else {
/* not yet, look it up and verify if it is valid */
- iprop= RNA_struct_find_property(&itemptr, propname);
+ iprop = RNA_struct_find_property(&itemptr, propname);
- if(iprop) {
- itemlen= RNA_property_array_length(&itemptr, iprop);
- itemtype= RNA_property_type(iprop);
+ if (iprop) {
+ itemlen = RNA_property_array_length(&itemptr, iprop);
+ itemtype = RNA_property_type(iprop);
}
else {
BKE_reportf(reports, RPT_ERROR, "Property named %s not found", propname);
- err= 1;
+ err = 1;
break;
}
- if(!ELEM3(itemtype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
+ if (!ELEM3(itemtype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
BKE_report(reports, RPT_ERROR, "Only boolean, int and float properties supported");
- err= 1;
+ err = 1;
break;
}
}
/* editable check */
- if(!set || RNA_property_editable(&itemptr, iprop)) {
- if(a+itemlen > in.len) {
+ if (!set || RNA_property_editable(&itemptr, iprop)) {
+ if (a+itemlen > in.len) {
BKE_reportf(reports, RPT_ERROR, "Array length mismatch (got %d, expected more)", in.len);
- err= 1;
+ err = 1;
break;
}
- if(itemlen == 0) {
+ if (itemlen == 0) {
/* handle conversions */
- if(set) {
- switch(itemtype) {
+ if (set) {
+ switch (itemtype) {
case PROP_BOOLEAN: {
int b;
RAW_GET(int, b, in, a);
@@ -3175,19 +3175,19 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
}
}
else {
- switch(itemtype) {
+ switch (itemtype) {
case PROP_BOOLEAN: {
- int b= RNA_property_boolean_get(&itemptr, iprop);
+ int b = RNA_property_boolean_get(&itemptr, iprop);
RAW_SET(int, in, a, b);
break;
}
case PROP_INT: {
- int i= RNA_property_int_get(&itemptr, iprop);
+ int i = RNA_property_int_get(&itemptr, iprop);
RAW_SET(int, in, a, i);
break;
}
case PROP_FLOAT: {
- float f= RNA_property_float_get(&itemptr, iprop);
+ float f = RNA_property_float_get(&itemptr, iprop);
RAW_SET(float, in, a, f);
break;
}
@@ -3199,32 +3199,32 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
}
else if (needconv == 1) {
/* allocate temporary array if needed */
- if(tmparray && tmplen != itemlen) {
+ if (tmparray && tmplen != itemlen) {
MEM_freeN(tmparray);
- tmparray= NULL;
+ tmparray = NULL;
}
- if(!tmparray) {
- tmparray= MEM_callocN(sizeof(float)*itemlen, "RNA tmparray\n");
- tmplen= itemlen;
+ if (!tmparray) {
+ tmparray = MEM_callocN(sizeof(float)*itemlen, "RNA tmparray\n");
+ tmplen = itemlen;
}
/* handle conversions */
- if(set) {
- switch(itemtype) {
+ if (set) {
+ switch (itemtype) {
case PROP_BOOLEAN: {
- for(j=0; j<itemlen; j++, a++)
+ for (j = 0; j<itemlen; j++, a++)
RAW_GET(int, ((int*)tmparray)[j], in, a);
RNA_property_boolean_set_array(&itemptr, iprop, tmparray);
break;
}
case PROP_INT: {
- for(j=0; j<itemlen; j++, a++)
+ for (j = 0; j<itemlen; j++, a++)
RAW_GET(int, ((int*)tmparray)[j], in, a);
RNA_property_int_set_array(&itemptr, iprop, tmparray);
break;
}
case PROP_FLOAT: {
- for(j=0; j<itemlen; j++, a++)
+ for (j = 0; j<itemlen; j++, a++)
RAW_GET(float, ((float*)tmparray)[j], in, a);
RNA_property_float_set_array(&itemptr, iprop, tmparray);
break;
@@ -3234,22 +3234,22 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
}
}
else {
- switch(itemtype) {
+ switch (itemtype) {
case PROP_BOOLEAN: {
RNA_property_boolean_get_array(&itemptr, iprop, tmparray);
- for(j=0; j<itemlen; j++, a++)
+ for (j = 0; j<itemlen; j++, a++)
RAW_SET(int, in, a, ((int*)tmparray)[j]);
break;
}
case PROP_INT: {
RNA_property_int_get_array(&itemptr, iprop, tmparray);
- for(j=0; j<itemlen; j++, a++)
+ for (j = 0; j<itemlen; j++, a++)
RAW_SET(int, in, a, ((int*)tmparray)[j]);
break;
}
case PROP_FLOAT: {
RNA_property_float_get_array(&itemptr, iprop, tmparray);
- for(j=0; j<itemlen; j++, a++)
+ for (j = 0; j<itemlen; j++, a++)
RAW_SET(float, in, a, ((float*)tmparray)[j]);
break;
}
@@ -3259,8 +3259,8 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
}
}
else {
- if(set) {
- switch(itemtype) {
+ if (set) {
+ switch (itemtype) {
case PROP_BOOLEAN: {
RNA_property_boolean_set_array(&itemptr, iprop, &((int*)in.array)[a]);
a += itemlen;
@@ -3281,7 +3281,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
}
}
else {
- switch(itemtype) {
+ switch (itemtype) {
case PROP_BOOLEAN: {
RNA_property_boolean_get_array(&itemptr, iprop, &((int*)in.array)[a]);
a += itemlen;
@@ -3307,7 +3307,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
}
RNA_PROP_END;
- if(tmparray)
+ if (tmparray)
MEM_freeN(tmparray);
return !err;
@@ -3350,36 +3350,36 @@ void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb,
{
ListBaseIterator *internal;
- internal= MEM_callocN(sizeof(ListBaseIterator), "ListBaseIterator");
- internal->link= (lb)? lb->first: NULL;
- internal->skip= skip;
+ internal = MEM_callocN(sizeof(ListBaseIterator), "ListBaseIterator");
+ internal->link = (lb)? lb->first: NULL;
+ internal->skip = skip;
- iter->internal= internal;
- iter->valid= (internal->link != NULL);
+ iter->internal = internal;
+ iter->valid = (internal->link != NULL);
- if(skip && iter->valid && skip(iter, internal->link))
+ if (skip && iter->valid && skip(iter, internal->link))
rna_iterator_listbase_next(iter);
}
void rna_iterator_listbase_next(CollectionPropertyIterator *iter)
{
- ListBaseIterator *internal= iter->internal;
+ ListBaseIterator *internal = iter->internal;
- if(internal->skip) {
+ if (internal->skip) {
do {
- internal->link= internal->link->next;
- iter->valid= (internal->link != NULL);
- } while(iter->valid && internal->skip(iter, internal->link));
+ internal->link = internal->link->next;
+ iter->valid = (internal->link != NULL);
+ } while (iter->valid && internal->skip(iter, internal->link));
}
else {
- internal->link= internal->link->next;
- iter->valid= (internal->link != NULL);
+ internal->link = internal->link->next;
+ iter->valid = (internal->link != NULL);
}
}
void *rna_iterator_listbase_get(CollectionPropertyIterator *iter)
{
- ListBaseIterator *internal= iter->internal;
+ ListBaseIterator *internal = iter->internal;
return internal->link;
}
@@ -3387,12 +3387,12 @@ void *rna_iterator_listbase_get(CollectionPropertyIterator *iter)
void rna_iterator_listbase_end(CollectionPropertyIterator *iter)
{
MEM_freeN(iter->internal);
- iter->internal= NULL;
+ iter->internal = NULL;
}
PointerRNA rna_listbase_lookup_int(PointerRNA *ptr, StructRNA *type, struct ListBase *lb, int index)
{
- void *data= BLI_findlink(lb, index);
+ void *data = BLI_findlink(lb, index);
return rna_pointer_inherit_refine(ptr, type, data);
}
@@ -3400,54 +3400,54 @@ void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int i
{
ArrayIterator *internal;
- if(ptr == NULL)
- length= 0;
+ if (ptr == NULL)
+ length = 0;
else if (length == 0) {
- ptr= NULL;
- itemsize= 0;
+ ptr = NULL;
+ itemsize = 0;
}
- internal= MEM_callocN(sizeof(ArrayIterator), "ArrayIterator");
- internal->ptr= ptr;
- internal->free_ptr= free_ptr ? ptr:NULL;
- internal->endptr= ((char*)ptr)+length*itemsize;
- internal->itemsize= itemsize;
- internal->skip= skip;
- internal->length= length;
+ internal = MEM_callocN(sizeof(ArrayIterator), "ArrayIterator");
+ internal->ptr = ptr;
+ internal->free_ptr = free_ptr ? ptr:NULL;
+ internal->endptr = ((char*)ptr)+length*itemsize;
+ internal->itemsize = itemsize;
+ internal->skip = skip;
+ internal->length = length;
- iter->internal= internal;
- iter->valid= (internal->ptr != internal->endptr);
+ iter->internal = internal;
+ iter->valid = (internal->ptr != internal->endptr);
- if(skip && iter->valid && skip(iter, internal->ptr))
+ if (skip && iter->valid && skip(iter, internal->ptr))
rna_iterator_array_next(iter);
}
void rna_iterator_array_next(CollectionPropertyIterator *iter)
{
- ArrayIterator *internal= iter->internal;
+ ArrayIterator *internal = iter->internal;
- if(internal->skip) {
+ if (internal->skip) {
do {
internal->ptr += internal->itemsize;
- iter->valid= (internal->ptr != internal->endptr);
- } while(iter->valid && internal->skip(iter, internal->ptr));
+ iter->valid = (internal->ptr != internal->endptr);
+ } while (iter->valid && internal->skip(iter, internal->ptr));
}
else {
internal->ptr += internal->itemsize;
- iter->valid= (internal->ptr != internal->endptr);
+ iter->valid = (internal->ptr != internal->endptr);
}
}
void *rna_iterator_array_get(CollectionPropertyIterator *iter)
{
- ArrayIterator *internal= iter->internal;
+ ArrayIterator *internal = iter->internal;
return internal->ptr;
}
void *rna_iterator_array_dereference_get(CollectionPropertyIterator *iter)
{
- ArrayIterator *internal= iter->internal;
+ ArrayIterator *internal = iter->internal;
/* for ** arrays */
return *(void**)(internal->ptr);
@@ -3455,19 +3455,19 @@ void *rna_iterator_array_dereference_get(CollectionPropertyIterator *iter)
void rna_iterator_array_end(CollectionPropertyIterator *iter)
{
- ArrayIterator *internal= iter->internal;
+ ArrayIterator *internal = iter->internal;
- if(internal->free_ptr) {
+ if (internal->free_ptr) {
MEM_freeN(internal->free_ptr);
- internal->free_ptr= NULL;
+ internal->free_ptr = NULL;
}
MEM_freeN(iter->internal);
- iter->internal= NULL;
+ iter->internal = NULL;
}
PointerRNA rna_array_lookup_int(PointerRNA *ptr, StructRNA *type, void *data, int itemsize, int length, int index)
{
- if(index < 0 || index >= length)
+ if (index < 0 || index >= length)
return PointerRNA_NULL;
return rna_pointer_inherit_refine(ptr, type, ((char*)data) + index*itemsize);
@@ -3479,37 +3479,37 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int
{
const char *p;
char *buf;
- char quote= '\0';
+ char quote = '\0';
int i, j, len, escape;
- len= 0;
+ len = 0;
- if(bracket) {
+ if (bracket) {
/* get data between [], check escaping ] with \] */
- if(**path == '[') (*path)++;
+ if (**path == '[') (*path)++;
else return NULL;
- p= *path;
+ p = *path;
/* 2 kinds of lookups now, quoted or unquoted */
- quote= *p;
+ quote = *p;
- if(quote != '"') /* " - this comment is hack for Aligorith's text editor's sanity */
- quote= 0;
+ if (quote != '"') /* " - this comment is hack for Aligorith's text editor's sanity */
+ quote = 0;
- if(quote==0) {
- while(*p && (*p != ']')) {
+ if (quote == 0) {
+ while (*p && (*p != ']')) {
len++;
p++;
}
}
else {
- escape= 0;
+ escape = 0;
/* skip the first quote */
len++;
p++;
- while(*p && (*p != quote || escape)) {
- escape= (*p == '\\');
+ while (*p && (*p != quote || escape)) {
+ escape = (*p == '\\');
len++;
p++;
}
@@ -3519,57 +3519,57 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int
p++;
}
- if(*p != ']') return NULL;
+ if (*p != ']') return NULL;
}
else {
/* get data until . or [ */
- p= *path;
+ p = *path;
- while(*p && *p != '.' && *p != '[') {
+ while (*p && *p != '.' && *p != '[') {
len++;
p++;
}
}
/* empty, return */
- if(len == 0)
+ if (len == 0)
return NULL;
/* try to use fixed buffer if possible */
- if(len+1 < fixedlen)
- buf= fixedbuf;
+ if (len+1 < fixedlen)
+ buf = fixedbuf;
else
- buf= MEM_callocN(sizeof(char)*(len+1), "rna_path_token");
+ buf = MEM_callocN(sizeof(char)*(len+1), "rna_path_token");
/* copy string, taking into account escaped ] */
- if(bracket) {
- for(p=*path, i=0, j=0; i<len; i++, p++) {
- if(*p == '\\' && *(p+1) == quote);
- else buf[j++]= *p;
+ if (bracket) {
+ for (p = *path, i = 0, j = 0; i<len; i++, p++) {
+ if (*p == '\\' && *(p+1) == quote);
+ else buf[j++] = *p;
}
- buf[j]= 0;
+ buf[j] = 0;
}
else {
memcpy(buf, *path, sizeof(char)*len);
- buf[len]= '\0';
+ buf[len] = '\0';
}
/* set path to start of next token */
- if(*p == ']') p++;
- if(*p == '.') p++;
- *path= p;
+ if (*p == ']') p++;
+ if (*p == '.') p++;
+ *path = p;
return buf;
}
static int rna_token_strip_quotes(char *token)
{
- if(token[0]=='"') {
+ if (token[0] =='"') {
int len = strlen(token);
- if (len >= 2 && token[len-1]=='"') {
+ if (len >= 2 && token[len-1] =='"') {
/* strip away "" */
- token[len-1]= '\0';
+ token[len-1] = '\0';
return 1;
}
}
@@ -3589,80 +3589,80 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr,
char fixedbuf[256], *token;
int type, intkey;
- prop= NULL;
- curptr= *ptr;
+ prop = NULL;
+ curptr = *ptr;
- if(path==NULL || *path=='\0')
+ if (path == NULL || *path =='\0')
return 0;
- while(*path) {
- int use_id_prop = (*path=='[') ? 1:0;
+ while (*path) {
+ int use_id_prop = (*path =='[') ? 1:0;
/* custom property lookup ?
* C.object["someprop"]
*/
/* look up property name in current struct */
- token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), use_id_prop);
+ token = rna_path_token(&path, fixedbuf, sizeof(fixedbuf), use_id_prop);
- if(!token)
+ if (!token)
return 0;
- if(use_id_prop) { /* look up property name in current struct */
- IDProperty *group= RNA_struct_idprops(&curptr, 0);
- if(group && rna_token_strip_quotes(token))
- prop= (PropertyRNA *)IDP_GetPropertyFromGroup(group, token+1);
+ if (use_id_prop) { /* look up property name in current struct */
+ IDProperty *group = RNA_struct_idprops(&curptr, 0);
+ if (group && rna_token_strip_quotes(token))
+ prop = (PropertyRNA *)IDP_GetPropertyFromGroup(group, token+1);
}
else {
- prop= RNA_struct_find_property(&curptr, token);
+ prop = RNA_struct_find_property(&curptr, token);
}
- if(token != fixedbuf)
+ if (token != fixedbuf)
MEM_freeN(token);
- if(!prop)
+ if (!prop)
return 0;
- type= RNA_property_type(prop);
+ type = RNA_property_type(prop);
/* now look up the value of this property if it is a pointer or
* collection, otherwise return the property rna so that the
* caller can read the value of the property itself */
switch (type) {
case PROP_POINTER:
- nextptr= RNA_property_pointer_get(&curptr, prop);
+ nextptr = RNA_property_pointer_get(&curptr, prop);
- if(nextptr.data) {
- curptr= nextptr;
- prop= NULL; /* now we have a PointerRNA, the prop is our parent so forget it */
- if(index) *index= -1;
+ if (nextptr.data) {
+ curptr = nextptr;
+ prop = NULL; /* now we have a PointerRNA, the prop is our parent so forget it */
+ if (index) *index = -1;
}
else
return 0;
break;
case PROP_COLLECTION:
- if(*path) {
- if(*path == '[') {
+ if (*path) {
+ if (*path == '[') {
/* resolve the lookup with [] brackets */
- token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 1);
+ token = rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 1);
- if(!token)
+ if (!token)
return 0;
/* check for "" to see if it is a string */
- if(rna_token_strip_quotes(token)) {
+ if (rna_token_strip_quotes(token)) {
RNA_property_collection_lookup_string(&curptr, prop, token+1, &nextptr);
}
else {
/* otherwise do int lookup */
- intkey= atoi(token);
- if(intkey==0 && (token[0] != '0' || token[1] != '\0')) {
+ intkey = atoi(token);
+ if (intkey == 0 && (token[0] != '0' || token[1] != '\0')) {
return 0; /* we can be sure the fixedbuf was used in this case */
}
RNA_property_collection_lookup_int(&curptr, prop, intkey, &nextptr);
}
- if(token != fixedbuf) {
+ if (token != fixedbuf) {
MEM_freeN(token);
}
}
@@ -3672,15 +3672,15 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr,
/* ensure we quit on invalid values */
nextptr.data = NULL;
- if(RNA_property_collection_type_get(&curptr, prop, &c_ptr)) {
- nextptr= c_ptr;
+ if (RNA_property_collection_type_get(&curptr, prop, &c_ptr)) {
+ nextptr = c_ptr;
}
}
- if(nextptr.data) {
- curptr= nextptr;
- prop= NULL; /* now we have a PointerRNA, the prop is our parent so forget it */
- if(index) *index= -1;
+ if (nextptr.data) {
+ curptr = nextptr;
+ prop = NULL; /* now we have a PointerRNA, the prop is our parent so forget it */
+ if (index) *index = -1;
}
else
return 0;
@@ -3688,38 +3688,38 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr,
break;
default:
- if (index==NULL)
+ if (index == NULL)
break;
- *index= -1;
+ *index = -1;
if (*path) {
- int index_arr[RNA_MAX_ARRAY_DIMENSION]= {0};
+ int index_arr[RNA_MAX_ARRAY_DIMENSION] = {0};
int len[RNA_MAX_ARRAY_DIMENSION];
- const int dim= RNA_property_array_dimension(&curptr, prop, len);
+ const int dim = RNA_property_array_dimension(&curptr, prop, len);
int i, temp_index;
- for(i=0; i<dim; i++) {
- temp_index= -1;
+ for (i = 0; i<dim; i++) {
+ temp_index = -1;
/* multi index resolve */
- if (*path=='[') {
- token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 1);
+ if (*path =='[') {
+ token = rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 1);
- if(token==NULL) {
+ if (token == NULL) {
/* invalid syntax blah[] */
return 0;
}
/* check for "" to see if it is a string */
- else if(rna_token_strip_quotes(token)) {
- temp_index= RNA_property_array_item_index(prop, *(token+1));
+ else if (rna_token_strip_quotes(token)) {
+ temp_index = RNA_property_array_item_index(prop, *(token+1));
}
else {
/* otherwise do int lookup */
- temp_index= atoi(token);
+ temp_index = atoi(token);
- if(temp_index==0 && (token[0] != '0' || token[1] != '\0')) {
- if(token != fixedbuf) {
+ if (temp_index == 0 && (token[0] != '0' || token[1] != '\0')) {
+ if (token != fixedbuf) {
MEM_freeN(token);
}
@@ -3727,49 +3727,49 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr,
}
}
}
- else if(dim==1) {
+ else if (dim == 1) {
/* location.x || scale.X, single dimension arrays only */
- token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 0);
- if(token==NULL) {
+ token = rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 0);
+ if (token == NULL) {
/* invalid syntax blah.. */
return 0;
}
- temp_index= RNA_property_array_item_index(prop, *token);
+ temp_index = RNA_property_array_item_index(prop, *token);
}
- if(token != fixedbuf) {
+ if (token != fixedbuf) {
MEM_freeN(token);
}
/* out of range */
- if(temp_index < 0 || temp_index >= len[i])
+ if (temp_index < 0 || temp_index >= len[i])
return 0;
- index_arr[i]= temp_index;
+ index_arr[i] = temp_index;
/* end multi index resolve */
}
/* arrays always contain numbers so further values are not valid */
- if(*path) {
+ if (*path) {
return 0;
}
else {
- int totdim= 1;
- int flat_index= 0;
+ int totdim = 1;
+ int flat_index = 0;
- for(i=dim-1; i>=0; i--) {
+ for (i = dim-1; i >= 0; i--) {
flat_index += index_arr[i] * totdim;
totdim *= len[i];
}
- *index= flat_index;
+ *index = flat_index;
}
}
}
}
- *r_ptr= curptr;
- *r_prop= prop;
+ *r_ptr = curptr;
+ *r_prop = prop;
return 1;
}
@@ -3781,32 +3781,32 @@ char *RNA_path_append(const char *path, PointerRNA *UNUSED(ptr), PropertyRNA *pr
const char *s;
char appendstr[128], *result;
- dynstr= BLI_dynstr_new();
+ dynstr = BLI_dynstr_new();
/* add .identifier */
- if(path) {
+ if (path) {
BLI_dynstr_append(dynstr, (char*)path);
- if(*path)
+ if (*path)
BLI_dynstr_append(dynstr, ".");
}
BLI_dynstr_append(dynstr, RNA_property_identifier(prop));
- if(RNA_property_type(prop) == PROP_COLLECTION) {
+ if (RNA_property_type(prop) == PROP_COLLECTION) {
/* add ["strkey"] or [intkey] */
BLI_dynstr_append(dynstr, "[");
- if(strkey) {
+ if (strkey) {
BLI_dynstr_append(dynstr, "\"");
- for(s=strkey; *s; s++) {
- if(*s == '[') {
- appendstr[0]= '\\';
- appendstr[1]= *s;
- appendstr[2]= 0;
+ for (s = strkey; *s; s++) {
+ if (*s == '[') {
+ appendstr[0] = '\\';
+ appendstr[1] = *s;
+ appendstr[2] = 0;
}
else {
- appendstr[0]= *s;
- appendstr[1]= 0;
+ appendstr[0] = *s;
+ appendstr[1] = 0;
}
BLI_dynstr_append(dynstr, appendstr);
}
@@ -3820,7 +3820,7 @@ char *RNA_path_append(const char *path, PointerRNA *UNUSED(ptr), PropertyRNA *pr
BLI_dynstr_append(dynstr, "]");
}
- result= BLI_dynstr_get_cstring(dynstr);
+ result = BLI_dynstr_get_cstring(dynstr);
BLI_dynstr_free(dynstr);
return result;
@@ -3833,42 +3833,42 @@ char *RNA_path_back(const char *path)
char *result, *token;
int i;
- if(!path)
+ if (!path)
return NULL;
- previous= NULL;
- current= path;
+ previous = NULL;
+ current = path;
/* parse token by token until the end, then we back up to the previous
* position and strip of the next token to get the path one step back */
- while(*current) {
- token= rna_path_token(&current, fixedbuf, sizeof(fixedbuf), 0);
+ while (*current) {
+ token = rna_path_token(&current, fixedbuf, sizeof(fixedbuf), 0);
- if(!token)
+ if (!token)
return NULL;
- if(token != fixedbuf)
+ if (token != fixedbuf)
MEM_freeN(token);
/* in case of collection we also need to strip off [] */
- token= rna_path_token(&current, fixedbuf, sizeof(fixedbuf), 1);
- if(token && token != fixedbuf)
+ token = rna_path_token(&current, fixedbuf, sizeof(fixedbuf), 1);
+ if (token && token != fixedbuf)
MEM_freeN(token);
- if(!*current)
+ if (!*current)
break;
- previous= current;
+ previous = current;
}
- if(!previous)
+ if (!previous)
return NULL;
/* copy and strip off last token */
- i= previous - path;
- result= BLI_strdup(path);
+ i = previous - path;
+ result = BLI_strdup(path);
- if(i > 0 && result[i-1] == '.') i--;
- result[i]= 0;
+ if (i > 0 && result[i-1] == '.') i--;
+ result[i] = 0;
return result;
}
@@ -3885,42 +3885,42 @@ typedef struct IDP_Chain {
static char *rna_idp_path_create(IDP_Chain *child_link)
{
- DynStr *dynstr= BLI_dynstr_new();
+ DynStr *dynstr = BLI_dynstr_new();
char *path;
- short first= TRUE;
+ short first = TRUE;
- int tot= 0;
- IDP_Chain *link= child_link;
+ int tot = 0;
+ IDP_Chain *link = child_link;
/* reverse the list */
IDP_Chain *link_prev;
- link_prev= NULL;
- while(link) {
- IDP_Chain *link_next= link->up;
- link->up= link_prev;
- link_prev= link;
- link= link_next;
+ link_prev = NULL;
+ while (link) {
+ IDP_Chain *link_next = link->up;
+ link->up = link_prev;
+ link_prev = link;
+ link = link_next;
tot++;
}
- for(link= link_prev; link; link= link->up) {
+ for (link = link_prev; link; link = link->up) {
/* pass */
- if(link->index >= 0) {
+ if (link->index >= 0) {
BLI_dynstr_appendf(dynstr, first ? "%s[%d]" : ".%s[%d]", link->name, link->index);
}
else {
BLI_dynstr_appendf(dynstr, first ? "%s" : ".%s", link->name);
}
- first= FALSE;
+ first = FALSE;
}
- path= BLI_dynstr_get_cstring(dynstr);
+ path = BLI_dynstr_get_cstring(dynstr);
BLI_dynstr_free(dynstr);
- if(*path=='\0') {
+ if (*path =='\0') {
MEM_freeN(path);
- path= NULL;
+ path = NULL;
}
return path;
@@ -3928,7 +3928,7 @@ static char *rna_idp_path_create(IDP_Chain *child_link)
static char *rna_idp_path(PointerRNA *ptr, IDProperty *haystack, IDProperty *needle, IDP_Chain *parent_link)
{
- char *path= NULL;
+ char *path = NULL;
IDP_Chain link;
IDProperty *iter;
@@ -3936,50 +3936,50 @@ static char *rna_idp_path(PointerRNA *ptr, IDProperty *haystack, IDProperty *nee
BLI_assert(haystack->type == IDP_GROUP);
- link.up= parent_link;
- link.name= NULL;
- link.index= -1;
+ link.up = parent_link;
+ link.name = NULL;
+ link.index = -1;
- for (i=0, iter= haystack->data.group.first; iter; iter= iter->next, i++) {
- if(needle == iter) { /* found! */
- link.name= iter->name;
- path= rna_idp_path_create(&link);
+ for (i = 0, iter = haystack->data.group.first; iter; iter = iter->next, i++) {
+ if (needle == iter) { /* found! */
+ link.name = iter->name;
+ path = rna_idp_path_create(&link);
break;
}
else {
- if(iter->type == IDP_GROUP) {
+ if (iter->type == IDP_GROUP) {
/* ensure this is RNA */
- PointerRNA child_ptr= RNA_pointer_get(ptr, iter->name);
- if(child_ptr.type) {
- link.name= iter->name;
- if((path= rna_idp_path(&child_ptr, iter, needle, &link))) {
+ PointerRNA child_ptr = RNA_pointer_get(ptr, iter->name);
+ if (child_ptr.type) {
+ link.name = iter->name;
+ if ((path = rna_idp_path(&child_ptr, iter, needle, &link))) {
break;
}
}
}
else if (iter->type == IDP_IDPARRAY) {
- PropertyRNA *prop= RNA_struct_find_property(ptr, iter->name);
- if(prop && prop->type == PROP_COLLECTION) {
- IDProperty *array= IDP_IDPArray(iter);
- if(needle >= array && needle < (iter->len + array)) { /* found! */
- link.name= iter->name;
- link.index= (int)(needle - array);
- path= rna_idp_path_create(&link);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, iter->name);
+ if (prop && prop->type == PROP_COLLECTION) {
+ IDProperty *array = IDP_IDPArray(iter);
+ if (needle >= array && needle < (iter->len + array)) { /* found! */
+ link.name = iter->name;
+ link.index = (int)(needle - array);
+ path = rna_idp_path_create(&link);
break;
}
else {
int i;
- link.name= iter->name;
- for(i= 0; i < iter->len; i++, array++) {
+ link.name = iter->name;
+ for (i = 0; i < iter->len; i++, array++) {
PointerRNA child_ptr;
- if(RNA_property_collection_lookup_int(ptr, prop, i, &child_ptr)) {
- link.index= i;
- if((path= rna_idp_path(&child_ptr, array, needle, &link))) {
+ if (RNA_property_collection_lookup_int(ptr, prop, i, &child_ptr)) {
+ link.index = i;
+ if ((path = rna_idp_path(&child_ptr, array, needle, &link))) {
break;
}
}
}
- if(path)
+ if (path)
break;
}
}
@@ -4002,9 +4002,9 @@ static char *rna_path_from_ID_to_idpgroup(PointerRNA *ptr)
* unless this is added only way to find this is to also search all bones and pose bones of an armature or object */
RNA_id_pointer_create(ptr->id.data, &id_ptr);
- haystack= RNA_struct_idprops(&id_ptr, FALSE);
- if(haystack) { /* can fail when called on bones */
- needle= ptr->data;
+ haystack = RNA_struct_idprops(&id_ptr, FALSE);
+ if (haystack) { /* can fail when called on bones */
+ needle = ptr->data;
return rna_idp_path(&id_ptr, haystack, needle, NULL);
}
else {
@@ -4014,17 +4014,17 @@ static char *rna_path_from_ID_to_idpgroup(PointerRNA *ptr)
char *RNA_path_from_ID_to_struct(PointerRNA *ptr)
{
- char *ptrpath=NULL;
+ char *ptrpath = NULL;
- if(!ptr->id.data || !ptr->data)
+ if (!ptr->id.data || !ptr->data)
return NULL;
- if(!RNA_struct_is_ID(ptr->type)) {
- if(ptr->type->path) {
+ if (!RNA_struct_is_ID(ptr->type)) {
+ if (ptr->type->path) {
/* if type has a path to some ID, use it */
- ptrpath= ptr->type->path(ptr);
+ ptrpath = ptr->type->path(ptr);
}
- else if(ptr->type->nested && RNA_struct_is_ID(ptr->type->nested)) {
+ else if (ptr->type->nested && RNA_struct_is_ID(ptr->type->nested)) {
PointerRNA parentptr;
PropertyRNA *userprop;
@@ -4032,12 +4032,12 @@ char *RNA_path_from_ID_to_struct(PointerRNA *ptr)
* use its identifier as the first part of the path used...
*/
RNA_id_pointer_create(ptr->id.data, &parentptr);
- userprop= RNA_struct_find_nested(&parentptr, ptr->type);
+ userprop = RNA_struct_find_nested(&parentptr, ptr->type);
- if(userprop)
- ptrpath= BLI_strdup(RNA_property_identifier(userprop));
+ if (userprop)
+ ptrpath = BLI_strdup(RNA_property_identifier(userprop));
else
- return NULL; // can't do anything about this case yet...
+ return NULL; /* can't do anything about this case yet... */
}
else if (RNA_struct_is_a(ptr->type, &RNA_PropertyGroup)) {
/* special case, easier to deal with here then in ptr->type->path() */
@@ -4056,23 +4056,23 @@ char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop)
const char *propname;
char *ptrpath, *path;
- if(!ptr->id.data || !ptr->data || !prop)
+ if (!ptr->id.data || !ptr->data || !prop)
return NULL;
/* path from ID to the struct holding this property */
- ptrpath= RNA_path_from_ID_to_struct(ptr);
+ ptrpath = RNA_path_from_ID_to_struct(ptr);
- propname= RNA_property_identifier(prop);
+ propname = RNA_property_identifier(prop);
- if(ptrpath) {
- path= BLI_sprintfN(is_rna ? "%s.%s":"%s[\"%s\"]", ptrpath, propname);
+ if (ptrpath) {
+ path = BLI_sprintfN(is_rna ? "%s.%s":"%s[\"%s\"]", ptrpath, propname);
MEM_freeN(ptrpath);
}
else {
- if(is_rna)
- path= BLI_strdup(propname);
+ if (is_rna)
+ path = BLI_strdup(propname);
else
- path= BLI_sprintfN("[\"%s\"]", propname);
+ path = BLI_sprintfN("[\"%s\"]", propname);
}
return path;
@@ -4082,9 +4082,9 @@ char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop)
int RNA_boolean_get(PointerRNA *ptr, const char *name)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop) {
+ if (prop) {
return RNA_property_boolean_get(ptr, prop);
}
else {
@@ -4095,9 +4095,9 @@ int RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_boolean_set(PointerRNA *ptr, const char *name, int value)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_boolean_set(ptr, prop, value);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4105,9 +4105,9 @@ void RNA_boolean_set(PointerRNA *ptr, const char *name, int value)
void RNA_boolean_get_array(PointerRNA *ptr, const char *name, int *values)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_boolean_get_array(ptr, prop, values);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4115,9 +4115,9 @@ void RNA_boolean_get_array(PointerRNA *ptr, const char *name, int *values)
void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const int *values)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_boolean_set_array(ptr, prop, values);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4125,9 +4125,9 @@ void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const int *values)
int RNA_int_get(PointerRNA *ptr, const char *name)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop) {
+ if (prop) {
return RNA_property_int_get(ptr, prop);
}
else {
@@ -4138,9 +4138,9 @@ int RNA_int_get(PointerRNA *ptr, const char *name)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_int_set(ptr, prop, value);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4148,9 +4148,9 @@ void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_int_get_array(ptr, prop, values);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4158,9 +4158,9 @@ void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_int_set_array(ptr, prop, values);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4168,9 +4168,9 @@ void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
float RNA_float_get(PointerRNA *ptr, const char *name)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop) {
+ if (prop) {
return RNA_property_float_get(ptr, prop);
}
else {
@@ -4181,9 +4181,9 @@ float RNA_float_get(PointerRNA *ptr, const char *name)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_float_set(ptr, prop, value);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4191,9 +4191,9 @@ void RNA_float_set(PointerRNA *ptr, const char *name, float value)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_float_get_array(ptr, prop, values);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4201,9 +4201,9 @@ void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_float_set_array(ptr, prop, values);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4211,9 +4211,9 @@ void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
int RNA_enum_get(PointerRNA *ptr, const char *name)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop) {
+ if (prop) {
return RNA_property_enum_get(ptr, prop);
}
else {
@@ -4224,9 +4224,9 @@ int RNA_enum_get(PointerRNA *ptr, const char *name)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_enum_set(ptr, prop, value);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4234,11 +4234,11 @@ void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
void RNA_enum_set_identifier(PointerRNA *ptr, const char *name, const char *id)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop) {
+ if (prop) {
int value;
- if(RNA_property_enum_value(NULL, ptr, prop, id, &value))
+ if (RNA_property_enum_value(NULL, ptr, prop, id, &value))
RNA_property_enum_set(ptr, prop, value);
else
printf("%s: %s.%s has no enum id '%s'.\n", __func__, ptr->type->identifier, name, id);
@@ -4250,18 +4250,18 @@ void RNA_enum_set_identifier(PointerRNA *ptr, const char *name, const char *id)
int RNA_enum_is_equal(bContext *C, PointerRNA *ptr, const char *name, const char *enumname)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
EnumPropertyItem *item;
int free;
- if(prop) {
+ if (prop) {
RNA_property_enum_items(C, ptr, prop, &item, NULL, &free);
- for(; item->identifier; item++)
- if(strcmp(item->identifier, enumname) == 0)
+ for (; item->identifier; item++)
+ if (strcmp(item->identifier, enumname) == 0)
return (item->value == RNA_property_enum_get(ptr, prop));
- if(free)
+ if (free)
MEM_freeN(item);
printf("%s: %s.%s item %s not found.\n", __func__, ptr->type->identifier, name, enumname);
@@ -4275,9 +4275,9 @@ int RNA_enum_is_equal(bContext *C, PointerRNA *ptr, const char *name, const char
int RNA_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int *value)
{
- for( ; item->identifier; item++) {
- if(strcmp(item->identifier, identifier)==0) {
- *value= item->value;
+ for ( ; item->identifier; item++) {
+ if (strcmp(item->identifier, identifier) == 0) {
+ *value = item->value;
return 1;
}
}
@@ -4287,9 +4287,9 @@ int RNA_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int *
int RNA_enum_id_from_value(EnumPropertyItem *item, int value, const char **identifier)
{
- for( ; item->identifier; item++) {
- if(item->value==value) {
- *identifier= item->identifier;
+ for ( ; item->identifier; item++) {
+ if (item->value == value) {
+ *identifier = item->identifier;
return 1;
}
}
@@ -4299,8 +4299,8 @@ int RNA_enum_id_from_value(EnumPropertyItem *item, int value, const char **ident
int RNA_enum_icon_from_value(EnumPropertyItem *item, int value, int *icon)
{
- for( ; item->identifier; item++) {
- if(item->value==value) {
+ for ( ; item->identifier; item++) {
+ if (item->value == value) {
*icon = item->icon;
return 1;
}
@@ -4311,22 +4311,22 @@ int RNA_enum_icon_from_value(EnumPropertyItem *item, int value, int *icon)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop) {
+ if (prop) {
RNA_property_string_get(ptr, prop, value);
}
else {
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
- value[0]= '\0';
+ value[0] = '\0';
}
}
char *RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop) {
+ if (prop) {
return RNA_property_string_get_alloc(ptr, prop, fixedbuf, fixedlen, NULL); /* TODO, pass length */
}
else {
@@ -4337,9 +4337,9 @@ char *RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, in
int RNA_string_length(PointerRNA *ptr, const char *name)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop) {
+ if (prop) {
return RNA_property_string_length(ptr, prop);
}
else {
@@ -4350,9 +4350,9 @@ int RNA_string_length(PointerRNA *ptr, const char *name)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_string_set(ptr, prop, value);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4360,9 +4360,9 @@ void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop) {
+ if (prop) {
return RNA_property_pointer_get(ptr, prop);
}
else {
@@ -4374,9 +4374,9 @@ PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
void RNA_pointer_set(PointerRNA *ptr, const char *name, PointerRNA ptr_value)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop) {
+ if (prop) {
RNA_property_pointer_set(ptr, prop, ptr_value);
}
else {
@@ -4386,9 +4386,9 @@ void RNA_pointer_set(PointerRNA *ptr, const char *name, PointerRNA ptr_value)
void RNA_pointer_add(PointerRNA *ptr, const char *name)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_pointer_add(ptr, prop);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4396,9 +4396,9 @@ void RNA_pointer_add(PointerRNA *ptr, const char *name)
void RNA_collection_begin(PointerRNA *ptr, const char *name, CollectionPropertyIterator *iter)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_collection_begin(ptr, prop, iter);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4406,9 +4406,9 @@ void RNA_collection_begin(PointerRNA *ptr, const char *name, CollectionPropertyI
void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_collection_add(ptr, prop, r_value);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4416,9 +4416,9 @@ void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
void RNA_collection_clear(PointerRNA *ptr, const char *name)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop)
+ if (prop)
RNA_property_collection_clear(ptr, prop);
else
printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -4426,9 +4426,9 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name)
int RNA_collection_length(PointerRNA *ptr, const char *name)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, name);
- if(prop) {
+ if (prop) {
return RNA_property_collection_length(ptr, prop);
}
else {
@@ -4439,7 +4439,7 @@ int RNA_collection_length(PointerRNA *ptr, const char *name)
int RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
{
- if(prop->flag & PROP_IDPROPERTY) {
+ if (prop->flag & PROP_IDPROPERTY) {
IDProperty *idprop = rna_idproperty_find(ptr, prop->identifier);
return ((idprop != NULL) && !(idprop->flag & IDP_FLAG_GHOST));
}
@@ -4450,9 +4450,9 @@ int RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
int RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, identifier);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, identifier);
- if(prop) {
+ if (prop) {
return RNA_property_is_set(ptr, prop);
}
else {
@@ -4464,7 +4464,7 @@ int RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
int RNA_property_is_idprop(PropertyRNA *prop)
{
- return (prop->magic!=RNA_MAGIC);
+ return (prop->magic != RNA_MAGIC);
}
/* string representation of a property, python
@@ -4472,7 +4472,7 @@ int RNA_property_is_idprop(PropertyRNA *prop)
* context may be NULL */
char *RNA_pointer_as_string(bContext *C, PointerRNA *ptr)
{
- DynStr *dynstr= BLI_dynstr_new();
+ DynStr *dynstr = BLI_dynstr_new();
char *cstring;
const char *propname;
@@ -4483,12 +4483,12 @@ char *RNA_pointer_as_string(bContext *C, PointerRNA *ptr)
RNA_STRUCT_BEGIN(ptr, prop) {
propname = RNA_property_identifier(prop);
- if(strcmp(propname, "rna_type")==0)
+ if (strcmp(propname, "rna_type") == 0)
continue;
- if(first_time==0)
+ if (first_time == 0)
BLI_dynstr_append(dynstr, ", ");
- first_time= 0;
+ first_time = 0;
cstring = RNA_property_as_string(C, ptr, prop);
BLI_dynstr_appendf(dynstr, "\"%s\":%s", propname, cstring);
@@ -4510,50 +4510,50 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
int len = RNA_property_array_length(ptr, prop);
int i;
- DynStr *dynstr= BLI_dynstr_new();
+ DynStr *dynstr = BLI_dynstr_new();
char *cstring;
/* see if we can coorce into a python type - PropertyType */
switch (type) {
case PROP_BOOLEAN:
- if(len==0) {
+ if (len == 0) {
BLI_dynstr_append(dynstr, RNA_property_boolean_get(ptr, prop) ? "True" : "False");
}
else {
BLI_dynstr_append(dynstr, "(");
- for(i=0; i<len; i++) {
+ for (i = 0; i<len; i++) {
BLI_dynstr_appendf(dynstr, i?", %s":"%s", RNA_property_boolean_get_index(ptr, prop, i) ? "True" : "False");
}
- if(len==1)
+ if (len == 1)
BLI_dynstr_append(dynstr, ","); /* otherwise python wont see it as a tuple */
BLI_dynstr_append(dynstr, ")");
}
break;
case PROP_INT:
- if(len==0) {
+ if (len == 0) {
BLI_dynstr_appendf(dynstr, "%d", RNA_property_int_get(ptr, prop));
}
else {
BLI_dynstr_append(dynstr, "(");
- for(i=0; i<len; i++) {
+ for (i = 0; i<len; i++) {
BLI_dynstr_appendf(dynstr, i?", %d":"%d", RNA_property_int_get_index(ptr, prop, i));
}
- if(len==1)
+ if (len == 1)
BLI_dynstr_append(dynstr, ","); /* otherwise python wont see it as a tuple */
BLI_dynstr_append(dynstr, ")");
}
break;
case PROP_FLOAT:
- if(len==0) {
+ if (len == 0) {
BLI_dynstr_appendf(dynstr, "%g", RNA_property_float_get(ptr, prop));
}
else {
BLI_dynstr_append(dynstr, "(");
- for(i=0; i<len; i++) {
+ for (i = 0; i<len; i++) {
BLI_dynstr_appendf(dynstr, i?", %g":"%g", RNA_property_float_get_index(ptr, prop, i));
}
- if(len==1)
+ if (len == 1)
BLI_dynstr_append(dynstr, ","); /* otherwise python wont see it as a tuple */
BLI_dynstr_append(dynstr, ")");
}
@@ -4564,9 +4564,9 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
char *buf;
int length;
- length= RNA_property_string_length(ptr, prop);
- buf= MEM_mallocN(sizeof(char)*(length+1), "RNA_property_as_string");
- buf_esc= MEM_mallocN(sizeof(char)*(length*2+1), "RNA_property_as_string esc");
+ length = RNA_property_string_length(ptr, prop);
+ buf = MEM_mallocN(sizeof(char)*(length+1), "RNA_property_as_string");
+ buf_esc = MEM_mallocN(sizeof(char)*(length*2+1), "RNA_property_as_string esc");
RNA_property_string_get(ptr, prop, buf);
BLI_strescape(buf_esc, buf, length*2+1);
MEM_freeN(buf);
@@ -4580,31 +4580,31 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
const char *identifier;
int val = RNA_property_enum_get(ptr, prop);
- if(RNA_property_flag(prop) & PROP_ENUM_FLAG) {
+ if (RNA_property_flag(prop) & PROP_ENUM_FLAG) {
/* represent as a python set */
- EnumPropertyItem *item= NULL;
+ EnumPropertyItem *item = NULL;
int free;
BLI_dynstr_append(dynstr, "{");
RNA_property_enum_items(C, ptr, prop, &item, NULL, &free);
- if(item) {
- short is_first= TRUE;
+ if (item) {
+ short is_first = TRUE;
for (; item->identifier; item++) {
- if(item->identifier[0] && item->value & val) {
+ if (item->identifier[0] && item->value & val) {
BLI_dynstr_appendf(dynstr, is_first ? "'%s'" : ", '%s'", item->identifier);
- is_first= FALSE;
+ is_first = FALSE;
}
}
- if(free) {
+ if (free) {
MEM_freeN(item);
}
}
BLI_dynstr_append(dynstr, "}");
}
- else if(RNA_property_enum_identifier(C, ptr, prop, val, &identifier)) {
+ else if (RNA_property_enum_identifier(C, ptr, prop, val, &identifier)) {
BLI_dynstr_appendf(dynstr, "'%s'", identifier);
}
else {
@@ -4614,8 +4614,8 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
}
case PROP_POINTER:
{
- PointerRNA tptr= RNA_property_pointer_get(ptr, prop);
- cstring= RNA_pointer_as_string(C, &tptr);
+ PointerRNA tptr = RNA_property_pointer_get(ptr, prop);
+ cstring = RNA_pointer_as_string(C, &tptr);
BLI_dynstr_append(dynstr, cstring);
MEM_freeN(cstring);
break;
@@ -4626,15 +4626,15 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
CollectionPropertyIterator collect_iter;
BLI_dynstr_append(dynstr, "[");
- for(RNA_property_collection_begin(ptr, prop, &collect_iter); collect_iter.valid; RNA_property_collection_next(&collect_iter)) {
- PointerRNA itemptr= collect_iter.ptr;
+ for (RNA_property_collection_begin(ptr, prop, &collect_iter); collect_iter.valid; RNA_property_collection_next(&collect_iter)) {
+ PointerRNA itemptr = collect_iter.ptr;
- if(first_time==0)
+ if (first_time == 0)
BLI_dynstr_append(dynstr, ", ");
- first_time= 0;
+ first_time = 0;
/* now get every prop of the collection */
- cstring= RNA_pointer_as_string(C, &itemptr);
+ cstring = RNA_pointer_as_string(C, &itemptr);
BLI_dynstr_append(dynstr, cstring);
MEM_freeN(cstring);
}
@@ -4696,58 +4696,58 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *UNUSE
{
PropertyRNA *parm;
void *data;
- int alloc_size= 0, size;
+ int alloc_size = 0, size;
- parms->arg_count= 0;
- parms->ret_count= 0;
+ parms->arg_count = 0;
+ parms->ret_count = 0;
/* allocate data */
- for(parm= func->cont.properties.first; parm; parm= parm->next) {
+ for (parm = func->cont.properties.first; parm; parm = parm->next) {
alloc_size += rna_parameter_size_alloc(parm);
- if(parm->flag & PROP_OUTPUT)
+ if (parm->flag & PROP_OUTPUT)
parms->ret_count++;
else
parms->arg_count++;
}
- parms->data= MEM_callocN(alloc_size, "RNA_parameter_list_create");
- parms->func= func;
- parms->alloc_size= alloc_size;
+ parms->data = MEM_callocN(alloc_size, "RNA_parameter_list_create");
+ parms->func = func;
+ parms->alloc_size = alloc_size;
/* set default values */
- data= parms->data;
+ data = parms->data;
- for(parm= func->cont.properties.first; parm; parm= parm->next) {
- size= rna_parameter_size(parm);
+ for (parm = func->cont.properties.first; parm; parm = parm->next) {
+ size = rna_parameter_size(parm);
/* set length to 0, these need to be set later, see bpy_array.c's py_to_array */
if (parm->flag & PROP_DYNAMIC) {
- ParameterDynAlloc *data_alloc= data;
- data_alloc->array_tot= 0;
- data_alloc->array= NULL;
+ ParameterDynAlloc *data_alloc = data;
+ data_alloc->array_tot = 0;
+ data_alloc->array = NULL;
}
- if(!(parm->flag & PROP_REQUIRED) && !(parm->flag & PROP_DYNAMIC)) {
- switch(parm->type) {
+ if (!(parm->flag & PROP_REQUIRED) && !(parm->flag & PROP_DYNAMIC)) {
+ switch (parm->type) {
case PROP_BOOLEAN:
- if(parm->arraydimension) memcpy(data, ((BoolPropertyRNA*)parm)->defaultarray, size);
+ if (parm->arraydimension) memcpy(data, ((BoolPropertyRNA*)parm)->defaultarray, size);
else memcpy(data, &((BoolPropertyRNA*)parm)->defaultvalue, size);
break;
case PROP_INT:
- if(parm->arraydimension) memcpy(data, ((IntPropertyRNA*)parm)->defaultarray, size);
+ if (parm->arraydimension) memcpy(data, ((IntPropertyRNA*)parm)->defaultarray, size);
else memcpy(data, &((IntPropertyRNA*)parm)->defaultvalue, size);
break;
case PROP_FLOAT:
- if(parm->arraydimension) memcpy(data, ((FloatPropertyRNA*)parm)->defaultarray, size);
+ if (parm->arraydimension) memcpy(data, ((FloatPropertyRNA*)parm)->defaultarray, size);
else memcpy(data, &((FloatPropertyRNA*)parm)->defaultvalue, size);
break;
case PROP_ENUM:
memcpy(data, &((EnumPropertyRNA*)parm)->defaultvalue, size);
break;
case PROP_STRING: {
- const char *defvalue= ((StringPropertyRNA*)parm)->defaultvalue;
- if(defvalue && defvalue[0]) {
+ const char *defvalue = ((StringPropertyRNA*)parm)->defaultvalue;
+ if (defvalue && defvalue[0]) {
/* causes bug [#29988], possibly this is only correct for thick wrapped
* need to look further into it - campbell */
#if 0
@@ -4764,7 +4764,7 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *UNUSE
}
}
- data= ((char*)data) + rna_parameter_size_alloc(parm);
+ data = ((char*)data) + rna_parameter_size_alloc(parm);
}
return parms;
@@ -4775,24 +4775,24 @@ void RNA_parameter_list_free(ParameterList *parms)
PropertyRNA *parm;
int tot;
- parm= parms->func->cont.properties.first;
- for(tot= 0; parm; parm= parm->next) {
- if(parm->type == PROP_COLLECTION)
+ parm = parms->func->cont.properties.first;
+ for (tot = 0; parm; parm = parm->next) {
+ if (parm->type == PROP_COLLECTION)
BLI_freelistN((ListBase*)((char*)parms->data+tot));
else if (parm->flag & PROP_DYNAMIC) {
/* for dynamic arrays and strings, data is a pointer to an array */
- ParameterDynAlloc *data_alloc= (void *)(((char *)parms->data) + tot);
- if(data_alloc->array)
+ ParameterDynAlloc *data_alloc = (void *)(((char *)parms->data) + tot);
+ if (data_alloc->array)
MEM_freeN(data_alloc->array);
}
- tot+= rna_parameter_size_alloc(parm);
+ tot += rna_parameter_size_alloc(parm);
}
MEM_freeN(parms->data);
- parms->data= NULL;
+ parms->data = NULL;
- parms->func= NULL;
+ parms->func = NULL;
}
int RNA_parameter_list_size(ParameterList *parms)
@@ -4815,26 +4815,26 @@ void RNA_parameter_list_begin(ParameterList *parms, ParameterIterator *iter)
/* may be useful but unused now */
/* RNA_pointer_create(NULL, &RNA_Function, parms->func, &iter->funcptr); */ /*UNUSED*/
- iter->parms= parms;
- iter->parm= parms->func->cont.properties.first;
- iter->valid= iter->parm != NULL;
- iter->offset= 0;
+ iter->parms = parms;
+ iter->parm = parms->func->cont.properties.first;
+ iter->valid = iter->parm != NULL;
+ iter->offset = 0;
- if(iter->valid) {
- iter->size= rna_parameter_size_alloc(iter->parm);
- iter->data= (((char*)iter->parms->data)); /* +iter->offset, always 0 */
+ if (iter->valid) {
+ iter->size = rna_parameter_size_alloc(iter->parm);
+ iter->data = (((char*)iter->parms->data)); /* +iter->offset, always 0 */
}
}
void RNA_parameter_list_next(ParameterIterator *iter)
{
- iter->offset+= iter->size;
- iter->parm= iter->parm->next;
- iter->valid= iter->parm != NULL;
+ iter->offset += iter->size;
+ iter->parm = iter->parm->next;
+ iter->valid = iter->parm != NULL;
- if(iter->valid) {
- iter->size= rna_parameter_size_alloc(iter->parm);
- iter->data= (((char*)iter->parms->data)+iter->offset);
+ if (iter->valid) {
+ iter->size = rna_parameter_size_alloc(iter->parm);
+ iter->data = (((char*)iter->parms->data)+iter->offset);
}
}
@@ -4849,14 +4849,14 @@ void RNA_parameter_get(ParameterList *parms, PropertyRNA *parm, void **value)
RNA_parameter_list_begin(parms, &iter);
- for(; iter.valid; RNA_parameter_list_next(&iter))
- if(iter.parm==parm)
+ for (; iter.valid; RNA_parameter_list_next(&iter))
+ if (iter.parm == parm)
break;
- if(iter.valid)
- *value= iter.data;
+ if (iter.valid)
+ *value = iter.data;
else
- *value= NULL;
+ *value = NULL;
RNA_parameter_list_end(&iter);
}
@@ -4865,12 +4865,12 @@ void RNA_parameter_get_lookup(ParameterList *parms, const char *identifier, void
{
PropertyRNA *parm;
- parm= parms->func->cont.properties.first;
- for(; parm; parm= parm->next)
- if(strcmp(RNA_property_identifier(parm), identifier)==0)
+ parm = parms->func->cont.properties.first;
+ for (; parm; parm = parm->next)
+ if (strcmp(RNA_property_identifier(parm), identifier) == 0)
break;
- if(parm)
+ if (parm)
RNA_parameter_get(parms, parm, value);
}
@@ -4880,11 +4880,11 @@ void RNA_parameter_set(ParameterList *parms, PropertyRNA *parm, const void *valu
RNA_parameter_list_begin(parms, &iter);
- for(; iter.valid; RNA_parameter_list_next(&iter))
- if(iter.parm==parm)
+ for (; iter.valid; RNA_parameter_list_next(&iter))
+ if (iter.parm == parm)
break;
- if(iter.valid)
+ if (iter.valid)
memcpy(iter.data, value, iter.size);
RNA_parameter_list_end(&iter);
@@ -4894,28 +4894,28 @@ void RNA_parameter_set_lookup(ParameterList *parms, const char *identifier, cons
{
PropertyRNA *parm;
- parm= parms->func->cont.properties.first;
- for(; parm; parm= parm->next)
- if(strcmp(RNA_property_identifier(parm), identifier)==0)
+ parm = parms->func->cont.properties.first;
+ for (; parm; parm = parm->next)
+ if (strcmp(RNA_property_identifier(parm), identifier) == 0)
break;
- if(parm)
+ if (parm)
RNA_parameter_set(parms, parm, value);
}
int RNA_parameter_length_get(ParameterList *parms, PropertyRNA *parm)
{
ParameterIterator iter;
- int len= 0;
+ int len = 0;
RNA_parameter_list_begin(parms, &iter);
- for(; iter.valid; RNA_parameter_list_next(&iter))
- if(iter.parm==parm)
+ for (; iter.valid; RNA_parameter_list_next(&iter))
+ if (iter.parm == parm)
break;
- if(iter.valid)
- len= RNA_parameter_length_get_data(parms, parm, iter.data);
+ if (iter.valid)
+ len = RNA_parameter_length_get_data(parms, parm, iter.data);
RNA_parameter_list_end(&iter);
@@ -4928,11 +4928,11 @@ void RNA_parameter_length_set(ParameterList *parms, PropertyRNA *parm, int lengt
RNA_parameter_list_begin(parms, &iter);
- for(; iter.valid; RNA_parameter_list_next(&iter))
- if(iter.parm==parm)
+ for (; iter.valid; RNA_parameter_list_next(&iter))
+ if (iter.parm == parm)
break;
- if(iter.valid)
+ if (iter.valid)
RNA_parameter_length_set_data(parms, parm, iter.data, length);
RNA_parameter_list_end(&iter);
@@ -4945,12 +4945,12 @@ int RNA_parameter_length_get_data(ParameterList *UNUSED(parms), PropertyRNA *UNU
void RNA_parameter_length_set_data(ParameterList *UNUSED(parms), PropertyRNA *UNUSED(parm), void *data, int length)
{
- *((int *)data)= length;
+ *((int *)data) = length;
}
int RNA_function_call(bContext *C, ReportList *reports, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms)
{
- if(func->call) {
+ if (func->call) {
func->call(C, reports, ptr, parms);
return 0;
@@ -4963,9 +4963,9 @@ int RNA_function_call_lookup(bContext *C, ReportList *reports, PointerRNA *ptr,
{
FunctionRNA *func;
- func= RNA_struct_find_function(ptr, identifier);
+ func = RNA_struct_find_function(ptr, identifier);
- if(func)
+ if (func)
return RNA_function_call(C, reports, ptr, func, parms);
return -1;
@@ -4978,7 +4978,7 @@ int RNA_function_call_direct(bContext *C, ReportList *reports, PointerRNA *ptr,
va_start(args, format);
- ret= RNA_function_call_direct_va(C, reports, ptr, func, format, args);
+ ret = RNA_function_call_direct_va(C, reports, ptr, func, format, args);
va_end(args);
@@ -4989,15 +4989,15 @@ int RNA_function_call_direct_lookup(bContext *C, ReportList *reports, PointerRNA
{
FunctionRNA *func;
- func= RNA_struct_find_function(ptr, identifier);
+ func = RNA_struct_find_function(ptr, identifier);
- if(func) {
+ if (func) {
va_list args;
int ret;
va_start(args, format);
- ret= RNA_function_call_direct_va(C, reports, ptr, func, format, args);
+ ret = RNA_function_call_direct_va(C, reports, ptr, func, format, args);
va_end(args);
@@ -5010,15 +5010,15 @@ int RNA_function_call_direct_lookup(bContext *C, ReportList *reports, PointerRNA
static int rna_function_format_array_length(const char *format, int ofs, int flen)
{
char lenbuf[16];
- int idx= 0;
+ int idx = 0;
- if (format[ofs++]=='[')
- for (; ofs<flen && format[ofs]!=']' && idx<sizeof(*lenbuf)-1; idx++, ofs++)
- lenbuf[idx]= format[ofs];
+ if (format[ofs++] =='[')
+ for (; ofs<flen && format[ofs] !=']' && idx<sizeof(*lenbuf)-1; idx++, ofs++)
+ lenbuf[idx] = format[ofs];
- if (ofs<flen && format[ofs+1]==']') {
+ if (ofs<flen && format[ofs+1] ==']') {
/* XXX put better error reporting for ofs>=flen or idx over lenbuf capacity */
- lenbuf[idx]= '\0';
+ lenbuf[idx] = '\0';
return atoi(lenbuf);
}
@@ -5034,13 +5034,13 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop
switch (type) {
case PROP_BOOLEAN:
{
- if (ftype!='b') {
+ if (ftype !='b') {
fprintf(stderr, "%s.%s: wrong type for parameter %s, a boolean was expected\n", tid, fid, pid);
return -1;
}
- if (len==0)
- *((int*)dest)= *((int*)src);
+ if (len == 0)
+ *((int*)dest) = *((int*)src);
else
memcpy(dest, src, len*sizeof(int));
@@ -5048,13 +5048,13 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop
}
case PROP_INT:
{
- if (ftype!='i') {
+ if (ftype !='i') {
fprintf(stderr, "%s.%s: wrong type for parameter %s, an integer was expected\n", tid, fid, pid);
return -1;
}
- if (len==0)
- *((int*)dest)= *((int*)src);
+ if (len == 0)
+ *((int*)dest) = *((int*)src);
else
memcpy(dest, src, len*sizeof(int));
@@ -5062,13 +5062,13 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop
}
case PROP_FLOAT:
{
- if (ftype!='f') {
+ if (ftype !='f') {
fprintf(stderr, "%s.%s: wrong type for parameter %s, a float was expected\n", tid, fid, pid);
return -1;
}
- if (len==0)
- *((float*)dest)= *((float*)src);
+ if (len == 0)
+ *((float*)dest) = *((float*)src);
else
memcpy(dest, src, len*sizeof(float));
@@ -5076,23 +5076,23 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop
}
case PROP_STRING:
{
- if (ftype!='s') {
+ if (ftype !='s') {
fprintf(stderr, "%s.%s: wrong type for parameter %s, a string was expected\n", tid, fid, pid);
return -1;
}
- *((char**)dest)= *((char**)src);
+ *((char**)dest) = *((char**)src);
break;
}
case PROP_ENUM:
{
- if (ftype!='e') {
+ if (ftype !='e') {
fprintf(stderr, "%s.%s: wrong type for parameter %s, an enum was expected\n", tid, fid, pid);
return -1;
}
- *((int*)dest)= *((int*)src);
+ *((int*)dest) = *((int*)src);
break;
}
@@ -5100,26 +5100,26 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop
{
StructRNA *ptype;
- if (ftype!='O') {
+ if (ftype !='O') {
fprintf(stderr, "%s.%s: wrong type for parameter %s, an object was expected\n", tid, fid, pid);
return -1;
}
- ptype= RNA_property_pointer_type(ptr, prop);
+ ptype = RNA_property_pointer_type(ptr, prop);
- if(prop->flag & PROP_RNAPTR) {
- *((PointerRNA*)dest)= *((PointerRNA*)src);
+ if (prop->flag & PROP_RNAPTR) {
+ *((PointerRNA*)dest) = *((PointerRNA*)src);
break;
}
- if (ptype!=srna && !RNA_struct_is_a(srna, ptype)) {
+ if (ptype != srna && !RNA_struct_is_a(srna, ptype)) {
fprintf(stderr, "%s.%s: wrong type for parameter %s, "
"an object of type %s was expected, passed an object of type %s\n",
tid, fid, pid, RNA_struct_identifier(ptype), RNA_struct_identifier(srna));
return -1;
}
- *((void**)dest)= *((void**)src);
+ *((void**)dest) = *((void**)src);
break;
}
@@ -5130,16 +5130,16 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop
Link *link;
CollectionPointerLink *clink;
- if (ftype!='C') {
+ if (ftype !='C') {
fprintf(stderr, "%s.%s: wrong type for parameter %s, a collection was expected\n", tid, fid, pid);
return -1;
}
- lb= (ListBase *)src;
- clb= (ListBase *)dest;
- ptype= RNA_property_pointer_type(ptr, prop);
+ lb = (ListBase *)src;
+ clb = (ListBase *)dest;
+ ptype = RNA_property_pointer_type(ptr, prop);
- if (ptype!=srna && !RNA_struct_is_a(srna, ptype)) {
+ if (ptype != srna && !RNA_struct_is_a(srna, ptype)) {
fprintf(stderr, "%s.%s: wrong type for parameter %s, "
"a collection of objects of type %s was expected, "
"passed a collection of objects of type %s\n",
@@ -5147,17 +5147,17 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop
return -1;
}
- for (link= lb->first; link; link= link->next) {
- clink= MEM_callocN(sizeof(CollectionPointerLink), "CCollectionPointerLink");
+ for (link = lb->first; link; link = link->next) {
+ clink = MEM_callocN(sizeof(CollectionPointerLink), "CCollectionPointerLink");
RNA_pointer_create(NULL, srna, link, &clink->ptr);
BLI_addtail(clb, clink);
}
break;
}
- default:
+ default:
{
- if (len==0)
+ if (len == 0)
fprintf(stderr, "%s.%s: unknown type for parameter %s\n", tid, fid, pid);
else
fprintf(stderr, "%s.%s: unknown array type for parameter %s\n", tid, fid, pid);
@@ -5176,38 +5176,38 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt
ParameterIterator iter;
PropertyRNA *pret, *parm;
PropertyType type;
- int i, ofs, flen, flag, len, alen, err= 0;
- const char *tid, *fid, *pid=NULL;
+ int i, ofs, flen, flag, len, alen, err = 0;
+ const char *tid, *fid, *pid = NULL;
char ftype;
- void **retdata=NULL;
+ void **retdata = NULL;
RNA_pointer_create(NULL, &RNA_Function, func, &funcptr);
- tid= RNA_struct_identifier(ptr->type);
- fid= RNA_function_identifier(func);
- pret= func->c_ret;
- flen= strlen(format);
+ tid = RNA_struct_identifier(ptr->type);
+ fid = RNA_function_identifier(func);
+ pret = func->c_ret;
+ flen = strlen(format);
RNA_parameter_list_create(&parms, ptr, func);
RNA_parameter_list_begin(&parms, &iter);
- for(i= 0, ofs= 0; iter.valid; RNA_parameter_list_next(&iter), i++) {
- parm= iter.parm;
- flag= RNA_property_flag(parm);
+ for (i = 0, ofs = 0; iter.valid; RNA_parameter_list_next(&iter), i++) {
+ parm = iter.parm;
+ flag = RNA_property_flag(parm);
- if(parm==pret) {
- retdata= iter.data;
+ if (parm == pret) {
+ retdata = iter.data;
continue;
}
else if (flag & PROP_OUTPUT) {
continue;
}
- pid= RNA_property_identifier(parm);
+ pid = RNA_property_identifier(parm);
- if (ofs>=flen || format[ofs]=='N') {
+ if (ofs >= flen || format[ofs] =='N') {
if (flag & PROP_REQUIRED) {
- err= -1;
+ err = -1;
fprintf(stderr, "%s.%s: missing required parameter %s\n", tid, fid, pid);
break;
}
@@ -5215,13 +5215,13 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt
continue;
}
- type= RNA_property_type(parm);
- ftype= format[ofs++];
- len= RNA_property_array_length(&funcptr, parm);
- alen= rna_function_format_array_length(format, ofs, flen);
+ type = RNA_property_type(parm);
+ ftype = format[ofs++];
+ len = RNA_property_array_length(&funcptr, parm);
+ alen = rna_function_format_array_length(format, ofs, flen);
- if (len!=alen) {
- err= -1;
+ if (len != alen) {
+ err = -1;
fprintf(stderr, "%s.%s: for parameter %s, "
"was expecting an array of %i elements, "
"passed %i elements instead\n",
@@ -5234,62 +5234,62 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt
case PROP_INT:
case PROP_ENUM:
{
- int arg= va_arg(args, int);
- err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, NULL, tid, fid, pid);
+ int arg = va_arg(args, int);
+ err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, NULL, tid, fid, pid);
break;
}
case PROP_FLOAT:
{
- double arg= va_arg(args, double);
- err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, NULL, tid, fid, pid);
+ double arg = va_arg(args, double);
+ err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, NULL, tid, fid, pid);
break;
}
case PROP_STRING:
{
- char *arg= va_arg(args, char*);
- err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, NULL, tid, fid, pid);
+ char *arg = va_arg(args, char*);
+ err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, NULL, tid, fid, pid);
break;
}
case PROP_POINTER:
{
- StructRNA *srna= va_arg(args, StructRNA*);
- void *arg= va_arg(args, void*);
- err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, srna, tid, fid, pid);
+ StructRNA *srna = va_arg(args, StructRNA*);
+ void *arg = va_arg(args, void*);
+ err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, srna, tid, fid, pid);
break;
}
case PROP_COLLECTION:
{
- StructRNA *srna= va_arg(args, StructRNA*);
- ListBase *arg= va_arg(args, ListBase*);
- err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, srna, tid, fid, pid);
+ StructRNA *srna = va_arg(args, StructRNA*);
+ ListBase *arg = va_arg(args, ListBase*);
+ err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, srna, tid, fid, pid);
break;
}
default:
{
/* handle errors */
- err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, NULL, NULL, tid, fid, pid);
+ err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, NULL, NULL, tid, fid, pid);
break;
}
}
- if (err!=0)
+ if (err != 0)
break;
}
- if (err==0)
- err= RNA_function_call(C, reports, ptr, func, &parms);
+ if (err == 0)
+ err = RNA_function_call(C, reports, ptr, func, &parms);
/* XXX throw error when more parameters than those needed are passed or leave silent? */
- if (err==0 && pret && ofs<flen && format[ofs++]=='R') {
- parm= pret;
+ if (err == 0 && pret && ofs<flen && format[ofs++] =='R') {
+ parm = pret;
- type= RNA_property_type(parm);
- ftype= format[ofs++];
- len= RNA_property_array_length(&funcptr, parm);
- alen= rna_function_format_array_length(format, ofs, flen);
+ type = RNA_property_type(parm);
+ ftype = format[ofs++];
+ len = RNA_property_array_length(&funcptr, parm);
+ alen = rna_function_format_array_length(format, ofs, flen);
- if (len!=alen) {
- err= -1;
+ if (len != alen) {
+ err = -1;
fprintf(stderr, "%s.%s: for return parameter %s, "
"was expecting an array of %i elements, passed %i elements instead\n",
tid, fid, pid, len, alen);
@@ -5300,40 +5300,40 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt
case PROP_INT:
case PROP_ENUM:
{
- int *arg= va_arg(args, int*);
- err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata, NULL, tid, fid, pid);
+ int *arg = va_arg(args, int*);
+ err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata, NULL, tid, fid, pid);
break;
}
case PROP_FLOAT:
{
- float *arg= va_arg(args, float*);
- err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata, NULL, tid, fid, pid);
+ float *arg = va_arg(args, float*);
+ err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata, NULL, tid, fid, pid);
break;
}
case PROP_STRING:
{
- char **arg= va_arg(args, char**);
- err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata, NULL, tid, fid, pid);
+ char **arg = va_arg(args, char**);
+ err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata, NULL, tid, fid, pid);
break;
}
case PROP_POINTER:
{
- StructRNA *srna= va_arg(args, StructRNA*);
- void **arg= va_arg(args, void**);
- err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata, srna, tid, fid, pid);
+ StructRNA *srna = va_arg(args, StructRNA*);
+ void **arg = va_arg(args, void**);
+ err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata, srna, tid, fid, pid);
break;
}
case PROP_COLLECTION:
{
- StructRNA *srna= va_arg(args, StructRNA*);
- ListBase **arg= va_arg(args, ListBase**);
- err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata, srna, tid, fid, pid);
+ StructRNA *srna = va_arg(args, StructRNA*);
+ ListBase **arg = va_arg(args, ListBase**);
+ err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata, srna, tid, fid, pid);
break;
- }
+ }
default:
{
/* handle errors */
- err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, NULL, NULL, NULL, tid, fid, pid);
+ err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, NULL, NULL, NULL, tid, fid, pid);
break;
}
}
@@ -5351,9 +5351,9 @@ int RNA_function_call_direct_va_lookup(bContext *C, ReportList *reports, Pointer
{
FunctionRNA *func;
- func= RNA_struct_find_function(ptr, identifier);
+ func = RNA_struct_find_function(ptr, identifier);
- if(func)
+ if (func)
return RNA_function_call_direct_va(C, reports, ptr, func, format, args);
return 0;
@@ -5364,14 +5364,14 @@ int RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index)
int len;
/* get the length of the array to work with */
- len= RNA_property_array_length(ptr, prop);
+ len = RNA_property_array_length(ptr, prop);
/* get and set the default values as appropriate for the various types */
switch (RNA_property_type(prop)) {
case PROP_BOOLEAN:
if (len) {
if (index == -1) {
- int *tmparray= MEM_callocN(sizeof(int)*len, "reset_defaults - boolean");
+ int *tmparray = MEM_callocN(sizeof(int)*len, "reset_defaults - boolean");
RNA_property_boolean_get_default_array(ptr, prop, tmparray);
RNA_property_boolean_set_array(ptr, prop, tmparray);
@@ -5379,19 +5379,19 @@ int RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index)
MEM_freeN(tmparray);
}
else {
- int value= RNA_property_boolean_get_default_index(ptr, prop, index);
+ int value = RNA_property_boolean_get_default_index(ptr, prop, index);
RNA_property_boolean_set_index(ptr, prop, index, value);
}
}
else {
- int value= RNA_property_boolean_get_default(ptr, prop);
+ int value = RNA_property_boolean_get_default(ptr, prop);
RNA_property_boolean_set(ptr, prop, value);
}
return 1;
case PROP_INT:
if (len) {
if (index == -1) {
- int *tmparray= MEM_callocN(sizeof(int)*len, "reset_defaults - int");
+ int *tmparray = MEM_callocN(sizeof(int)*len, "reset_defaults - int");
RNA_property_int_get_default_array(ptr, prop, tmparray);
RNA_property_int_set_array(ptr, prop, tmparray);
@@ -5399,19 +5399,19 @@ int RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index)
MEM_freeN(tmparray);
}
else {
- int value= RNA_property_int_get_default_index(ptr, prop, index);
+ int value = RNA_property_int_get_default_index(ptr, prop, index);
RNA_property_int_set_index(ptr, prop, index, value);
}
}
else {
- int value= RNA_property_int_get_default(ptr, prop);
+ int value = RNA_property_int_get_default(ptr, prop);
RNA_property_int_set(ptr, prop, value);
}
return 1;
case PROP_FLOAT:
if (len) {
if (index == -1) {
- float *tmparray= MEM_callocN(sizeof(float)*len, "reset_defaults - float");
+ float *tmparray = MEM_callocN(sizeof(float)*len, "reset_defaults - float");
RNA_property_float_get_default_array(ptr, prop, tmparray);
RNA_property_float_set_array(ptr, prop, tmparray);
@@ -5419,25 +5419,25 @@ int RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index)
MEM_freeN(tmparray);
}
else {
- float value= RNA_property_float_get_default_index(ptr, prop, index);
+ float value = RNA_property_float_get_default_index(ptr, prop, index);
RNA_property_float_set_index(ptr, prop, index, value);
}
}
else {
- float value= RNA_property_float_get_default(ptr, prop);
+ float value = RNA_property_float_get_default(ptr, prop);
RNA_property_float_set(ptr, prop, value);
}
return 1;
case PROP_ENUM:
{
- int value= RNA_property_enum_get_default(ptr, prop);
+ int value = RNA_property_enum_get_default(ptr, prop);
RNA_property_enum_set(ptr, prop, value);
return 1;
}
case PROP_STRING:
{
- char *value= RNA_property_string_get_default_alloc(ptr, prop, NULL, 0);
+ char *value = RNA_property_string_get_default_alloc(ptr, prop, NULL, 0);
RNA_property_string_set(ptr, prop, value);
MEM_freeN(value);
return 1;
@@ -5445,13 +5445,13 @@ int RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index)
case PROP_POINTER:
{
- PointerRNA value= RNA_property_pointer_get_default(ptr, prop);
+ PointerRNA value = RNA_property_pointer_get_default(ptr, prop);
RNA_property_pointer_set(ptr, prop, value);
return 1;
}
- default:
- // FIXME: are there still any cases that haven't been handled? comment out "default" block to check :)
+ default:
+ /* FIXME: are there still any cases that haven't been handled? comment out "default" block to check :) */
return 0;
}
}
@@ -5461,10 +5461,10 @@ int RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, i
int len, fromlen;
/* get the length of the array to work with */
- len= RNA_property_array_length(ptr, prop);
- fromlen= RNA_property_array_length(ptr, prop);
+ len = RNA_property_array_length(ptr, prop);
+ fromlen = RNA_property_array_length(ptr, prop);
- if(len != fromlen)
+ if (len != fromlen)
return 0;
/* get and set the default values as appropriate for the various types */
@@ -5472,7 +5472,7 @@ int RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, i
case PROP_BOOLEAN:
if (len) {
if (index == -1) {
- int *tmparray= MEM_callocN(sizeof(int)*len, "copy - boolean");
+ int *tmparray = MEM_callocN(sizeof(int)*len, "copy - boolean");
RNA_property_boolean_get_array(fromptr, prop, tmparray);
RNA_property_boolean_set_array(ptr, prop, tmparray);
@@ -5480,19 +5480,19 @@ int RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, i
MEM_freeN(tmparray);
}
else {
- int value= RNA_property_boolean_get_index(fromptr, prop, index);
+ int value = RNA_property_boolean_get_index(fromptr, prop, index);
RNA_property_boolean_set_index(ptr, prop, index, value);
}
}
else {
- int value= RNA_property_boolean_get(fromptr, prop);
+ int value = RNA_property_boolean_get(fromptr, prop);
RNA_property_boolean_set(ptr, prop, value);
}
return 1;
case PROP_INT:
if (len) {
if (index == -1) {
- int *tmparray= MEM_callocN(sizeof(int)*len, "copy - int");
+ int *tmparray = MEM_callocN(sizeof(int)*len, "copy - int");
RNA_property_int_get_array(fromptr, prop, tmparray);
RNA_property_int_set_array(ptr, prop, tmparray);
@@ -5500,19 +5500,19 @@ int RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, i
MEM_freeN(tmparray);
}
else {
- int value= RNA_property_int_get_index(fromptr, prop, index);
+ int value = RNA_property_int_get_index(fromptr, prop, index);
RNA_property_int_set_index(ptr, prop, index, value);
}
}
else {
- int value= RNA_property_int_get(fromptr, prop);
+ int value = RNA_property_int_get(fromptr, prop);
RNA_property_int_set(ptr, prop, value);
}
return 1;
case PROP_FLOAT:
if (len) {
if (index == -1) {
- float *tmparray= MEM_callocN(sizeof(float)*len, "copy - float");
+ float *tmparray = MEM_callocN(sizeof(float)*len, "copy - float");
RNA_property_float_get_array(fromptr, prop, tmparray);
RNA_property_float_set_array(ptr, prop, tmparray);
@@ -5520,30 +5520,30 @@ int RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, i
MEM_freeN(tmparray);
}
else {
- float value= RNA_property_float_get_index(fromptr, prop, index);
+ float value = RNA_property_float_get_index(fromptr, prop, index);
RNA_property_float_set_index(ptr, prop, index, value);
}
}
else {
- float value= RNA_property_float_get(fromptr, prop);
+ float value = RNA_property_float_get(fromptr, prop);
RNA_property_float_set(ptr, prop, value);
}
return 1;
case PROP_ENUM:
{
- int value= RNA_property_enum_get(fromptr, prop);
+ int value = RNA_property_enum_get(fromptr, prop);
RNA_property_enum_set(ptr, prop, value);
return 1;
}
case PROP_POINTER:
{
- PointerRNA value= RNA_property_pointer_get(fromptr, prop);
+ PointerRNA value = RNA_property_pointer_get(fromptr, prop);
RNA_property_pointer_set(ptr, prop, value);
return 1;
}
case PROP_STRING:
{
- char *value= RNA_property_string_get_alloc(fromptr, prop, NULL, 0, NULL);
+ char *value = RNA_property_string_get_alloc(fromptr, prop, NULL, 0, NULL);
RNA_property_string_set(ptr, prop, value);
MEM_freeN(value);
return 1;
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 6d83873bd2c..3df868f9afe 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -50,17 +50,17 @@
static void rna_ActionGroup_channels_next(CollectionPropertyIterator *iter)
{
- ListBaseIterator *internal= iter->internal;
- FCurve *fcu= (FCurve*)internal->link;
- bActionGroup *grp= fcu->grp;
+ ListBaseIterator *internal = iter->internal;
+ FCurve *fcu = (FCurve*)internal->link;
+ bActionGroup *grp = fcu->grp;
/* only continue if the next F-Curve (if existant) belongs in the same group */
if ((fcu->next) && (fcu->next->grp == grp))
- internal->link= (Link*)fcu->next;
+ internal->link = (Link*)fcu->next;
else
- internal->link= NULL;
+ internal->link = NULL;
- iter->valid= (internal->link != NULL);
+ iter->valid = (internal->link != NULL);
}
static bActionGroup *rna_Action_groups_new(bAction *act, const char name[])
@@ -79,8 +79,8 @@ static void rna_Action_groups_remove(bAction *act, ReportList *reports, bActionG
}
/* move every one one of the group's F-Curves out into the Action again */
- for (fcu= agrp->channels.first; (fcu) && (fcu->grp==agrp); fcu=fcn) {
- fcn= fcu->next;
+ for (fcu = agrp->channels.first; (fcu) && (fcu->grp == agrp); fcu = fcn) {
+ fcn = fcu->next;
/* remove from group */
action_groups_remove_channel(act, fcu);
@@ -90,12 +90,12 @@ static void rna_Action_groups_remove(bAction *act, ReportList *reports, bActionG
}
/* XXX, invalidates PyObject */
- MEM_freeN(agrp);
+ MEM_freeN(agrp);
}
static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, const char *data_path, int index, const char *group)
{
- if (group && group[0]=='\0') group= NULL;
+ if (group && group[0] =='\0') group = NULL;
if (data_path[0] == '\0') {
BKE_report(reports, RPT_ERROR, "F-Curve data path empty, invalid argument");
@@ -135,8 +135,8 @@ static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, FCurve *
static TimeMarker *rna_Action_pose_markers_new(bAction *act, const char name[])
{
TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
- marker->flag= 1;
- marker->frame= 1;
+ marker->flag = 1;
+ marker->frame = 1;
BLI_strncpy_utf8(marker->name, name, sizeof(marker->name));
BLI_addtail(&act->markers, marker);
return marker;
@@ -155,35 +155,35 @@ static void rna_Action_pose_markers_remove(bAction *act, ReportList *reports, Ti
static PointerRNA rna_Action_active_pose_marker_get(PointerRNA *ptr)
{
- bAction *act= (bAction*)ptr->data;
+ bAction *act = (bAction*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_TimelineMarker, BLI_findlink(&act->markers, act->active_marker-1));
}
static void rna_Action_active_pose_marker_set(PointerRNA *ptr, PointerRNA value)
{
- bAction *act= (bAction*)ptr->data;
- act->active_marker= BLI_findindex(&act->markers, value.data) + 1;
+ bAction *act = (bAction*)ptr->data;
+ act->active_marker = BLI_findindex(&act->markers, value.data) + 1;
}
static int rna_Action_active_pose_marker_index_get(PointerRNA *ptr)
{
- bAction *act= (bAction*)ptr->data;
+ bAction *act = (bAction*)ptr->data;
return MAX2(act->active_marker-1, 0);
}
static void rna_Action_active_pose_marker_index_set(PointerRNA *ptr, int value)
{
- bAction *act= (bAction*)ptr->data;
- act->active_marker= value+1;
+ bAction *act = (bAction*)ptr->data;
+ act->active_marker = value+1;
}
static void rna_Action_active_pose_marker_index_range(PointerRNA *ptr, int *min, int *max)
{
- bAction *act= (bAction*)ptr->data;
+ bAction *act = (bAction*)ptr->data;
- *min= 0;
- *max= BLI_countlist(&act->markers)-1;
- *max= MAX2(0, *max);
+ *min = 0;
+ *max = BLI_countlist(&act->markers)-1;
+ *max = MAX2(0, *max);
}
@@ -251,179 +251,179 @@ static void rna_def_dopesheet(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "DopeSheet", NULL);
+ srna = RNA_def_struct(brna, "DopeSheet", NULL);
RNA_def_struct_sdna(srna, "bDopeSheet");
RNA_def_struct_ui_text(srna, "DopeSheet", "Settings for filtering the channels shown in Animation Editors");
/* Source of DopeSheet data */
- // XXX: make this obsolete?
- prop= RNA_def_property(srna, "source", PROP_POINTER, PROP_NONE);
+ /* XXX: make this obsolete? */
+ prop = RNA_def_property(srna, "source", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ID");
RNA_def_property_ui_text(prop, "Source", "ID-Block representing source data, currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil)");
/* Show datablock filters */
- prop= RNA_def_property(srna, "show_datablock_filters", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_datablock_filters", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ADS_FLAG_SHOW_DBFILTERS);
RNA_def_property_ui_text(prop, "Show Datablock Filters", "Show options for whether channels related to certain types of data are included");
RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, -1);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN, NULL);
/* General Filtering Settings */
- prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYSEL);
RNA_def_property_ui_text(prop, "Only Selected", "Only include channels relating to selected objects and data");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_INCL_HIDDEN);
RNA_def_property_ui_text(prop, "Display Hidden", "Include channels from objects/bone that aren't visible");
RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* Object Group Filtering Settings */
- prop= RNA_def_property(srna, "show_only_group_objects", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_only_group_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYOBGROUP);
RNA_def_property_ui_text(prop, "Only Objects in Group", "Only include channels from Objects in the specified Group");
RNA_def_property_ui_icon(prop, ICON_GROUP, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "filter_group", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "filter_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "filter_grp");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Filtering Group", "Group that included Object should be a member of");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* FCurve Display Name Search Settings */
- prop= RNA_def_property(srna, "show_only_matching_fcurves", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_only_matching_fcurves", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_BY_FCU_NAME);
RNA_def_property_ui_text(prop, "Only Matching F-Curves", "Only include F-Curves with names containing search text");
RNA_def_property_ui_icon(prop, ICON_VIEWZOOM, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "filter_fcurve_name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "filter_fcurve_name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "searchstr");
RNA_def_property_ui_text(prop, "F-Curve Name Filter", "F-Curve live filtering string");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* NLA Specific Settings */
- prop= RNA_def_property(srna, "show_missing_nla", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_missing_nla", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NLA_NOACT);
RNA_def_property_ui_text(prop, "Include Missing NLA", "Include Animation Data blocks with no NLA data (NLA Editor only)");
RNA_def_property_ui_icon(prop, ICON_ACTION, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* Summary Settings (DopeSheet editors only) */
- prop= RNA_def_property(srna, "show_summary", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_summary", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_SUMMARY);
RNA_def_property_ui_text(prop, "Display Summary", "Display an additional 'summary' line (DopeSheet Editors only)");
RNA_def_property_ui_icon(prop, ICON_BORDERMOVE, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_expanded_summary", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_expanded_summary", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADS_FLAG_SUMMARY_COLLAPSED);
RNA_def_property_ui_text(prop, "Collapse Summary", "Collapse summary when shown, so all other channels get hidden (DopeSheet Editors Only)");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* General DataType Filtering Settings */
- prop= RNA_def_property(srna, "show_transforms", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_transforms", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOOBJ);
RNA_def_property_ui_text(prop, "Display Transforms", "Include visualization of Object-level Animation data (mostly Transforms)");
- RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0); // XXX?
+ RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0); /* XXX? */
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_shapekeys", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_shapekeys", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSHAPEKEYS);
RNA_def_property_ui_text(prop, "Display Shapekeys", "Include visualization of ShapeKey related Animation data");
RNA_def_property_ui_icon(prop, ICON_SHAPEKEY_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_meshes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_meshes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMESH);
RNA_def_property_ui_text(prop, "Display Meshes", "Include visualization of Mesh related Animation data");
RNA_def_property_ui_icon(prop, ICON_MESH_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_lattices", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_lattices", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLAT);
RNA_def_property_ui_text(prop, "Display Lattices", "Include visualization of Lattice related Animation data");
RNA_def_property_ui_icon(prop, ICON_LATTICE_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_cameras", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_cameras", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCAM);
RNA_def_property_ui_text(prop, "Display Camera", "Include visualization of Camera related Animation data");
RNA_def_property_ui_icon(prop, ICON_CAMERA_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_materials", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_materials", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMAT);
RNA_def_property_ui_text(prop, "Display Material", "Include visualization of Material related Animation data");
RNA_def_property_ui_icon(prop, ICON_MATERIAL_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_lamps", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_lamps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLAM);
RNA_def_property_ui_text(prop, "Display Lamp", "Include visualization of Lamp related Animation data");
RNA_def_property_ui_icon(prop, ICON_LAMP_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_linestyles", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_linestyles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLINESTYLE);
RNA_def_property_ui_text(prop, "Display Line Style", "Include visualization of Line Style related Animation data");
RNA_def_property_ui_icon(prop, ICON_BRUSH_DATA, 0); /* FIXME */
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_textures", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_textures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOTEX);
RNA_def_property_ui_text(prop, "Display Texture", "Include visualization of Texture related Animation data");
RNA_def_property_ui_icon(prop, ICON_TEXTURE_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_curves", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_curves", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCUR);
RNA_def_property_ui_text(prop, "Display Curve", "Include visualization of Curve related Animation data");
RNA_def_property_ui_icon(prop, ICON_CURVE_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_worlds", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_worlds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOWOR);
RNA_def_property_ui_text(prop, "Display World", "Include visualization of World related Animation data");
RNA_def_property_ui_icon(prop, ICON_WORLD_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_scenes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_scenes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSCE);
RNA_def_property_ui_text(prop, "Display Scene", "Include visualization of Scene related Animation data");
RNA_def_property_ui_icon(prop, ICON_SCENE_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOPART);
RNA_def_property_ui_text(prop, "Display Particle", "Include visualization of Particle related Animation data");
RNA_def_property_ui_icon(prop, ICON_PARTICLE_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_metaballs", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_metaballs", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMBA);
RNA_def_property_ui_text(prop, "Display Metaball", "Include visualization of Metaball related Animation data");
RNA_def_property_ui_icon(prop, ICON_META_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_armatures", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_armatures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOARM);
RNA_def_property_ui_text(prop, "Display Armature", "Include visualization of Armature related Animation data");
RNA_def_property_ui_icon(prop, ICON_ARMATURE_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_nodes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NONTREE);
RNA_def_property_ui_text(prop, "Display Node", "Include visualization of Node related Animation data");
RNA_def_property_ui_icon(prop, ICON_NODETREE, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_speakers", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_speakers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSPK);
RNA_def_property_ui_text(prop, "Display Speaker", "Include visualization of Speaker related Animation data");
RNA_def_property_ui_icon(prop, ICON_SPEAKER, 0);
@@ -435,11 +435,11 @@ static void rna_def_action_group(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ActionGroup", NULL);
+ srna = RNA_def_struct(brna, "ActionGroup", NULL);
RNA_def_struct_sdna(srna, "bActionGroup");
RNA_def_struct_ui_text(srna, "Action Group", "Groups of F-Curves");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
@@ -454,28 +454,28 @@ static void rna_def_action_group(BlenderRNA *brna)
* If such changes are required, these MUST go through the API functions for manipulating
* these F-Curve groupings. Also, note that groups only apply in actions ONLY.
*/
- prop= RNA_def_property(srna, "channels", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "channels", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "channels", NULL);
RNA_def_property_struct_type(prop, "FCurve");
RNA_def_property_collection_funcs(prop, 0, "rna_ActionGroup_channels_next", NULL, NULL, NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group");
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_SELECTED);
RNA_def_property_ui_text(prop, "Select", "Action Group is selected");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_SELECTED, NULL);
- prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_PROTECTED);
RNA_def_property_ui_text(prop, "Lock", "Action Group is locked");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_EXPANDED);
RNA_def_property_ui_text(prop, "Expanded", "Action Group is expanded");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "custom_color", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "custom_color", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "customCol");
RNA_def_property_ui_text(prop, "Custom Color", "Index of custom color set");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
@@ -490,23 +490,23 @@ static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "ActionGroups");
- srna= RNA_def_struct(brna, "ActionGroups", NULL);
+ srna = RNA_def_struct(brna, "ActionGroups", NULL);
RNA_def_struct_sdna(srna, "bAction");
RNA_def_struct_ui_text(srna, "Action Groups", "Collection of action groups");
- func= RNA_def_function(srna, "new", "rna_Action_groups_new");
+ func = RNA_def_function(srna, "new", "rna_Action_groups_new");
RNA_def_function_ui_description(func, "Add a keyframe to the curve");
- parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the action group");
+ parm = RNA_def_string(func, "name", "Group", 0, "", "New name for the action group");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "action_group", "ActionGroup", "", "Newly created action group");
+ parm = RNA_def_pointer(func, "action_group", "ActionGroup", "", "Newly created action group");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Action_groups_remove");
+ func = RNA_def_function(srna, "remove", "rna_Action_groups_remove");
RNA_def_function_ui_description(func, "Remove action group");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "action_group", "ActionGroup", "", "Action group to remove");
+ parm = RNA_def_pointer(func, "action_group", "ActionGroup", "", "Action group to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -518,26 +518,26 @@ static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "ActionFCurves");
- srna= RNA_def_struct(brna, "ActionFCurves", NULL);
+ srna = RNA_def_struct(brna, "ActionFCurves", NULL);
RNA_def_struct_sdna(srna, "bAction");
RNA_def_struct_ui_text(srna, "Action F-Curves", "Collection of action F-Curves");
- func= RNA_def_function(srna, "new", "rna_Action_fcurve_new");
+ func = RNA_def_function(srna, "new", "rna_Action_fcurve_new");
RNA_def_function_ui_description(func, "Add a keyframe to the F-Curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_string(func, "data_path", "", 0, "Data Path", "F-Curve data path to use");
+ parm = RNA_def_string(func, "data_path", "", 0, "Data Path", "F-Curve data path to use");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX);
RNA_def_string(func, "action_group", "", 0, "Action Group", "Acton group to add this F-Curve into");
- parm= RNA_def_pointer(func, "fcurve", "FCurve", "", "Newly created F-Curve");
+ parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "Newly created F-Curve");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Action_fcurve_remove");
+ func = RNA_def_function(srna, "remove", "rna_Action_fcurve_remove");
RNA_def_function_ui_description(func, "Remove action group");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "fcurve", "FCurve", "", "F-Curve to remove");
+ parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "F-Curve to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -550,31 +550,31 @@ static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "ActionPoseMarkers");
- srna= RNA_def_struct(brna, "ActionPoseMarkers", NULL);
+ srna = RNA_def_struct(brna, "ActionPoseMarkers", NULL);
RNA_def_struct_sdna(srna, "bAction");
RNA_def_struct_ui_text(srna, "Action Pose Markers", "Collection of timeline markers");
- func= RNA_def_function(srna, "new", "rna_Action_pose_markers_new");
+ func = RNA_def_function(srna, "new", "rna_Action_pose_markers_new");
RNA_def_function_ui_description(func, "Add a pose marker to the action");
- parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)");
+ parm = RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created marker");
+ parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created marker");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Action_pose_markers_remove");
+ func = RNA_def_function(srna, "remove", "rna_Action_pose_markers_remove");
RNA_def_function_ui_description(func, "Remove a timeline marker");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove");
+ parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "TimelineMarker");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, "rna_Action_active_pose_marker_get", "rna_Action_active_pose_marker_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Active Pose Marker", "Active pose marker for this Action");
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "active_marker");
RNA_def_property_int_funcs(prop, "rna_Action_active_pose_marker_index_get", "rna_Action_active_pose_marker_index_set", "rna_Action_active_pose_marker_index_range");
RNA_def_property_ui_text(prop, "Active Pose Marker Index", "Index of active pose marker");
@@ -585,37 +585,37 @@ static void rna_def_action(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Action", "ID");
+ srna = RNA_def_struct(brna, "Action", "ID");
RNA_def_struct_sdna(srna, "bAction");
RNA_def_struct_ui_text(srna, "Action", "A collection of F-Curves for animation");
RNA_def_struct_ui_icon(srna, ICON_ACTION);
/* collections */
- prop= RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "curves", NULL);
RNA_def_property_struct_type(prop, "FCurve");
RNA_def_property_ui_text(prop, "F-Curves", "The individual F-Curves that make up the Action");
rna_def_action_fcurves(brna, prop);
- prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "groups", NULL);
RNA_def_property_struct_type(prop, "ActionGroup");
RNA_def_property_ui_text(prop, "Groups", "Convenient groupings of F-Curves");
rna_def_action_groups(brna, prop);
- prop= RNA_def_property(srna, "pose_markers", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "pose_markers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
RNA_def_property_struct_type(prop, "TimelineMarker");
RNA_def_property_ui_text(prop, "Pose Markers", "Markers specific to this Action, for labeling poses");
rna_def_action_pose_markers(brna, prop);
/* properties */
- prop= RNA_def_float_vector(srna, "frame_range" , 2 , NULL , 0, 0, "Frame Range" , "The final frame range of all F-Curves within this action" , 0 , 0);
+ prop = RNA_def_float_vector(srna, "frame_range" , 2 , NULL , 0, 0, "Frame Range" , "The final frame range of all F-Curves within this action" , 0 , 0);
RNA_def_property_float_funcs(prop, "rna_Action_frame_range_get" , NULL, NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* special "type" limiter - should not really be edited in general, but is still available/editable in 'emergencies' */
- prop= RNA_def_property(srna, "id_root", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "id_root", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "idroot");
RNA_def_property_enum_items(prop, id_type_items);
RNA_def_property_ui_text(prop, "ID Root Type", "Type of ID-block that action can be used on - DO NOT CHANGE UNLESS YOU KNOW WHAT YOU'RE DOING");
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index 6098e885df5..78555d2a877 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -34,14 +34,14 @@
#include "DNA_constraint_types.h"
#include "DNA_object_types.h"
#include "DNA_actuator_types.h"
-#include "DNA_scene_types.h" // for MAXFRAME
+#include "DNA_scene_types.h" /* for MAXFRAME */
#include "WM_types.h"
#include "BLI_utildefines.h"
/* Always keep in alphabetical order */
-EnumPropertyItem actuator_type_items[] ={
+EnumPropertyItem actuator_type_items[] = {
{ACT_ACTION, "ACTION", 0, "Action", ""},
{ACT_ARMATURE, "ARMATURE", 0, "Armature", ""},
{ACT_CAMERA, "CAMERA", 0, "Camera", ""},
@@ -67,9 +67,9 @@ EnumPropertyItem actuator_type_items[] ={
static StructRNA* rna_Actuator_refine(struct PointerRNA *ptr)
{
- bActuator *actuator= (bActuator*)ptr->data;
+ bActuator *actuator = (bActuator*)ptr->data;
- switch(actuator->type) {
+ switch (actuator->type) {
case ACT_ACTION:
return &RNA_ActionActuator;
case ACT_OBJECT:
@@ -111,21 +111,21 @@ static StructRNA* rna_Actuator_refine(struct PointerRNA *ptr)
void rna_Actuator_name_set(PointerRNA *ptr, const char *value)
{
- bActuator *act= (bActuator *)ptr->data;
+ bActuator *act = (bActuator *)ptr->data;
BLI_strncpy_utf8(act->name, value, sizeof(act->name));
if (ptr->id.data) {
- Object *ob= (Object *)ptr->id.data;
+ Object *ob = (Object *)ptr->id.data;
BLI_uniquename(&ob->actuators, act, "Actuator", '.', offsetof(bActuator, name), sizeof(act->name));
}
}
static void rna_Actuator_type_set(struct PointerRNA *ptr, int value)
{
- bActuator *act= (bActuator *)ptr->data;
- if (value != act->type)
- {
+ bActuator *act = (bActuator *)ptr->data;
+
+ if (value != act->type) {
act->type = value;
init_actuator(act);
}
@@ -133,10 +133,10 @@ static void rna_Actuator_type_set(struct PointerRNA *ptr, int value)
static void rna_ConstraintActuator_type_set(struct PointerRNA *ptr, int value)
{
- bActuator *act= (bActuator *)ptr->data;
- bConstraintActuator *ca= act->data;
- if (value != ca->type)
- {
+ bActuator *act = (bActuator *)ptr->data;
+ bConstraintActuator *ca = act->data;
+
+ if (value != ca->type) {
ca->type = value;
switch (ca->type) {
case ACT_CONST_TYPE_ORI:
@@ -160,12 +160,12 @@ static float rna_ConstraintActuator_limitmin_get(struct PointerRNA *ptr)
bConstraintActuator *ca = act->data;
float *fp;
- if(ca->flag & ACT_CONST_LOCX) fp= ca->minloc;
- else if(ca->flag & ACT_CONST_LOCY) fp= ca->minloc+1;
- else if(ca->flag & ACT_CONST_LOCZ) fp= ca->minloc+2;
- else if(ca->flag & ACT_CONST_ROTX) fp= ca->minrot;
- else if(ca->flag & ACT_CONST_ROTY) fp= ca->minrot+1;
- else fp= ca->minrot+2;
+ if (ca->flag & ACT_CONST_LOCX) fp = ca->minloc;
+ else if (ca->flag & ACT_CONST_LOCY) fp = ca->minloc+1;
+ else if (ca->flag & ACT_CONST_LOCZ) fp = ca->minloc+2;
+ else if (ca->flag & ACT_CONST_ROTX) fp = ca->minrot;
+ else if (ca->flag & ACT_CONST_ROTY) fp = ca->minrot+1;
+ else fp = ca->minrot+2;
return *fp;
}
@@ -176,12 +176,12 @@ static void rna_ConstraintActuator_limitmin_set(struct PointerRNA *ptr, float va
bConstraintActuator *ca = act->data;
float *fp;
- if(ca->flag & ACT_CONST_LOCX) fp= ca->minloc;
- else if(ca->flag & ACT_CONST_LOCY) fp= ca->minloc+1;
- else if(ca->flag & ACT_CONST_LOCZ) fp= ca->minloc+2;
- else if(ca->flag & ACT_CONST_ROTX) fp= ca->minrot;
- else if(ca->flag & ACT_CONST_ROTY) fp= ca->minrot+1;
- else fp= ca->minrot+2;
+ if (ca->flag & ACT_CONST_LOCX) fp = ca->minloc;
+ else if (ca->flag & ACT_CONST_LOCY) fp = ca->minloc+1;
+ else if (ca->flag & ACT_CONST_LOCZ) fp = ca->minloc+2;
+ else if (ca->flag & ACT_CONST_ROTX) fp = ca->minrot;
+ else if (ca->flag & ACT_CONST_ROTY) fp = ca->minrot+1;
+ else fp = ca->minrot+2;
*fp = value;
}
@@ -192,12 +192,12 @@ static float rna_ConstraintActuator_limitmax_get(struct PointerRNA *ptr)
bConstraintActuator *ca = act->data;
float *fp;
- if(ca->flag & ACT_CONST_LOCX) fp= ca->maxloc;
- else if(ca->flag & ACT_CONST_LOCY) fp= ca->maxloc+1;
- else if(ca->flag & ACT_CONST_LOCZ) fp= ca->maxloc+2;
- else if(ca->flag & ACT_CONST_ROTX) fp= ca->maxrot;
- else if(ca->flag & ACT_CONST_ROTY) fp= ca->maxrot+1;
- else fp= ca->maxrot+2;
+ if (ca->flag & ACT_CONST_LOCX) fp = ca->maxloc;
+ else if (ca->flag & ACT_CONST_LOCY) fp = ca->maxloc+1;
+ else if (ca->flag & ACT_CONST_LOCZ) fp = ca->maxloc+2;
+ else if (ca->flag & ACT_CONST_ROTX) fp = ca->maxrot;
+ else if (ca->flag & ACT_CONST_ROTY) fp = ca->maxrot+1;
+ else fp = ca->maxrot+2;
return *fp;
}
@@ -208,12 +208,12 @@ static void rna_ConstraintActuator_limitmax_set(struct PointerRNA *ptr, float va
bConstraintActuator *ca = act->data;
float *fp;
- if(ca->flag & ACT_CONST_LOCX) fp= ca->maxloc;
- else if(ca->flag & ACT_CONST_LOCY) fp= ca->maxloc+1;
- else if(ca->flag & ACT_CONST_LOCZ) fp= ca->maxloc+2;
- else if(ca->flag & ACT_CONST_ROTX) fp= ca->maxrot;
- else if(ca->flag & ACT_CONST_ROTY) fp= ca->maxrot+1;
- else fp= ca->maxrot+2;
+ if (ca->flag & ACT_CONST_LOCX) fp = ca->maxloc;
+ else if (ca->flag & ACT_CONST_LOCY) fp = ca->maxloc+1;
+ else if (ca->flag & ACT_CONST_LOCZ) fp = ca->maxloc+2;
+ else if (ca->flag & ACT_CONST_ROTX) fp = ca->maxrot;
+ else if (ca->flag & ACT_CONST_ROTY) fp = ca->maxrot+1;
+ else fp = ca->maxrot+2;
*fp = value;
}
@@ -224,9 +224,9 @@ static float rna_ConstraintActuator_distance_get(struct PointerRNA *ptr)
bConstraintActuator *ca = act->data;
float *fp;
- if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->minloc;
- else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->minloc+1;
- else fp= ca->minloc+2;
+ if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->minloc;
+ else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->minloc+1;
+ else fp = ca->minloc+2;
return *fp;
}
@@ -237,9 +237,9 @@ static void rna_ConstraintActuator_distance_set(struct PointerRNA *ptr, float va
bConstraintActuator *ca = act->data;
float *fp;
- if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->minloc;
- else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->minloc+1;
- else fp= ca->minloc+2;
+ if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->minloc;
+ else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->minloc+1;
+ else fp = ca->minloc+2;
*fp = value;
}
@@ -250,9 +250,9 @@ static float rna_ConstraintActuator_range_get(struct PointerRNA *ptr)
bConstraintActuator *ca = act->data;
float *fp;
- if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->maxloc;
- else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->maxloc+1;
- else fp= ca->maxloc+2;
+ if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->maxloc;
+ else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->maxloc+1;
+ else fp = ca->maxloc+2;
return *fp;
}
@@ -263,9 +263,9 @@ static void rna_ConstraintActuator_range_set(struct PointerRNA *ptr, float value
bConstraintActuator *ca = act->data;
float *fp;
- if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->maxloc;
- else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->maxloc+1;
- else fp= ca->maxloc+2;
+ if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->maxloc;
+ else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->maxloc+1;
+ else fp = ca->maxloc+2;
*fp = value;
}
@@ -276,9 +276,9 @@ static float rna_ConstraintActuator_fhheight_get(struct PointerRNA *ptr)
bConstraintActuator *ca = act->data;
float *fp;
- if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->minloc;
- else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->minloc+1;
- else fp= ca->minloc+2;
+ if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->minloc;
+ else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->minloc+1;
+ else fp = ca->minloc+2;
return *fp;
}
@@ -289,9 +289,9 @@ static void rna_ConstraintActuator_fhheight_set(struct PointerRNA *ptr, float va
bConstraintActuator *ca = act->data;
float *fp;
- if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->minloc;
- else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->minloc+1;
- else fp= ca->minloc+2;
+ if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->minloc;
+ else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->minloc+1;
+ else fp = ca->minloc+2;
*fp = value;
}
@@ -302,9 +302,9 @@ static float rna_ConstraintActuator_spring_get(struct PointerRNA *ptr)
bConstraintActuator *ca = act->data;
float *fp;
- if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->maxloc;
- else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->maxloc+1;
- else fp= ca->maxloc+2;
+ if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->maxloc;
+ else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->maxloc+1;
+ else fp = ca->maxloc+2;
return *fp;
}
@@ -315,9 +315,9 @@ static void rna_ConstraintActuator_spring_set(struct PointerRNA *ptr, float valu
bConstraintActuator *ca = act->data;
float *fp;
- if(ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= ca->maxloc;
- else if(ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= ca->maxloc+1;
- else fp= ca->maxloc+2;
+ if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->maxloc;
+ else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->maxloc+1;
+ else fp = ca->maxloc+2;
*fp = value;
}
@@ -341,7 +341,7 @@ static void rna_ActionActuator_add_set(struct PointerRNA *ptr, int value)
bActuator *act = (bActuator *)ptr->data;
bActionActuator *aa = act->data;
- if(value == 1){
+ if (value == 1){
aa->flag &= ~ACT_IPOFORCE;
aa->flag |= ACT_IPOADD;
}else
@@ -353,7 +353,7 @@ static void rna_ActionActuator_force_set(struct PointerRNA *ptr, int value)
bActuator *act = (bActuator *)ptr->data;
bActionActuator *aa = act->data;
- if(value == 1){
+ if (value == 1){
aa->flag &= ~ACT_IPOADD;
aa->flag |= ACT_IPOFORCE;
}else
@@ -362,10 +362,9 @@ static void rna_ActionActuator_force_set(struct PointerRNA *ptr, int value)
static void rna_ObjectActuator_type_set(struct PointerRNA *ptr, int value)
{
- bActuator *act= (bActuator *)ptr->data;
+ bActuator *act = (bActuator *)ptr->data;
bObjectActuator *oa = act->data;
- if (value != oa->type)
- {
+ if (value != oa->type) {
oa->type = value;
switch (oa->type) {
case ACT_OBJECT_NORMAL:
@@ -400,18 +399,18 @@ static void rna_StateActuator_state_set(PointerRNA *ptr, const int *values)
bActuator *act = (bActuator*)ptr->data;
bStateActuator *sa = act->data;
- int i, tot= 0;
+ int i, tot = 0;
/* ensure we always have some state selected */
- for(i=0; i<OB_MAX_STATES; i++)
- if(values[i])
+ for (i = 0; i<OB_MAX_STATES; i++)
+ if (values[i])
tot++;
- if(tot==0)
+ if (tot == 0)
return;
- for(i=0; i<OB_MAX_STATES; i++) {
- if(values[i]) sa->mask |= (1<<i);
+ for (i = 0; i<OB_MAX_STATES; i++) {
+ if (values[i]) sa->mask |= (1<<i);
else sa->mask &= ~(1<<i);
}
}
@@ -419,11 +418,11 @@ static void rna_StateActuator_state_set(PointerRNA *ptr, const int *values)
/* Always keep in alphabetical order */
EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{
- EnumPropertyItem *item= NULL;
- Object *ob= NULL;
- int totitem= 0;
+ EnumPropertyItem *item = NULL;
+ Object *ob = NULL;
+ int totitem = 0;
- if (ptr->type==&RNA_Actuator || RNA_struct_is_a(ptr->type, &RNA_Actuator)){
+ if (ptr->type == &RNA_Actuator || RNA_struct_is_a(ptr->type, &RNA_Actuator)){
ob = (Object *)ptr->id.data;
} else {
/* can't use ob from ptr->id.data because that enum is also used by operators */
@@ -431,7 +430,7 @@ EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, Property
}
if (ob != NULL) {
- if (ob->type==OB_ARMATURE) {
+ if (ob->type == OB_ARMATURE) {
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ARMATURE);
}
}
@@ -455,32 +454,32 @@ EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, Property
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_VISIBILITY);
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
static void rna_Actuator_Armature_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- bActuator *act= (bActuator *)ptr->data;
+ bActuator *act = (bActuator *)ptr->data;
bArmatureActuator *aa = act->data;
Object *ob = (Object *)ptr->id.data;
- char *posechannel= aa->posechannel;
- char *constraint= aa->constraint;
+ char *posechannel = aa->posechannel;
+ char *constraint = aa->constraint;
/* check that bone exist in the active object */
if (ob->type == OB_ARMATURE && ob->pose) {
bPoseChannel *pchan;
bPose *pose = ob->pose;
- for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) {
+ for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
if (!strcmp(pchan->name, posechannel)) {
/* found it, now look for constraint channel */
bConstraint *con;
- for (con=pchan->constraints.first; con; con=con->next) {
+ for (con = pchan->constraints.first; con; con = con->next) {
if (!strcmp(con->name, constraint)) {
/* found it, all ok */
- return;
+ return;
}
}
/* didn't find constraint, make empty */
@@ -500,7 +499,7 @@ static void rna_SteeringActuator_navmesh_set(PointerRNA *ptr, PointerRNA value)
bSteeringActuator *sa = (bSteeringActuator*) act->data;
Object* obj = value.data;
- if (obj && obj->body_type==OB_BODY_TYPE_NAVMESH)
+ if (obj && obj->body_type == OB_BODY_TYPE_NAVMESH)
sa->navmesh = obj;
else
sa->navmesh = NULL;
@@ -530,29 +529,29 @@ void rna_def_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Actuator", NULL);
+ srna = RNA_def_struct(brna, "Actuator", NULL);
RNA_def_struct_ui_text(srna, "Actuator", "Actuator to apply actions in the game engine");
RNA_def_struct_sdna(srna, "bActuator");
RNA_def_struct_refine_func(srna, "rna_Actuator_refine");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Actuator_name_set");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, actuator_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Actuator_type_set", "rna_Actuator_type_itemf");
RNA_def_property_ui_text(prop, "Type", "");
- prop= RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_PIN);
RNA_def_property_ui_text(prop, "Pinned", "Display when not linked to a visible states controller");
RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SHOW);
RNA_def_property_ui_text(prop, "Expanded", "Set actuator expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
@@ -565,7 +564,7 @@ static void rna_def_action_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{ACT_ACTION_PLAY, "PLAY", 0, "Play", ""},
{ACT_ACTION_PINGPONG, "PINGPONG", 0, "Ping Pong", ""},
{ACT_ACTION_FLIPPER, "FLIPPER", 0, "Flipper", ""},
@@ -577,17 +576,17 @@ static void rna_def_action_actuator(BlenderRNA *brna)
#endif
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ActionActuator", "Actuator");
+ srna = RNA_def_struct(brna, "ActionActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Action Actuator", "Actuator to control the object movement");
RNA_def_struct_sdna_from(srna, "bActionActuator", "data");
- prop= RNA_def_property(srna, "play_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "play_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Action Type", "Action playback type");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act");
RNA_def_property_struct_type(prop, "Action");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -596,79 +595,79 @@ static void rna_def_action_actuator(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_action_action_set", NULL, NULL);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "end_reset", 1);
RNA_def_property_ui_text(prop, "Continue", "Restore last frame when switching on/off, otherwise play from the start each time");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "Use this property to define the Action position");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sta");
RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 100, 2);
RNA_def_property_ui_text(prop, "Start Frame", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "end");
RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 100, 2);
RNA_def_property_ui_text(prop, "End Frame", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "frame_blend_in", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_blend_in", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "blendin");
RNA_def_property_range(prop, 0, 32767);
RNA_def_property_ui_text(prop, "Blendin", "Number of frames of motion blending");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "priority", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "priority", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Priority", "Execution priority - lower numbers will override actions with higher numbers (with 2 or more actions at once, the overriding channels must be lower in the stack)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "layer", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "layer", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 7); /* This should match BL_ActionManager::MAX_ACTION_LAYERS - 1 */
RNA_def_property_ui_text(prop, "Layer", "The animation layer to play the action on");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "layer_weight", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "layer_weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Layer Weight", "How much of the previous layer to blend into this one (0 = add mode)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "frameProp");
RNA_def_property_ui_text(prop, "Frame Property", "Assign the action's current frame number to this property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
- prop= RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOADD);
RNA_def_property_boolean_funcs(prop, NULL, "rna_ActionActuator_add_set");
RNA_def_property_ui_text(prop, "Add", "Action is added to the current loc/rot/scale in global or local coordinate according to Local flag");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_force", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_force", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOFORCE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_ActionActuator_force_set");
RNA_def_property_ui_text(prop, "Force", "Apply Action as a global or local force depending on the local option (dynamic objects only)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_local", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_local", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOLOCAL);
RNA_def_property_ui_text(prop, "L", "Let the Action act in local coordinates, used in Force and Add mode");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "apply_to_children", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "apply_to_children", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOCHILD);
RNA_def_property_ui_text(prop, "Child", "Update Action on all children Objects as well");
RNA_def_property_update(prop, NC_LOGIC, NULL);
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
- prop= RNA_def_property(srna, "stride_length", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "stride_length", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stridelength");
RNA_def_property_range(prop, 0.0, 2500.0);
RNA_def_property_ui_text(prop, "Cycle", "Distance covered by a single cycle of the action");
@@ -681,128 +680,128 @@ static void rna_def_object_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA* prop;
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{ACT_OBJECT_NORMAL, "OBJECT_NORMAL", 0, "Simple Motion", ""},
{ACT_OBJECT_SERVO, "OBJECT_SERVO", 0, "Servo Control", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ObjectActuator", "Actuator");
+ srna = RNA_def_struct(brna, "ObjectActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Motion Actuator", "Actuator to control the object movement");
RNA_def_struct_sdna_from(srna, "bObjectActuator", "data");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_ObjectActuator_type_set", NULL);
RNA_def_property_ui_text(prop, "Motion Type", "Specify the motion system");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "reference_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "reference_object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "reference");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Reference Object", "Reference object for velocity calculation, leave empty for world reference");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "damping", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "damping", PROP_INT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 1000, 1, 1);
RNA_def_property_ui_text(prop, "Damping Frames", "Number of frames to reach the target velocity");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "proportional_coefficient", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "proportional_coefficient", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "forcerot[0]");
RNA_def_property_ui_range(prop, 0.0, 200.0, 10, 2);
RNA_def_property_ui_text(prop, "Proportional Coefficient", "Typical value is 60x integral coefficient");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "integral_coefficient", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "integral_coefficient", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "forcerot[1]");
RNA_def_property_ui_range(prop, 0.0, 3.0, 10, 2);
RNA_def_property_float_funcs(prop, NULL, "rna_ObjectActuator_integralcoefficient_set", NULL);
RNA_def_property_ui_text(prop, "Integral Coefficient", "Low value (0.01) for slow response, high value (0.5) for fast response");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "derivate_coefficient", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "derivate_coefficient", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "forcerot[2]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 10, 2);
RNA_def_property_ui_text(prop, "Derivate Coefficient", "Not required, high values can cause instability");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Servo Limit */
- prop= RNA_def_property(srna, "force_max_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "force_max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dloc[0]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
RNA_def_property_ui_text(prop, "Max", "Upper limit for X force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "force_min_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "force_min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "drot[0]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
RNA_def_property_ui_text(prop, "Min", "Lower limit for X force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "force_max_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "force_max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dloc[1]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
RNA_def_property_ui_text(prop, "Max", "Upper limit for Y force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "force_min_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "force_min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "drot[1]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
RNA_def_property_ui_text(prop, "Min", "Lower limit for Y force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "force_max_z", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "force_max_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dloc[2]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
RNA_def_property_ui_text(prop, "Max", "Upper limit for Z force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "force_min_z", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "force_min_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "drot[2]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1, 2);
RNA_def_property_ui_text(prop, "Min", "Lower limit for Z force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats 3 Arrays*/
- prop= RNA_def_property(srna, "offset_location", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "offset_location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "dloc");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
RNA_def_property_ui_text(prop, "Loc", "Location");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "offset_rotation", PROP_FLOAT, PROP_EULER);
+ prop = RNA_def_property(srna, "offset_rotation", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "drot");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
RNA_def_property_ui_text(prop, "Rot", "Rotation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "force", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "forceloc");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
RNA_def_property_ui_text(prop, "Force", "Force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "torque", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "torque", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "forcerot");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
RNA_def_property_ui_text(prop, "Torque", "Torque");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "linearvelocity");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
RNA_def_property_ui_text(prop, "Linear Velocity", "Linear velocity (in Servo mode it sets the target relative linear velocity, it will be achieved by automatic application of force - Null velocity is a valid target)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "angularvelocity");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
@@ -810,52 +809,52 @@ static void rna_def_object_actuator(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
- prop= RNA_def_property(srna, "use_local_location", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_local_location", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_DLOC_LOCAL);
RNA_def_property_ui_text(prop, "L", "Location is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_local_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_local_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_DROT_LOCAL);
RNA_def_property_ui_text(prop, "L", "Rotation is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_local_force", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_local_force", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_FORCE_LOCAL);
RNA_def_property_ui_text(prop, "L", "Force is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_local_torque", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_local_torque", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_TORQUE_LOCAL);
RNA_def_property_ui_text(prop, "L", "Torque is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_local_linear_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_local_linear_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_LIN_VEL_LOCAL);
RNA_def_property_ui_text(prop, "L", "Velocity is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_local_angular_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_local_angular_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_ANG_VEL_LOCAL);
RNA_def_property_ui_text(prop, "L", "Angular velocity is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_add_linear_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_add_linear_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_ADD_LIN_VEL);
RNA_def_property_ui_text(prop, "Add", "Toggles between ADD and SET linV");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_servo_limit_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_servo_limit_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_X);
RNA_def_property_ui_text(prop, "X", "Set limit to force along the X axis");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_servo_limit_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_servo_limit_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_Y);
RNA_def_property_ui_text(prop, "Y", "Set limit to force along the Y axis");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_servo_limit_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_servo_limit_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_Z);
RNA_def_property_ui_text(prop, "Z", "Set limit to force along the Z axis");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -866,18 +865,18 @@ static void rna_def_camera_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_axis_items[] ={
+ static EnumPropertyItem prop_axis_items[] = {
{OB_POSX, "POS_X", 0, "+X", "Camera tries to get behind the X axis"},
{OB_POSY, "POS_Y", 0, "+Y", "Camera tries to get behind the Y axis"},
{OB_NEGX, "NEG_X", 0, "-X", "Camera tries to get behind the -X axis"},
{OB_NEGY, "NEG_Y", 0, "-Y", "Camera tries to get behind the -Y axis"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "CameraActuator", "Actuator");
+ srna = RNA_def_struct(brna, "CameraActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Camera Actuator", "");
RNA_def_struct_sdna_from(srna, "bCameraActuator", "data");
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -885,22 +884,22 @@ static void rna_def_camera_actuator(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats */
- prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2);
RNA_def_property_ui_text(prop, "Height", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2);
RNA_def_property_ui_text(prop, "Min", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0.0, 20.0, 1, 2);
RNA_def_property_ui_text(prop, "Max", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "damping");
RNA_def_property_range(prop, 0, 10.0);
RNA_def_property_ui_range(prop, 0, 5.0, 1, 2);
@@ -908,7 +907,7 @@ static void rna_def_camera_actuator(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* +x/+y/-x/-y */
- prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "axis");
RNA_def_property_enum_items(prop, prop_axis_items);
RNA_def_property_ui_text(prop, "Axis", "Axis the Camera will try to get behind");
@@ -920,7 +919,7 @@ static void rna_def_sound_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{ACT_SND_PLAY_STOP_SOUND, "PLAYSTOP", 0, "Play Stop", ""},
{ACT_SND_PLAY_END_SOUND, "PLAYEND", 0, "Play End", ""},
{ACT_SND_LOOP_STOP_SOUND, "LOOPSTOP", 0, "Loop Stop", ""},
@@ -930,84 +929,84 @@ static void rna_def_sound_actuator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- srna= RNA_def_struct(brna, "SoundActuator", "Actuator");
+ srna = RNA_def_struct(brna, "SoundActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Sound Actuator", "Actuator to handle sound");
RNA_def_struct_sdna_from(srna, "bSoundActuator", "data");
- prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Sound");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_struct_ui_text(srna, "Sound", "Sound file");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Play Mode", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Volume", "Initial volume of the sound");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, -12.0, 12.0, 1, 2);
RNA_def_property_ui_text(prop, "Pitch", "Pitch of the sound");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats - 3D Parameters */
- prop= RNA_def_property(srna, "gain_3d_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "gain_3d_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.min_gain");
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
RNA_def_property_ui_text(prop, "Minimum Gain", "The minimum gain of the sound, no matter how far it is away");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "gain_3d_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "gain_3d_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.max_gain");
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
RNA_def_property_ui_text(prop, "Maximum Gain", "The maximum gain of the sound, no matter how near it is");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "distance_3d_reference", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance_3d_reference", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.reference_distance");
RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1, 2);
RNA_def_property_ui_text(prop, "Reference Distance", "The distance where the sound has a gain of 1.0");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "distance_3d_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance_3d_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.max_distance");
RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1, 2);
RNA_def_property_ui_text(prop, "Maximum Distance", "The maximum distance at which you can hear the sound");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "rolloff_factor_3d", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "rolloff_factor_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.rolloff_factor");
RNA_def_property_ui_range(prop, 0.0, 5.0, 1, 2);
RNA_def_property_ui_text(prop, "Rolloff", "The influence factor on volume depending on distance");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "cone_outer_gain_3d", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "cone_outer_gain_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_outer_gain");
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
RNA_def_property_ui_text(prop, "Cone Outer Gain", "The gain outside the outer cone (the gain in the outer cone will be interpolated between this value and the normal gain in the inner cone)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "cone_outer_angle_3d", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "cone_outer_angle_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_outer_angle");
RNA_def_property_ui_range(prop, 0.0, 360.0, 1, 2);
RNA_def_property_ui_text(prop, "Cone Outer Angle", "The angle of the outer cone");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "cone_inner_angle_3d", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "cone_inner_angle_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_inner_angle");
RNA_def_property_ui_range(prop, 0.0, 360.0, 1, 2);
RNA_def_property_ui_text(prop, "Cone Inner Angle", "The angle of the inner cone");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
- prop= RNA_def_property(srna, "use_sound_3d", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_sound_3d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SND_3D_SOUND);
RNA_def_property_ui_text(prop, "3D Sound", "Enable/Disable 3D Sound");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -1018,7 +1017,7 @@ static void rna_def_property_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{ACT_PROP_ASSIGN, "ASSIGN", 0, "Assign", ""},
{ACT_PROP_ADD, "ADD", 0, "Add", ""},
{ACT_PROP_COPY, "COPY", 0, "Copy", ""},
@@ -1026,35 +1025,35 @@ static void rna_def_property_actuator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- srna= RNA_def_struct(brna, "PropertyActuator", "Actuator");
+ srna = RNA_def_struct(brna, "PropertyActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Property Actuator", "Actuator to handle properties");
RNA_def_struct_sdna_from(srna, "bPropertyActuator", "data");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Mode", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "The name of the property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Value", "The name of the property or the value to use (use \"\" around strings)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Copy Mode */
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Copy from this Object");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- //XXX add even magic'er property lookup (need to look for the property list of the target object)
- prop= RNA_def_property(srna, "object_property", PROP_STRING, PROP_NONE);
+ /*XXX add even magic'er property lookup (need to look for the property list of the target object) */
+ prop = RNA_def_property(srna, "object_property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "value");
RNA_def_property_ui_text(prop, "Property Name", "Copy this property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -1065,7 +1064,7 @@ static void rna_def_constraint_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{ACT_CONST_TYPE_LOC, "LOC", 0, "Location Constraint", ""},
{ACT_CONST_TYPE_DIST, "DIST", 0, "Distance Constraint", ""},
{ACT_CONST_TYPE_ORI, "ORI", 0, "Orientation Constraint", ""},
@@ -1073,7 +1072,7 @@ static void rna_def_constraint_actuator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- static EnumPropertyItem prop_limit_items[] ={
+ static EnumPropertyItem prop_limit_items[] = {
{ACT_CONST_NONE, "NONE", 0, "None", ""},
{ACT_CONST_LOCX, "LOCX", 0, "Loc X", ""},
{ACT_CONST_LOCY, "LOCY", 0, "Loc Y", ""},
@@ -1081,7 +1080,7 @@ static void rna_def_constraint_actuator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- static EnumPropertyItem prop_direction_items[] ={
+ static EnumPropertyItem prop_direction_items[] = {
{ACT_CONST_NONE, "NONE", 0, "None", ""},
{ACT_CONST_DIRPX, "DIRPX", 0, "X axis", ""},
{ACT_CONST_DIRPY, "DIRPY", 0, "Y axis", ""},
@@ -1092,7 +1091,7 @@ static void rna_def_constraint_actuator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- static EnumPropertyItem prop_direction_pos_items[] ={
+ static EnumPropertyItem prop_direction_pos_items[] = {
{ACT_CONST_NONE, "NONE", 0, "None", ""},
{ACT_CONST_DIRPX, "DIRPX", 0, "X axis", ""},
{ACT_CONST_DIRPY, "DIRPY", 0, "Y axis", ""},
@@ -1100,172 +1099,172 @@ static void rna_def_constraint_actuator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- srna= RNA_def_struct(brna, "ConstraintActuator", "Actuator");
+ srna = RNA_def_struct(brna, "ConstraintActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Constraint Actuator", "Actuator to handle Constraints");
RNA_def_struct_sdna_from(srna, "bConstraintActuator", "data");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_ConstraintActuator_type_set", NULL);
RNA_def_property_ui_text(prop, "Constraints Mode", "The type of the constraint");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "limit", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "limit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_limit_items);
RNA_def_property_ui_text(prop, "Limit", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, prop_direction_items);
RNA_def_property_ui_text(prop, "Direction", "Direction of the ray");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "direction_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "direction_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, prop_direction_items);
RNA_def_property_ui_text(prop, "Direction", "Select the axis to be aligned along the reference direction");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_CONST_TYPE_LOC */
- prop= RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_limitmin_get", "rna_ConstraintActuator_limitmin_set", NULL);
RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Min", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_limitmax_get", "rna_ConstraintActuator_limitmax_set", NULL);
RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Max", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "damping", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "damping", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "damp");
RNA_def_property_ui_range(prop, 0, 100, 1, 1);
RNA_def_property_ui_text(prop, "Damping", "Damping factor: time constant (in frame) of low pass filter");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_CONST_TYPE_DIST */
- prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_range_get", "rna_ConstraintActuator_range_set", NULL);
RNA_def_property_ui_range(prop, 0.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Range", "Maximum length of ray");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_distance_get", "rna_ConstraintActuator_distance_set", NULL);
RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Distance", "Keep this distance to target");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- //XXX to use a pointer or add a material lookup
- prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
+ /*XXX to use a pointer or add a material lookup */
+ prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "matprop");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Material", "Ray detects only Objects with this material");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- //XXX add magic property lookup
- prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ /*XXX add magic property lookup */
+ prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "matprop");
RNA_def_property_ui_text(prop, "Property", "Ray detects only Objects with this property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "time", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "time", PROP_INT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 1000, 1, 2);
RNA_def_property_ui_text(prop, "Time", "Maximum activation time in frame, 0 for unlimited");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "damping_rotation", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "damping_rotation", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rotdamp");
RNA_def_property_ui_range(prop, 0, 100, 1, 1);
RNA_def_property_ui_text(prop, "RotDamp", "Use a different damping for orientation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_CONST_TYPE_ORI */
- prop= RNA_def_property(srna, "direction_axis_pos", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "direction_axis_pos", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, prop_direction_pos_items);
RNA_def_property_ui_text(prop, "Direction", "Select the axis to be aligned along the reference direction");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "rotation_max", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "rotation_max", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "maxrot");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -2000.0, 2000.0, 10, 2);
RNA_def_property_ui_text(prop, "Reference Direction", "Reference Direction");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- //XXX TODO - use radians internally then change to PROP_ANGLE
- prop= RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_NONE);
+ /*XXX TODO - use radians internally then change to PROP_ANGLE */
+ prop = RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minloc[0]");
RNA_def_property_range(prop, 0.0, 180.0);
RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle (in degree) to maintain with target direction (no correction is done if angle with target direction is between min and max)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- //XXX TODO - use radians internally then change to PROP_ANGLE
- prop= RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_NONE);
+ /*XXX TODO - use radians internally then change to PROP_ANGLE */
+ prop = RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxloc[0]");
RNA_def_property_range(prop, 0.0, 180.0);
RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle (in degree) allowed with target direction (no correction is done if angle with target direction is between min and max)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_CONST_TYPE_FH */
- prop= RNA_def_property(srna, "fh_height", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "fh_height", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_fhheight_get", "rna_ConstraintActuator_fhheight_set", NULL);
RNA_def_property_ui_range(prop, 0.01, 2000.0, 10, 2);
RNA_def_property_ui_text(prop, "Distance", "Height of the force field area");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "fh_force", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "fh_force", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_spring_get", "rna_ConstraintActuator_spring_set", NULL);
RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 2);
RNA_def_property_ui_text(prop, "Force", "Spring force within the force field area");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "fh_damping", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "fh_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxrot[0]");
RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 2);
RNA_def_property_ui_text(prop, "Damping", "Damping factor of the force field spring");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
- prop= RNA_def_property(srna, "use_force_distance", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_force_distance", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_DISTANCE);
RNA_def_property_ui_text(prop, "Force Distance", "Force distance of object to point of impact of ray");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_local", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_local", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_LOCAL);
RNA_def_property_ui_text(prop, "L", "Set ray along object's axis or global axis");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_NORMAL);
RNA_def_property_ui_text(prop, "N", "Set object axis along (local axis) or parallel (global axis) to the normal at hit position");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_PERMANENT);
RNA_def_property_ui_text(prop, "PER", "Persistent actuator: stays active even if ray does not reach target");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- //XXX to use an enum instead of a flag if possible
- prop= RNA_def_property(srna, "use_material_detect", PROP_BOOLEAN, PROP_NONE);
+ /*XXX to use an enum instead of a flag if possible */
+ prop = RNA_def_property(srna, "use_material_detect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_MATERIAL);
RNA_def_property_ui_text(prop, "M/P", "Detect material instead of property");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Actuator_constraint_detect_material_set");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_fh_paralel_axis", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_fh_paralel_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_DOROTFH);
RNA_def_property_ui_text(prop, "Rot Fh", "Keep object axis parallel to normal");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_fh_normal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_fh_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_NORMAL);
RNA_def_property_ui_text(prop, "N", "Add a horizontal spring force on slopes");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -1276,7 +1275,7 @@ static void rna_def_edit_object_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_dyn_items[] ={
+ static EnumPropertyItem prop_dyn_items[] = {
{ACT_EDOB_RESTORE_DYN, "RESTOREDYN", 0, "Restore Dynamics", ""},
{ACT_EDOB_SUSPEND_DYN, "SUSPENDDYN", 0, "Suspend Dynamics", ""},
{ACT_EDOB_ENABLE_RB, "ENABLERIGIDBODY", 0, "Enable Rigid Body", ""},
@@ -1284,7 +1283,7 @@ static void rna_def_edit_object_actuator(BlenderRNA *brna)
{ACT_EDOB_SET_MASS, "SETMASS", 0, "Set Mass", ""},
{0, NULL, 0, NULL, NULL} };
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{ACT_EDOB_ADD_OBJECT, "ADDOBJECT", 0, "Add Object", ""},
{ACT_EDOB_END_OBJECT, "ENDOBJECT", 0, "End Object", ""},
{ACT_EDOB_REPLACE_MESH, "REPLACEMESH", 0, "Replace Mesh", ""},
@@ -1292,37 +1291,37 @@ static void rna_def_edit_object_actuator(BlenderRNA *brna)
{ACT_EDOB_DYNAMICS, "DYNAMICS", 0, "Dynamics", ""},
{0, NULL, 0, NULL, NULL} };
- srna= RNA_def_struct(brna, "EditObjectActuator", "Actuator");
+ srna = RNA_def_struct(brna, "EditObjectActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Edit Object Actuator", "Actuator used to edit objects");
RNA_def_struct_sdna_from(srna, "bEditObjectActuator", "data");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Edit Object", "The mode of the actuator");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "dynamic_operation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "dynamic_operation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "dyn_operation");
RNA_def_property_enum_items(prop, prop_dyn_items);
RNA_def_property_ui_text(prop, "Dynamic Operation", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Add this Object and all its children (can't be on a visible layer)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "track_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "track_object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Track to this Object");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "mesh", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "mesh", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Mesh");
RNA_def_property_pointer_sdna(prop, NULL, "me");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -1331,25 +1330,25 @@ static void rna_def_edit_object_actuator(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_editobject_mesh_set", NULL, NULL);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "time", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "time", PROP_INT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 2000, 1, 1);
RNA_def_property_ui_text(prop, "Time", "Duration the new Object lives or the track takes");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 10000, 1, 2);
RNA_def_property_ui_text(prop, "Mass", "The mass of the object");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats 3 Arrays*/
- prop= RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "linVelocity");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -100.0, 100.0, 10, 2);
RNA_def_property_ui_text(prop, "Linear Velocity", "Velocity upon creation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "angVelocity");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2);
@@ -1357,27 +1356,27 @@ static void rna_def_edit_object_actuator(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
- prop= RNA_def_property(srna, "use_local_linear_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_local_linear_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "localflag", ACT_EDOB_LOCAL_LINV);
RNA_def_property_ui_text(prop, "L", "Apply the transformation locally");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_local_angular_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_local_angular_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "localflag", ACT_EDOB_LOCAL_ANGV);
RNA_def_property_ui_text(prop, "L", "Apply the rotation locally");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_replace_display_mesh", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_replace_display_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_EDOB_REPLACE_MESH_NOGFX);
RNA_def_property_ui_text(prop, "Gfx", "Replace the display mesh");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_replace_physics_mesh", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_replace_physics_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_EDOB_REPLACE_MESH_PHYS);
RNA_def_property_ui_text(prop, "Phys", "Replace the physics mesh (triangle bounds only - compound shapes not supported)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_3d_tracking", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_3d_tracking", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_TRACK_3D);
RNA_def_property_ui_text(prop, "3D", "Enable 3D tracking");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -1388,7 +1387,7 @@ static void rna_def_scene_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{ACT_SCENE_RESTART, "RESTART", 0, "Restart", ""},
{ACT_SCENE_SET, "SET", 0, "Set Scene", ""},
{ACT_SCENE_CAMERA, "CAMERA", 0, "Set Camera", ""},
@@ -1399,24 +1398,24 @@ static void rna_def_scene_actuator(BlenderRNA *brna)
{ACT_SCENE_RESUME, "RESUME", 0, "Resume Scene", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SceneActuator", "Actuator");
+ srna = RNA_def_struct(brna, "SceneActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Scene Actuator", "");
RNA_def_struct_sdna_from(srna, "bSceneActuator", "data");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Mode", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- //XXX filter only camera objects
- prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
+ /*XXX filter only camera objects */
+ prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Camera Object", "Set this Camera (leave empty to refer to self object)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Scene");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Scene", "Scene to be added/removed/paused/resumed");
@@ -1444,7 +1443,7 @@ static void rna_def_random_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_distribution_items[] ={
+ static EnumPropertyItem prop_distribution_items[] = {
{ACT_RANDOM_BOOL_CONST, "BOOL_CONSTANT", 0, "Bool Constant", ""},
{ACT_RANDOM_BOOL_UNIFORM, "BOOL_UNIFORM", 0, "Bool Uniform", ""},
{ACT_RANDOM_BOOL_BERNOUILLI, "BOOL_BERNOUILLI", 0, "Bool Bernoulli", ""},
@@ -1457,22 +1456,22 @@ static void rna_def_random_actuator(BlenderRNA *brna)
{ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL, "FLOAT_NEGATIVE_EXPONENTIAL", 0, "Float Neg. Exp.", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "RandomActuator", "Actuator");
+ srna = RNA_def_struct(brna, "RandomActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Random Actuator", "");
RNA_def_struct_sdna_from(srna, "bRandomActuator", "data");
- prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 1000, 1, 1);
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_text(prop, "Seed", "Initial seed of the random generator, use Python for more freedom (choose 0 for not random)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "propname");
RNA_def_property_ui_text(prop, "Property", "Assign the random value to this property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_distribution_items);
RNA_def_property_ui_text(prop, "Distribution", "Choose the type of distribution");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -1481,83 +1480,83 @@ static void rna_def_random_actuator(BlenderRNA *brna)
/* int_arg_1, int_arg_2, float_arg_1, float_arg_2 */
/* ACT_RANDOM_BOOL_CONST */
- prop= RNA_def_property(srna, "use_always_true", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_always_true", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "int_arg_1", 1);
RNA_def_property_ui_text(prop, "Always True", "Always false or always true");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_BOOL_UNIFORM */
- // label => "Choose between true and false, 50% chance each"
+ /* label => "Choose between true and false, 50% chance each" */
/* ACT_RANDOM_BOOL_BERNOUILLI */
- prop= RNA_def_property(srna, "chance", PROP_FLOAT, PROP_PERCENTAGE);
+ prop = RNA_def_property(srna, "chance", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Chance", "Pick a number between 0 and 1, success if it's below this value");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_INT_CONST */
- prop= RNA_def_property(srna, "int_value", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "int_value", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "int_arg_1");
RNA_def_property_ui_range(prop, -1000, 1000, 1, 1);
RNA_def_property_ui_text(prop, "Value", "Always return this number");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_INT_UNIFORM */
- prop= RNA_def_property(srna, "int_min", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "int_min", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "int_arg_1");
RNA_def_property_range(prop, -1000, 1000);
RNA_def_property_ui_text(prop, "Min", "Choose a number from a range: lower boundary of the range");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "int_max", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "int_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "int_arg_2");
RNA_def_property_range(prop, -1000, 1000);
RNA_def_property_ui_text(prop, "Max", "Choose a number from a range: upper boundary of the range");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_INT_POISSON */
- prop= RNA_def_property(srna, "int_mean", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "int_mean", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
RNA_def_property_range(prop, 0.01, 100.0);
RNA_def_property_ui_text(prop, "Mean", "Expected mean value of the distribution");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_FLOAT_CONST */
- prop= RNA_def_property(srna, "float_value", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "float_value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Value", "Always return this number");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_FLOAT_UNIFORM */
- prop= RNA_def_property(srna, "float_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "float_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
RNA_def_property_range(prop, -1000.0, 1000.0);
RNA_def_property_ui_text(prop, "Min", "Choose a number from a range: lower boundary of the range");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "float_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "float_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_2");
RNA_def_property_range(prop, -1000.0, 1000.0);
RNA_def_property_ui_text(prop, "Max", "Choose a number from a range: upper boundary of the range");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_FLOAT_NORMAL */
- prop= RNA_def_property(srna, "float_mean", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "float_mean", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
RNA_def_property_range(prop, -1000.0, 1000.0);
RNA_def_property_ui_text(prop, "Mean", "A normal distribution: mean of the distribution");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "standard_derivation", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "standard_derivation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_2");
RNA_def_property_range(prop, -1000.0, 1000.0);
RNA_def_property_ui_text(prop, "SD", "A normal distribution: standard deviation of the distribution");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL */
- prop= RNA_def_property(srna, "half_life_time", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "half_life_time", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
RNA_def_property_range(prop, -1000.0, 1000.0);
RNA_def_property_ui_text(prop, "Half-Life Time", "Negative exponential dropoff");
@@ -1569,37 +1568,37 @@ static void rna_def_message_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_body_type_items[] ={
+ static EnumPropertyItem prop_body_type_items[] = {
{ACT_MESG_MESG, "TEXT", 0, "Text", ""},
{ACT_MESG_PROP, "PROPERTY", 0, "Property", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MessageActuator", "Actuator");
+ srna = RNA_def_struct(brna, "MessageActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Message Actuator", "");
RNA_def_struct_sdna_from(srna, "bMessageActuator", "data");
- prop= RNA_def_property(srna, "to_property", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "to_property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "toPropName");
RNA_def_property_ui_text(prop, "To", "Optional, send message to objects with this name only, or empty to broadcast");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Subject", "Optional, message subject (this is what can be filtered on)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "body_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "body_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "bodyType");
RNA_def_property_enum_items(prop, prop_body_type_items);
RNA_def_property_ui_text(prop, "Body", "Toggle message type: either Text or a PropertyName");
/* ACT_MESG_MESG */
- prop= RNA_def_property(srna, "body_message", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "body_message", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "body");
RNA_def_property_ui_text(prop, "Body", "Optional, message body Text");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_MESG_PROP */
- prop= RNA_def_property(srna, "body_property", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "body_property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "body");
RNA_def_property_ui_text(prop, "Prop Name", "The message body will be set by the Property Value");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -1610,11 +1609,11 @@ static void rna_def_game_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
-// {ACT_GAME_LOAD, "LOAD", 0, "Load Game", ""},
-// {ACT_GAME_START, "START", 0, "Start Loaded Game", ""},
-// keeping the load/start hacky for compatibility with 2.49
-// ideally we could use ACT_GAME_START again and do a do_version()
+ static EnumPropertyItem prop_type_items[] = {
+/* {ACT_GAME_LOAD, "LOAD", 0, "Load Game", ""}, */
+/* {ACT_GAME_START, "START", 0, "Start Loaded Game", ""}, */
+/* keeping the load/start hacky for compatibility with 2.49 */
+/* ideally we could use ACT_GAME_START again and do a do_version() */
{ACT_GAME_LOAD, "START", 0, "Start Game From File", ""},
{ACT_GAME_RESTART, "RESTART", 0, "Restart Game", ""},
@@ -1623,21 +1622,21 @@ static void rna_def_game_actuator(BlenderRNA *brna)
{ACT_GAME_LOADCFG, "LOADCFG", 0, "Load bge.logic.globalDict", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "GameActuator", "Actuator");
+ srna = RNA_def_struct(brna, "GameActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Game Actuator", "");
RNA_def_struct_sdna_from(srna, "bGameActuator", "data");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Game", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_GAME_LOAD */
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_ui_text(prop, "File", "Load this blend file, use the \"//\" prefix for a path relative to the current blend file");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- //XXX to do: an operator that calls file_browse with relative_path on and blender filtering active
+ /*XXX to do: an operator that calls file_browse with relative_path on and blender filtering active */
}
static void rna_def_visibility_actuator(BlenderRNA *brna)
@@ -1645,21 +1644,21 @@ static void rna_def_visibility_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "VisibilityActuator", "Actuator");
+ srna = RNA_def_struct(brna, "VisibilityActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Visibility Actuator", "Actuator to set visibility and occlusion of the object");
RNA_def_struct_sdna_from(srna, "bVisibilityActuator", "data");
- prop= RNA_def_property(srna, "use_visible", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_visible", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_VISIBILITY_INVISIBLE);
RNA_def_property_ui_text(prop, "Visible", "Set the objects visible (initialized from the object render restriction toggle in physics button)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_occlusion", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_occlusion", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_VISIBILITY_OCCLUSION);
RNA_def_property_ui_text(prop, "Occlusion", "Set the object to occlude objects behind it (initialized from the object type in physics button)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "apply_to_children", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "apply_to_children", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_VISIBILITY_RECURSIVE);
RNA_def_property_ui_text(prop, "Children", "Set all the children of this object to the same visibility/occlusion recursively");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -1670,7 +1669,7 @@ static void rna_def_twodfilter_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{ACT_2DFILTER_ENABLED, "ENABLE", 0, "Enable Filter", ""},
{ACT_2DFILTER_DISABLED, "DISABLE", 0, "Disable Filter", ""},
{ACT_2DFILTER_NOFILTER, "REMOVE", 0, "Remove Filter", ""},
@@ -1686,40 +1685,40 @@ static void rna_def_twodfilter_actuator(BlenderRNA *brna)
{ACT_2DFILTER_SEPIA, "SEPIA", 0, "Sepia", ""},
{ACT_2DFILTER_INVERT, "INVERT", 0, "Invert", ""},
{ACT_2DFILTER_CUSTOMFILTER, "CUSTOMFILTER", 0, "Custom Filter", ""},
-// {ACT_2DFILTER_NUMBER_OF_FILTERS, "", 0, "Do not use it. Sentinel", ""},
+/* {ACT_2DFILTER_NUMBER_OF_FILTERS, "", 0, "Do not use it. Sentinel", ""}, */
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Filter2DActuator", "Actuator");
+ srna = RNA_def_struct(brna, "Filter2DActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Filter 2D Actuator", "Actuator to apply screen graphic effects");
RNA_def_struct_sdna_from(srna, "bTwoDFilterActuator", "data");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Filter 2D Type", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "glsl_shader", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "glsl_shader", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "text");
RNA_def_property_struct_type(prop, "Text");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Script", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "filter_pass", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "filter_pass", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "int_arg");
RNA_def_property_ui_text(prop, "Pass Number", "Set filter order");
- RNA_def_property_range(prop, 0, 99); //MAX_RENDER_PASS-1
+ RNA_def_property_range(prop, 0, 99); /*MAX_RENDER_PASS-1 */
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "motion_blur_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "motion_blur_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg");
RNA_def_property_ui_text(prop, "Value", "Motion blur factor");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
- prop= RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", 1);
RNA_def_property_ui_text(prop, "Enable", "Enable/Disable Motion Blur");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -1730,22 +1729,22 @@ static void rna_def_parent_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{ACT_PARENT_SET, "SETPARENT", 0, "Set Parent", ""},
{ACT_PARENT_REMOVE, "REMOVEPARENT", 0, "Remove Parent", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ParentActuator", "Actuator");
+ srna = RNA_def_struct(brna, "ParentActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Parent Actuator", "");
RNA_def_struct_sdna_from(srna, "bParentActuator", "data");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Scene", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -1753,12 +1752,12 @@ static void rna_def_parent_actuator(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
- prop= RNA_def_property(srna, "use_compound", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_compound", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_PARENT_COMPOUND);
RNA_def_property_ui_text(prop, "Compound", "Add this object shape to the parent shape (only if the parent shape is already compound)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_ghost", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_ghost", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_PARENT_GHOST);
RNA_def_property_ui_text(prop, "Ghost", "Make this object ghost while parented");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -1769,7 +1768,7 @@ static void rna_def_shape_action_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{ACT_ACTION_PLAY, "PLAY", 0, "Play", ""},
{ACT_ACTION_PINGPONG, "PINGPONG", 0, "Ping Pong", ""},
{ACT_ACTION_FLIPPER, "FLIPPER", 0, "Flipper", ""},
@@ -1781,17 +1780,17 @@ static void rna_def_shape_action_actuator(BlenderRNA *brna)
#endif
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ShapeActionActuator", "Actuator");
+ srna = RNA_def_struct(brna, "ShapeActionActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Shape Action Actuator", "Actuator to control shape key animations");
RNA_def_struct_sdna_from(srna, "bActionActuator", "data");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Action Type", "Action playback type");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act");
RNA_def_property_struct_type(prop, "Action");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -1800,46 +1799,46 @@ static void rna_def_shape_action_actuator(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_action_action_set", NULL, NULL);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "end_reset", 1);
RNA_def_property_ui_text(prop, "Continue", "Restore last frame when switching on/off, otherwise play from the start each time");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "Use this property to define the Action position");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sta");
RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 100, 2);
RNA_def_property_ui_text(prop, "Start Frame", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "end");
RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 100, 2);
RNA_def_property_ui_text(prop, "End Frame", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "frame_blend_in", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_blend_in", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "blendin");
RNA_def_property_range(prop, 0, 32767);
RNA_def_property_ui_text(prop, "Blendin", "Number of frames of motion blending");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "priority", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "priority", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Priority", "Execution priority - lower numbers will override actions with higher numbers (with 2 or more actions at once, the overriding channels must be lower in the stack)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "frameProp");
RNA_def_property_ui_text(prop, "Frame Property", "Assign the action's current frame number to this property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
- prop= RNA_def_property(srna, "stride_length", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "stride_length", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stridelength");
RNA_def_property_range(prop, 0.0, 2500.0);
RNA_def_property_ui_text(prop, "Cycle", "Distance covered by a single cycle of the action");
@@ -1852,24 +1851,24 @@ static void rna_def_state_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{ACT_STATE_SET, "SET", 0, "Set State", ""},
{ACT_STATE_ADD, "ADD", 0, "Add State", ""},
{ACT_STATE_REMOVE, "REMOVE", 0, "Remove State", ""},
{ACT_STATE_CHANGE, "CHANGE", 0, "Change State", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "StateActuator", "Actuator");
+ srna = RNA_def_struct(brna, "StateActuator", "Actuator");
RNA_def_struct_ui_text(srna, "State Actuator", "Actuator to handle states");
RNA_def_struct_sdna_from(srna, "bStateActuator", "data");
- prop= RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Operation", "Select the bit operation on object state mask");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "states", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop = RNA_def_property(srna, "states", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "mask", 1);
RNA_def_property_array(prop, OB_MAX_STATES);
RNA_def_property_ui_text(prop, "State", "");
@@ -1881,52 +1880,59 @@ static void rna_def_armature_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA* prop;
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{ACT_ARM_RUN, "RUN", 0, "Run Armature", ""},
{ACT_ARM_ENABLE, "ENABLE", 0, "Enable", ""},
{ACT_ARM_DISABLE, "DISABLE", 0, "Disable", ""},
{ACT_ARM_SETTARGET, "SETTARGET", 0, "Set Target", ""},
{ACT_ARM_SETWEIGHT, "SETWEIGHT", 0, "Set Weight", ""},
+ {ACT_ARM_SETINFLUENCE, "SETINFLUENCE", 0, "Set Influence", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ArmatureActuator", "Actuator");
+ srna = RNA_def_struct(brna, "ArmatureActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Armature Actuator", "");
RNA_def_struct_sdna_from(srna, "bArmatureActuator", "data");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Constraint Type", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "bone", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "bone", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "posechannel");
RNA_def_property_ui_text(prop, "Bone", "Bone on which the constraint is defined");
RNA_def_property_update(prop, NC_LOGIC, "rna_Actuator_Armature_update");
- prop= RNA_def_property(srna, "constraint", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "constraint", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "constraint");
RNA_def_property_ui_text(prop, "Constraint", "Name of the constraint to control");
RNA_def_property_update(prop, NC_LOGIC, "rna_Actuator_Armature_update");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Target", "Set this object as the target of the constraint");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "secondary_target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "secondary_target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "subtarget");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Secondary Target", "Set this object as the secondary target of the constraint (only IK polar target at the moment)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Weight", "Weight of this constraint");
RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "influence");
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_ui_text(prop, "Influence", "Influence of this constraint");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_steering_actuator(BlenderRNA *brna)
@@ -1934,13 +1940,13 @@ static void rna_def_steering_actuator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{ACT_STEERING_SEEK, "SEEK", 0, "Seek", ""},
{ACT_STEERING_FLEE, "FLEE", 0, "Flee", ""},
{ACT_STEERING_PATHFOLLOWING, "PATHFOLLOWING", 0, "Path following", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem facingaxis_items[] ={
+ static EnumPropertyItem facingaxis_items[] = {
{1, "X", 0, "X", ""},
{2, "Y", 0, "Y", ""},
{3, "Z", 0, "Z", ""},
@@ -1949,64 +1955,64 @@ static void rna_def_steering_actuator(BlenderRNA *brna)
{6, "NEG_Z", 0, "-Z", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SteeringActuator", "Actuator");
+ srna = RNA_def_struct(brna, "SteeringActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Steering Actuator", "");
RNA_def_struct_sdna_from(srna, "bSteeringActuator", "data");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Behavior", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "velocity");
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Velocity", "Velocity magnitude");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "acceleration", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "acceleration", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "acceleration");
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Acceleration", "Max acceleration");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "turn_speed", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "turn_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turnspeed");
RNA_def_property_range(prop, 0.0, 720.0);
RNA_def_property_ui_text(prop, "Turn Speed", "Max turn speed");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Dist", "Relax distance");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "target");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Target Object", "Target object");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "self_terminated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "self_terminated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_SELFTERMINATED);
RNA_def_property_ui_text(prop, "Self Terminated", "Terminate when target is reached");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "show_visualization", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_visualization", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_ENABLEVISUALIZATION);
RNA_def_property_ui_text(prop, "Visualize", "Enable debug visualization");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "update_period", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "update_period", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "updateTime");
RNA_def_property_ui_range(prop, -1, 100000, 1, 1);
RNA_def_property_ui_text(prop, "Update period", "Path update period");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "navmesh", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "navmesh", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "navmesh");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -2014,18 +2020,18 @@ static void rna_def_steering_actuator(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, NULL, "rna_SteeringActuator_navmesh_set", NULL, NULL);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "facing", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "facing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_AUTOMATICFACING);
RNA_def_property_ui_text(prop, "Facing", "Enable automatic facing");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "facing_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "facing_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "facingaxis");
RNA_def_property_enum_items(prop, facingaxis_items);
RNA_def_property_ui_text(prop, "Axis", "Axis for automatic facing");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "normal_up", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "normal_up", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_NORMALUP);
RNA_def_property_ui_text(prop, "N", "Use normal of the navmesh to set \"UP\" vector");
RNA_def_property_update(prop, NC_LOGIC, NULL);
diff --git a/source/blender/makesrna/intern/rna_actuator_api.c b/source/blender/makesrna/intern/rna_actuator_api.c
index dd289c2b8c4..eba2cfafd47 100644
--- a/source/blender/makesrna/intern/rna_actuator_api.c
+++ b/source/blender/makesrna/intern/rna_actuator_api.c
@@ -58,15 +58,15 @@ void RNA_api_actuator(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "link", "rna_Actuator_link");
+ func = RNA_def_function(srna, "link", "rna_Actuator_link");
RNA_def_function_ui_description(func, "Link the actuator to a controller");
- parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to");
+ parm = RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_update(parm, NC_LOGIC, NULL);
- func= RNA_def_function(srna, "unlink", "rna_Actuator_unlink");
+ func = RNA_def_function(srna, "unlink", "rna_Actuator_unlink");
RNA_def_function_ui_description(func, "Unlink the actuator from a controller");
- parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from");
+ parm = RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_update(parm, NC_LOGIC, NULL);
}
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index 21e99d312d6..56c176256bc 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -60,7 +60,7 @@ EnumPropertyItem keyingset_path_grouping_items[] = {
static int rna_AnimData_action_editable(PointerRNA *ptr)
{
- AnimData *adt= (AnimData *)ptr->data;
+ AnimData *adt = (AnimData *)ptr->data;
/* active action is only editable when it is not a tweaking strip */
if ((adt->flag & ADT_NLA_EDIT_ON) || (adt->actstrip) || (adt->tmpact))
@@ -89,7 +89,7 @@ static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
int ok;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr);
- func= &rna_KeyingSetInfo_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
+ func = &rna_KeyingSetInfo_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
/* hook up arguments */
@@ -101,7 +101,7 @@ static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
/* read the result */
RNA_parameter_get_lookup(&list, "ok", &ret);
- ok= *(int*)ret;
+ ok = *(int*)ret;
RNA_parameter_list_free(&list);
return ok;
@@ -117,7 +117,7 @@ static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks
FunctionRNA *func;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr);
- func= &rna_KeyingSetInfo_iterator_func; /* RNA_struct_find_function(&ptr, "poll"); */
+ func = &rna_KeyingSetInfo_iterator_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
/* hook up arguments */
@@ -140,7 +140,7 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks,
FunctionRNA *func;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr);
- func= &rna_KeyingSetInfo_generate_func; /* RNA_struct_find_generate(&ptr, "poll"); */
+ func = &rna_KeyingSetInfo_generate_func; /* RNA_struct_find_generate(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
/* hook up arguments */
@@ -156,16 +156,16 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks,
/* ------ */
-// XXX: the exact purpose of this is not too clear... maybe we want to revise this at some point?
+/* XXX: the exact purpose of this is not too clear... maybe we want to revise this at some point? */
static StructRNA *rna_KeyingSetInfo_refine(PointerRNA *ptr)
{
- KeyingSetInfo *ksi= (KeyingSetInfo *)ptr->data;
+ KeyingSetInfo *ksi = (KeyingSetInfo *)ptr->data;
return (ksi->ext.srna)? ksi->ext.srna: &RNA_KeyingSetInfo;
}
static void rna_KeyingSetInfo_unregister(Main *bmain, StructRNA *type)
{
- KeyingSetInfo *ksi= RNA_struct_blender_type_get(type);
+ KeyingSetInfo *ksi = RNA_struct_blender_type_get(type);
if (ksi == NULL)
return;
@@ -186,7 +186,7 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v
int have_function[3];
/* setup dummy type info to store static properties in */
- // TODO: perhaps we want to get users to register as if they're using 'KeyingSet' directly instead?
+ /* TODO: perhaps we want to get users to register as if they're using 'KeyingSet' directly instead? */
RNA_pointer_create(NULL, &RNA_KeyingSetInfo, &dummyksi, &dummyptr);
/* validate the python class */
@@ -194,7 +194,8 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v
return NULL;
if (strlen(identifier) >= sizeof(dummyksi.idname)) {
- BKE_reportf(reports, RPT_ERROR, "Registering keying set info class: '%s' is too long, maximum length is %d", identifier, (int)sizeof(dummyksi.idname));
+ BKE_reportf(reports, RPT_ERROR, "Registering keying set info class: '%s' is too long, maximum length is %d",
+ identifier, (int)sizeof(dummyksi.idname));
return NULL;
}
@@ -204,21 +205,21 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v
rna_KeyingSetInfo_unregister(bmain, ksi->ext.srna);
/* create a new KeyingSetInfo type */
- ksi= MEM_callocN(sizeof(KeyingSetInfo), "python keying set info");
+ ksi = MEM_callocN(sizeof(KeyingSetInfo), "python keying set info");
memcpy(ksi, &dummyksi, sizeof(KeyingSetInfo));
/* set RNA-extensions info */
- ksi->ext.srna= RNA_def_struct(&BLENDER_RNA, ksi->idname, "KeyingSetInfo");
- ksi->ext.data= data;
- ksi->ext.call= call;
- ksi->ext.free= free;
+ ksi->ext.srna = RNA_def_struct(&BLENDER_RNA, ksi->idname, "KeyingSetInfo");
+ ksi->ext.data = data;
+ ksi->ext.call = call;
+ ksi->ext.free = free;
RNA_struct_blender_type_set(ksi->ext.srna, ksi);
/* set callbacks */
- // NOTE: we really should have all of these...
- ksi->poll= (have_function[0])? RKS_POLL_rna_internal: NULL;
- ksi->iter= (have_function[1])? RKS_ITER_rna_internal: NULL;
- ksi->generate= (have_function[2])? RKS_GEN_rna_internal: NULL;
+ /* NOTE: we really should have all of these... */
+ ksi->poll = (have_function[0])? RKS_POLL_rna_internal: NULL;
+ ksi->iter = (have_function[1])? RKS_ITER_rna_internal: NULL;
+ ksi->generate = (have_function[2])? RKS_GEN_rna_internal: NULL;
/* add and register with other info as needed */
ANIM_keyingset_info_register(ksi);
@@ -231,39 +232,39 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v
static StructRNA *rna_ksPath_id_typef(PointerRNA *ptr)
{
- KS_Path *ksp= (KS_Path*)ptr->data;
+ KS_Path *ksp = (KS_Path*)ptr->data;
return ID_code_to_RNA_type(ksp->idtype);
}
static int rna_ksPath_id_editable(PointerRNA *ptr)
{
- KS_Path *ksp= (KS_Path*)ptr->data;
+ KS_Path *ksp = (KS_Path*)ptr->data;
return (ksp->idtype)? PROP_EDITABLE : 0;
}
static void rna_ksPath_id_type_set(PointerRNA *ptr, int value)
{
- KS_Path *data= (KS_Path*)(ptr->data);
+ KS_Path *data = (KS_Path*)(ptr->data);
/* set the driver type, then clear the id-block if the type is invalid */
- data->idtype= value;
+ data->idtype = value;
if ((data->id) && (GS(data->id->name) != data->idtype))
- data->id= NULL;
+ data->id = NULL;
}
static void rna_ksPath_RnaPath_get(PointerRNA *ptr, char *value)
{
- KS_Path *ksp= (KS_Path *)ptr->data;
+ KS_Path *ksp = (KS_Path *)ptr->data;
if (ksp->rna_path)
strcpy(value, ksp->rna_path);
else
- value[0]= '\0';
+ value[0] = '\0';
}
static int rna_ksPath_RnaPath_length(PointerRNA *ptr)
{
- KS_Path *ksp= (KS_Path *)ptr->data;
+ KS_Path *ksp = (KS_Path *)ptr->data;
if (ksp->rna_path)
return strlen(ksp->rna_path);
@@ -273,22 +274,22 @@ static int rna_ksPath_RnaPath_length(PointerRNA *ptr)
static void rna_ksPath_RnaPath_set(PointerRNA *ptr, const char *value)
{
- KS_Path *ksp= (KS_Path *)ptr->data;
+ KS_Path *ksp = (KS_Path *)ptr->data;
if (ksp->rna_path)
MEM_freeN(ksp->rna_path);
if (value[0])
- ksp->rna_path= BLI_strdup(value);
- else
- ksp->rna_path= NULL;
+ ksp->rna_path = BLI_strdup(value);
+ else
+ ksp->rna_path = NULL;
}
/* ****************************** */
static int rna_KeyingSet_active_ksPath_editable(PointerRNA *ptr)
{
- KeyingSet *ks= (KeyingSet *)ptr->data;
+ KeyingSet *ks = (KeyingSet *)ptr->data;
/* only editable if there are some paths to change to */
return (ks->paths.first != NULL);
@@ -296,45 +297,45 @@ static int rna_KeyingSet_active_ksPath_editable(PointerRNA *ptr)
static PointerRNA rna_KeyingSet_active_ksPath_get(PointerRNA *ptr)
{
- KeyingSet *ks= (KeyingSet *)ptr->data;
+ KeyingSet *ks = (KeyingSet *)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_KeyingSetPath, BLI_findlink(&ks->paths, ks->active_path-1));
}
static void rna_KeyingSet_active_ksPath_set(PointerRNA *ptr, PointerRNA value)
{
- KeyingSet *ks= (KeyingSet *)ptr->data;
- KS_Path *ksp= (KS_Path*)value.data;
- ks->active_path= BLI_findindex(&ks->paths, ksp) + 1;
+ KeyingSet *ks = (KeyingSet *)ptr->data;
+ KS_Path *ksp = (KS_Path*)value.data;
+ ks->active_path = BLI_findindex(&ks->paths, ksp) + 1;
}
static int rna_KeyingSet_active_ksPath_index_get(PointerRNA *ptr)
{
- KeyingSet *ks= (KeyingSet *)ptr->data;
+ KeyingSet *ks = (KeyingSet *)ptr->data;
return MAX2(ks->active_path-1, 0);
}
static void rna_KeyingSet_active_ksPath_index_set(PointerRNA *ptr, int value)
{
- KeyingSet *ks= (KeyingSet *)ptr->data;
- ks->active_path= value+1;
+ KeyingSet *ks = (KeyingSet *)ptr->data;
+ ks->active_path = value+1;
}
static void rna_KeyingSet_active_ksPath_index_range(PointerRNA *ptr, int *min, int *max)
{
- KeyingSet *ks= (KeyingSet *)ptr->data;
+ KeyingSet *ks = (KeyingSet *)ptr->data;
- *min= 0;
- *max= BLI_countlist(&ks->paths)-1;
- *max= MAX2(0, *max);
+ *min = 0;
+ *max = BLI_countlist(&ks->paths)-1;
+ *max = MAX2(0, *max);
}
static PointerRNA rna_KeyingSet_typeinfo_get(PointerRNA *ptr)
{
- KeyingSet *ks= (KeyingSet *)ptr->data;
+ KeyingSet *ks = (KeyingSet *)ptr->data;
KeyingSetInfo *ksi = NULL;
/* keying set info is only for builtin Keying Sets */
- if ((ks->flag & KEYINGSET_ABSOLUTE)==0)
+ if ((ks->flag & KEYINGSET_ABSOLUTE) == 0)
ksi = ANIM_keyingset_info_find_named(ks->typeinfo);
return rna_pointer_inherit_refine(ptr, &RNA_KeyingSetInfo, ksi);
}
@@ -355,8 +356,8 @@ static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset, ReportList *report
/* if data is valid, call the API function for this */
if (keyingset) {
- ksp= BKE_keyingset_add_path(keyingset, id, group_name, rna_path, index, flag, group_method);
- keyingset->active_path= BLI_countlist(&keyingset->paths);
+ ksp = BKE_keyingset_add_path(keyingset, id, group_name, rna_path, index, flag, group_method);
+ keyingset->active_path = BLI_countlist(&keyingset->paths);
}
else {
BKE_report(reports, RPT_ERROR, "Keying Set Path could not be added");
@@ -374,7 +375,7 @@ static void rna_KeyingSet_paths_remove(KeyingSet *keyingset, ReportList *reports
BKE_keyingset_free_path(keyingset, ksp);
/* the active path number will most likely have changed */
- // TODO: we should get more fancy and actually check if it was removed, but this will do for now
+ /* TODO: we should get more fancy and actually check if it was removed, but this will do for now */
keyingset->active_path = 0;
}
else {
@@ -389,8 +390,8 @@ static void rna_KeyingSet_paths_clear(KeyingSet *keyingset, ReportList *reports)
KS_Path *ksp, *kspn;
/* free each path as we go to avoid looping twice */
- for (ksp= keyingset->paths.first; ksp; ksp= kspn) {
- kspn= ksp->next;
+ for (ksp = keyingset->paths.first; ksp; ksp = kspn) {
+ kspn = ksp->next;
BKE_keyingset_free_path(keyingset, ksp);
}
@@ -421,15 +422,15 @@ static void rna_NlaTrack_remove(AnimData *adt, bContext *C, NlaTrack *track)
static PointerRNA rna_NlaTrack_active_get(PointerRNA *ptr)
{
- AnimData *adt= (AnimData*)ptr->data;
- NlaTrack *track= BKE_nlatrack_find_active(&adt->nla_tracks);
+ AnimData *adt = (AnimData*)ptr->data;
+ NlaTrack *track = BKE_nlatrack_find_active(&adt->nla_tracks);
return rna_pointer_inherit_refine(ptr, &RNA_NlaTrack, track);
}
static void rna_NlaTrack_active_set(PointerRNA *ptr, PointerRNA value)
{
- AnimData *adt= (AnimData*)ptr->data;
- NlaTrack *track= (NlaTrack*)value.data;
+ AnimData *adt = (AnimData*)ptr->data;
+ NlaTrack *track = (NlaTrack*)value.data;
BKE_nlatrack_set_active(&adt->nla_tracks, track);
}
@@ -445,7 +446,7 @@ static FCurve *rna_Driver_from_existing(AnimData *adt, bContext *C, FCurve *src_
/* just make a copy of the existing one and add to self */
FCurve *new_fcu = copy_fcurve(src_driver);
- // XXX: if we impose any ordering on these someday, this will be problematic
+ /* XXX: if we impose any ordering on these someday, this will be problematic */
BLI_addtail(&adt->drivers, new_fcu);
return new_fcu;
}
@@ -464,7 +465,7 @@ static void rna_def_common_keying_flags(StructRNA *srna, short reg)
{INSERTKEY_XYZ2RGB, "INSERTKEY_XYZ_TO_RGB", 0, "F-Curve Colors - XYZ to RGB", "Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis"},
{0, NULL, 0, NULL, NULL}};
- prop= RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "keyingflag");
RNA_def_property_enum_items(prop, keying_flag_items);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL|PROP_ENUM_FLAG);
@@ -473,6 +474,13 @@ static void rna_def_common_keying_flags(StructRNA *srna, short reg)
/* --- */
+/* To avoid repeating it twice! */
+#define KEYINGSET_IDNAME_DOC "If this is set, the Keying Set gets a custom ID, otherwise it takes " \
+ "the name of the class used to define the Keying Set (for example, " \
+ "if the class name is \"BUILTIN_KSI_location\", and bl_idname is not " \
+ "set by the script, then bl_idname = \"BUILTIN_KSI_location\")"
+
+
static void rna_def_keyingset_info(BlenderRNA *brna)
{
StructRNA *srna;
@@ -480,7 +488,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna)
FunctionRNA *func;
PropertyRNA *parm;
- srna= RNA_def_struct(brna, "KeyingSetInfo", NULL);
+ srna = RNA_def_struct(brna, "KeyingSetInfo", NULL);
RNA_def_struct_sdna(srna, "KeyingSetInfo");
RNA_def_struct_ui_text(srna, "Keying Set Info", "Callback function defines for builtin Keying Sets");
RNA_def_struct_refine_func(srna, "rna_KeyingSetInfo_refine");
@@ -488,50 +496,56 @@ static void rna_def_keyingset_info(BlenderRNA *brna)
/* Properties --------------------- */
- RNA_define_verify_sdna(0); // not in sdna
-
- prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
+ RNA_define_verify_sdna(0); /* not in sdna */
+
+ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "idname");
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
-
- /* Name */
- prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE);
+ RNA_def_property_ui_text(prop, "ID Name", KEYINGSET_IDNAME_DOC);
+
+ prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Name", "");
+ RNA_def_property_ui_text(prop, "UI Name", "");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_flag(prop, PROP_REGISTER);
+ prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE);
+ RNA_def_property_string_sdna(prop, NULL, "description");
+ RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
+ RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
+ RNA_def_property_ui_text(prop, "Description", "A short description of the keying set");
+
rna_def_common_keying_flags(srna, 1); /* '1' arg here is to indicate that we need these to be set on registering */
RNA_define_verify_sdna(1);
/* Function Callbacks ------------- */
/* poll */
- func= RNA_def_function(srna, "poll", NULL);
+ func = RNA_def_function(srna, "poll", NULL);
RNA_def_function_ui_description(func, "Test if Keying Set can be used or not");
RNA_def_function_flag(func, FUNC_REGISTER);
RNA_def_function_return(func, RNA_def_boolean(func, "ok", 1, "", ""));
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* iterator */
- func= RNA_def_function(srna, "iterator", NULL);
+ func = RNA_def_function(srna, "iterator", NULL);
RNA_def_function_ui_description(func, "Call generate() on the structs which have properties to be keyframed");
RNA_def_function_flag(func, FUNC_REGISTER);
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "ks", "KeyingSet", "", "");
+ parm = RNA_def_pointer(func, "ks", "KeyingSet", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* generate */
- func= RNA_def_function(srna, "generate", NULL);
+ func = RNA_def_function(srna, "generate", NULL);
RNA_def_function_ui_description(func, "Add Paths to the Keying Set to keyframe the properties of the given data");
RNA_def_function_flag(func, FUNC_REGISTER);
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "ks", "KeyingSet", "", "");
+ parm = RNA_def_pointer(func, "ks", "KeyingSet", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "data", "AnyType", "", "");
+ parm = RNA_def_pointer(func, "data", "AnyType", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
}
@@ -540,56 +554,56 @@ static void rna_def_keyingset_path(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "KeyingSetPath", NULL);
+ srna = RNA_def_struct(brna, "KeyingSetPath", NULL);
RNA_def_struct_sdna(srna, "KS_Path");
RNA_def_struct_ui_text(srna, "Keying Set Path", "Path to a setting for use in a Keying Set");
/* ID */
- prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ID");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_editable_func(prop, "rna_ksPath_id_editable");
RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_ksPath_id_typef", NULL);
RNA_def_property_ui_text(prop, "ID-Block", "ID-Block that keyframes for Keying Set should be added to (for Absolute Keying Sets only)");
- RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); // XXX: maybe a bit too noisy
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
- prop= RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "idtype");
RNA_def_property_enum_items(prop, id_type_items);
RNA_def_property_enum_default(prop, ID_OB);
RNA_def_property_enum_funcs(prop, NULL, "rna_ksPath_id_type_set", NULL);
RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used");
- RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); // XXX: maybe a bit too noisy
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
/* Group */
- prop= RNA_def_property(srna, "group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "group", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Group Name", "Name of Action Group to assign setting(s) for this path to");
- RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); // XXX: maybe a bit too noisy
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
/* Grouping */
- prop= RNA_def_property(srna, "group_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "group_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "groupmode");
RNA_def_property_enum_items(prop, keyingset_path_grouping_items);
RNA_def_property_ui_text(prop, "Grouping Method", "Method used to define which Group-name to use");
- RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); // XXX: maybe a bit too noisy
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
/* Path + Array Index */
- prop= RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ksPath_RnaPath_get", "rna_ksPath_RnaPath_length", "rna_ksPath_RnaPath_set");
RNA_def_property_ui_text(prop, "Data Path", "Path to property setting");
- RNA_def_struct_name_property(srna, prop); // XXX this is the best indicator for now...
+ RNA_def_struct_name_property(srna, prop); /* XXX this is the best indicator for now... */
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL);
/* called 'index' when given as function arg */
- prop= RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific setting if applicable");
- RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); // XXX: maybe a bit too noisy
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
/* Flags */
- prop= RNA_def_property(srna, "use_entire_array", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_entire_array", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KSP_FLAG_WHOLE_ARRAY);
RNA_def_property_ui_text(prop, "Entire Array", "When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used");
- RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); // XXX: maybe a bit too noisy
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
/* Keyframing Settings */
rna_def_common_keying_flags(srna, 0);
@@ -607,23 +621,23 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "KeyingSetPaths");
- srna= RNA_def_struct(brna, "KeyingSetPaths", NULL);
+ srna = RNA_def_struct(brna, "KeyingSetPaths", NULL);
RNA_def_struct_sdna(srna, "KeyingSet");
RNA_def_struct_ui_text(srna, "Keying set paths", "Collection of keying set paths");
/* Add Path */
- func= RNA_def_function(srna, "add", "rna_KeyingSet_paths_add");
+ func = RNA_def_function(srna, "add", "rna_KeyingSet_paths_add");
RNA_def_function_ui_description(func, "Add a new path for the Keying Set");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* return arg */
- parm= RNA_def_pointer(func, "ksp", "KeyingSetPath", "New Path", "Path created and added to the Keying Set");
+ parm = RNA_def_pointer(func, "ksp", "KeyingSetPath", "New Path", "Path created and added to the Keying Set");
RNA_def_function_return(func, parm);
/* ID-block for target */
- parm= RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID-Datablock for the destination");
+ parm = RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID-Datablock for the destination");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* rna-path */
- parm= RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property"); // xxx hopefully this is long enough
+ parm = RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property"); /* xxx hopefully this is long enough */
RNA_def_property_flag(parm, PROP_REQUIRED);
/* index (defaults to -1 for entire array) */
RNA_def_int(func, "index", -1, -1, INT_MAX, "Index",
@@ -637,27 +651,27 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
/* Remove Path */
- func= RNA_def_function(srna, "remove", "rna_KeyingSet_paths_remove");
+ func = RNA_def_function(srna, "remove", "rna_KeyingSet_paths_remove");
RNA_def_function_ui_description(func, "Remove the given path from the Keying Set");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* path to remove */
- parm= RNA_def_pointer(func, "path", "KeyingSetPath", "Path", "");
+ parm = RNA_def_pointer(func, "path", "KeyingSetPath", "Path", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* Remove All Paths */
- func= RNA_def_function(srna, "clear", "rna_KeyingSet_paths_clear");
+ func = RNA_def_function(srna, "clear", "rna_KeyingSet_paths_clear");
RNA_def_function_ui_description(func, "Remove all the paths from the Keying Set");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyingSetPath");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_editable_func(prop, "rna_KeyingSet_active_ksPath_editable");
RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_active_ksPath_get", "rna_KeyingSet_active_ksPath_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "active_path");
RNA_def_property_int_funcs(prop, "rna_KeyingSet_active_ksPath_index_get", "rna_KeyingSet_active_ksPath_index_set", "rna_KeyingSet_active_ksPath_index_range");
RNA_def_property_ui_text(prop, "Active Path Index", "Current Keying Set index");
@@ -668,31 +682,44 @@ static void rna_def_keyingset(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "KeyingSet", NULL);
+ srna = RNA_def_struct(brna, "KeyingSet", NULL);
RNA_def_struct_ui_text(srna, "Keying Set", "Settings that should be keyframed together");
- /* Name */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
- RNA_def_property_ui_text(prop, "Name", "");
+ /* Id/Label. */
+ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "idname");
+ RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
+ RNA_def_property_ui_text(prop, "ID Name", KEYINGSET_IDNAME_DOC);
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_RENAME, NULL);
+
+ prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_property_ui_text(prop, "UI Name", "");
RNA_def_struct_ui_icon(srna, ICON_KEYINGSET);
RNA_def_struct_name_property(srna, prop);
- RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_RENAME, NULL);
+/* RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_RENAME, NULL);*/
+
+ prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE);
+ RNA_def_property_string_sdna(prop, NULL, "description");
+ RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
+ RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
+ RNA_def_property_ui_text(prop, "Description", "A short description of the keying set");
/* KeyingSetInfo (Type Info) for Builtin Sets only */
- prop= RNA_def_property(srna, "type_info", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "type_info", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyingSetInfo");
RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_typeinfo_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Type Info", "Callback function defines for built-in Keying Sets");
/* Paths */
- prop= RNA_def_property(srna, "paths", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "paths", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "paths", NULL);
RNA_def_property_struct_type(prop, "KeyingSetPath");
RNA_def_property_ui_text(prop, "Paths", "Keying Set Paths to define settings that get keyframed together");
rna_def_keyingset_paths(brna, prop);
/* Flags */
- prop= RNA_def_property(srna, "is_path_absolute", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_path_absolute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_ABSOLUTE);
RNA_def_property_ui_text(prop, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)");
@@ -705,6 +732,7 @@ static void rna_def_keyingset(BlenderRNA *brna)
RNA_api_keyingset(srna);
}
+#undef KEYINGSET_IDNAME_DOC
/* --- */
static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop)
@@ -716,7 +744,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "NlaTracks");
- srna= RNA_def_struct(brna, "NlaTracks", NULL);
+ srna = RNA_def_struct(brna, "NlaTracks", NULL);
RNA_def_struct_sdna(srna, "AnimData");
RNA_def_struct_ui_text(srna, "NLA Tracks", "Collection of NLA Tracks");
@@ -734,7 +762,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop)
parm = RNA_def_pointer(func, "track", "NlaTrack", "", "NLA Track to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "NlaTrack");
RNA_def_property_pointer_funcs(prop, "rna_NlaTrack_active_get", "rna_NlaTrack_active_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -749,10 +777,10 @@ static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
FunctionRNA *func;
- // PropertyRNA *prop;
+ /* PropertyRNA *prop; */
RNA_def_property_srna(cprop, "AnimDataDrivers");
- srna= RNA_def_struct(brna, "AnimDataDrivers", NULL);
+ srna = RNA_def_struct(brna, "AnimDataDrivers", NULL);
RNA_def_struct_sdna(srna, "AnimData");
RNA_def_struct_ui_text(srna, "Drivers", "Collection of Driver F-Curves");
@@ -769,7 +797,7 @@ void rna_def_animdata_common(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "animation_data", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "animation_data", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "adt");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Animation Data", "Animation data for this datablock");
@@ -780,11 +808,11 @@ void rna_def_animdata(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "AnimData", NULL);
+ srna = RNA_def_struct(brna, "AnimData", NULL);
RNA_def_struct_ui_text(srna, "Animation Data", "Animation data for datablock");
/* NLA */
- prop= RNA_def_property(srna, "nla_tracks", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "nla_tracks", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "nla_tracks", NULL);
RNA_def_property_struct_type(prop, "NlaTrack");
RNA_def_property_ui_text(prop, "NLA Tracks", "NLA Tracks (i.e. Animation Layers)");
@@ -792,7 +820,7 @@ void rna_def_animdata(BlenderRNA *brna)
rna_api_animdata_nla_tracks(brna, prop);
/* Active Action */
- prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE); /* this flag as well as the dynamic test must be defined for this to be editable... */
RNA_def_property_pointer_funcs(prop, NULL, "rna_AnimData_action_set", NULL, "rna_Action_id_poll");
RNA_def_property_editable_func(prop, "rna_AnimData_action_editable");
@@ -800,19 +828,19 @@ void rna_def_animdata(BlenderRNA *brna)
RNA_def_property_update(prop, NC_ANIMATION, NULL); /* this will do? */
/* Active Action Settings */
- prop= RNA_def_property(srna, "action_extrapolation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "action_extrapolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "act_extendmode");
RNA_def_property_enum_items(prop, nla_mode_extend_items);
RNA_def_property_ui_text(prop, "Action Extrapolation", "Action to take for gaps past the Active Action's range (when evaluating with NLA)");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "action_blend_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "action_blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "act_blendmode");
RNA_def_property_enum_items(prop, nla_mode_blend_items);
RNA_def_property_ui_text(prop, "Action Blending", "Method used for combining Active Action's result with result of NLA stack");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "action_influence", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "action_influence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "act_influence");
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_range(prop, 0.0f, 1.0f);
@@ -820,7 +848,7 @@ void rna_def_animdata(BlenderRNA *brna)
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Drivers */
- prop= RNA_def_property(srna, "drivers", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "drivers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "drivers", NULL);
RNA_def_property_struct_type(prop, "FCurve");
RNA_def_property_ui_text(prop, "Drivers", "The Drivers/Expressions for this datablock");
@@ -828,7 +856,7 @@ void rna_def_animdata(BlenderRNA *brna)
rna_api_animdata_drivers(brna, prop);
/* General Settings */
- prop= RNA_def_property(srna, "use_nla", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_nla", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADT_NLA_EVAL_OFF);
RNA_def_property_ui_text(prop, "NLA Evaluation Enabled", "NLA stack is evaluated when evaluating this block");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
diff --git a/source/blender/makesrna/intern/rna_animation_api.c b/source/blender/makesrna/intern/rna_animation_api.c
index 714a74ec424..f47f8eb88cf 100644
--- a/source/blender/makesrna/intern/rna_animation_api.c
+++ b/source/blender/makesrna/intern/rna_animation_api.c
@@ -49,7 +49,7 @@
static void rna_KeyingSet_context_refresh(KeyingSet *ks, bContext *C, ReportList *reports)
{
- // TODO: enable access to providing a list of overrides (dsources)?
+ /* TODO: enable access to providing a list of overrides (dsources)? */
int success = ANIM_validate_keyingset(C, NULL, ks);
if (success != 0) {
@@ -70,10 +70,10 @@ static void rna_KeyingSet_context_refresh(KeyingSet *ks, bContext *C, ReportList
void RNA_api_keyingset(StructRNA *srna)
{
FunctionRNA *func;
- //PropertyRNA *parm;
+ /*PropertyRNA *parm; */
/* validate relative Keying Set (used to ensure paths are ok for context) */
- func= RNA_def_function(srna, "refresh", "rna_KeyingSet_context_refresh");
+ func = RNA_def_function(srna, "refresh", "rna_KeyingSet_context_refresh");
RNA_def_function_ui_description(func, "Refresh Keying Set to ensure that it is valid for the current context. Call before each use of one");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
}
diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c
index 29133db8101..adc3640dae4 100644
--- a/source/blender/makesrna/intern/rna_animviz.c
+++ b/source/blender/makesrna/intern/rna_animviz.c
@@ -53,35 +53,35 @@ static PointerRNA rna_AnimViz_motion_paths_get(PointerRNA *ptr)
static void rna_AnimViz_ghost_start_frame_set(PointerRNA *ptr, int value)
{
- bAnimVizSettings *data= (bAnimVizSettings*)ptr->data;
+ bAnimVizSettings *data = (bAnimVizSettings*)ptr->data;
CLAMP(value, 1, data->ghost_ef);
- data->ghost_sf= value;
+ data->ghost_sf = value;
}
static void rna_AnimViz_ghost_end_frame_set(PointerRNA *ptr, int value)
{
- bAnimVizSettings *data= (bAnimVizSettings*)ptr->data;
+ bAnimVizSettings *data = (bAnimVizSettings*)ptr->data;
CLAMP(value, data->ghost_sf, (int)(MAXFRAMEF/2));
- data->ghost_ef= value;
+ data->ghost_ef = value;
}
static void rna_AnimViz_path_start_frame_set(PointerRNA *ptr, int value)
{
- bAnimVizSettings *data= (bAnimVizSettings*)ptr->data;
+ bAnimVizSettings *data = (bAnimVizSettings*)ptr->data;
CLAMP(value, 1, data->path_ef-1);
- data->path_sf= value;
+ data->path_sf = value;
}
static void rna_AnimViz_path_end_frame_set(PointerRNA *ptr, int value)
{
- bAnimVizSettings *data= (bAnimVizSettings*)ptr->data;
+ bAnimVizSettings *data = (bAnimVizSettings*)ptr->data;
- // XXX: watchit! Path Start > MAXFRAME/2 could be a problem...
+ /* XXX: watchit! Path Start > MAXFRAME/2 could be a problem... */
CLAMP(value, data->path_sf+1, (int)(MAXFRAMEF/2));
- data->path_ef= value;
+ data->path_ef = value;
}
#else
@@ -90,7 +90,7 @@ void rna_def_motionpath_common(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "motion_path", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "motion_path", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mpath");
RNA_def_property_ui_text(prop, "Motion Path", "Motion Path for this element");
}
@@ -100,15 +100,15 @@ static void rna_def_animviz_motionpath_vert(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MotionPathVert", NULL);
+ srna = RNA_def_struct(brna, "MotionPathVert", NULL);
RNA_def_struct_sdna(srna, "bMotionPathVert");
RNA_def_struct_ui_text(srna, "Motion Path Cache Point", "Cached location on path");
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Coordinates", "");
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_VERT_SEL);
RNA_def_property_ui_text(prop, "Select", "Path point is selected for editing");
}
@@ -118,38 +118,38 @@ static void rna_def_animviz_motion_path(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MotionPath", NULL);
+ srna = RNA_def_struct(brna, "MotionPath", NULL);
RNA_def_struct_sdna(srna, "bMotionPath");
RNA_def_struct_ui_text(srna, "Motion Path", "Cache of the worldspace positions of an element over a frame range");
/* Collections */
- prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "points", "length");
RNA_def_property_struct_type(prop, "MotionPathVert");
RNA_def_property_ui_text(prop, "Motion Path Points", "Cached positions per frame");
/* Playback Ranges */
- prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "start_frame");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Start Frame", "Starting frame of the stored range");
- prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "end_frame");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "End Frame", "End frame of the stored range");
- prop= RNA_def_property(srna, "length", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "length", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Length", "Number of frames cached");
/* Settings */
- prop= RNA_def_property(srna, "use_bone_head", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_bone_head", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_FLAG_BHEAD);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // xxx
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* xxx */
RNA_def_property_ui_text(prop, "Use Bone Heads", "For PoseBone paths, use the bone head location when calculating this path");
- prop= RNA_def_property(srna, "is_modified", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_modified", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_FLAG_EDIT);
RNA_def_property_ui_text(prop, "Edit Path", "Path is being edited");
}
@@ -169,51 +169,51 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "AnimVizOnionSkinning", NULL);
+ srna = RNA_def_struct(brna, "AnimVizOnionSkinning", NULL);
RNA_def_struct_sdna(srna, "bAnimVizSettings");
RNA_def_struct_nested(brna, srna, "AnimViz");
RNA_def_struct_ui_text(srna, "Onion Skinning Settings", "Onion Skinning settings for animation visualisation");
/* Enums */
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ghost_type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Method used for determining what ghosts get drawn");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
/* Settings */
- prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ghost_flag", GHOST_FLAG_ONLYSEL);
RNA_def_property_ui_text(prop, "On Selected Bones Only", "For Pose-Mode drawing, only draw ghosts for selected bones");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
- prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ghost_step");
RNA_def_property_range(prop, 1, 20);
RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between ghosts shown (not for 'On Keyframes' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
/* Playback Ranges */
- prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghost_sf");
RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_ghost_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Start Frame", "Starting frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
- prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghost_ef");
RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_ghost_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "End Frame", "End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
/* Around Current Ranges */
- prop= RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghost_bc");
RNA_def_property_range(prop, 0, 30);
RNA_def_property_ui_text(prop, "Before Current", "Number of frames to show before the current frame (only for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
- prop= RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghost_ac");
RNA_def_property_range(prop, 0, 30);
RNA_def_property_ui_text(prop, "After Current", "Number of frames to show after the current frame (only for 'Around Current Frame' Onion-skinning method)");
@@ -225,55 +225,55 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static const EnumPropertyItem prop_type_items[]= {
+ static const EnumPropertyItem prop_type_items[] = {
{MOTIONPATH_TYPE_ACFRA, "CURRENT_FRAME", 0, "Around Frame", "Display Paths of poses within a fixed number of frames around the current frame"},
{MOTIONPATH_TYPE_RANGE, "RANGE", 0, "In Range", "Display Paths of poses within specified range"},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem prop_location_items[]= {
+ static const EnumPropertyItem prop_location_items[] = {
{MOTIONPATH_BAKE_HEADS, "HEADS", 0, "Heads", "Calculate bone paths from heads"},
{0, "TAILS", 0, "Tails", "Calculate bone paths from tails"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "AnimVizMotionPaths", NULL);
+ srna = RNA_def_struct(brna, "AnimVizMotionPaths", NULL);
RNA_def_struct_sdna(srna, "bAnimVizSettings");
RNA_def_struct_nested(brna, srna, "AnimViz");
RNA_def_struct_ui_text(srna, "Motion Path Settings", "Motion Path settings for animation visualisation");
/* Enums */
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "path_type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Paths Type", "Type of range to show for Motion Paths");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
- prop= RNA_def_property(srna, "bake_location", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "bake_location", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "path_bakeflag");
RNA_def_property_enum_items(prop, prop_location_items);
RNA_def_property_ui_text(prop, "Bake Location", "When calculating Bone Paths, use Head or Tips");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
/* Settings */
- prop= RNA_def_property(srna, "show_frame_numbers", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_frame_numbers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_FNUMS);
RNA_def_property_ui_text(prop, "Show Frame Numbers", "Show frame numbers on Motion Paths");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
- prop= RNA_def_property(srna, "show_keyframe_highlight", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_keyframe_highlight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFRAS);
RNA_def_property_ui_text(prop, "Highlight Keyframes", "Emphasize position of keyframes on Motion Paths");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
- prop= RNA_def_property(srna, "show_keyframe_numbers", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_keyframe_numbers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFNOS);
RNA_def_property_ui_text(prop, "Show Keyframe Numbers", "Show frame numbers of Keyframes on Motion Paths");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
- prop= RNA_def_property(srna, "show_keyframe_action_all", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_keyframe_action_all", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFACT);
RNA_def_property_ui_text(prop, "All Action Keyframes", "For bone motion paths, search whole Action for keyframes instead of in group with matching name only (is slower)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
- prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "path_step");
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between paths shown (not for 'On Keyframes' Onion-skinning method)");
@@ -281,26 +281,26 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
/* Playback Ranges */
- prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "path_sf");
RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_path_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Start Frame", "Starting frame of range of paths to display/calculate (not for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
- prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "path_ef");
RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_path_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "End Frame", "End frame of range of paths to display/calculate (not for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
/* Around Current Ranges */
- prop= RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "path_bc");
RNA_def_property_range(prop, 1, MAXFRAMEF/2);
RNA_def_property_ui_text(prop, "Before Current", "Number of frames to show before the current frame (only for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
- prop= RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "path_ac");
RNA_def_property_range(prop, 1, MAXFRAMEF/2);
RNA_def_property_ui_text(prop, "After Current", "Number of frames to show after the current frame (only for 'Around Current Frame' Onion-skinning method)");
@@ -313,7 +313,7 @@ void rna_def_animviz_common(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "animation_visualisation", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "animation_visualisation", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "avs");
RNA_def_property_ui_text(prop, "Animation Visualisation", "Animation data for this datablock");
@@ -324,19 +324,19 @@ static void rna_def_animviz(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "AnimViz", NULL);
+ srna = RNA_def_struct(brna, "AnimViz", NULL);
RNA_def_struct_sdna(srna, "bAnimVizSettings");
RNA_def_struct_ui_text(srna, "Animation Visualisation", "Settings for the visualisation of motion");
/* onion-skinning settings (nested struct) */
- prop= RNA_def_property(srna, "onion_skin_frames", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "onion_skin_frames", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "AnimVizOnionSkinning");
RNA_def_property_pointer_funcs(prop, "rna_AnimViz_onion_skinning_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Onion Skinning", "Onion Skinning (ghosting) settings for visualisation");
/* motion path settings (nested struct) */
- prop= RNA_def_property(srna, "motion_path", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "motion_path", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "AnimVizMotionPaths");
RNA_def_property_pointer_funcs(prop, "rna_AnimViz_motion_paths_get", NULL, NULL, NULL);
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index 18ba3936e44..b6d07d079f1 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -52,49 +52,49 @@
static void rna_Armature_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
DAG_id_tag_update(id, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
- //WM_main_add_notifier(NC_OBJECT|ND_POSE, NULL);
+ /*WM_main_add_notifier(NC_OBJECT|ND_POSE, NULL); */
}
static void rna_Armature_act_bone_set(PointerRNA *ptr, PointerRNA value)
{
- bArmature *arm= (bArmature*)ptr->data;
+ bArmature *arm = (bArmature*)ptr->data;
- if(value.id.data==NULL && value.data==NULL) {
- arm->act_bone= NULL;
+ if (value.id.data == NULL && value.data == NULL) {
+ arm->act_bone = NULL;
}
else {
- if(value.id.data != arm) {
+ if (value.id.data != arm) {
Object *ob = (Object *)value.id.data;
- if(GS(ob->id.name)!=ID_OB || (ob->data != arm)) {
+ if (GS(ob->id.name) != ID_OB || (ob->data != arm)) {
printf("ERROR: armature set active bone - new active doesn't come from this armature\n");
return;
}
}
- arm->act_bone= value.data;
+ arm->act_bone = value.data;
arm->act_bone->flag |= BONE_SELECTED;
}
}
static void rna_Armature_act_edit_bone_set(PointerRNA *ptr, PointerRNA value)
{
- bArmature *arm= (bArmature*)ptr->data;
+ bArmature *arm = (bArmature*)ptr->data;
- if(value.id.data==NULL && value.data==NULL) {
- arm->act_edbone= NULL;
+ if (value.id.data == NULL && value.data == NULL) {
+ arm->act_edbone = NULL;
}
else {
- if(value.id.data != arm) {
+ if (value.id.data != arm) {
/* raise an error! */
}
else {
- arm->act_edbone= value.data;
+ arm->act_edbone = value.data;
((EditBone *)arm->act_edbone)->flag |= BONE_SELECTED;
}
}
@@ -102,7 +102,7 @@ static void rna_Armature_act_edit_bone_set(PointerRNA *ptr, PointerRNA value)
EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, const char *name)
{
- if(arm->edbo==NULL) {
+ if (arm->edbo == NULL) {
BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant add an editbone", arm->id.name+2);
return NULL;
}
@@ -111,12 +111,12 @@ EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, const
void rna_Armature_edit_bone_remove(bArmature *arm, ReportList *reports, EditBone *ebone)
{
- if(arm->edbo==NULL) {
+ if (arm->edbo == NULL) {
BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant remove an editbone", arm->id.name+2);
return;
}
- if(BLI_findindex(arm->edbo, ebone) == -1) {
+ if (BLI_findindex(arm->edbo, ebone) == -1) {
BKE_reportf(reports, RPT_ERROR, "Armature '%s' doesn't contain bone '%s'", arm->id.name+2, ebone->name);
return;
}
@@ -126,13 +126,13 @@ void rna_Armature_edit_bone_remove(bArmature *arm, ReportList *reports, EditBone
static void rna_Armature_update_layers(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
- bArmature *arm= ptr->id.data;
+ bArmature *arm = ptr->id.data;
Object *ob;
/* proxy lib exception, store it here so we can restore layers on file
load, since it would otherwise get lost due to being linked data */
- for(ob = bmain->object.first; ob; ob=ob->id.next)
- if(ob->data == arm && ob->pose)
+ for (ob = bmain->object.first; ob; ob = ob->id.next)
+ if (ob->data == arm && ob->pose)
ob->pose->proxy_layer = arm->layer;
WM_main_add_notifier(NC_GEOM|ND_DATA, arm);
@@ -140,7 +140,7 @@ static void rna_Armature_update_layers(Main *bmain, Scene *UNUSED(scene), Pointe
static void rna_Armature_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
}
@@ -165,11 +165,11 @@ static char *rna_Bone_path(PointerRNA *ptr)
static IDProperty *rna_Bone_idprops(PointerRNA *ptr, int create)
{
- Bone *bone= ptr->data;
+ Bone *bone = ptr->data;
- if(create && !bone->prop) {
+ if (create && !bone->prop) {
IDPropertyTemplate val = {0};
- bone->prop= IDP_New(IDP_GROUP, &val, "RNA_Bone ID properties");
+ bone->prop = IDP_New(IDP_GROUP, &val, "RNA_Bone ID properties");
}
return bone->prop;
@@ -177,11 +177,11 @@ static IDProperty *rna_Bone_idprops(PointerRNA *ptr, int create)
static IDProperty *rna_EditBone_idprops(PointerRNA *ptr, int create)
{
- EditBone *ebone= ptr->data;
+ EditBone *ebone = ptr->data;
- if(create && !ebone->prop) {
+ if (create && !ebone->prop) {
IDPropertyTemplate val = {0};
- ebone->prop= IDP_New(IDP_GROUP, &val, "RNA_EditBone ID properties");
+ ebone->prop = IDP_New(IDP_GROUP, &val, "RNA_EditBone ID properties");
}
return ebone->prop;
@@ -189,67 +189,75 @@ static IDProperty *rna_EditBone_idprops(PointerRNA *ptr, int create)
static void rna_bone_layer_set(int *layer, const int *values)
{
- int i, tot= 0;
+ int i, tot = 0;
/* ensure we always have some layer selected */
- for(i=0; i<32; i++)
- if(values[i])
+ for (i = 0; i<32; i++)
+ if (values[i])
tot++;
- if(tot==0)
+ if (tot == 0)
return;
- for(i=0; i<32; i++) {
- if(values[i]) *layer |= (1<<i);
+ for (i = 0; i<32; i++) {
+ if (values[i]) *layer |= (1<<i);
else *layer &= ~(1<<i);
}
}
static void rna_Bone_layer_set(PointerRNA *ptr, const int *values)
{
- Bone *bone= (Bone*)ptr->data;
+ Bone *bone = (Bone*)ptr->data;
rna_bone_layer_set(&bone->layer, values);
}
static void rna_Armature_layer_set(PointerRNA *ptr, const int *values)
{
- bArmature *arm= (bArmature*)ptr->data;
- int i, tot= 0;
+ bArmature *arm = (bArmature*)ptr->data;
+ int i, tot = 0;
/* ensure we always have some layer selected */
- for(i=0; i<32; i++)
- if(values[i])
+ for (i = 0; i<32; i++)
+ if (values[i])
tot++;
- if(tot==0)
+ if (tot == 0)
return;
- for(i=0; i<32; i++) {
- if(values[i]) arm->layer |= (1<<i);
+ for (i = 0; i<32; i++) {
+ if (values[i]) arm->layer |= (1<<i);
else arm->layer &= ~(1<<i);
}
}
-// XXX depreceated.... old armature only animviz
+/* XXX depreceated.... old armature only animviz */
static void rna_Armature_ghost_start_frame_set(PointerRNA *ptr, int value)
{
- bArmature *data= (bArmature*)ptr->data;
- CLAMP(value, 1, data->ghostef);
- data->ghostsf= value;
+ bArmature *data = (bArmature*)ptr->data;
+ CLAMP(value, 1, (int)(MAXFRAMEF/2));
+ data->ghostsf = value;
+
+ if (data->ghostsf >= data->ghostef) {
+ data->ghostef = MIN2(data->ghostsf + 1, (int)(MAXFRAMEF/2));
+ }
}
static void rna_Armature_ghost_end_frame_set(PointerRNA *ptr, int value)
{
- bArmature *data= (bArmature*)ptr->data;
- CLAMP(value, data->ghostsf, (int)(MAXFRAMEF/2));
- data->ghostef= value;
+ bArmature *data = (bArmature*)ptr->data;
+ CLAMP(value, 1, (int)(MAXFRAMEF/2));
+ data->ghostef = value;
+
+ if (data->ghostsf >= data->ghostef) {
+ data->ghostsf = MAX2(data->ghostef - 1, 1);
+ }
}
-// XXX depreceated... old armature only animviz
+/* XXX depreceated... old armature only animviz */
static void rna_EditBone_name_set(PointerRNA *ptr, const char *value)
{
- bArmature *arm= (bArmature*)ptr->id.data;
- EditBone *ebone= (EditBone*)ptr->data;
+ bArmature *arm = (bArmature*)ptr->id.data;
+ EditBone *ebone = (EditBone*)ptr->data;
char oldname[sizeof(ebone->name)], newname[sizeof(ebone->name)];
/* need to be on the stack */
@@ -261,8 +269,8 @@ static void rna_EditBone_name_set(PointerRNA *ptr, const char *value)
static void rna_Bone_name_set(PointerRNA *ptr, const char *value)
{
- bArmature *arm= (bArmature*)ptr->id.data;
- Bone *bone= (Bone*)ptr->data;
+ bArmature *arm = (bArmature*)ptr->id.data;
+ Bone *bone = (Bone*)ptr->data;
char oldname[sizeof(bone->name)], newname[sizeof(bone->name)];
/* need to be on the stack */
@@ -274,21 +282,21 @@ static void rna_Bone_name_set(PointerRNA *ptr, const char *value)
static void rna_EditBone_layer_set(PointerRNA *ptr, const int values[])
{
- EditBone *data= (EditBone*)(ptr->data);
+ EditBone *data = (EditBone*)(ptr->data);
rna_bone_layer_set(&data->layer, values);
}
static void rna_EditBone_connected_check(EditBone *ebone)
{
- if(ebone->parent) {
- if(ebone->flag & BONE_CONNECTED) {
+ if (ebone->parent) {
+ if (ebone->flag & BONE_CONNECTED) {
/* Attach this bone to its parent */
copy_v3_v3(ebone->head, ebone->parent->tail);
- if(ebone->flag & BONE_ROOTSEL)
+ if (ebone->flag & BONE_ROOTSEL)
ebone->parent->flag |= BONE_TIPSEL;
}
- else if(!(ebone->parent->flag & BONE_ROOTSEL)) {
+ else if (!(ebone->parent->flag & BONE_ROOTSEL)) {
ebone->parent->flag &= ~BONE_TIPSEL;
}
}
@@ -296,9 +304,9 @@ static void rna_EditBone_connected_check(EditBone *ebone)
static void rna_EditBone_connected_set(PointerRNA *ptr, int value)
{
- EditBone *ebone= (EditBone*)(ptr->data);
+ EditBone *ebone = (EditBone*)(ptr->data);
- if(value) ebone->flag |= BONE_CONNECTED;
+ if (value) ebone->flag |= BONE_CONNECTED;
else ebone->flag &= ~BONE_CONNECTED;
rna_EditBone_connected_check(ebone);
@@ -306,17 +314,17 @@ static void rna_EditBone_connected_set(PointerRNA *ptr, int value)
static PointerRNA rna_EditBone_parent_get(PointerRNA *ptr)
{
- EditBone *data= (EditBone*)(ptr->data);
+ EditBone *data = (EditBone*)(ptr->data);
return rna_pointer_inherit_refine(ptr, &RNA_EditBone, data->parent);
}
static void rna_EditBone_parent_set(PointerRNA *ptr, PointerRNA value)
{
- EditBone *ebone= (EditBone*)(ptr->data);
- EditBone *pbone, *parbone= (EditBone*)value.data;
+ EditBone *ebone = (EditBone*)(ptr->data);
+ EditBone *pbone, *parbone = (EditBone*)value.data;
- if(parbone == NULL) {
- if(ebone->parent && !(ebone->parent->flag & BONE_ROOTSEL))
+ if (parbone == NULL) {
+ if (ebone->parent && !(ebone->parent->flag & BONE_ROOTSEL))
ebone->parent->flag &= ~BONE_TIPSEL;
ebone->parent = NULL;
@@ -324,15 +332,15 @@ static void rna_EditBone_parent_set(PointerRNA *ptr, PointerRNA value)
}
else {
/* within same armature */
- if(value.id.data != ptr->id.data)
+ if (value.id.data != ptr->id.data)
return;
/* make sure this is a valid child */
- if(parbone == ebone)
+ if (parbone == ebone)
return;
- for(pbone= parbone->parent; pbone; pbone=pbone->parent)
- if(pbone == ebone)
+ for (pbone = parbone->parent; pbone; pbone = pbone->parent)
+ if (pbone == ebone)
return;
ebone->parent = parbone;
@@ -342,7 +350,7 @@ static void rna_EditBone_parent_set(PointerRNA *ptr, PointerRNA value)
static void rna_EditBone_matrix_get(PointerRNA *ptr, float *values)
{
- EditBone *ebone= (EditBone*)(ptr->data);
+ EditBone *ebone = (EditBone*)(ptr->data);
float delta[3], tmat[3][3], mat[4][4];
@@ -357,35 +365,35 @@ static void rna_EditBone_matrix_get(PointerRNA *ptr, float *values)
static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- bArmature *arm= (bArmature*)ptr->id.data;
- EditBone *ebone= (EditBone*)ptr->data;
+ bArmature *arm = (bArmature*)ptr->id.data;
+ EditBone *ebone = (EditBone*)ptr->data;
EditBone *child, *eboflip;
/* update our parent */
- if(ebone->parent && ebone->flag & BONE_CONNECTED)
+ if (ebone->parent && ebone->flag & BONE_CONNECTED)
copy_v3_v3(ebone->parent->tail, ebone->head);
/* update our children if necessary */
- for(child = arm->edbo->first; child; child=child->next)
- if(child->parent == ebone && (child->flag & BONE_CONNECTED))
+ for (child = arm->edbo->first; child; child = child->next)
+ if (child->parent == ebone && (child->flag & BONE_CONNECTED))
copy_v3_v3(child->head, ebone->tail);
- if(arm->flag & ARM_MIRROR_EDIT) {
- eboflip= ED_armature_bone_get_mirrored(arm->edbo, ebone);
+ if (arm->flag & ARM_MIRROR_EDIT) {
+ eboflip = ED_armature_bone_get_mirrored(arm->edbo, ebone);
- if(eboflip) {
- eboflip->roll= -ebone->roll;
+ if (eboflip) {
+ eboflip->roll = -ebone->roll;
- eboflip->head[0]= -ebone->head[0];
- eboflip->tail[0]= -ebone->tail[0];
+ eboflip->head[0] = -ebone->head[0];
+ eboflip->tail[0] = -ebone->tail[0];
/* update our parent */
- if(eboflip->parent && eboflip->flag & BONE_CONNECTED)
+ if (eboflip->parent && eboflip->flag & BONE_CONNECTED)
copy_v3_v3(eboflip->parent->tail, eboflip->head);
/* update our children if necessary */
- for(child = arm->edbo->first; child; child=child->next)
- if(child->parent == eboflip && (child->flag & BONE_CONNECTED))
+ for (child = arm->edbo->first; child; child = child->next)
+ if (child->parent == eboflip && (child->flag & BONE_CONNECTED))
copy_v3_v3 (child->head, eboflip->tail);
}
}
@@ -395,174 +403,174 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po
static void rna_Armature_bones_next(CollectionPropertyIterator *iter)
{
- ListBaseIterator *internal= iter->internal;
- Bone *bone= (Bone*)internal->link;
+ ListBaseIterator *internal = iter->internal;
+ Bone *bone = (Bone*)internal->link;
- if(bone->childbase.first)
- internal->link= (Link*)bone->childbase.first;
- else if(bone->next)
- internal->link= (Link*)bone->next;
+ if (bone->childbase.first)
+ internal->link = (Link*)bone->childbase.first;
+ else if (bone->next)
+ internal->link = (Link*)bone->next;
else {
- internal->link= NULL;
+ internal->link = NULL;
do {
- bone= bone->parent;
- if(bone && bone->next) {
- internal->link= (Link*)bone->next;
+ bone = bone->parent;
+ if (bone && bone->next) {
+ internal->link = (Link*)bone->next;
break;
}
- } while(bone);
+ } while (bone);
}
- iter->valid= (internal->link != NULL);
+ iter->valid = (internal->link != NULL);
}
#else
-static int rna_matrix_dimsize_4x4[]= {4, 4};
-static int rna_matrix_dimsize_3x3[]= {3, 3};
+static int rna_matrix_dimsize_4x4[] = {4, 4};
+static int rna_matrix_dimsize_3x3[] = {3, 3};
static void rna_def_bone_common(StructRNA *srna, int editbone)
{
PropertyRNA *prop;
/* strings */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
- if(editbone) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_EditBone_name_set");
+ if (editbone) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_EditBone_name_set");
else RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Bone_name_set");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* flags */
- prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
RNA_def_property_array(prop, 32);
- if(editbone) RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_layer_set");
+ if (editbone) RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_layer_set");
else RNA_def_property_boolean_funcs(prop, NULL, "rna_Bone_layer_set");
RNA_def_property_ui_text(prop, "Layers", "Layers bone exists in");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "use_connect", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_connect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_CONNECTED);
- if(editbone) RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_connected_set");
+ if (editbone) RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_connected_set");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Connected", "When bone has a parent, bone's head is stuck to the parent's tail");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "use_inherit_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_inherit_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_HINGE);
RNA_def_property_ui_text(prop, "Inherit Rotation", "Bone inherits rotation or scale from parent bone");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "use_envelope_multiply", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_envelope_multiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_MULT_VG_ENV);
RNA_def_property_ui_text(prop, "Multiply Vertex Group with Envelope",
"When deforming bone, multiply effects of Vertex Group weights with Envelope influence");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "use_deform", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_deform", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_DEFORM);
RNA_def_property_ui_text(prop, "Deform", "Bone does not deform any geometry");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "use_inherit_scale", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_inherit_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Inherit Scale", "Bone inherits scaling from parent bone");
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_SCALE);
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "use_local_location", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_local_location", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Local Location", "Bone location is set in local space");
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_LOCAL_LOCATION);
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_DRAWWIRE);
RNA_def_property_ui_text(prop, "Draw Wire",
"Bone is always drawn as Wireframe regardless of viewport draw mode "
"(useful for non-obstructive custom bone shapes)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "use_cyclic_offset", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_cyclic_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_CYCLICOFFSET);
RNA_def_property_ui_text(prop, "Cyclic Offset", "When bone doesn't have a parent, it receives cyclic offset effects");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_UNSELECTABLE);
RNA_def_property_ui_text(prop, "Selectable", "Bone is able to be selected");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* Number values */
/* envelope deform settings */
- prop= RNA_def_property(srna, "envelope_distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "envelope_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Envelope Deform Distance", "Bone deformation distance (for Envelope deform only)");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "envelope_weight", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "envelope_weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Envelope Deform Weight", "Bone deformation weight (for Envelope deform only)");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "head_radius", PROP_FLOAT, PROP_UNSIGNED);
- if(editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
+ prop = RNA_def_property(srna, "head_radius", PROP_FLOAT, PROP_UNSIGNED);
+ if (editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
else RNA_def_property_update(prop, 0, "rna_Armature_update_data");
RNA_def_property_float_sdna(prop, NULL, "rad_head");
- //RNA_def_property_range(prop, 0, 1000); // XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid);
+ /*RNA_def_property_range(prop, 0, 1000); *//* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */
RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Envelope Head Radius", "Radius of head of bone (for Envelope deform only)");
- prop= RNA_def_property(srna, "tail_radius", PROP_FLOAT, PROP_UNSIGNED);
- if(editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
+ prop = RNA_def_property(srna, "tail_radius", PROP_FLOAT, PROP_UNSIGNED);
+ if (editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
else RNA_def_property_update(prop, 0, "rna_Armature_update_data");
RNA_def_property_float_sdna(prop, NULL, "rad_tail");
- //RNA_def_property_range(prop, 0, 1000); // XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid);
+ /*RNA_def_property_range(prop, 0, 1000); *//* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */
RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Envelope Tail Radius", "Radius of tail of bone (for Envelope deform only)");
/* b-bones deform settings */
- prop= RNA_def_property(srna, "bbone_segments", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "bbone_segments", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "segments");
RNA_def_property_range(prop, 1, 32);
RNA_def_property_ui_text(prop, "B-Bone Segments", "Number of subdivisions of bone (for B-Bones only)");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "bbone_in", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bbone_in", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ease1");
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "B-Bone Ease In", "Length of first Bezier Handle (for B-Bones only)");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "bbone_out", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bbone_out", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ease2");
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "B-Bone Ease Out", "Length of second Bezier Handle (for B-Bones only)");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "bbone_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bbone_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xwidth");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "B-Bone Display X Width", "B-Bone X size");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "bbone_z", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bbone_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zwidth");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "B-Bone Display Z Width", "B-Bone Z size");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
}
-// err... bones should not be directly edited (only editbones should be...)
+/* err... bones should not be directly edited (only editbones should be...) */
static void rna_def_bone(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Bone", NULL);
+ srna = RNA_def_struct(brna, "Bone", NULL);
RNA_def_struct_ui_text(srna, "Bone", "Bone in an Armature datablock");
RNA_def_struct_ui_icon(srna, ICON_BONE_DATA);
RNA_def_struct_path_func(srna, "rna_Bone_path");
@@ -570,76 +578,76 @@ static void rna_def_bone(BlenderRNA *brna)
/* pointers/collections */
/* parent (pointer) */
- prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Bone");
RNA_def_property_pointer_sdna(prop, NULL, "parent");
RNA_def_property_ui_text(prop, "Parent", "Parent bone (in same Armature)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* children (collection) */
- prop= RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "childbase", NULL);
RNA_def_property_struct_type(prop, "Bone");
RNA_def_property_ui_text(prop, "Children", "Bones which are children of this bone");
rna_def_bone_common(srna, 0);
- // XXX should we define this in PoseChannel wrapping code instead? but PoseChannels directly get some of their flags from here...
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ /* XXX should we define this in PoseChannel wrapping code instead? but PoseChannels directly get some of their flags from here... */
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_P);
RNA_def_property_ui_text(prop, "Hide", "Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED);
RNA_def_property_ui_text(prop, "Select", "");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "select_head", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_head", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_ROOTSEL);
RNA_def_property_ui_text(prop, "Select Head", "");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "select_tail", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_tail", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_TIPSEL);
RNA_def_property_ui_text(prop, "Select Tail", "");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* XXX better matrix descriptions possible (Arystan) */
- prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "bone_mat");
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_3x3);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Bone Matrix", "3x3 bone matrix");
- prop= RNA_def_property(srna, "matrix_local", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "matrix_local", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "arm_mat");
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Bone Armature-Relative Matrix", "4x4 bone matrix relative to armature");
- prop= RNA_def_property(srna, "tail", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "tail", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "tail");
RNA_def_property_array(prop, 3);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Tail", "Location of tail end of the bone");
- prop= RNA_def_property(srna, "tail_local", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "tail_local", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "arm_tail");
RNA_def_property_array(prop, 3);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Armature-Relative Tail", "Location of tail end of the bone relative to armature");
- prop= RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "head");
RNA_def_property_array(prop, 3);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Head", "Location of head end of the bone relative to its parent");
- prop= RNA_def_property(srna, "head_local", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "head_local", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "arm_head");
RNA_def_property_array(prop, 3);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -653,36 +661,36 @@ static void rna_def_edit_bone(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "EditBone", NULL);
+ srna = RNA_def_struct(brna, "EditBone", NULL);
RNA_def_struct_sdna(srna, "EditBone");
RNA_def_struct_idprops_func(srna, "rna_EditBone_idprops");
RNA_def_struct_ui_text(srna, "Edit Bone", "Editmode bone in an Armature datablock");
RNA_def_struct_ui_icon(srna, ICON_BONE_DATA);
- RNA_define_verify_sdna(0); // not in sdna
+ RNA_define_verify_sdna(0); /* not in sdna */
- prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EditBone");
RNA_def_property_pointer_funcs(prop, "rna_EditBone_parent_get", "rna_EditBone_parent_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Parent", "Parent edit bone (in same Armature)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "roll", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "roll", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "roll");
RNA_def_property_ui_range(prop, -M_PI * 2, M_PI * 2, 0.1, 2);
RNA_def_property_ui_text(prop, "Roll", "Bone rotation around head-tail axis");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
- prop= RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "head");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Head", "Location of head end of the bone");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
- prop= RNA_def_property(srna, "tail", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "tail", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "tail");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Tail", "Location of tail end of the bone");
@@ -691,44 +699,44 @@ static void rna_def_edit_bone(BlenderRNA *brna)
rna_def_bone_common(srna, 1);
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_A);
RNA_def_property_ui_text(prop, "Hide", "Bone is not visible when in Edit Mode");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_EDITMODE_LOCKED);
RNA_def_property_ui_text(prop, "Lock", "Bone is not able to be transformed when in Edit Mode");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED);
RNA_def_property_ui_text(prop, "Select", "");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "select_head", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_head", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_ROOTSEL);
RNA_def_property_ui_text(prop, "Head Select", "");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "select_tail", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_tail", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_TIPSEL);
RNA_def_property_ui_text(prop, "Tail Select", "");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* calculated and read only, not actual data access */
- prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
- //RNA_def_property_float_sdna(prop, NULL, ""); // doesnt access any real data
+ prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
+ /*RNA_def_property_float_sdna(prop, NULL, ""); *//* doesnt access any real data */
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_THICK_WRAP); /* no reference to original data */
RNA_def_property_ui_text(prop, "Editbone Matrix", "Read-only matrix calculated from the roll (armature space)");
- RNA_def_property_float_funcs(prop, "rna_EditBone_matrix_get", NULL, NULL); // TODO - this could be made writable also
+ RNA_def_property_float_funcs(prop, "rna_EditBone_matrix_get", NULL, NULL); /* TODO - this could be made writable also */
RNA_api_armature_edit_bone(srna);
@@ -742,16 +750,16 @@ static void rna_def_armature_bones(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna;
PropertyRNA *prop;
-// FunctionRNA *func;
-// PropertyRNA *parm;
+/* FunctionRNA *func; */
+/* PropertyRNA *parm; */
RNA_def_property_srna(cprop, "ArmatureBones");
- srna= RNA_def_struct(brna, "ArmatureBones", NULL);
+ srna = RNA_def_struct(brna, "ArmatureBones", NULL);
RNA_def_struct_sdna(srna, "bArmature");
RNA_def_struct_ui_text(srna, "Armature Bones", "Collection of armature bones");
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Bone");
RNA_def_property_pointer_sdna(prop, NULL, "act_bone");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -759,7 +767,7 @@ static void rna_def_armature_bones(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_bone_set", NULL, NULL);
/* todo, redraw */
-// RNA_def_property_collection_active(prop, prop_act);
+/* RNA_def_property_collection_active(prop, prop_act); */
}
/* armature.bones.* */
@@ -772,38 +780,38 @@ static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "ArmatureEditBones");
- srna= RNA_def_struct(brna, "ArmatureEditBones", NULL);
+ srna = RNA_def_struct(brna, "ArmatureEditBones", NULL);
RNA_def_struct_sdna(srna, "bArmature");
RNA_def_struct_ui_text(srna, "Armature EditBones", "Collection of armature edit bones");
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EditBone");
RNA_def_property_pointer_sdna(prop, NULL, "act_edbone");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active EditBone", "Armatures active edit bone");
- //RNA_def_property_update(prop, 0, "rna_Armature_act_editbone_update");
+ /*RNA_def_property_update(prop, 0, "rna_Armature_act_editbone_update"); */
RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL, NULL);
/* todo, redraw */
-// RNA_def_property_collection_active(prop, prop_act);
+/* RNA_def_property_collection_active(prop, prop_act); */
/* add target */
- func= RNA_def_function(srna, "new", "rna_Armature_edit_bone_new");
+ func = RNA_def_function(srna, "new", "rna_Armature_edit_bone_new");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new bone");
- parm= RNA_def_string(func, "name", "Object", 0, "", "New name for the bone");
+ parm = RNA_def_string(func, "name", "Object", 0, "", "New name for the bone");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "bone", "EditBone", "", "Newly created edit bone");
+ parm = RNA_def_pointer(func, "bone", "EditBone", "", "Newly created edit bone");
RNA_def_function_return(func, parm);
/* remove target */
- func= RNA_def_function(srna, "remove", "rna_Armature_edit_bone_remove");
+ func = RNA_def_function(srna, "remove", "rna_Armature_edit_bone_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove an existing bone from the armature");
/* target to remove*/
- parm= RNA_def_pointer(func, "bone", "EditBone", "", "EditBone to remove");
+ parm = RNA_def_pointer(func, "bone", "EditBone", "", "EditBone to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -829,12 +837,12 @@ static void rna_def_armature(BlenderRNA *brna)
{ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Display Ghosts of poses within specified range"},
{ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Display Ghosts of poses on Keyframes"},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem prop_pose_position_items[]= {
+ static const EnumPropertyItem prop_pose_position_items[] = {
{0, "POSE", 0, "Pose Position", "Show armature in posed state"},
{ARM_RESTPOS, "REST", 0, "Rest Position", "Show Armature in binding pose state (no posing possible)"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Armature", "ID");
+ srna = RNA_def_struct(brna, "Armature", "ID");
RNA_def_struct_ui_text(srna, "Armature",
"Armature datablock containing a hierarchy of bones, usually used for rigging characters");
RNA_def_struct_ui_icon(srna, ICON_ARMATURE_DATA);
@@ -844,53 +852,53 @@ static void rna_def_armature(BlenderRNA *brna)
rna_def_animdata_common(srna);
/* Collections */
- prop= RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "bonebase", NULL);
RNA_def_property_collection_funcs(prop, 0, "rna_Armature_bones_next", NULL, NULL, NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "Bone");
RNA_def_property_ui_text(prop, "Bones", "");
rna_def_armature_bones(brna, prop);
- prop= RNA_def_property(srna, "edit_bones", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "edit_bones", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "edbo", NULL);
RNA_def_property_struct_type(prop, "EditBone");
RNA_def_property_ui_text(prop, "Edit Bones", "");
rna_def_armature_edit_bones(brna, prop);
/* Enum values */
- prop= RNA_def_property(srna, "pose_position", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "pose_position", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_pose_position_items);
RNA_def_property_ui_text(prop, "Pose Position", "Show armature in binding pose or final posed state");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- prop= RNA_def_property(srna, "draw_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "draw_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "drawtype");
RNA_def_property_enum_items(prop, prop_drawtype_items);
RNA_def_property_ui_text(prop, "Draw Type", "");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- prop= RNA_def_property(srna, "deform_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "deform_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "gevertdeformer");
RNA_def_property_enum_items(prop, prop_vdeformer);
RNA_def_property_ui_text(prop, "Vertex Deformer", "");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
-// XXX depreceated ....... old animviz for armatures only
- prop= RNA_def_property(srna, "ghost_type", PROP_ENUM, PROP_NONE);
+/* XXX depreceated ....... old animviz for armatures only */
+ prop = RNA_def_property(srna, "ghost_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ghosttype");
RNA_def_property_enum_items(prop, prop_ghost_type_items);
RNA_def_property_ui_text(prop, "Ghost Type", "Method of Onion-skinning for active Action");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
-// XXX depreceated ....... old animviz for armatures only
+/* XXX depreceated ....... old animviz for armatures only */
/* Boolean values */
/* layer */
- prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
RNA_def_property_array(prop, 32);
RNA_def_property_ui_text(prop, "Visible Layers", "Armature layer visibility");
@@ -899,7 +907,7 @@ static void rna_def_armature(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
/* layer protection */
- prop= RNA_def_property(srna, "layers_protected", PROP_BOOLEAN, PROP_LAYER);
+ prop = RNA_def_property(srna, "layers_protected", PROP_BOOLEAN, PROP_LAYER);
RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1);
RNA_def_property_array(prop, 32);
RNA_def_property_ui_text(prop, "Layer Proxy Protection",
@@ -907,78 +915,78 @@ static void rna_def_armature(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* flag */
- prop= RNA_def_property(srna, "show_axes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_axes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWAXES);
RNA_def_property_ui_text(prop, "Draw Axes", "Draw bone axes");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- prop= RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWNAMES);
RNA_def_property_ui_text(prop, "Draw Names", "Draw bone names");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- prop= RNA_def_property(srna, "use_deform_delay", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_deform_delay", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DELAYDEFORM);
RNA_def_property_ui_text(prop, "Delay Deform", "Don't deform children when manipulating bones in Pose Mode");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_MIRROR_EDIT);
RNA_def_property_ui_text(prop, "X-Axis Mirror", "Apply changes to matching bone on opposite side of X-Axis");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- prop= RNA_def_property(srna, "use_auto_ik", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_ik", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_AUTO_IK);
RNA_def_property_ui_text(prop, "Auto IK", "Add temporaral IK constraints while grabbing bones in Pose Mode");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- prop= RNA_def_property(srna, "show_bone_custom_shapes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_bone_custom_shapes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ARM_NO_CUSTOM);
RNA_def_property_ui_text(prop, "Draw Custom Bone Shapes", "Draw bones with their custom shapes");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_COL_CUSTOM);
RNA_def_property_ui_text(prop, "Draw Bone Group Colors", "Draw bone group colors");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
-// XXX depreceated ....... old animviz for armatures only
- prop= RNA_def_property(srna, "show_only_ghost_selected", PROP_BOOLEAN, PROP_NONE);
+/* XXX depreceated ....... old animviz for armatures only */
+ prop = RNA_def_property(srna, "show_only_ghost_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_GHOST_ONLYSEL);
RNA_def_property_ui_text(prop, "Draw Ghosts on Selected Bones Only", "");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
-// XXX depreceated ....... old animviz for armatures only
+/* XXX depreceated ....... old animviz for armatures only */
/* deformflag */
- prop= RNA_def_property(srna, "use_deform_vertex_groups", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_deform_vertex_groups", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_VGROUP);
RNA_def_property_ui_text(prop, "Deform Vertex Groups", "Enable Vertex Groups when defining deform");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "use_deform_envelopes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_deform_envelopes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_ENVELOPE);
RNA_def_property_ui_text(prop, "Deform Envelopes", "Enable Bone Envelopes when defining deform");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_QUATERNION);
RNA_def_property_ui_text(prop, "Use Dual Quaternion Deformation", "Enable deform rotation with Quaternions");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- //prop= RNA_def_property(srna, "deform_invert_vertexgroups", PROP_BOOLEAN, PROP_NONE);
- //RNA_def_property_boolean_negative_sdna(prop, NULL, "deformflag", ARM_DEF_INVERT_VGROUP);
- //RNA_def_property_ui_text(prop, "Invert Vertex Group Influence", "Invert Vertex Group influence (only for Modifiers)");
- //RNA_def_property_update(prop, 0, "rna_Armature_update_data");
+ /*prop= RNA_def_property(srna, "deform_invert_vertexgroups", PROP_BOOLEAN, PROP_NONE); */
+ /*RNA_def_property_boolean_negative_sdna(prop, NULL, "deformflag", ARM_DEF_INVERT_VGROUP); */
+ /*RNA_def_property_ui_text(prop, "Invert Vertex Group Influence", "Invert Vertex Group influence (only for Modifiers)"); */
+ /*RNA_def_property_update(prop, 0, "rna_Armature_update_data"); */
/* Number fields */
-// XXX depreceated ....... old animviz for armatures only
+/* XXX depreceated ....... old animviz for armatures only */
/* ghost/onionskining settings */
- prop= RNA_def_property(srna, "ghost_step", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "ghost_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ghostep");
RNA_def_property_range(prop, 0, 30);
RNA_def_property_ui_text(prop, "Ghosting Step",
@@ -987,7 +995,7 @@ static void rna_def_armature(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- prop= RNA_def_property(srna, "ghost_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "ghost_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ghostsize");
RNA_def_property_range(prop, 1, 20);
RNA_def_property_ui_text(prop, "Ghosting Frame Step",
@@ -995,7 +1003,7 @@ static void rna_def_armature(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- prop= RNA_def_property(srna, "ghost_frame_start", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "ghost_frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghostsf");
RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Ghosting Start Frame",
@@ -1004,14 +1012,14 @@ static void rna_def_armature(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- prop= RNA_def_property(srna, "ghost_frame_end", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "ghost_frame_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghostef");
RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "Ghosting End Frame",
"End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
-// XXX depreceated ....... old animviz for armatures only
+/* XXX depreceated ....... old animviz for armatures only */
}
void RNA_def_armature(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_armature_api.c b/source/blender/makesrna/intern/rna_armature_api.c
index fa079486b95..08c0a5b54aa 100644
--- a/source/blender/makesrna/intern/rna_armature_api.c
+++ b/source/blender/makesrna/intern/rna_armature_api.c
@@ -44,7 +44,7 @@
void rna_EditBone_align_roll(EditBone *ebo, float no[3])
{
- ebo->roll= ED_rollBoneToVector(ebo, no, FALSE);
+ ebo->roll = ED_rollBoneToVector(ebo, no, FALSE);
}
float rna_Bone_do_envelope(Bone *bone, float *vec)
@@ -60,10 +60,10 @@ void RNA_api_armature_edit_bone(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "align_roll", "rna_EditBone_align_roll");
+ func = RNA_def_function(srna, "align_roll", "rna_EditBone_align_roll");
RNA_def_function_ui_description(func, "Align the bone to a localspace roll so the Z axis "
"points in the direction of the vector given");
- parm= RNA_def_float_vector(func, "vector", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX);
+ parm = RNA_def_float_vector(func, "vector", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -72,13 +72,13 @@ void RNA_api_bone(StructRNA *srna)
PropertyRNA *parm;
FunctionRNA *func;
- func= RNA_def_function(srna, "evaluate_envelope", "rna_Bone_do_envelope");
+ func = RNA_def_function(srna, "evaluate_envelope", "rna_Bone_do_envelope");
RNA_def_function_ui_description(func, "Calculate bone envelope at given point");
- parm= RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point",
+ parm = RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point",
"Position in 3d space to evaluate", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return value */
- parm= RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX);
+ parm = RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX);
RNA_def_function_return(func, parm);
}
diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c
index 702f06860f7..0db401334cd 100644
--- a/source/blender/makesrna/intern/rna_boid.c
+++ b/source/blender/makesrna/intern/rna_boid.c
@@ -46,7 +46,7 @@
#include "WM_api.h"
#include "WM_types.h"
-EnumPropertyItem boidrule_type_items[] ={
+EnumPropertyItem boidrule_type_items[] = {
{eBoidRuleType_Goal, "GOAL", 0, "Goal", "Go to assigned object or loudest assigned signal source"},
{eBoidRuleType_Avoid, "AVOID", 0, "Avoid", "Get away from assigned object or loudest assigned signal source"},
{eBoidRuleType_AvoidCollision, "AVOID_COLLISION", 0, "Avoid Collision", "Manoeuvre to avoid collisions with other boids and deflector objects in near future"},
@@ -55,13 +55,13 @@ EnumPropertyItem boidrule_type_items[] ={
{eBoidRuleType_FollowLeader, "FOLLOW_LEADER", 0, "Follow Leader", "Follow a boid or assigned object"},
{eBoidRuleType_AverageSpeed, "AVERAGE_SPEED", 0, "Average Speed", "Maintain speed, flight level or wander"},
{eBoidRuleType_Fight, "FIGHT", 0, "Fight", "Go to closest enemy and attack when in range"},
- //{eBoidRuleType_Protect, "PROTECT", 0, "Protect", "Go to enemy closest to target and attack when in range"},
- //{eBoidRuleType_Hide, "HIDE", 0, "Hide", "Find a deflector move to it's other side from closest enemy"},
- //{eBoidRuleType_FollowPath, "FOLLOW_PATH", 0, "Follow Path", "Move along a assigned curve or closest curve in a group"},
- //{eBoidRuleType_FollowWall, "FOLLOW_WALL", 0, "Follow Wall", "Move next to a deflector object's in direction of it's tangent"},
+ /*{eBoidRuleType_Protect, "PROTECT", 0, "Protect", "Go to enemy closest to target and attack when in range"}, */
+ /*{eBoidRuleType_Hide, "HIDE", 0, "Hide", "Find a deflector move to it's other side from closest enemy"}, */
+ /*{eBoidRuleType_FollowPath, "FOLLOW_PATH", 0, "Follow Path", "Move along a assigned curve or closest curve in a group"}, */
+ /*{eBoidRuleType_FollowWall, "FOLLOW_WALL", 0, "Follow Wall", "Move next to a deflector object's in direction of it's tangent"}, */
{0, NULL, 0, NULL, NULL}};
-EnumPropertyItem boidruleset_type_items[] ={
+EnumPropertyItem boidruleset_type_items[] = {
{eBoidRulesetType_Fuzzy, "FUZZY", 0, "Fuzzy", "Rules are gone through top to bottom. Only the first rule that effect above fuzziness threshold is evaluated"},
{eBoidRulesetType_Random, "RANDOM", 0, "Random", "A random rule is selected for each boid"},
{eBoidRulesetType_Average, "AVERAGE", 0, "Average", "All rules are averaged"},
@@ -76,7 +76,7 @@ EnumPropertyItem boidruleset_type_items[] ={
static void rna_Boids_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- if(ptr->type==&RNA_ParticleSystem) {
+ if (ptr->type == &RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data;
psys->recalc = PSYS_RECALC_RESET;
@@ -90,7 +90,7 @@ static void rna_Boids_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN
}
static void rna_Boids_reset_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- if(ptr->type==&RNA_ParticleSystem) {
+ if (ptr->type == &RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data;
psys->recalc = PSYS_RECALC_RESET;
@@ -107,9 +107,9 @@ static void rna_Boids_reset_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
static StructRNA* rna_BoidRule_refine(struct PointerRNA *ptr)
{
- BoidRule *rule= (BoidRule*)ptr->data;
+ BoidRule *rule = (BoidRule*)ptr->data;
- switch(rule->type) {
+ switch (rule->type) {
case eBoidRuleType_Goal:
return &RNA_BoidRuleGoal;
case eBoidRuleType_Avoid:
@@ -129,36 +129,36 @@ static StructRNA* rna_BoidRule_refine(struct PointerRNA *ptr)
static char *rna_BoidRule_path(PointerRNA *ptr)
{
- return BLI_sprintfN("rules[\"%s\"]", ((BoidRule*)ptr->data)->name); // XXX not unique
+ return BLI_sprintfN("rules[\"%s\"]", ((BoidRule*)ptr->data)->name); /* XXX not unique */
}
static PointerRNA rna_BoidState_active_boid_rule_get(PointerRNA *ptr)
{
- BoidState *state= (BoidState*)ptr->data;
+ BoidState *state = (BoidState*)ptr->data;
BoidRule *rule = (BoidRule*)state->rules.first;
- for(; rule; rule=rule->next) {
- if(rule->flag & BOIDRULE_CURRENT)
+ for (; rule; rule = rule->next) {
+ if (rule->flag & BOIDRULE_CURRENT)
return rna_pointer_inherit_refine(ptr, &RNA_BoidRule, rule);
}
return rna_pointer_inherit_refine(ptr, &RNA_BoidRule, NULL);
}
static void rna_BoidState_active_boid_rule_index_range(PointerRNA *ptr, int *min, int *max)
{
- BoidState *state= (BoidState*)ptr->data;
- *min= 0;
- *max= BLI_countlist(&state->rules)-1;
- *max= MAX2(0, *max);
+ BoidState *state = (BoidState*)ptr->data;
+ *min = 0;
+ *max = BLI_countlist(&state->rules)-1;
+ *max = MAX2(0, *max);
}
static int rna_BoidState_active_boid_rule_index_get(PointerRNA *ptr)
{
- BoidState *state= (BoidState*)ptr->data;
+ BoidState *state = (BoidState*)ptr->data;
BoidRule *rule = (BoidRule*)state->rules.first;
- int i=0;
+ int i = 0;
- for(; rule; rule=rule->next, i++) {
- if(rule->flag & BOIDRULE_CURRENT)
+ for (; rule; rule = rule->next, i++) {
+ if (rule->flag & BOIDRULE_CURRENT)
return i;
}
return 0;
@@ -166,12 +166,12 @@ static int rna_BoidState_active_boid_rule_index_get(PointerRNA *ptr)
static void rna_BoidState_active_boid_rule_index_set(struct PointerRNA *ptr, int value)
{
- BoidState *state= (BoidState*)ptr->data;
+ BoidState *state = (BoidState*)ptr->data;
BoidRule *rule = (BoidRule*)state->rules.first;
- int i=0;
+ int i = 0;
- for(; rule; rule=rule->next, i++) {
- if(i==value)
+ for (; rule; rule = rule->next, i++) {
+ if (i == value)
rule->flag |= BOIDRULE_CURRENT;
else
rule->flag &= ~BOIDRULE_CURRENT;
@@ -180,7 +180,7 @@ static void rna_BoidState_active_boid_rule_index_set(struct PointerRNA *ptr, int
static int particle_id_check(PointerRNA *ptr)
{
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
return (GS(id->name) == ID_PA);
}
@@ -189,7 +189,7 @@ static char *rna_BoidSettings_path(PointerRNA *ptr)
{
BoidSettings *boids = (BoidSettings *)ptr->data;
- if(particle_id_check(ptr)) {
+ if (particle_id_check(ptr)) {
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
if (part->boids == boids)
@@ -200,31 +200,31 @@ static char *rna_BoidSettings_path(PointerRNA *ptr)
static PointerRNA rna_BoidSettings_active_boid_state_get(PointerRNA *ptr)
{
- BoidSettings *boids= (BoidSettings*)ptr->data;
+ BoidSettings *boids = (BoidSettings*)ptr->data;
BoidState *state = (BoidState*)boids->states.first;
- for(; state; state=state->next) {
- if(state->flag & BOIDSTATE_CURRENT)
+ for (; state; state = state->next) {
+ if (state->flag & BOIDSTATE_CURRENT)
return rna_pointer_inherit_refine(ptr, &RNA_BoidState, state);
}
return rna_pointer_inherit_refine(ptr, &RNA_BoidState, NULL);
}
static void rna_BoidSettings_active_boid_state_index_range(PointerRNA *ptr, int *min, int *max)
{
- BoidSettings *boids= (BoidSettings*)ptr->data;
- *min= 0;
- *max= BLI_countlist(&boids->states)-1;
- *max= MAX2(0, *max);
+ BoidSettings *boids = (BoidSettings*)ptr->data;
+ *min = 0;
+ *max = BLI_countlist(&boids->states)-1;
+ *max = MAX2(0, *max);
}
static int rna_BoidSettings_active_boid_state_index_get(PointerRNA *ptr)
{
- BoidSettings *boids= (BoidSettings*)ptr->data;
+ BoidSettings *boids = (BoidSettings*)ptr->data;
BoidState *state = (BoidState*)boids->states.first;
- int i=0;
+ int i = 0;
- for(; state; state=state->next, i++) {
- if(state->flag & BOIDSTATE_CURRENT)
+ for (; state; state = state->next, i++) {
+ if (state->flag & BOIDSTATE_CURRENT)
return i;
}
return 0;
@@ -232,12 +232,12 @@ static int rna_BoidSettings_active_boid_state_index_get(PointerRNA *ptr)
static void rna_BoidSettings_active_boid_state_index_set(struct PointerRNA *ptr, int value)
{
- BoidSettings *boids= (BoidSettings*)ptr->data;
+ BoidSettings *boids = (BoidSettings*)ptr->data;
BoidState *state = (BoidState*)boids->states.first;
- int i=0;
+ int i = 0;
- for(; state; state=state->next, i++) {
- if(i==value)
+ for (; state; state = state->next, i++) {
+ if (i == value)
state->flag |= BOIDSTATE_CURRENT;
else
state->flag &= ~BOIDSTATE_CURRENT;
@@ -251,17 +251,17 @@ static void rna_def_boidrule_goal(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "BoidRuleGoal", "BoidRule");
+ srna = RNA_def_struct(brna, "BoidRuleGoal", "BoidRule");
RNA_def_struct_ui_text(srna, "Goal", "");
RNA_def_struct_sdna(srna, "BoidRuleGoalAvoid");
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Goal object");
RNA_def_property_update(prop, 0, "rna_Boids_reset_deps");
- prop= RNA_def_property(srna, "use_predict", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_predict", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_GOAL_AVOID_PREDICT);
RNA_def_property_ui_text(prop, "Predict", "Predict target movement");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -272,22 +272,22 @@ static void rna_def_boidrule_avoid(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "BoidRuleAvoid", "BoidRule");
+ srna = RNA_def_struct(brna, "BoidRuleAvoid", "BoidRule");
RNA_def_struct_ui_text(srna, "Avoid", "");
RNA_def_struct_sdna(srna, "BoidRuleGoalAvoid");
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to avoid");
RNA_def_property_update(prop, 0, "rna_Boids_reset_deps");
- prop= RNA_def_property(srna, "use_predict", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_predict", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_GOAL_AVOID_PREDICT);
RNA_def_property_ui_text(prop, "Predict", "Predict target movement");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "fear_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "fear_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Fear factor", "Avoid object if danger from it is above this threshold");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -298,20 +298,20 @@ static void rna_def_boidrule_avoid_collision(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "BoidRuleAvoidCollision", "BoidRule");
+ srna = RNA_def_struct(brna, "BoidRuleAvoidCollision", "BoidRule");
RNA_def_struct_ui_text(srna, "Avoid Collision", "");
- prop= RNA_def_property(srna, "use_avoid", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_avoid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_ACOLL_WITH_BOIDS);
RNA_def_property_ui_text(prop, "Boids", "Avoid collision with other boids");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "use_avoid_collision", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_avoid_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_ACOLL_WITH_DEFLECTORS);
RNA_def_property_ui_text(prop, "Deflectors", "Avoid collision with deflector objects");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "look_ahead", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "look_ahead", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Look ahead", "Time to look ahead in seconds");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -322,27 +322,27 @@ static void rna_def_boidrule_follow_leader(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "BoidRuleFollowLeader", "BoidRule");
+ srna = RNA_def_struct(brna, "BoidRuleFollowLeader", "BoidRule");
RNA_def_struct_ui_text(srna, "Follow Leader", "");
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Follow this object instead of a boid");
RNA_def_property_update(prop, 0, "rna_Boids_reset_deps");
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Distance", "Distance behind leader to follow");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "queue_count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "queue_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "queue_size");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Queue Size", "How many boids in a line");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "use_line", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_line", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_LEADER_IN_LINE);
RNA_def_property_ui_text(prop, "Line", "Follow leader in a line");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -353,20 +353,20 @@ static void rna_def_boidrule_average_speed(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "BoidRuleAverageSpeed", "BoidRule");
+ srna = RNA_def_struct(brna, "BoidRuleAverageSpeed", "BoidRule");
RNA_def_struct_ui_text(srna, "Average Speed", "");
- prop= RNA_def_property(srna, "wander", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "wander", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Wander", "How fast velocity's direction is randomized");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "level", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "level", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Level", "How much velocity's z-component is kept constant");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Speed", "Percentage of maximum speed");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -377,15 +377,15 @@ static void rna_def_boidrule_fight(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "BoidRuleFight", "BoidRule");
+ srna = RNA_def_struct(brna, "BoidRuleFight", "BoidRule");
RNA_def_struct_ui_text(srna, "Fight", "");
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Fight Distance", "Attack boids at max this distance");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "flee_distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "flee_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Flee Distance", "Flee to this distance");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -397,37 +397,37 @@ static void rna_def_boidrule(BlenderRNA *brna)
PropertyRNA *prop;
/* data */
- srna= RNA_def_struct(brna, "BoidRule", NULL);
+ srna = RNA_def_struct(brna, "BoidRule", NULL);
RNA_def_struct_ui_text(srna , "Boid Rule", "");
RNA_def_struct_refine_func(srna, "rna_BoidRule_refine");
RNA_def_struct_path_func(srna, "rna_BoidRule_path");
/* strings */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Boid rule name");
RNA_def_struct_name_property(srna, prop);
/* enums */
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, boidrule_type_items);
RNA_def_property_ui_text(prop, "Type", "");
/* flags */
- prop= RNA_def_property(srna, "use_in_air", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_in_air", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_IN_AIR);
RNA_def_property_ui_text(prop, "In Air", "Use rule when boid is flying");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "use_on_land", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_on_land", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_ON_LAND);
RNA_def_property_ui_text(prop, "On Land", "Use rule when boid is on land");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- //prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
- //RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded);
- //RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface");
+ /*prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); */
+ /*RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded); */
+ /*RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface"); */
/* types */
rna_def_boidrule_goal(brna);
@@ -446,39 +446,39 @@ static void rna_def_boidstate(BlenderRNA *brna)
srna = RNA_def_struct(brna, "BoidState", NULL);
RNA_def_struct_ui_text(srna, "Boid State", "Boid state for boid physics");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Boid state name");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "ruleset_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "ruleset_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, boidruleset_type_items);
RNA_def_property_ui_text(prop, "Rule Evaluation", "How the rules in the list are evaluated");
- prop= RNA_def_property(srna, "rules", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "rules", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "BoidRule");
RNA_def_property_ui_text(prop, "Boid Rules", "");
- prop= RNA_def_property(srna, "active_boid_rule", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active_boid_rule", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoidRule");
RNA_def_property_pointer_funcs(prop, "rna_BoidState_active_boid_rule_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Boid Rule", "");
- prop= RNA_def_property(srna, "active_boid_rule_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "active_boid_rule_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_BoidState_active_boid_rule_index_get", "rna_BoidState_active_boid_rule_index_set", "rna_BoidState_active_boid_rule_index_range");
RNA_def_property_ui_text(prop, "Active Boid Rule Index", "");
- prop= RNA_def_property(srna, "rule_fuzzy", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "rule_fuzzy", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rule_fuzziness");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Rule Fuzziness", "");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Volume", "");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Falloff", "");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -492,144 +492,144 @@ static void rna_def_boid_settings(BlenderRNA *brna)
RNA_def_struct_path_func(srna, "rna_BoidSettings_path");
RNA_def_struct_ui_text(srna, "Boid Settings", "Settings for boid physics");
- prop= RNA_def_property(srna, "land_smooth", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "land_smooth", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "landing_smoothness");
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Landing Smoothness", "How smoothly the boids land");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "bank", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bank", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "banking");
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Banking", "Amount of rotation around velocity vector on turns");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pitch");
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Pitch", "Amount of rotation around side vector");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Height", "Boid height relative to particle size");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
/* states */
- prop= RNA_def_property(srna, "states", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "states", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "BoidState");
RNA_def_property_ui_text(prop, "Boid States", "");
- prop= RNA_def_property(srna, "active_boid_state", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active_boid_state", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoidRule");
RNA_def_property_pointer_funcs(prop, "rna_BoidSettings_active_boid_state_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Boid Rule", "");
- prop= RNA_def_property(srna, "active_boid_state_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "active_boid_state_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_BoidSettings_active_boid_state_index_get", "rna_BoidSettings_active_boid_state_index_set", "rna_BoidSettings_active_boid_state_index_range");
RNA_def_property_ui_text(prop, "Active Boid State Index", "");
/* character properties */
- prop= RNA_def_property(srna, "health", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "health", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Health", "Initial boid health when born");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Strength", "Maximum caused damage on attack per second");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "aggression", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "aggression", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Aggression", "Boid will fight this times stronger enemy");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Accuracy", "Accuracy of attack");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Range", "Maximum distance from which a boid can attack");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
/* physical properties */
- prop= RNA_def_property(srna, "air_speed_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "air_speed_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "air_min_speed");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Min Air Speed", "Minimum speed in air (relative to maximum speed)");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "air_speed_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "air_speed_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "air_max_speed");
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Max Air Speed", "Maximum speed in air");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "air_acc_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "air_acc_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "air_max_acc");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Max Air Acceleration", "Maximum acceleration in air (relative to maximum speed)");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "air_ave_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "air_ave_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "air_max_ave");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Max Air Angular Velocity", "Maximum angular velocity in air (relative to 180 degrees)");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "air_personal_space", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "air_personal_space", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Air Personal Space", "Radius of boids personal space in air (% of particle size)");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "land_jump_speed", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "land_jump_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Jump Speed", "Maximum speed for jumping");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "land_speed_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "land_speed_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "land_max_speed");
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Max Land Speed", "Maximum speed on land");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "land_acc_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "land_acc_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "land_max_acc");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Max Land Acceleration", "Maximum acceleration on land (relative to maximum speed)");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "land_ave_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "land_ave_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "land_max_ave");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Max Land Angular Velocity", "Maximum angular velocity on land (relative to 180 degrees)");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "land_personal_space", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "land_personal_space", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Land Personal Space", "Radius of boids personal space on land (% of particle size)");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "land_stick_force", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "land_stick_force", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Land Stick Force", "How strong a force must be to start effecting a boid on land");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
/* options */
- prop= RNA_def_property(srna, "use_flight", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_flight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_FLIGHT);
RNA_def_property_ui_text(prop, "Allow Flight", "Allow boids to move in air");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "use_land", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_land", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_LAND);
RNA_def_property_ui_text(prop, "Allow Land", "Allow boids to move on land");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
- prop= RNA_def_property(srna, "use_climb", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_climb", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_CLIMB);
RNA_def_property_ui_text(prop, "Allow Climbing", "Allow boids to climb goal objects");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index c1f87240e77..49817e8e4b5 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -43,7 +43,7 @@
#include "WM_types.h"
-static EnumPropertyItem prop_direction_items[]= {
+static EnumPropertyItem prop_direction_items[] = {
{0, "ADD", 0, "Add", "Add effect of brush"},
{BRUSH_DIR_IN, "SUBTRACT", 0, "Subtract", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}};
@@ -104,10 +104,10 @@ static void rna_Brush_reset_icon(Brush *br, const char *UNUSED(type))
{
ID *id = &br->id;
- if(br->flag & BRUSH_CUSTOM_ICON)
+ if (br->flag & BRUSH_CUSTOM_ICON)
return;
- if(id->icon_id >= BIFICONID_LAST) {
+ if (id->icon_id >= BIFICONID_LAST) {
BKE_icon_delete(id);
BKE_previewimg_free_id(id);
}
@@ -117,44 +117,44 @@ static void rna_Brush_reset_icon(Brush *br, const char *UNUSED(type))
static void rna_Brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Brush *br= (Brush*)ptr->data;
+ Brush *br = (Brush*)ptr->data;
WM_main_add_notifier(NC_BRUSH|NA_EDITED, br);
- //WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL);
+ /*WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL); */
}
static void rna_Brush_sculpt_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Brush *br= (Brush*)ptr->data;
+ Brush *br = (Brush*)ptr->data;
rna_Brush_reset_icon(br, "sculpt");
rna_Brush_update(bmain, scene, ptr);
}
static void rna_Brush_vertex_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Brush *br= (Brush*)ptr->data;
+ Brush *br = (Brush*)ptr->data;
rna_Brush_reset_icon(br, "vertex_paint");
rna_Brush_update(bmain, scene, ptr);
}
static void rna_Brush_imagepaint_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Brush *br= (Brush*)ptr->data;
+ Brush *br = (Brush*)ptr->data;
rna_Brush_reset_icon(br, "image_paint");
rna_Brush_update(bmain, scene, ptr);
}
static void rna_Brush_icon_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Brush *br= (Brush*)ptr->data;
+ Brush *br = (Brush*)ptr->data;
- if(br->icon_imbuf) {
+ if (br->icon_imbuf) {
IMB_freeImBuf(br->icon_imbuf);
- br->icon_imbuf= NULL;
+ br->icon_imbuf = NULL;
}
br->id.icon_id = 0;
- if(br->flag & BRUSH_CUSTOM_ICON) {
+ if (br->flag & BRUSH_CUSTOM_ICON) {
BKE_previewimg_get(&br->id);
BKE_icon_changed(BKE_icon_getid(&br->id));
}
@@ -169,7 +169,7 @@ static void rna_Brush_set_size(PointerRNA *ptr, int value)
/* scale unprojected radius so it stays consistent with brush size */
brush_scale_unprojected_radius(&brush->unprojected_radius,
value, brush->size);
- brush->size= value;
+ brush->size = value;
}
static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value)
@@ -178,40 +178,40 @@ static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value)
/* scale brush size so it stays consistent with unprojected_radius */
brush_scale_size(&brush->size, value, brush->unprojected_radius);
- brush->unprojected_radius= value;
+ brush->unprojected_radius = value;
}
static EnumPropertyItem *rna_Brush_direction_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
- static EnumPropertyItem prop_default_items[]= {
+ static EnumPropertyItem prop_default_items[] = {
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem prop_flatten_contrast_items[]= {
+ static EnumPropertyItem prop_flatten_contrast_items[] = {
{0, "FLATTEN", 0, "Flatten", "Add effect of brush"},
{BRUSH_DIR_IN, "CONTRAST", 0, "Contrast", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem prop_fill_deepen_items[]= {
+ static EnumPropertyItem prop_fill_deepen_items[] = {
{0, "FILL", 0, "Fill", "Add effect of brush"},
{BRUSH_DIR_IN, "DEEPEN", 0, "Deepen", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem prop_scrape_peaks_items[]= {
+ static EnumPropertyItem prop_scrape_peaks_items[] = {
{0, "SCRAPE", 0, "Scrape", "Add effect of brush"},
{BRUSH_DIR_IN, "PEAKS", 0, "Peaks", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem prop_pinch_magnify_items[]= {
+ static EnumPropertyItem prop_pinch_magnify_items[] = {
{0, "PINCH", 0, "Pinch", "Add effect of brush"},
{BRUSH_DIR_IN, "MAGNIFY", 0, "Magnify", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem prop_inflate_deflate_items[]= {
+ static EnumPropertyItem prop_inflate_deflate_items[] = {
{0, "INFLATE", 0, "Inflate", "Add effect of brush"},
{BRUSH_DIR_IN, "DEFLATE", 0, "Deflate", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}};
- Brush *me= (Brush*)(ptr->data);
+ Brush *me = (Brush*)(ptr->data);
switch (me->sculpt_tool) {
case SCULPT_TOOL_DRAW:
@@ -254,17 +254,17 @@ static void rna_def_brush_texture_slot(BlenderRNA *brna)
{MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot");
+ srna = RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot");
RNA_def_struct_sdna(srna, "MTex");
RNA_def_struct_ui_text(srna, "Brush Texture Slot", "Texture slot for textures in a Brush datablock");
- prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_range(prop, 0, M_PI*2);
RNA_def_property_ui_text(prop, "Angle", "Brush texture rotation");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
- prop= RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode");
RNA_def_property_enum_items(prop, prop_map_mode_items);
RNA_def_property_ui_text(prop, "Mode", "");
@@ -314,115 +314,115 @@ static void rna_def_brush(BlenderRNA *brna)
{SCULPT_DISP_DIR_Z, "Z", 0, "Z Plane", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Brush", "ID");
+ srna = RNA_def_struct(brna, "Brush", "ID");
RNA_def_struct_ui_text(srna, "Brush", "Brush datablock for storing brush settings for painting and sculpting");
RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA);
/* enums */
- prop= RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_blend_items);
RNA_def_property_ui_text(prop, "Blending mode", "Brush blending mode");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, brush_sculpt_tool_items);
RNA_def_property_ui_text(prop, "Sculpt Tool", "");
RNA_def_property_update(prop, 0, "rna_Brush_sculpt_tool_update");
- prop= RNA_def_property(srna, "vertex_tool", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "vertexpaint_tool");
RNA_def_property_enum_items(prop, brush_vertex_tool_items);
RNA_def_property_ui_text(prop, "Vertex/Weight Paint Tool", "");
RNA_def_property_update(prop, 0, "rna_Brush_vertex_tool_update");
- prop= RNA_def_property(srna, "image_tool", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "image_tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "imagepaint_tool");
RNA_def_property_enum_items(prop, brush_image_tool_items);
RNA_def_property_ui_text(prop, "Image Paint Tool", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_imagepaint_tool_update");
- prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_direction_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Brush_direction_itemf");
RNA_def_property_ui_text(prop, "Direction", "");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, brush_stroke_method_items);
RNA_def_property_ui_text(prop, "Stroke Method", "");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "texture_angle_source_random", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_angle_source_random", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, texture_angle_source_items);
RNA_def_property_ui_text(prop, "Texture Angle Source", "");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "texture_angle_source_no_random", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_angle_source_no_random", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, texture_angle_source_no_random_items);
RNA_def_property_ui_text(prop, "Texture Angle Source", "");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "sculpt_plane", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "sculpt_plane", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, brush_sculpt_plane_items);
RNA_def_property_ui_text(prop, "Sculpt Plane", "");
RNA_def_property_update(prop, 0, "rna_Brush_update");
/* number values */
- prop= RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL);
RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS*10);
RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, 0);
RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_funcs(prop, NULL, "rna_Brush_set_unprojected_radius", NULL);
RNA_def_property_range(prop, 0.001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001, 1, 0, 0);
RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "jitter");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "spacing", PROP_INT, PROP_PERCENTAGE);
+ prop = RNA_def_property(srna, "spacing", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "spacing");
RNA_def_property_range(prop, 1, 1000);
RNA_def_property_ui_range(prop, 1, 500, 5, 0);
RNA_def_property_ui_text(prop, "Spacing", "Spacing between brush daubs as a percentage of brush diameter");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_DISTANCE);
RNA_def_property_range(prop, 10, 200);
RNA_def_property_ui_text(prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.5, 0.99);
RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rate");
RNA_def_property_range(prop, 0.0001f , 10000.0f);
RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 3);
RNA_def_property_ui_text(prop, "Rate", "Interval between paints for Airbrush");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_float_sdna(prop, NULL, "rgb");
RNA_def_property_ui_text(prop, "Color", "");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0.0f, 10.0f);
@@ -430,7 +430,7 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Strength", "How powerful the effect of the brush is when applied");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "plane_offset", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "plane_offset", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "plane_offset");
RNA_def_property_float_default(prop, 0);
RNA_def_property_range(prop, -2.0f, 2.0f);
@@ -438,42 +438,42 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Plane Offset", "Adjust plane on which the brush acts towards or away from the object surface");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "plane_trim", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "plane_trim", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "plane_trim");
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0, 1.0f);
RNA_def_property_ui_text(prop, "Plane Trim", "If a vertex is further away from offset plane than this, then it is not affected");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "height");
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0, 1.0f);
RNA_def_property_ui_text(prop, "Brush Height", "Affectable height of brush (layer height for layer tool, i.e.)");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "texture_sample_bias", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "texture_sample_bias", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "texture_sample_bias");
RNA_def_property_float_default(prop, 0);
RNA_def_property_range(prop, -1, 1);
RNA_def_property_ui_text(prop, "Texture Sample Bias", "Value added to texture samples");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "normal_weight", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "normal_weight", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "normal_weight");
RNA_def_property_float_default(prop, 0);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Normal Weight", "How much grab will pull vertexes out of surface during a grab");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "crease_pinch_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "crease_pinch_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "crease_pinch_factor");
RNA_def_property_float_default(prop, 2.0f/3.0f);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Crease Brush Pinch Factor", "How much the crease brush pinches");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "auto_smooth_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "auto_smooth_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "autosmooth_factor");
RNA_def_property_float_default(prop, 0);
RNA_def_property_range(prop, 0.0f, 1.0f);
@@ -482,221 +482,221 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Brush_update");
/* flag */
- prop= RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH);
RNA_def_property_ui_text(prop, "Airbrush", "Keep applying paint effect while holding mouse (spray)");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_original_normal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_original_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ORIGINAL_NORMAL);
RNA_def_property_ui_text(prop, "Original Normal", "When locked keep using normal of surface where stroke was initiated");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_wrap", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_wrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TORUS);
RNA_def_property_ui_text(prop, "Wrap", "Enable torus wrapping while painting");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_offset_pressure", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_offset_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_OFFSET_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Plane Offset Pressure", "Enable tablet pressure sensitivity for offset");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_pressure_jitter", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pressure_jitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_JITTER_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Jitter Pressure", "Enable tablet pressure sensitivity for jitter");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_pressure_spacing", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pressure_spacing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACING_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_inverse_smooth_pressure", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_inverse_smooth_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_INVERSE_SMOOTH_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RAKE);
RNA_def_property_ui_text(prop, "Rake", "Rotate the brush texture to match the stroke direction");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_random_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_random_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RANDOM_ROTATION);
RNA_def_property_ui_text(prop, "Random Rotation", "Rotate the brush texture at random");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PLANE_TRIM);
RNA_def_property_ui_text(prop, "Use Plane Trim", "Enable Plane Trim");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_frontface", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_frontface", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FRONTFACE);
RNA_def_property_ui_text(prop, "Use Front-Face", "Brush only affects vertexes that face the viewer");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ANCHORED);
RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE);
RNA_def_property_ui_text(prop, "Space", "Limit brush application to the distance specified by spacing");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SMOOTH_STROKE);
RNA_def_property_ui_text(prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PERSISTENT);
RNA_def_property_ui_text(prop, "Persistent", "Sculpt on a persistent layer of the mesh");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_accumulate", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_accumulate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ACCUMULATE);
RNA_def_property_ui_text(prop, "Accumulate", "Accumulate stroke daubs on top of each other");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_space_atten", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_space_atten", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE_ATTEN);
RNA_def_property_ui_text(prop, "Use Automatic Strength Adjustment", "Automatically adjust strength to give consistent results for different spacings");
RNA_def_property_update(prop, 0, "rna_Brush_update");
/* adaptive space is not implemented yet */
- prop= RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ADAPTIVE_SPACE);
RNA_def_property_ui_text(prop, "Adaptive Spacing", "Space daubs according to surface orientation instead of screen space");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_LOCK_SIZE);
RNA_def_property_ui_text(prop, "Use Blender Units", "When locked brush stays same size relative to object; when unlocked brush size is given in pixels");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_texture_overlay", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_texture_overlay", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TEXTURE_OVERLAY);
RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_EDGE_TO_EDGE);
RNA_def_property_ui_text(prop, "Edge-to-edge", "Drag anchor brush from edge-to-edge");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RESTORE_MESH);
RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_fixed_texture", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_fixed_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FIXED_TEX);
RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position");
RNA_def_property_update(prop, 0, "rna_Brush_update");
/* only for projection paint, TODO, other paint modes */
- prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BRUSH_LOCK_ALPHA);
RNA_def_property_ui_text(prop, "Alpha", "When this is disabled, lock alpha while painting");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve");
RNA_def_property_update(prop, 0, "rna_Brush_update");
/* paint mode flags */
- prop= RNA_def_property(srna, "use_paint_sculpt", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_paint_sculpt", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_SCULPT);
RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt mode");
- prop= RNA_def_property(srna, "use_paint_vertex", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_paint_vertex", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_VERTEX_PAINT);
RNA_def_property_ui_text(prop, "Use Vertex", "Use this brush in vertex paint mode");
- prop= RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_WEIGHT_PAINT);
RNA_def_property_ui_text(prop, "Use Weight", "Use this brush in weight paint mode");
- prop= RNA_def_property(srna, "use_paint_image", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_paint_image", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_TEXTURE_PAINT);
RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode");
/* texture */
- prop= RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BrushTextureSlot");
RNA_def_property_pointer_sdna(prop, NULL, "mtex");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture Slot", "");
- prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mtex.tex");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture", "");
RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_update");
- prop= RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
+ prop = RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "texture_overlay_alpha");
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Texture Overlay Alpha", "");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "cursor_color_add", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "cursor_color_add", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "add_col");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Add Color", "Color of cursor when adding");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "cursor_color_subtract", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "cursor_color_subtract", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "sub_col");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Subtract Color", "Color of cursor when subtracting");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "use_custom_icon", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_custom_icon", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_CUSTOM_ICON);
RNA_def_property_ui_text(prop, "Custom Icon", "Set the brush icon from an image file");
RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
- prop= RNA_def_property(srna, "icon_filepath", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "icon_filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "icon_filepath");
RNA_def_property_ui_text(prop, "Brush Icon Filepath", "File path to brush icon");
RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
/* clone tool */
- prop= RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clone.image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_update");
- prop= RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clone.alpha");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Clone Alpha", "Opacity of clone image display");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_update");
- prop= RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "clone.offset");
RNA_def_property_ui_text(prop, "Clone Offset", "");
RNA_def_property_ui_range(prop, -1.0f , 1.0f, 10.0f, 3);
@@ -719,42 +719,42 @@ static void rna_def_operator_stroke_element(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "OperatorStrokeElement", "PropertyGroup");
+ srna = RNA_def_struct(brna, "OperatorStrokeElement", "PropertyGroup");
RNA_def_struct_ui_text(srna, "Operator Stroke Element", "");
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Location", "");
- prop= RNA_def_property(srna, "mouse", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "mouse", PROP_FLOAT, PROP_XYZ);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_array(prop, 2);
RNA_def_property_ui_text(prop, "Mouse", "");
- prop= RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Pressure", "Tablet pressure");
- prop= RNA_def_property(srna, "pen_flip", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "pen_flip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_ui_text(prop, "Flip", "");
- // used in uv painting
- prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
+ /* used in uv painting */
+ prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_ui_text(prop, "Time", "");
/* used for Grease Pencil sketching sessions */
- prop= RNA_def_property(srna, "is_start", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_ui_text(prop, "Is Stroke Start", "");
/* XXX: Tool (this will be for pressing a modifier key for a different brush,
e.g. switching to a Smooth brush in the middle of the stroke */
- // XXX: i don't think blender currently supports the ability to properly do a remappable modifier in the middle of a stroke
+ /* XXX: i don't think blender currently supports the ability to properly do a remappable modifier in the middle of a stroke */
}
void RNA_def_brush(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index 6f6a4baec92..084e299140d 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -45,45 +45,45 @@
static float rna_Camera_angle_get(PointerRNA *ptr)
{
- Camera *cam= ptr->id.data;
- float sensor= camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
+ Camera *cam = ptr->id.data;
+ float sensor = camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
return focallength_to_fov(cam->lens, sensor);
}
static void rna_Camera_angle_set(PointerRNA *ptr, float value)
{
- Camera *cam= ptr->id.data;
- float sensor= camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
- cam->lens= fov_to_focallength(value, sensor);
+ Camera *cam = ptr->id.data;
+ float sensor = camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
+ cam->lens = fov_to_focallength(value, sensor);
}
static float rna_Camera_angle_x_get(PointerRNA *ptr)
{
- Camera *cam= ptr->id.data;
+ Camera *cam = ptr->id.data;
return focallength_to_fov(cam->lens, cam->sensor_x);
}
static void rna_Camera_angle_x_set(PointerRNA *ptr, float value)
{
- Camera *cam= ptr->id.data;
- cam->lens= fov_to_focallength(value, cam->sensor_x);
+ Camera *cam = ptr->id.data;
+ cam->lens = fov_to_focallength(value, cam->sensor_x);
}
static float rna_Camera_angle_y_get(PointerRNA *ptr)
{
- Camera *cam= ptr->id.data;
+ Camera *cam = ptr->id.data;
return focallength_to_fov(cam->lens, cam->sensor_y);
}
static void rna_Camera_angle_y_set(PointerRNA *ptr, float value)
{
- Camera *cam= ptr->id.data;
- cam->lens= fov_to_focallength(value, cam->sensor_y);
+ Camera *cam = ptr->id.data;
+ cam->lens = fov_to_focallength(value, cam->sensor_y);
}
static void rna_Camera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Camera *camera= (Camera*)ptr->id.data;
+ Camera *camera = (Camera*)ptr->id.data;
DAG_id_tag_update(&camera->id, 0);
}
@@ -118,24 +118,24 @@ void RNA_def_camera(BlenderRNA *brna)
{CAMERA_SENSOR_FIT_VERT, "VERTICAL", 0, "Vertical", "Fit to the sensor height"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Camera", "ID");
+ srna = RNA_def_struct(brna, "Camera", "ID");
RNA_def_struct_ui_text(srna, "Camera", "Camera datablock for storing camera settings");
RNA_def_struct_ui_icon(srna, ICON_CAMERA_DATA);
/* Enums */
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Camera types");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
- prop= RNA_def_property(srna, "show_guide", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "show_guide", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "dtx");
RNA_def_property_enum_items(prop, prop_draw_type_extra_items);
RNA_def_property_flag(prop, PROP_ENUM_FLAG);
RNA_def_property_ui_text(prop, "Composition Guides", "Draw overlay");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "sensor_fit", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "sensor_fit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "sensor_fit");
RNA_def_property_enum_items(prop, sensor_fit_items);
RNA_def_property_ui_text(prop, "Sensor Fit", "Method to fit image and field of view angle inside the sensor");
@@ -143,134 +143,134 @@ void RNA_def_camera(BlenderRNA *brna)
/* Number values */
- prop= RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "passepartalpha");
RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "angle_x", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "angle_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Horizontal FOV", "Camera lens horizontal field of view in degrees");
RNA_def_property_float_funcs(prop, "rna_Camera_angle_x_get", "rna_Camera_angle_x_set", NULL);
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
- prop= RNA_def_property(srna, "angle_y", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "angle_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Vertical FOV", "Camera lens vertical field of view in degrees");
RNA_def_property_float_funcs(prop, "rna_Camera_angle_y_get", "rna_Camera_angle_y_set", NULL);
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
- prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Field of View", "Camera lens field of view in degrees");
RNA_def_property_float_funcs(prop, "rna_Camera_angle_get", "rna_Camera_angle_set", NULL);
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
- prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.001f, FLT_MAX);
RNA_def_property_ui_text(prop, "Clip Start", "Camera near clipping distance");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 1.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Clip End", "Camera far clipping distance");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "lens");
RNA_def_property_range(prop, 1.0f, 5000.0f);
RNA_def_property_ui_text(prop, "Focal Length", "Perspective Camera lens value in millimeters");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
- prop= RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sensor_x");
RNA_def_property_range(prop, 1.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2);
RNA_def_property_ui_text(prop, "Sensor Width", "Horizontal size of the image sensor area in millimeters");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
- prop= RNA_def_property(srna, "sensor_height", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "sensor_height", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sensor_y");
RNA_def_property_range(prop, 1.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2);
RNA_def_property_ui_text(prop, "Sensor Height", "Vertical size of the image sensor area in millimeters");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
- prop= RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ortho_scale");
RNA_def_property_range(prop, 0.01f, 4000.0f);
RNA_def_property_ui_text(prop, "Orthographic Scale", "Orthographic Camera scale (similar to zoom)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
- prop= RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "drawsize");
RNA_def_property_range(prop, 0.01f, 1000.0f);
RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
RNA_def_property_ui_text(prop, "Draw Size", "Apparent size of the Camera object in the 3D View");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "shift_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shift_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shiftx");
RNA_def_property_range(prop, -10.0f, 10.0f);
RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3);
RNA_def_property_ui_text(prop, "Shift X", "Perspective Camera horizontal shift");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
- prop= RNA_def_property(srna, "shift_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shift_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shifty");
RNA_def_property_range(prop, -10.0f, 10.0f);
RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3);
RNA_def_property_ui_text(prop, "Shift Y", "Perspective Camera vertical shift");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
- prop= RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "YF_dofdist");
RNA_def_property_range(prop, 0.0f, 5000.0f);
RNA_def_property_ui_text(prop, "DOF Distance", "Distance to the focus point for depth of field");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* flag */
- prop= RNA_def_property(srna, "show_limits", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_limits", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWLIMITS);
RNA_def_property_ui_text(prop, "Show Limits", "Draw the clipping range and focus point on the camera");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "show_mist", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_mist", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWMIST);
RNA_def_property_ui_text(prop, "Show Mist", "Draw a line from the Camera to indicate the mist area");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "show_passepartout", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_passepartout", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWPASSEPARTOUT);
RNA_def_property_ui_text(prop, "Show Passepartout", "Show a darkened overlay outside the image area in Camera view");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "show_title_safe", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_title_safe", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWTITLESAFE);
RNA_def_property_ui_text(prop, "Show Title Safe", "Show indicators for the title safe zone in Camera view");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWNAME);
RNA_def_property_ui_text(prop, "Show Name", "Show the active Camera's name in Camera view");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "show_sensor", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_sensor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWSENSOR);
RNA_def_property_ui_text(prop, "Show Sensor Size", "Show sensor size (film gate) in Camera view");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "lens_unit", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "lens_unit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_lens_unit_items);
RNA_def_property_ui_text(prop, "Lens Unit", "Unit to edit lens in for the user interface");
- prop= RNA_def_property(srna, "use_panorama", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_panorama", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_PANORAMA);
RNA_def_property_ui_text(prop, "Panorama", "Render the scene with a cylindrical camera for pseudo-fisheye lens effects");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
@@ -278,7 +278,7 @@ void RNA_def_camera(BlenderRNA *brna)
/* pointers */
rna_def_animdata_common(srna);
- prop= RNA_def_property(srna, "dof_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "dof_object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "dof_ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
diff --git a/source/blender/makesrna/intern/rna_camera_api.c b/source/blender/makesrna/intern/rna_camera_api.c
index 2af0524861a..3cd33be1b86 100644
--- a/source/blender/makesrna/intern/rna_camera_api.c
+++ b/source/blender/makesrna/intern/rna_camera_api.c
@@ -61,25 +61,25 @@ void RNA_api_camera(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "view_frame", "rna_camera_view_frame");
+ func = RNA_def_function(srna, "view_frame", "rna_camera_view_frame");
RNA_def_function_ui_description(func, "Return 4 points for the cameras frame (before object transformation)");
RNA_def_pointer(func, "scene", "Scene", "", "Scene to use for aspect calculation, when omitted 1:1 aspect is used");
/* return location and normal */
- parm= RNA_def_float_vector(func, "result_1", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
+ parm = RNA_def_float_vector(func, "result_1", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm);
- parm= RNA_def_float_vector(func, "result_2", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
+ parm = RNA_def_float_vector(func, "result_2", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm);
- parm= RNA_def_float_vector(func, "result_3", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
+ parm = RNA_def_float_vector(func, "result_3", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm);
- parm= RNA_def_float_vector(func, "result_4", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
+ parm = RNA_def_float_vector(func, "result_4", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm);
}
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index 1327a205c19..34a9dc592b9 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -49,7 +49,7 @@
static void rna_cloth_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
@@ -57,8 +57,8 @@ static void rna_cloth_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
static void rna_cloth_pinning_changed(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
-// ClothSimSettings *settings = (ClothSimSettings*)ptr->data;
+ Object *ob = (Object*)ptr->id.data;
+/* ClothSimSettings *settings = (ClothSimSettings*)ptr->data; */
ClothModifierData *clmd = (ClothModifierData*)modifiers_findByType(ob, eModifierType_Cloth);
cloth_free_modifier(clmd);
@@ -69,7 +69,7 @@ static void rna_cloth_pinning_changed(Main *UNUSED(bmain), Scene *UNUSED(scene),
static void rna_cloth_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
ClothSimSettings *settings = (ClothSimSettings*)ptr->data;
settings->reset = 1;
@@ -84,7 +84,7 @@ static void rna_ClothSettings_max_bend_set(struct PointerRNA *ptr, float value)
ClothSimSettings *settings = (ClothSimSettings*)ptr->data;
/* check for clipping */
- if(value < settings->bending)
+ if (value < settings->bending)
value = settings->bending;
settings->max_bend = value;
@@ -95,7 +95,7 @@ static void rna_ClothSettings_max_struct_set(struct PointerRNA *ptr, float value
ClothSimSettings *settings = (ClothSimSettings*)ptr->data;
/* check for clipping */
- if(value < settings->structural)
+ if (value < settings->structural)
value = settings->structural;
settings->max_struct = value;
@@ -103,104 +103,104 @@ static void rna_ClothSettings_max_struct_set(struct PointerRNA *ptr, float value
static void rna_ClothSettings_mass_vgroup_get(PointerRNA *ptr, char *value)
{
- ClothSimSettings *sim= (ClothSimSettings*)ptr->data;
+ ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
rna_object_vgroup_name_index_get(ptr, value, sim->vgroup_mass);
}
static int rna_ClothSettings_mass_vgroup_length(PointerRNA *ptr)
{
- ClothSimSettings *sim= (ClothSimSettings*)ptr->data;
+ ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
return rna_object_vgroup_name_index_length(ptr, sim->vgroup_mass);
}
static void rna_ClothSettings_mass_vgroup_set(PointerRNA *ptr, const char *value)
{
- ClothSimSettings *sim= (ClothSimSettings*)ptr->data;
+ ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
rna_object_vgroup_name_index_set(ptr, value, &sim->vgroup_mass);
}
static void rna_ClothSettings_struct_vgroup_get(PointerRNA *ptr, char *value)
{
- ClothSimSettings *sim= (ClothSimSettings*)ptr->data;
+ ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
rna_object_vgroup_name_index_get(ptr, value, sim->vgroup_struct);
}
static int rna_ClothSettings_struct_vgroup_length(PointerRNA *ptr)
{
- ClothSimSettings *sim= (ClothSimSettings*)ptr->data;
+ ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
return rna_object_vgroup_name_index_length(ptr, sim->vgroup_struct);
}
static void rna_ClothSettings_struct_vgroup_set(PointerRNA *ptr, const char *value)
{
- ClothSimSettings *sim= (ClothSimSettings*)ptr->data;
+ ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
rna_object_vgroup_name_index_set(ptr, value, &sim->vgroup_struct);
}
static void rna_ClothSettings_bend_vgroup_get(PointerRNA *ptr, char *value)
{
- ClothSimSettings *sim= (ClothSimSettings*)ptr->data;
+ ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
rna_object_vgroup_name_index_get(ptr, value, sim->vgroup_bend);
}
static int rna_ClothSettings_bend_vgroup_length(PointerRNA *ptr)
{
- ClothSimSettings *sim= (ClothSimSettings*)ptr->data;
+ ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
return rna_object_vgroup_name_index_length(ptr, sim->vgroup_bend);
}
static void rna_ClothSettings_bend_vgroup_set(PointerRNA *ptr, const char *value)
{
- ClothSimSettings *sim= (ClothSimSettings*)ptr->data;
+ ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
rna_object_vgroup_name_index_set(ptr, value, &sim->vgroup_bend);
}
static PointerRNA rna_ClothSettings_rest_shape_key_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- ClothSimSettings *sim= (ClothSimSettings*)ptr->data;
+ Object *ob = (Object*)ptr->id.data;
+ ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
return rna_object_shapekey_index_get(ob->data, sim->shapekey_rest);
}
static void rna_ClothSettings_rest_shape_key_set(PointerRNA *ptr, PointerRNA value)
{
- Object *ob= (Object*)ptr->id.data;
- ClothSimSettings *sim= (ClothSimSettings*)ptr->data;
+ Object *ob = (Object*)ptr->id.data;
+ ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
- sim->shapekey_rest= rna_object_shapekey_index_set(ob->data, value, sim->shapekey_rest);
+ sim->shapekey_rest = rna_object_shapekey_index_set(ob->data, value, sim->shapekey_rest);
}
static void rna_ClothSettings_gravity_get(PointerRNA *ptr, float *values)
{
- ClothSimSettings *sim= (ClothSimSettings*)ptr->data;
+ ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
- values[0]= sim->gravity[0];
- values[1]= sim->gravity[1];
- values[2]= sim->gravity[2];
+ values[0] = sim->gravity[0];
+ values[1] = sim->gravity[1];
+ values[2] = sim->gravity[2];
}
static void rna_ClothSettings_gravity_set(PointerRNA *ptr, const float *values)
{
- ClothSimSettings *sim= (ClothSimSettings*)ptr->data;
+ ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
- sim->gravity[0]= values[0];
- sim->gravity[1]= values[1];
- sim->gravity[2]= values[2];
+ sim->gravity[0] = values[0];
+ sim->gravity[1] = values[1];
+ sim->gravity[2] = values[2];
}
static char *rna_ClothSettings_path(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth);
+ Object *ob = (Object*)ptr->id.data;
+ ModifierData *md = modifiers_findByType(ob, eModifierType_Cloth);
return md ? BLI_sprintfN("modifiers[\"%s\"].settings", md->name) : NULL;
}
static char *rna_ClothCollisionSettings_path(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth);
+ Object *ob = (Object*)ptr->id.data;
+ ModifierData *md = modifiers_findByType(ob, eModifierType_Cloth);
return md ? BLI_sprintfN("modifiers[\"%s\"].collision_settings", md->name) : NULL;
}
@@ -219,43 +219,43 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
/* goal */
- prop= RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mingoal");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Goal Minimum", "Goal minimum, vertex group weights are scaled to match this range");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxgoal");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Goal Maximum", "Goal maximum, vertex group weights are scaled to match this range");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "defgoal");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value, when no Vertex Group used");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "goalspring");
RNA_def_property_range(prop, 0.0f, 0.999f);
RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "goalfrict");
RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Goal Damping", "Goal (vertex target position) friction");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "internal_friction", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "internal_friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "velocity_smooth");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Internal Friction", "");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "collider_friction", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "collider_friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "collider_friction");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Collider Friction", "");
@@ -263,18 +263,18 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
/* mass */
- prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Mass", "Mass of cloth material");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "vertex_group_mass", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_mass", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ClothSettings_mass_vgroup_get", "rna_ClothSettings_mass_vgroup_length",
"rna_ClothSettings_mass_vgroup_set");
RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex Group for pinning of vertices");
RNA_def_property_update(prop, 0, "rna_cloth_pinning_changed");
- prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
+ prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -100.0, 100.0);
RNA_def_property_float_funcs(prop, "rna_ClothSettings_gravity_get", "rna_ClothSettings_gravity_set", NULL);
@@ -283,13 +283,13 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
/* various */
- prop= RNA_def_property(srna, "air_damping", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "air_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "Cvi");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Air Damping", "Air has normally some thickness which slows falling things down");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "vel_damping", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "vel_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vel_damping");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Velocity Damping",
@@ -297,19 +297,19 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
"(1.0 = no damping, 0.0 = fully dampened)");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "use_pin_cloth", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pin_cloth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_GOAL);
RNA_def_property_ui_text(prop, "Pin Cloth", "Enable pinning of cloth vertices to other objects/positions");
RNA_def_property_update(prop, 0, "rna_cloth_pinning_changed");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- prop= RNA_def_property(srna, "pin_stiffness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "pin_stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "goalspring");
RNA_def_property_range(prop, 0.0f, 50.0);
RNA_def_property_ui_text(prop, "Pin Stiffness", "Pin (vertex target position) spring stiffness");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "stepsPerFrame");
RNA_def_property_range(prop, 4, 80);
RNA_def_property_ui_text(prop, "Quality",
@@ -318,70 +318,70 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
/* springs */
- prop= RNA_def_property(srna, "use_stiffness_scale", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stiffness_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_SCALING);
RNA_def_property_ui_text(prop, "Stiffness Scaling",
"If enabled, stiffness can be scaled along a weight painted vertex group");
RNA_def_property_update(prop, 0, "rna_cloth_update");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- prop= RNA_def_property(srna, "spring_damping", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "spring_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "Cdis");
RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Spring Damping", "Damping of cloth velocity (higher = more smooth, less jiggling)");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "structural_stiffness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "structural_stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "structural");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_ui_text(prop, "Structural Stiffness", "Overall stiffness of structure");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "structural_stiffness_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "structural_stiffness_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max_struct");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_float_funcs(prop, NULL, "rna_ClothSettings_max_struct_set", NULL);
RNA_def_property_ui_text(prop, "Structural Stiffness Maximum", "Maximum structural stiffness value");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "vertex_group_structural_stiffness", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_structural_stiffness", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ClothSettings_struct_vgroup_get", "rna_ClothSettings_struct_vgroup_length",
"rna_ClothSettings_struct_vgroup_set");
RNA_def_property_ui_text(prop, "Structural Stiffness Vertex Group",
"Vertex group for fine control over structural stiffness");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "bending_stiffness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bending_stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bending");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_ui_text(prop, "Bending Stiffness", "Wrinkle coefficient (higher = less smaller but more big wrinkles)");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "bending_stiffness_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bending_stiffness_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max_bend");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_float_funcs(prop, NULL, "rna_ClothSettings_max_bend_set", NULL);
RNA_def_property_ui_text(prop, "Bending Stiffness Maximum", "Maximum bending stiffness value");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "vertex_group_bending", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_bending", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ClothSettings_bend_vgroup_get", "rna_ClothSettings_bend_vgroup_length",
"rna_ClothSettings_bend_vgroup_set");
RNA_def_property_ui_text(prop, "Bending Stiffness Vertex Group", "Vertex group for fine control over bending stiffness");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EffectorWeights");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Effector Weights", "");
- prop= RNA_def_property(srna, "pre_roll", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "pre_roll", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "preroll");
RNA_def_property_range(prop, 0, 200);
RNA_def_property_ui_text(prop, "Pre Roll", "Simulation starts on this frame");
RNA_def_property_update(prop, 0, "rna_cloth_reset");
- prop= RNA_def_property(srna, "rest_shape_key", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "rest_shape_key", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "ShapeKey");
RNA_def_property_pointer_funcs(prop, "rna_ClothSettings_rest_shape_key_get",
@@ -440,19 +440,19 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
/* general collision */
- prop= RNA_def_property(srna, "use_collision", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_ENABLED);
RNA_def_property_ui_text(prop, "Enable Collision", "Enable collisions with other objects");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "repel_force", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "repel_force", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "repel_force");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Repulsion Force", "Repulsion force to apply on cloth when close to colliding");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "distance_repel", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance_repel", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "distance_repel");
RNA_def_property_range(prop, 0.001f, 10.0f);
RNA_def_property_float_default(prop, 0.005f);
@@ -460,19 +460,19 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
"Maximum distance to apply repulsion force, must be greater than minimum distance");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "epsilon");
RNA_def_property_range(prop, 0.001f, 1.0f);
RNA_def_property_ui_text(prop, "Minimum Distance",
"Minimum distance between collision objects before collision response takes in");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 80.0f);
RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened (higher = less movement)");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "collision_quality", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "collision_quality", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "loop_count");
RNA_def_property_range(prop, 1, 20);
RNA_def_property_ui_text(prop, "Collision Quality",
@@ -481,30 +481,30 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
/* self collision */
- prop= RNA_def_property(srna, "use_self_collision", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_self_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_SELF);
RNA_def_property_ui_text(prop, "Enable Self Collision", "Enable self collisions");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "self_distance_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "self_distance_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "selfepsilon");
RNA_def_property_range(prop, 0.5f, 1.0f);
RNA_def_property_ui_text(prop, "Self Minimum Distance", "0.5 means no distance at all, 1.0 is maximum distance");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "self_friction", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "self_friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 80.0f);
RNA_def_property_ui_text(prop, "Self Friction", "Friction/damping with self contact");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "self_collision_quality", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "self_collision_quality", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "self_loop_count");
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Self Collision Quality",
"How many self collision iterations should be done (higher is better quality but slower)");
RNA_def_property_update(prop, 0, "rna_cloth_update");
- prop= RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Collision Group", "Limit colliders to this Group");
RNA_def_property_update(prop, 0, "rna_cloth_update");
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index 2fe56d8cc88..0d141387deb 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -56,11 +56,11 @@
static int rna_CurveMapping_curves_length(PointerRNA *ptr)
{
- CurveMapping *cumap= (CurveMapping*)ptr->data;
+ CurveMapping *cumap = (CurveMapping*)ptr->data;
int len;
- for(len=0; len<CM_TOT; len++)
- if(!cumap->cm[len].curve)
+ for (len = 0; len<CM_TOT; len++)
+ if (!cumap->cm[len].curve)
break;
return len;
@@ -68,16 +68,16 @@ static int rna_CurveMapping_curves_length(PointerRNA *ptr)
static void rna_CurveMapping_curves_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- CurveMapping *cumap= (CurveMapping*)ptr->data;
+ CurveMapping *cumap = (CurveMapping*)ptr->data;
rna_iterator_array_begin(iter, cumap->cm, sizeof(CurveMap), rna_CurveMapping_curves_length(ptr), 0, NULL);
}
static void rna_CurveMapping_clip_set(PointerRNA *ptr, int value)
{
- CurveMapping *cumap= (CurveMapping*)ptr->data;
+ CurveMapping *cumap = (CurveMapping*)ptr->data;
- if(value) cumap->flag |= CUMA_DO_CLIP;
+ if (value) cumap->flag |= CUMA_DO_CLIP;
else cumap->flag &= ~CUMA_DO_CLIP;
curvemapping_changed(cumap, 0);
@@ -85,52 +85,52 @@ static void rna_CurveMapping_clip_set(PointerRNA *ptr, int value)
static void rna_CurveMapping_black_level_set(PointerRNA *ptr, const float *values)
{
- CurveMapping *cumap= (CurveMapping*)ptr->data;
- cumap->black[0]= values[0];
- cumap->black[1]= values[1];
- cumap->black[2]= values[2];
+ CurveMapping *cumap = (CurveMapping*)ptr->data;
+ cumap->black[0] = values[0];
+ cumap->black[1] = values[1];
+ cumap->black[2] = values[2];
curvemapping_set_black_white(cumap, NULL, NULL);
}
static void rna_CurveMapping_white_level_set(PointerRNA *ptr, const float *values)
{
- CurveMapping *cumap= (CurveMapping*)ptr->data;
- cumap->white[0]= values[0];
- cumap->white[1]= values[1];
- cumap->white[2]= values[2];
+ CurveMapping *cumap = (CurveMapping*)ptr->data;
+ cumap->white[0] = values[0];
+ cumap->white[1] = values[1];
+ cumap->white[2] = values[2];
curvemapping_set_black_white(cumap, NULL, NULL);
}
static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float *max)
{
- CurveMapping *cumap= (CurveMapping*)ptr->data;
+ CurveMapping *cumap = (CurveMapping*)ptr->data;
- *min= -100.0f;
- *max= cumap->clipr.xmax;
+ *min = -100.0f;
+ *max = cumap->clipr.xmax;
}
static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float *max)
{
- CurveMapping *cumap= (CurveMapping*)ptr->data;
+ CurveMapping *cumap = (CurveMapping*)ptr->data;
- *min= -100.0f;
- *max= cumap->clipr.ymax;
+ *min = -100.0f;
+ *max = cumap->clipr.ymax;
}
static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float *max)
{
- CurveMapping *cumap= (CurveMapping*)ptr->data;
+ CurveMapping *cumap = (CurveMapping*)ptr->data;
- *min= cumap->clipr.xmin;
- *max= 100.0f;
+ *min = cumap->clipr.xmin;
+ *max = 100.0f;
}
static void rna_CurveMapping_clipmaxy_range(PointerRNA *ptr, float *min, float *max)
{
- CurveMapping *cumap= (CurveMapping*)ptr->data;
+ CurveMapping *cumap = (CurveMapping*)ptr->data;
- *min= cumap->clipr.ymin;
- *max= 100.0f;
+ *min = cumap->clipr.ymin;
+ *max = 100.0f;
}
@@ -138,12 +138,12 @@ static char *rna_ColorRamp_path(PointerRNA *ptr)
{
/* handle the cases where a single datablock may have 2 ramp types */
if (ptr->id.data) {
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
switch (GS(id->name)) {
case ID_MA: /* material has 2 cases - diffuse and specular */
{
- Material *ma= (Material*)id;
+ Material *ma = (Material*)id;
if (ptr->data == ma->ramp_col)
return BLI_strdup("diffuse_ramp");
@@ -179,26 +179,26 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
#define COLRAMP_GETPATH \
{ \
- prop= RNA_struct_find_property(&ramp_ptr, "elements"); \
+ prop = RNA_struct_find_property(&ramp_ptr, "elements"); \
if (prop) { \
- index= RNA_property_collection_lookup_index(&ramp_ptr, prop, ptr); \
+ index = RNA_property_collection_lookup_index(&ramp_ptr, prop, ptr); \
if (index >= 0) { \
- char *texture_path= rna_ColorRamp_path(&ramp_ptr); \
- path= BLI_sprintfN("%s.elements[%d]", texture_path, index); \
+ char *texture_path = rna_ColorRamp_path(&ramp_ptr); \
+ path = BLI_sprintfN("%s.elements[%d]", texture_path, index); \
MEM_freeN(texture_path); \
} \
} \
}
/* determine the path from the ID-block to the ramp */
- // FIXME: this is a very slow way to do it, but it will have to suffice...
+ /* FIXME: this is a very slow way to do it, but it will have to suffice... */
if (ptr->id.data) {
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
switch (GS(id->name)) {
case ID_MA: /* 2 cases for material - diffuse and spec */
{
- Material *ma= (Material *)id;
+ Material *ma = (Material *)id;
/* try diffuse first */
if (ma->ramp_col) {
@@ -213,13 +213,13 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
}
break;
- // TODO: node trees need special attention
+ /* TODO: node trees need special attention */
case ID_NT:
{
bNodeTree *ntree = (bNodeTree *)id;
bNode *node;
- for(node=ntree->nodes.first; node; node=node->next) {
+ for (node = ntree->nodes.first; node; node = node->next) {
if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
RNA_pointer_create(id, &RNA_ColorRamp, node->storage, &ramp_ptr);
COLRAMP_GETPATH;
@@ -262,12 +262,12 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
if (ptr->id.data) {
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
switch (GS(id->name)) {
case ID_MA:
{
- Material *ma= ptr->id.data;
+ Material *ma = ptr->id.data;
DAG_id_tag_update(&ma->id, 0);
WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ma);
@@ -278,7 +278,7 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
bNodeTree *ntree = (bNodeTree *)id;
bNode *node;
- for(node=ntree->nodes.first; node; node=node->next) {
+ for (node = ntree->nodes.first; node; node = node->next) {
if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
ED_node_generic_update(bmain, ntree, node);
}
@@ -287,7 +287,7 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
break;
case ID_TE:
{
- Tex *tex= ptr->id.data;
+ Tex *tex = ptr->id.data;
DAG_id_tag_update(&tex->id, 0);
WM_main_add_notifier(NC_TEXTURE, tex);
@@ -313,9 +313,9 @@ static void rna_ColorRamp_eval(struct ColorBand *coba, float position, float col
static CBData *rna_ColorRampElement_new(struct ColorBand *coba, ReportList *reports, float position)
{
- CBData *element= colorband_element_add(coba, position);
+ CBData *element = colorband_element_add(coba, position);
- if(element==NULL)
+ if (element == NULL)
BKE_reportf(reports, RPT_ERROR, "Unable to add element to colorband (limit %d)", MAXCOLORBAND);
return element;
@@ -324,14 +324,14 @@ static CBData *rna_ColorRampElement_new(struct ColorBand *coba, ReportList *repo
static void rna_ColorRampElement_remove(struct ColorBand *coba, ReportList *reports, CBData *element)
{
int index = (int)(element - coba->data);
- if(colorband_element_remove(coba, index) == 0)
+ if (colorband_element_remove(coba, index) == 0)
BKE_report(reports, RPT_ERROR, "Element not found in element collection or last element");
}
static void rna_Scopes_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Scopes *s= (Scopes*)ptr->data;
+ Scopes *s = (Scopes*)ptr->data;
s->ok = 0;
}
@@ -347,24 +347,24 @@ static void rna_def_curvemappoint(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- srna= RNA_def_struct(brna, "CurveMapPoint", NULL);
+ srna = RNA_def_struct(brna, "CurveMapPoint", NULL);
RNA_def_struct_ui_text(srna, "CurveMapPoint", "Point of a curve used for a curve mapping");
/* not editable for now, need to have CurveMapping to do curvemapping_changed */
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_array(prop, 2);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Location", "X/Y coordinates of the curve point");
- prop= RNA_def_property(srna, "handle_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "handle_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_handle_type_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Handle Type", "Curve interpolation at this point: Bezier or vector");
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CUMA_SELECT);
RNA_def_property_ui_text(prop, "Select", "Selection state of the curve point");
}
@@ -379,18 +379,18 @@ static void rna_def_curvemap(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- srna= RNA_def_struct(brna, "CurveMap", NULL);
+ srna = RNA_def_struct(brna, "CurveMap", NULL);
RNA_def_struct_ui_text(srna, "CurveMap", "Curve in a curve mapping");
/* not editable for now, need to have CurveMapping to do curvemapping_changed */
- prop= RNA_def_property(srna, "extend", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "extend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_extend_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Extend", "Extrapolate the curve or extend it horizontally");
- prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "curve", "totpoint");
RNA_def_property_struct_type(prop, "CurveMapPoint");
RNA_def_property_ui_text(prop, "Points", "");
@@ -401,50 +401,50 @@ static void rna_def_curvemapping(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "CurveMapping", NULL);
+ srna = RNA_def_struct(brna, "CurveMapping", NULL);
RNA_def_struct_ui_text(srna, "CurveMapping", "Curve mapping to map color, vector and scalar values to other values using a user defined curve");
- prop= RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CUMA_DO_CLIP);
RNA_def_property_ui_text(prop, "Clip", "Force the curve view to fit a defined boundary");
RNA_def_property_boolean_funcs(prop, NULL, "rna_CurveMapping_clip_set");
- prop= RNA_def_property(srna, "clip_min_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "clip_min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipr.xmin");
RNA_def_property_range(prop, -100.0f, 100.0f);
RNA_def_property_ui_text(prop, "Clip Min X", "");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipminx_range");
- prop= RNA_def_property(srna, "clip_min_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "clip_min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipr.ymin");
RNA_def_property_range(prop, -100.0f, 100.0f);
RNA_def_property_ui_text(prop, "Clip Min Y", "");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipminy_range");
- prop= RNA_def_property(srna, "clip_max_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "clip_max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipr.xmax");
RNA_def_property_range(prop, -100.0f, 100.0f);
RNA_def_property_ui_text(prop, "Clip Max X", "");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipmaxx_range");
- prop= RNA_def_property(srna, "clip_max_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "clip_max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipr.ymax");
RNA_def_property_range(prop, -100.0f, 100.0f);
RNA_def_property_ui_text(prop, "Clip Max Y", "");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipmaxy_range");
- prop= RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_CurveMapping_curves_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_CurveMapping_curves_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "CurveMap");
RNA_def_property_ui_text(prop, "Curves", "");
- prop= RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "black");
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Black Level", "For RGB curves, the color that black is mapped to");
RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_black_level_set", NULL);
- prop= RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "white");
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "White Level", "For RGB curves, the color that white is mapped to");
@@ -456,18 +456,18 @@ static void rna_def_color_ramp_element(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ColorRampElement", NULL);
+ srna = RNA_def_struct(brna, "ColorRampElement", NULL);
RNA_def_struct_sdna(srna, "CBData");
RNA_def_struct_path_func(srna, "rna_ColorRampElement_path");
RNA_def_struct_ui_text(srna, "Color Ramp Element", "Element defining a color at a position in the color ramp");
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Color", "Set color of selected color stop");
RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
- prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pos");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Position", "Set position of selected color stop");
@@ -481,7 +481,7 @@ static void rna_def_color_ramp_element_api(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
RNA_def_property_srna(cprop, "ColorRampElements");
- srna= RNA_def_struct(brna, "ColorRampElements", NULL);
+ srna = RNA_def_struct(brna, "ColorRampElements", NULL);
RNA_def_struct_sdna(srna, "ColorBand");
RNA_def_struct_path_func(srna, "rna_ColorRampElement_path");
RNA_def_struct_ui_text(srna, "Color Ramp Elements", "Collection of Color Ramp Elements");
@@ -490,16 +490,16 @@ static void rna_def_color_ramp_element_api(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "new", "rna_ColorRampElement_new");
RNA_def_function_ui_description(func, "Add element to ColorRamp");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_float(func, "position", 0.0f, 0.0f, 1.0f, "Position", "Position to add element", 0.0f, 1.0f);
+ parm = RNA_def_float(func, "position", 0.0f, 0.0f, 1.0f, "Position", "Position to add element", 0.0f, 1.0f);
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "element", "ColorRampElement", "", "New element");
+ parm = RNA_def_pointer(func, "element", "ColorRampElement", "", "New element");
RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "remove", "rna_ColorRampElement_remove");
RNA_def_function_ui_description(func, "Delete element from ColorRamp");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "element", "ColorRampElement", "", "Element to remove");
+ parm = RNA_def_pointer(func, "element", "ColorRampElement", "", "Element to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -517,26 +517,26 @@ static void rna_def_color_ramp(BlenderRNA *brna)
{4, "CONSTANT", 0, "Constant", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ColorRamp", NULL);
+ srna = RNA_def_struct(brna, "ColorRamp", NULL);
RNA_def_struct_sdna(srna, "ColorBand");
RNA_def_struct_path_func(srna, "rna_ColorRamp_path");
RNA_def_struct_ui_text(srna, "Color Ramp", "Color ramp mapping a scalar value to a color");
- prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_COLOR);
+ prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_COLOR);
RNA_def_property_collection_sdna(prop, NULL, "data", "tot");
RNA_def_property_struct_type(prop, "ColorRampElement");
RNA_def_property_ui_text(prop, "Elements", "");
RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
rna_def_color_ramp_element_api(brna, prop);
- prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ipotype");
RNA_def_property_enum_items(prop, prop_interpolation_items);
RNA_def_property_ui_text(prop, "Interpolation", "");
RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
-#if 0 // use len(elements)
- prop= RNA_def_property(srna, "total", PROP_INT, PROP_NONE);
+#if 0 /* use len(elements) */
+ prop = RNA_def_property(srna, "total", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tot");
/* needs a function to do the right thing when adding elements like colorband_add_cb() */
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -547,7 +547,7 @@ static void rna_def_color_ramp(BlenderRNA *brna)
func = RNA_def_function(srna, "evaluate", "rna_ColorRamp_eval");
RNA_def_function_ui_description(func, "Evaluate ColorRamp");
- prop= RNA_def_float(func, "position", 1.0f, 0.0f, 1.0f, "Position", "Evaluate ColorRamp at position", 0.0f, 1.0f);
+ prop = RNA_def_float(func, "position", 1.0f, 0.0f, 1.0f, "Position", "Evaluate ColorRamp at position", 0.0f, 1.0f);
RNA_def_property_flag(prop, PROP_REQUIRED);
/* return */
prop = RNA_def_float_color(func, "color", 4, NULL, -FLT_MAX, FLT_MAX, "Color", "Color at given position", -FLT_MAX, FLT_MAX);
@@ -568,10 +568,10 @@ static void rna_def_histogram(BlenderRNA *brna)
{HISTO_MODE_B, "B", ICON_COLOR, "Blue", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Histogram", NULL);
+ srna = RNA_def_struct(brna, "Histogram", NULL);
RNA_def_struct_ui_text(srna, "Histogram", "Statistical view of the levels of color in an image");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, prop_mode_items);
RNA_def_property_ui_text(prop, "Mode", "Channels to display when drawing the histogram");
@@ -591,38 +591,38 @@ static void rna_def_scopes(BlenderRNA *brna)
{SCOPES_WAVEFRM_YCC_JPEG, "YCBCRJPG", ICON_COLOR, "YCbCr (Jpeg)", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Scopes", NULL);
+ srna = RNA_def_struct(brna, "Scopes", NULL);
RNA_def_struct_ui_text(srna, "Scopes", "Scopes for statistical view of an image");
- prop= RNA_def_property(srna, "use_full_resolution", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_full_resolution", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, "Scopes", "sample_full", 1);
RNA_def_property_ui_text(prop, "Full Sample", "Sample every pixel of the image");
RNA_def_property_update(prop, 0, "rna_Scopes_update");
- prop= RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_PERCENTAGE);
+ prop = RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, "Scopes", "accuracy");
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
RNA_def_property_ui_text(prop, "Accuracy", "Proportion of original image source pixel lines to sample");
RNA_def_property_update(prop, 0, "rna_Scopes_update");
- prop= RNA_def_property(srna, "histogram", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "histogram", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, "Scopes", "hist");
RNA_def_property_struct_type(prop, "Histogram");
RNA_def_property_ui_text(prop, "Histogram", "Histogram for viewing image statistics");
- prop= RNA_def_property(srna, "waveform_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "waveform_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, "Scopes", "wavefrm_mode");
RNA_def_property_enum_items(prop, prop_wavefrm_mode_items);
RNA_def_property_ui_text(prop, "Waveform Mode", "");
RNA_def_property_update(prop, 0, "rna_Scopes_update");
- prop= RNA_def_property(srna, "waveform_alpha", PROP_FLOAT, PROP_PERCENTAGE);
+ prop = RNA_def_property(srna, "waveform_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, "Scopes", "wavefrm_alpha");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Waveform Opacity", "Opacity of the points");
- prop= RNA_def_property(srna, "vectorscope_alpha", PROP_FLOAT, PROP_PERCENTAGE);
+ prop = RNA_def_property(srna, "vectorscope_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, "Scopes", "vecscope_alpha");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Vectorscope Opacity", "Opacity of the points");
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 8a1c56abedf..883b72ef832 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -42,7 +42,7 @@
#include "ED_object.h"
#include "WM_types.h"
-EnumPropertyItem constraint_type_items[] ={
+EnumPropertyItem constraint_type_items[] = {
{0, "", 0, "Motion Tracking", ""},
{CONSTRAINT_TYPE_CAMERASOLVER, "CAMERA_SOLVER", ICON_CONSTRAINT_DATA, "Camera Solver", ""},
{CONSTRAINT_TYPE_OBJECTSOLVER, "OBJECT_SOLVER", ICON_CONSTRAINT_DATA, "Object Solver", ""},
@@ -107,9 +107,9 @@ static EnumPropertyItem space_object_items[] = {
static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
{
- bConstraint *con= (bConstraint*)ptr->data;
+ bConstraint *con = (bConstraint*)ptr->data;
- switch(con->type) {
+ switch (con->type) {
case CONSTRAINT_TYPE_CHILDOF:
return &RNA_ChildOfConstraint;
case CONSTRAINT_TYPE_TRACKTO:
@@ -173,7 +173,7 @@ static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
static void rna_Constraint_name_set(PointerRNA *ptr, const char *value)
{
- bConstraint *con= ptr->data;
+ bConstraint *con = ptr->data;
char oldname[sizeof(con->name)];
/* make a copy of the old name first */
@@ -184,7 +184,7 @@ static void rna_Constraint_name_set(PointerRNA *ptr, const char *value)
/* make sure name is unique */
if (ptr->id.data) {
- Object *ob= ptr->id.data;
+ Object *ob = ptr->id.data;
ListBase *list = get_constraint_lb(ob, con, NULL);
/* if we have the list, check for unique name, otherwise give up */
@@ -198,15 +198,15 @@ static void rna_Constraint_name_set(PointerRNA *ptr, const char *value)
static char *rna_Constraint_path(PointerRNA *ptr)
{
- Object *ob= ptr->id.data;
- bConstraint *con= ptr->data;
+ Object *ob = ptr->id.data;
+ bConstraint *con = ptr->data;
bPoseChannel *pchan;
ListBase *lb = get_constraint_lb(ob, con, &pchan);
- if(lb == NULL)
+ if (lb == NULL)
printf("rna_Constraint_path: internal error, constraint '%s' not found in object '%s'\n", con->name, ob->id.name);
- if(pchan) {
+ if (pchan) {
return BLI_sprintfN("pose.bones[\"%s\"].constraints[\"%s\"]", pchan->name, con->name);
}
@@ -225,9 +225,9 @@ static void rna_Constraint_dependency_update(Main *bmain, Scene *scene, PointerR
static void rna_Constraint_influence_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Object *ob= ptr->id.data;
+ Object *ob = ptr->id.data;
- if(ob->pose)
+ if (ob->pose)
ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
rna_Constraint_update(bmain, scene, ptr);
@@ -239,8 +239,8 @@ static void rna_Constraint_ik_type_set(struct PointerRNA *ptr, int value)
bKinematicConstraint *ikdata = con->data;
if (ikdata->type != value) {
- // the type of IK constraint has changed, set suitable default values
- // in case constraints reuse same fields incompatible
+ /* the type of IK constraint has changed, set suitable default values */
+ /* in case constraints reuse same fields incompatible */
switch (value) {
case CONSTRAINT_IK_COPYPOSE:
break;
@@ -253,10 +253,10 @@ static void rna_Constraint_ik_type_set(struct PointerRNA *ptr, int value)
static EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
- Object *ob= (Object*)ptr->id.data;
- bConstraint *con= (bConstraint*)ptr->data;
+ Object *ob = (Object*)ptr->id.data;
+ bConstraint *con = (bConstraint*)ptr->data;
- if(BLI_findindex(&ob->constraints, con) == -1)
+ if (BLI_findindex(&ob->constraints, con) == -1)
return owner_space_pchan_items;
else /* object */
return space_object_items;
@@ -264,22 +264,22 @@ static EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *UNUSED(C), P
static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
- bConstraint *con= (bConstraint*)ptr->data;
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
+ bConstraint *con = (bConstraint*)ptr->data;
+ bConstraintTypeInfo *cti = constraint_get_typeinfo(con);
ListBase targets = {NULL, NULL};
bConstraintTarget *ct;
- if(cti && cti->get_constraint_targets) {
+ if (cti && cti->get_constraint_targets) {
cti->get_constraint_targets(con, &targets);
- for(ct=targets.first; ct; ct= ct->next)
- if(ct->tar && ct->tar->type == OB_ARMATURE)
+ for (ct = targets.first; ct; ct = ct->next)
+ if (ct->tar && ct->tar->type == OB_ARMATURE)
break;
- if(cti->flush_constraint_targets)
+ if (cti->flush_constraint_targets)
cti->flush_constraint_targets(con, &targets, 1);
- if(ct)
+ if (ct)
return target_space_pchan_items;
}
@@ -288,51 +288,51 @@ static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *UNUSED(C),
static void rna_ActionConstraint_minmax_range(PointerRNA *ptr, float *min, float *max)
{
- bConstraint *con= (bConstraint*)ptr->data;
+ bConstraint *con = (bConstraint*)ptr->data;
bActionConstraint *acon = (bActionConstraint *)con->data;
/* 0, 1, 2 = magic numbers for rotX, rotY, rotZ */
if (ELEM3(acon->type, 0, 1, 2)) {
- *min= -180.0f;
- *max= 180.0f;
+ *min = -180.0f;
+ *max = 180.0f;
} else {
- *min= -1000.f;
- *max= 1000.f;
+ *min = -1000.f;
+ *max = 1000.f;
}
}
static int rna_SplineIKConstraint_joint_bindings_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
- bConstraint *con= (bConstraint*)ptr->data;
- bSplineIKConstraint *ikData= (bSplineIKConstraint *)con->data;
+ bConstraint *con = (bConstraint*)ptr->data;
+ bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data;
if (ikData)
- length[0]= ikData->numpoints;
+ length[0] = ikData->numpoints;
else
- length[0]= 256; /* for raw_access, untested */
+ length[0] = 256; /* for raw_access, untested */
return length[0];
}
static void rna_SplineIKConstraint_joint_bindings_get(PointerRNA *ptr, float *values)
{
- bConstraint *con= (bConstraint*)ptr->data;
- bSplineIKConstraint *ikData= (bSplineIKConstraint *)con->data;
+ bConstraint *con = (bConstraint*)ptr->data;
+ bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data;
memcpy(values, ikData->points, ikData->numpoints * sizeof(float));
}
static void rna_SplineIKConstraint_joint_bindings_set(PointerRNA *ptr, const float *values)
{
- bConstraint *con= (bConstraint*)ptr->data;
- bSplineIKConstraint *ikData= (bSplineIKConstraint *)con->data;
+ bConstraint *con = (bConstraint*)ptr->data;
+ bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data;
memcpy(ikData->points, values, ikData->numpoints * sizeof(float));
}
static int rna_Constraint_cameraObject_poll(PointerRNA *ptr, PointerRNA value)
{
- Object *ob= (Object*)value.data;
+ Object *ob = (Object*)value.data;
if (ob) {
if (ob->type == OB_CAMERA && ob != (Object*)ptr->id.data) {
@@ -345,39 +345,39 @@ static int rna_Constraint_cameraObject_poll(PointerRNA *ptr, PointerRNA value)
static void rna_Constraint_followTrack_camera_set(PointerRNA *ptr, PointerRNA value)
{
- bConstraint *con= (bConstraint*)ptr->data;
- bFollowTrackConstraint *data= (bFollowTrackConstraint*)con->data;
- Object *ob= (Object*)value.data;
+ bConstraint *con = (bConstraint*)ptr->data;
+ bFollowTrackConstraint *data = (bFollowTrackConstraint*)con->data;
+ Object *ob = (Object*)value.data;
if (ob) {
if (ob->type == OB_CAMERA && ob != (Object*)ptr->id.data) {
- data->camera= ob;
+ data->camera = ob;
}
} else {
- data->camera= NULL;
+ data->camera = NULL;
}
}
static void rna_Constraint_followTrack_depthObject_set(PointerRNA *ptr, PointerRNA value)
{
- bConstraint *con= (bConstraint*)ptr->data;
- bFollowTrackConstraint *data= (bFollowTrackConstraint*)con->data;
- Object *ob= (Object*)value.data;
+ bConstraint *con = (bConstraint*)ptr->data;
+ bFollowTrackConstraint *data = (bFollowTrackConstraint*)con->data;
+ Object *ob = (Object*)value.data;
if (ob) {
if (ob->type == OB_MESH && ob != (Object*)ptr->id.data) {
- data->depth_ob= ob;
+ data->depth_ob = ob;
}
} else {
- data->depth_ob= NULL;
+ data->depth_ob = NULL;
}
}
static int rna_Constraint_followTrack_depthObject_poll(PointerRNA *ptr, PointerRNA value)
{
- Object *ob= (Object*)value.data;
+ Object *ob = (Object*)value.data;
- if(ob) {
+ if (ob) {
if (ob->type == OB_MESH && ob != (Object*)ptr->id.data) {
return 1;
}
@@ -388,16 +388,16 @@ static int rna_Constraint_followTrack_depthObject_poll(PointerRNA *ptr, PointerR
static void rna_Constraint_objectSolver_camera_set(PointerRNA *ptr, PointerRNA value)
{
- bConstraint *con= (bConstraint*)ptr->data;
- bObjectSolverConstraint *data= (bObjectSolverConstraint*)con->data;
- Object *ob= (Object*)value.data;
+ bConstraint *con = (bConstraint*)ptr->data;
+ bObjectSolverConstraint *data = (bObjectSolverConstraint*)con->data;
+ Object *ob = (Object*)value.data;
if (ob) {
if (ob->type == OB_CAMERA && ob != (Object*)ptr->id.data) {
- data->camera= ob;
+ data->camera = ob;
}
} else {
- data->camera= NULL;
+ data->camera = NULL;
}
}
@@ -416,91 +416,91 @@ static void rna_def_constrainttarget(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ConstraintTarget", NULL);
+ srna = RNA_def_struct(brna, "ConstraintTarget", NULL);
RNA_def_struct_ui_text(srna, "Constraint Target", "Target object for multi-target constraints");
RNA_def_struct_sdna(srna, "bConstraintTarget");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- // space, flag and type still to do
+ /* space, flag and type still to do */
}
static void rna_def_constraint_childof(BlenderRNA *brna)
{
- static int rna_matrix_dimsize_4x4[]= {4, 4};
+ static int rna_matrix_dimsize_4x4[] = {4, 4};
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ChildOfConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "ChildOfConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Child Of Constraint", "Create constraint-based parent-child relationship");
RNA_def_struct_sdna_from(srna, "bChildOfConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "use_location_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_location_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCX);
RNA_def_property_ui_text(prop, "Location X", "Use X Location of Parent");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_location_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_location_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCY);
RNA_def_property_ui_text(prop, "Location Y", "Use Y Location of Parent");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_location_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_location_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCZ);
RNA_def_property_ui_text(prop, "Location Z", "Use Z Location of Parent");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_rotation_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_rotation_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_ROTX);
RNA_def_property_ui_text(prop, "Rotation X", "Use X Rotation of Parent");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_rotation_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_rotation_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_ROTY);
RNA_def_property_ui_text(prop, "Rotation Y", "Use Y Rotation of Parent");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_rotation_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_rotation_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_ROTZ);
RNA_def_property_ui_text(prop, "Rotation Z", "Use Z Rotation of Parent");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_scale_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_scale_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEX);
RNA_def_property_ui_text(prop, "Scale X", "Use X Scale of Parent");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_scale_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_scale_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEY);
RNA_def_property_ui_text(prop, "Scale Y", "Use Y Scale of Parent");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_scale_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_scale_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEZ);
RNA_def_property_ui_text(prop, "Scale Z", "Use Z Scale of Parent");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "inverse_matrix", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "inverse_matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "invmat");
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -513,31 +513,31 @@ static void rna_def_constraint_python(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "PythonConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "PythonConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Python Constraint", "Use Python script for constraint evaluation");
RNA_def_struct_sdna_from(srna, "bPythonConstraint", "data");
- prop= RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "targets", NULL);
RNA_def_property_struct_type(prop, "ConstraintTarget");
RNA_def_property_ui_text(prop, "Targets", "Target Objects");
- prop= RNA_def_property(srna, "target_count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "target_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tarnum");
RNA_def_property_ui_text(prop, "Number of Targets", "Usually only 1-3 are needed");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Script", "The text object that contains the Python script");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_targets", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_targets", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PYCON_USETARGETS);
RNA_def_property_ui_text(prop, "Use Targets", "Use the targets indicated in the constraint panel");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "has_script_error", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "has_script_error", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PYCON_SCRIPTERROR);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Script Error", "The linked Python script has thrown an error");
@@ -548,146 +548,146 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem constraint_ik_axisref_items[] ={
+ static EnumPropertyItem constraint_ik_axisref_items[] = {
{0, "BONE", 0, "Bone", ""},
{CONSTRAINT_IK_TARGETAXIS, "TARGET", 0, "Target", ""},
{0, NULL, 0, NULL, NULL},
};
- static EnumPropertyItem constraint_ik_type_items[] ={
+ static EnumPropertyItem constraint_ik_type_items[] = {
{CONSTRAINT_IK_COPYPOSE, "COPY_POSE", 0, "Copy Pose", ""},
{CONSTRAINT_IK_DISTANCE, "DISTANCE", 0, "Distance", ""},
{0, NULL, 0, NULL, NULL},
};
- srna= RNA_def_struct(brna, "KinematicConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "KinematicConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Kinematic Constraint", "Inverse Kinematics");
RNA_def_struct_sdna_from(srna, "bKinematicConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 10000);
RNA_def_property_ui_text(prop, "Iterations", "Maximum number of solving iterations");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "pole_target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "pole_target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "poletar");
RNA_def_property_ui_text(prop, "Pole Target", "Object for pole rotation");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "pole_subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "pole_subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "polesubtarget");
RNA_def_property_ui_text(prop, "Pole Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "pole_angle", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "pole_angle", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "poleangle");
RNA_def_property_range(prop, -M_PI, M_PI);
RNA_def_property_ui_text(prop, "Pole Angle", "Pole rotation offset");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 1.f);
RNA_def_property_ui_text(prop, "Weight", "For Tree-IK: Weight of position control for this target");
- prop= RNA_def_property(srna, "orient_weight", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "orient_weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "orientweight");
RNA_def_property_range(prop, 0.01, 1.f);
RNA_def_property_ui_text(prop, "Orientation Weight", "For Tree-IK: Weight of orientation control for this target");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rootbone");
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the IK effect - 0 uses all bones");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "use_tail", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_tail", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_TIP);
RNA_def_property_ui_text(prop, "Use Tail", "Include bone's tail as last element in chain");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "reference_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "reference_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, constraint_ik_axisref_items);
RNA_def_property_ui_text(prop, "Axis Reference", "Constraint axis Lock options relative to Bone or Target reference");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "use_location", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_location", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_POS);
RNA_def_property_ui_text(prop, "Position", "Chain follows position of target");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_POS_X);
RNA_def_property_ui_text(prop, "Lock X Pos", "Constraint position along X axis");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "lock_location_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_location_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_POS_Y);
RNA_def_property_ui_text(prop, "Lock Y Pos", "Constraint position along Y axis");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "lock_location_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_location_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_POS_Z);
RNA_def_property_ui_text(prop, "Lock Z Pos", "Constraint position along Z axis");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_ROT);
RNA_def_property_ui_text(prop, "Rotation", "Chain follows rotation of target");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_ROT_X);
RNA_def_property_ui_text(prop, "Lock X Rot", "Constraint rotation along X axis");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_ROT_Y);
RNA_def_property_ui_text(prop, "Lock Y Rot", "Constraint rotation along Y axis");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_ROT_Z);
RNA_def_property_ui_text(prop, "Lock Z Rot", "Constraint rotation along Z axis");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "use_target", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_target", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_AUTO);
RNA_def_property_ui_text(prop, "Target", "Disable for targetless IK");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_STRETCH);
RNA_def_property_ui_text(prop, "Stretch", "Enable IK Stretching");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "ik_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "ik_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_funcs(prop, NULL, "rna_Constraint_ik_type_set", NULL);
RNA_def_property_enum_items(prop, constraint_ik_type_items);
RNA_def_property_ui_text(prop, "IK Type", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, constraint_distance_items);
RNA_def_property_ui_text(prop, "Limit Mode", "Distances in relation to sphere of influence to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_range(prop, 0.0, 100.f);
RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere");
@@ -714,40 +714,40 @@ static void rna_def_constraint_track_to(BlenderRNA *brna)
{TRACK_Z, "UP_Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "TrackToConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "TrackToConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Track To Constraint", "Aim the constrained object toward the target");
- prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
RNA_def_struct_sdna_from(srna, "bTrackToConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "reserved1");
RNA_def_property_enum_items(prop, track_items);
RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "reserved2");
RNA_def_property_enum_items(prop, up_items);
RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_target_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_target_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TARGET_Z_UP);
RNA_def_property_ui_text(prop, "Target Z", "Target's Z axis, not World Z axis, will constraint the Up direction");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -758,59 +758,59 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "CopyLocationConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "CopyLocationConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copy the location of the target");
- prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
RNA_def_struct_sdna_from(srna, "bLocateLikeConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X);
RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X location");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Y);
RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y location");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Z);
RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z location");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X_INVERT);
RNA_def_property_ui_text(prop, "Invert X", "Invert the X location");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Y_INVERT);
RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y location");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Z_INVERT);
RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z location");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_OFFSET);
RNA_def_property_ui_text(prop, "Offset", "Add original location into copied location");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -821,52 +821,52 @@ static void rna_def_constraint_rotate_like(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "CopyRotationConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "CopyRotationConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Copy Rotation Constraint", "Copy the rotation of the target");
RNA_def_struct_sdna_from(srna, "bRotateLikeConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_X);
RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X rotation");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Y);
RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y rotation");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Z);
RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z rotation");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_X_INVERT);
RNA_def_property_ui_text(prop, "Invert X", "Invert the X rotation");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Y_INVERT);
RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y rotation");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Z_INVERT);
RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z rotation");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_OFFSET);
RNA_def_property_ui_text(prop, "Offset", "Add original rotation into copied rotation");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -877,38 +877,38 @@ static void rna_def_constraint_size_like(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "CopyScaleConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "CopyScaleConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Copy Scale Constraint", "Copy the scale of the target");
RNA_def_struct_sdna_from(srna, "bSizeLikeConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_X);
RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X scale");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_Y);
RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y scale");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_Z);
RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z scale");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_OFFSET);
RNA_def_property_ui_text(prop, "Offset", "Add original scale into copied scale");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -925,17 +925,17 @@ static void rna_def_constraint_same_volume(BlenderRNA *brna)
{SAMEVOL_Z, "SAMEVOL_Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MaintainVolumeConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "MaintainVolumeConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Maintain Volume Constraint", "Maintain a constant volume along a single scaling axis");
RNA_def_struct_sdna_from(srna, "bSameVolumeConstraint", "data");
- prop= RNA_def_property(srna, "free_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "free_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, volume_items);
RNA_def_property_ui_text(prop, "Free Axis", "The free scaling axis of the object");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0.001, 100.f);
RNA_def_property_ui_text(prop, "Volume", "Volume of the bone at rest");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -947,23 +947,23 @@ static void rna_def_constraint_transform_like(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "CopyTransformsConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "CopyTransformsConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Copy Transforms Constraint", "Copy all the transforms of the target");
- prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
RNA_def_struct_sdna_from(srna, "bTransLikeConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
@@ -983,38 +983,38 @@ static void rna_def_constraint_minmax(BlenderRNA *brna)
{TRACK_nZ, "FLOOR_NEGATIVE_Z", 0, "-Z", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "FloorConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "FloorConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Floor Constraint", "Use the target object for location limitation");
RNA_def_struct_sdna_from(srna, "bMinMaxConstraint","data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "floor_location", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "floor_location", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "minmaxflag");
RNA_def_property_enum_items(prop, minmax_items);
RNA_def_property_ui_text(prop, "Floor Location", "Location of target that object will not pass through");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_sticky", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_sticky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MINMAX_STICKY);
RNA_def_property_ui_text(prop, "Sticky", "Immobilize object while constrained");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MINMAX_USEROT);
RNA_def_property_ui_text(prop, "Use Rotation", "Use the target's rotation to determine floor");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0.0, 100.f);
RNA_def_property_ui_text(prop, "Offset", "Offset of floor from object origin");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1037,53 +1037,53 @@ static void rna_def_constraint_action(BlenderRNA *brna)
{12, "SCALE_Z", 0, "Z Scale", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ActionConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "ActionConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Action Constraint", "Map an action to the transform axes of a bone");
RNA_def_struct_sdna_from(srna, "bActionConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "transform_channel", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "transform_channel", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, transform_channel_items);
RNA_def_property_ui_text(prop, "Transform Channel", "Transformation channel from the target that is used to key the Action");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act");
RNA_def_property_ui_text(prop, "Action", "The constraining action");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "start");
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Start Frame", "First frame of the Action to use");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "end");
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "End Frame", "Last frame of the Action to use");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_range(prop, -1000.f, 1000.f);
RNA_def_property_ui_text(prop, "Maximum", "Maximum value for target channel range");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range");
- prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_range(prop, -1000.f, 1000.f);
RNA_def_property_ui_text(prop, "Minimum", "Minimum value for target channel range");
@@ -1111,34 +1111,34 @@ static void rna_def_constraint_locked_track(BlenderRNA *brna)
{TRACK_Z, "LOCK_Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "LockedTrackConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "LockedTrackConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Locked Track Constraint", "Point toward the target along the track axis, while locking the other axis");
- prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
RNA_def_struct_sdna_from(srna, "bLockTrackConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "trackflag");
RNA_def_property_enum_items(prop, locktrack_items);
RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "lockflag");
RNA_def_property_enum_items(prop, lock_items);
RNA_def_property_ui_text(prop, "Locked Axis", "Axis that points upward");
@@ -1165,51 +1165,51 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna)
{TRACK_Z, "UP_Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "FollowPathConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "FollowPathConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Follow Path Constraint", "Lock motion to the target path");
RNA_def_struct_sdna_from(srna, "bFollowPathConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TIME);
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Offset", "Offset from the position corresponding to the time frame");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "offset_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "offset_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "offset_fac");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Offset Factor", "Percentage value defining target position along length of bone");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "forward_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "forward_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "trackflag");
RNA_def_property_enum_items(prop, forwardpath_items);
RNA_def_property_ui_text(prop, "Forward Axis", "Axis that points forward along the path");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "upflag");
RNA_def_property_enum_items(prop, pathup_items);
RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_curve_follow", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_curve_follow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "followflag", FOLLOWPATH_FOLLOW);
RNA_def_property_ui_text(prop, "Follow Curve", "Object will follow the heading and banking of the curve");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_fixed_location", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_fixed_location", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "followflag", FOLLOWPATH_STATIC);
RNA_def_property_ui_text(prop, "Fixed Position", "Object will stay locked to a single point somewhere along the length of the curve regardless of time");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_curve_radius", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_curve_radius", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "followflag", FOLLOWPATH_RADIUS);
RNA_def_property_ui_text(prop, "Curve Radius", "Object is scaled by the curve radius");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1232,46 +1232,46 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna)
{PLANE_Z, "PLANE_Z", 0, "Z", "Keep Z Axis"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "StretchToConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "StretchToConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Stretch To Constraint", "Stretch to meet the target object");
- prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
RNA_def_struct_sdna_from(srna, "bStretchToConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "volume", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "volume", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "volmode");
RNA_def_property_enum_items(prop, volume_items);
RNA_def_property_ui_text(prop, "Maintain Volume", "Maintain the object's volume as it stretches");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "keep_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "keep_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "plane");
RNA_def_property_enum_items(prop, plane_items);
RNA_def_property_ui_text(prop, "Keep Axis", "Axis to maintain during stretch");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "orglength");
RNA_def_property_range(prop, 0.0, 100.f);
RNA_def_property_ui_text(prop, "Original Length", "Length at rest position");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "bulge", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bulge", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.f);
RNA_def_property_ui_text(prop, "Volume Variation", "Factor between volume variation and stretching");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1289,69 +1289,69 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna)
{CONSTRAINT_RB_GENERIC6DOF, "GENERIC_6_DOF", 0, "Generic 6 DoF", "No constraints by default, limits can be set individually"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "RigidBodyJointConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "RigidBodyJointConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Rigid Body Joint Constraint", "For use with the Game Engine");
RNA_def_struct_sdna_from(srna, "bRigidBodyJointConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "child", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "child", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Child Object", "Child object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "pivot_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "pivot_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, pivot_items);
RNA_def_property_ui_text(prop, "Pivot Type", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "pivot_x", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "pivot_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "pivX");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Pivot X", "Offset pivot on X");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "pivot_y", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "pivot_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "pivY");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Pivot Y", "Offset pivot on Y");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "pivot_z", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "pivot_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "pivZ");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Pivot Z", "Offset pivot on Z");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "axis_x", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "axis_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "axX");
RNA_def_property_range(prop, -M_PI*2, M_PI*2);
RNA_def_property_ui_text(prop, "Axis X", "Rotate pivot on X axis in degrees");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "axis_y", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "axis_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "axY");
RNA_def_property_range(prop, -M_PI*2, M_PI*2);
RNA_def_property_ui_text(prop, "Axis Y", "Rotate pivot on Y axis in degrees");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "axis_z", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "axis_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "axZ");
RNA_def_property_range(prop, -M_PI*2, M_PI*2);
RNA_def_property_ui_text(prop, "Axis Z", "Rotate pivot on Z axis in degrees");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_linked_collision", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_linked_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE_LINKED_COLLISION);
RNA_def_property_ui_text(prop, "Disable Linked Collision", "Disable collision between linked bodies");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "show_pivot", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_pivot", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DRAW_PIVOT);
RNA_def_property_ui_text(prop, "Draw Pivot", "Display the pivot point and rotation in 3D view");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1359,88 +1359,88 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna)
/* Limits */
/* Limit Min/Max */
- prop= RNA_def_property(srna, "limit_min_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minLimit[0]");
RNA_def_property_ui_text(prop, "Minimum Limit X", "");
- prop= RNA_def_property(srna, "limit_min_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minLimit[1]");
RNA_def_property_ui_text(prop, "Minimum Limit Y", "");
- prop= RNA_def_property(srna, "limit_min_z", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_min_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minLimit[2]");
RNA_def_property_ui_text(prop, "Minimum Limit Z", "");
- prop= RNA_def_property(srna, "limit_max_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxLimit[0]");
RNA_def_property_ui_text(prop, "Maximum Limit X", "");
- prop= RNA_def_property(srna, "limit_max_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxLimit[1]");
RNA_def_property_ui_text(prop, "Maximum Limit Y", "");
- prop= RNA_def_property(srna, "limit_max_z", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_max_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxLimit[2]");
RNA_def_property_ui_text(prop, "Maximum Limit Z", "");
/* Limit Min/Max for angle */
- prop= RNA_def_property(srna, "limit_angle_min_x", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "limit_angle_min_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "minLimit[3]");
RNA_def_property_range(prop, -M_PI*2, M_PI*2);
RNA_def_property_ui_text(prop, "Minimum Angular Limit X", "");
- prop= RNA_def_property(srna, "limit_angle_min_y", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "limit_angle_min_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "minLimit[4]");
RNA_def_property_range(prop, -M_PI*2, M_PI*2);
RNA_def_property_ui_text(prop, "Minimum Angular Limit Y", "");
- prop= RNA_def_property(srna, "limit_angle_min_z", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "limit_angle_min_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "minLimit[5]");
RNA_def_property_range(prop, -M_PI*2, M_PI*2);
RNA_def_property_ui_text(prop, "Minimum Angular Limit Z", "");
- prop= RNA_def_property(srna, "limit_angle_max_x", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "limit_angle_max_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "maxLimit[3]");
RNA_def_property_range(prop, -M_PI*2, M_PI*2);
RNA_def_property_ui_text(prop, "Maximum Angular Limit X", "");
- prop= RNA_def_property(srna, "limit_angle_max_y", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "limit_angle_max_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "maxLimit[4]");
RNA_def_property_range(prop, -M_PI*2, M_PI*2);
RNA_def_property_ui_text(prop, "Maximum Angular Limit Y", "");
- prop= RNA_def_property(srna, "limit_angle_max_z", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "limit_angle_max_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "maxLimit[5]");
RNA_def_property_range(prop, -M_PI*2, M_PI*2);
RNA_def_property_ui_text(prop, "Maximum Angular Limit Z", "");
/* Limit Booleans */
- prop= RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
RNA_def_property_ui_text(prop, "Limit X", "Use minimum/maximum X limit");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 2);
RNA_def_property_ui_text(prop, "Limit Y", "Use minimum/maximum y limit");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_limit_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_limit_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 4);
RNA_def_property_ui_text(prop, "Limit Z", "Use minimum/maximum z limit");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_angular_limit_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_angular_limit_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 8);
RNA_def_property_ui_text(prop, "Angular X Limit", "Use minimum/maximum X angular limit");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_angular_limit_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_angular_limit_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 16);
RNA_def_property_ui_text(prop, "Angular Y Limit", "Use minimum/maximum Y angular limit");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_angular_limit_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_angular_limit_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 32);
RNA_def_property_ui_text(prop, "Angular Z Limit", "Use minimum/maximum Z angular limit");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1458,24 +1458,24 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna)
{CLAMPTO_Z, "CLAMPTO_Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ClampToConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "ClampToConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Clamp To Constraint", "Constrains an object's location to the nearest point along the target path");
RNA_def_struct_sdna_from(srna, "bClampToConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "main_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "main_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, clamp_items);
RNA_def_property_ui_text(prop, "Main Axis", "Main axis of movement");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", CLAMPTO_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic", "Treat curve as cyclic curve (no clamping to curve bounding box)");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1498,123 +1498,123 @@ static void rna_def_constraint_transform(BlenderRNA *brna)
{2, "Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "TransformConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "TransformConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Transformation Constraint", "Maps transformations of the target to the object");
RNA_def_struct_sdna_from(srna, "bTransformConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "map_from", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "map_from", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "from");
RNA_def_property_enum_items(prop, transform_items);
RNA_def_property_ui_text(prop, "Map From", "The transformation type to use from the target");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "map_to", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "map_to", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "to");
RNA_def_property_enum_items(prop, transform_items);
RNA_def_property_ui_text(prop, "Map To", "The transformation type to affect of the constrained object");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "map_to_x_from", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "map_to_x_from", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "map[0]");
RNA_def_property_enum_items(prop, axis_map_items);
RNA_def_property_ui_text(prop, "Map To X From", "The source axis constrained object's X axis uses");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "map_to_y_from", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "map_to_y_from", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "map[1]");
RNA_def_property_enum_items(prop, axis_map_items);
RNA_def_property_ui_text(prop, "Map To Y From", "The source axis constrained object's Y axis uses");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "map_to_z_from", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "map_to_z_from", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "map[2]");
RNA_def_property_enum_items(prop, axis_map_items);
RNA_def_property_ui_text(prop, "Map To Z From", "The source axis constrained object's Z axis uses");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_motion_extrapolate", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_motion_extrapolate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "expo", CLAMPTO_CYCLIC);
RNA_def_property_ui_text(prop, "Extrapolate Motion", "Extrapolate ranges");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "from_min_x", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "from_min_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "from_min[0]");
RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
RNA_def_property_ui_text(prop, "From Minimum X", "Bottom range of X axis source motion");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "from_min_y", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "from_min_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "from_min[1]");
RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
RNA_def_property_ui_text(prop, "From Minimum Y", "Bottom range of Y axis source motion");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "from_min_z", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "from_min_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "from_min[2]");
RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
RNA_def_property_ui_text(prop, "From Minimum Z", "Bottom range of Z axis source motion");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "from_max_x", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "from_max_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "from_max[0]");
RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
RNA_def_property_ui_text(prop, "From Maximum X", "Top range of X axis source motion");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "from_max_y", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "from_max_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "from_max[1]");
RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
RNA_def_property_ui_text(prop, "From Maximum Y", "Top range of Y axis source motion");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "from_max_z", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "from_max_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "from_max[2]");
RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
RNA_def_property_ui_text(prop, "From Maximum Z", "Top range of Z axis source motion");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "to_min_x", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "to_min_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "to_min[0]");
RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
RNA_def_property_ui_text(prop, "To Minimum X", "Bottom range of X axis destination motion");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "to_min_y", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "to_min_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "to_min[1]");
RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
RNA_def_property_ui_text(prop, "To Minimum Y", "Bottom range of Y axis destination motion");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "to_min_z", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "to_min_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "to_min[2]");
RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
RNA_def_property_ui_text(prop, "To Minimum Z", "Bottom range of Z axis destination motion");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "to_max_x", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "to_max_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "to_max[0]");
RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
RNA_def_property_ui_text(prop, "To Maximum X", "Top range of X axis destination motion");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "to_max_y", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "to_max_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "to_max[1]");
RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
RNA_def_property_ui_text(prop, "To Maximum Y", "Top range of Y axis destination motion");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "to_max_z", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "to_max_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "to_max[2]");
RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
RNA_def_property_ui_text(prop, "To Maximum Z", "Top range of Z axis destination motion");
@@ -1626,77 +1626,77 @@ static void rna_def_constraint_location_limit(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "LimitLocationConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "LimitLocationConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Limit Location Constraint", "Limit the location of the constrained object");
RNA_def_struct_sdna_from(srna, "bLocLimitConstraint", "data");
- prop= RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMIN);
RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMIN);
RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_min_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_min_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMIN);
RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMAX);
RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMAX);
RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_max_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_max_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMAX);
RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "xmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "ymin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "zmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "xmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "ymax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "zmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM);
RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1707,62 +1707,62 @@ static void rna_def_constraint_rotation_limit(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "LimitRotationConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "LimitRotationConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Limit Rotation Constraint", "Limit the rotation of the constrained object");
RNA_def_struct_sdna_from(srna, "bRotLimitConstraint", "data");
- prop= RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XROT);
RNA_def_property_ui_text(prop, "Limit X", "Use the minimum X value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YROT);
RNA_def_property_ui_text(prop, "Limit Y", "Use the minimum Y value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_limit_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_limit_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZROT);
RNA_def_property_ui_text(prop, "Limit Z", "Use the minimum Z value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "xmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "ymin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "zmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "xmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "ymax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "zmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM);
RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1773,77 +1773,77 @@ static void rna_def_constraint_size_limit(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "LimitScaleConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "LimitScaleConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Limit Size Constraint", "Limit the scaling of the constrained object");
RNA_def_struct_sdna_from(srna, "bSizeLimitConstraint", "data");
- prop= RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMIN);
RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMIN);
RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_min_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_min_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMIN);
RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMAX);
RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMAX);
RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_max_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_max_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMAX);
RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ymin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ymax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM);
RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1854,40 +1854,40 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "LimitDistanceConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "LimitDistanceConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Limit Distance Constraint", "Limit the distance from target object");
- prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
RNA_def_struct_sdna_from(srna, "bDistLimitConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_range(prop, 0.0, 100.f);
RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, constraint_distance_items);
RNA_def_property_ui_text(prop, "Limit Mode", "Distances in relation to sphere of influence to allow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMITDIST_TRANSFORM);
RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1904,40 +1904,40 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna)
{MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrink the location to the nearest target vertex"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ShrinkwrapConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "ShrinkwrapConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Shrinkwrap Constraint", "Create constraint-based shrinkwrap relationship");
RNA_def_struct_sdna_from(srna, "bShrinkwrapConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "target"); /* TODO, mesh type */
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Mesh_object_poll");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "shrinkwrap_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "shrinkwrap_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "shrinkType");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Shrinkwrap Type", "Select type of shrinkwrap algorithm for target position");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_range(prop, 0.0, 100.f);
RNA_def_property_ui_text(prop, "Distance", "Distance to Target");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS);
RNA_def_property_ui_text(prop, "Axis X", "Projection over X Axis");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS);
RNA_def_property_ui_text(prop, "Axis Y", "Projection over Y Axis");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS);
RNA_def_property_ui_text(prop, "Axis Z", "Projection over Z Axis");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -1957,28 +1957,28 @@ static void rna_def_constraint_damped_track(BlenderRNA *brna)
{TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "DampedTrackConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "DampedTrackConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Damped Track Constraint", "Point toward target by taking the shortest rotation path");
- prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
RNA_def_struct_sdna_from(srna, "bDampTrackConstraint", "data");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "trackflag");
RNA_def_property_enum_items(prop, damptrack_items);
RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
@@ -1996,27 +1996,27 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna)
{CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC, "VOLUME_PRESERVE", 0, "Volume Preservation", "Scale of the X and Z axes is the inverse of the Y-Scale"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SplineIKConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "SplineIKConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Spline IK Constraint", "Align 'n' bones along a curve");
RNA_def_struct_sdna_from(srna, "bSplineIKConstraint", "data");
/* target chain */
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Curve that controls this relationship");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "chainlen");
- RNA_def_property_range(prop, 1, 255); // TODO: this should really check the max length of the chain the constraint is attached to
+ RNA_def_property_range(prop, 1, 255); /* TODO: this should really check the max length of the chain the constraint is attached to */
RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the chain");
- RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); // XXX: this update goes wrong... needs extra flush?
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); /* XXX: this update goes wrong... needs extra flush? */
/* direct access to bindings */
- // NOTE: only to be used by experienced users
- prop= RNA_def_property(srna, "joint_bindings", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_array(prop, 32); // XXX this is the maximum value allowed - why?
+ /* NOTE: only to be used by experienced users */
+ prop = RNA_def_property(srna, "joint_bindings", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_array(prop, 32); /* XXX this is the maximum value allowed - why? */
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_SplineIKConstraint_joint_bindings_get_length");
RNA_def_property_float_funcs(prop, "rna_SplineIKConstraint_joint_bindings_get", "rna_SplineIKConstraint_joint_bindings_set", NULL);
@@ -2024,27 +2024,27 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
/* settings */
- prop= RNA_def_property(srna, "use_chain_offset", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_chain_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_NO_ROOT);
RNA_def_property_ui_text(prop, "Chain Offset", "Offset the entire chain relative to the root joint");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_even_divisions", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_even_divisions", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_EVENSPLITS);
RNA_def_property_ui_text(prop, "Even Divisions", "Ignore the relative lengths of the bones when fitting to the curve");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_y_stretch", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_y_stretch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_SCALE_LIMITED);
RNA_def_property_ui_text(prop, "Y Stretch", "Stretch the Y axis of the bones to fit the curve");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "use_curve_radius", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_curve_radius", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_NO_CURVERAD);
RNA_def_property_ui_text(prop, "Use Curve Radius", "Average radius of the endpoints is used to tweak the X and Z Scaling of the bones, on top of XZ Scale mode");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "xz_scale_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "xz_scale_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "xzScaleMode");
RNA_def_property_enum_items(prop, splineik_xz_scale_mode);
RNA_def_property_ui_text(prop, "XZ Scale Mode", "Method used for determining the scaling of the X and Z axes of the bones");
@@ -2066,10 +2066,10 @@ static void rna_def_constraint_pivot(BlenderRNA *brna)
{PIVOTCON_AXIS_Z, "Z", 0, "Z Rot", "Use the pivot point in the positive rotation range around the Z-axis"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "PivotConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "PivotConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Pivot Constraint", "Rotate around a different point");
- prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -2077,30 +2077,30 @@ static void rna_def_constraint_pivot(BlenderRNA *brna)
RNA_def_struct_sdna_from(srna, "bPivotConstraint", "data");
/* target-defined pivot */
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target Object, defining the position of the pivot when defined");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
/* pivot offset */
- prop= RNA_def_property(srna, "use_relative_location", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_relative_location", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PIVOTCON_FLAG_OFFSET_ABS);
RNA_def_property_ui_text(prop, "Use Relative Offset", "Offset will be an absolute point in space instead of relative to the target");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "offset");
RNA_def_property_ui_text(prop, "Offset", "Offset of pivot from target (when set), or from owner's location (when Fixed Position is off), or the absolute pivot point");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
/* rotation-based activation */
- prop= RNA_def_property(srna, "rotation_range", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "rotation_range", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rotAxis");
RNA_def_property_enum_items(prop, pivot_rotAxis_items);
RNA_def_property_ui_text(prop, "Enabled Rotation Range", "Rotation range on which pivoting should occur");
@@ -2112,43 +2112,43 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "FollowTrackConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "FollowTrackConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Follow Track Constraint", "Lock motion to the target motion track");
RNA_def_struct_sdna_from(srna, "bFollowTrackConstraint", "data");
/* movie clip */
- prop= RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clip");
RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
/* track */
- prop= RNA_def_property(srna, "track", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "track", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "track");
RNA_def_property_ui_text(prop, "Track", "Movie tracking track to follow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
/* use default clip */
- prop= RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FOLLOWTRACK_ACTIVECLIP);
RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
/* use 3d position */
- prop= RNA_def_property(srna, "use_3d_position", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_3d_position", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FOLLOWTRACK_USE_3D_POSITION);
RNA_def_property_ui_text(prop, "3D Position", "Use 3D position of track to parent to");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
/* object */
- prop= RNA_def_property(srna, "object", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Object", "Movie tracking object to follow (if empty, camera object is used)");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
/* camera */
- prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "camera");
RNA_def_property_ui_text(prop, "Camera", "Camera to which motion is parented (if empty active scene camera is used)");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -2156,7 +2156,7 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, NULL, "rna_Constraint_followTrack_camera_set", NULL, "rna_Constraint_cameraObject_poll");
/* depth object */
- prop= RNA_def_property(srna, "depth_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "depth_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "depth_ob");
RNA_def_property_ui_text(prop, "Depth Object", "Object used to define depth in camera space by projecting onto surface of this object");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -2169,19 +2169,19 @@ static void rna_def_constraint_camera_solver(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "CameraSolverConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "CameraSolverConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Camera Solver Constraint", "Lock motion to the reconstructed camera movement");
RNA_def_struct_sdna_from(srna, "bCameraSolverConstraint", "data");
/* movie clip */
- prop= RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clip");
RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
/* use default clip */
- prop= RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAMERASOLVER_ACTIVECLIP);
RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -2192,31 +2192,31 @@ static void rna_def_constraint_object_solver(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ObjectSolverConstraint", "Constraint");
+ srna = RNA_def_struct(brna, "ObjectSolverConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Object Solver Constraint", "Lock motion to the reconstructed object movement");
RNA_def_struct_sdna_from(srna, "bObjectSolverConstraint", "data");
/* movie clip */
- prop= RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clip");
RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
/* use default clip */
- prop= RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAMERASOLVER_ACTIVECLIP);
RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
/* object */
- prop= RNA_def_property(srna, "object", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Object", "Movie tracking object to follow");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
/* camera */
- prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "camera");
RNA_def_property_ui_text(prop, "Camera", "Camera to which motion is parented (if empty active scene camera is used)");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -2231,77 +2231,77 @@ void RNA_def_constraint(BlenderRNA *brna)
PropertyRNA *prop;
/* data */
- srna= RNA_def_struct(brna, "Constraint", NULL );
+ srna = RNA_def_struct(brna, "Constraint", NULL );
RNA_def_struct_ui_text(srna, "Constraint", "Constraint modifying the transformation of objects and bones");
RNA_def_struct_refine_func(srna, "rna_ConstraintType_refine");
RNA_def_struct_path_func(srna, "rna_Constraint_path");
RNA_def_struct_sdna(srna, "bConstraint");
/* strings */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constraint_name_set");
RNA_def_property_ui_text(prop, "Name", "Constraint name");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT|NA_RENAME, NULL);
/* enums */
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, constraint_type_items);
RNA_def_property_ui_text(prop, "Type", "");
- prop= RNA_def_property(srna, "owner_space", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "owner_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ownspace");
RNA_def_property_enum_items(prop, owner_space_pchan_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_owner_space_itemf");
RNA_def_property_ui_text(prop, "Owner Space", "Space that owner is evaluated in");
- prop= RNA_def_property(srna, "target_space", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "target_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "tarspace");
RNA_def_property_enum_items(prop, target_space_pchan_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_target_space_itemf");
RNA_def_property_ui_text(prop, "Target Space", "Space that target is evaluated in");
/* flags */
- prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_OFF);
RNA_def_property_ui_text(prop, "Disable", "Enable/Disable Constraint");
- prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_EXPAND);
RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is expanded in UI");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
- // XXX this is really an internal flag, but it may be useful for some tools to be able to access this...
- prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
+ /* XXX this is really an internal flag, but it may be useful for some tools to be able to access this... */
+ prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE);
RNA_def_property_ui_text(prop, "Valid", "Constraint has valid settings and can be evaluated");
- // TODO: setting this to true must ensure that all others in stack are turned off too...
- prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ /* TODO: setting this to true must ensure that all others in stack are turned off too... */
+ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_ACTIVE);
RNA_def_property_ui_text(prop, "Active", "Constraint is the one being edited ");
- prop= RNA_def_property(srna, "is_proxy_local", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_proxy_local", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_PROXY_LOCAL);
RNA_def_property_ui_text(prop, "Proxy Local", "Constraint was added in this proxy instance (i.e. did not belong to source Armature)");
/* values */
- prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "enforce");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Influence", "Amount of influence constraint will have on the final solution");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_influence_update");
/* readonly values */
- prop= RNA_def_property(srna, "error_location", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "error_location", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "lin_error");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Lin error", "Amount of residual error in Blender space unit for constraints that work on position");
- prop= RNA_def_property(srna, "error_rotation", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "error_rotation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rot_error");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Rot error", "Amount of residual error in radiant for constraints that work on orientation");
diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c
index 043645aaf57..bd149b1f1f3 100644
--- a/source/blender/makesrna/intern/rna_context.c
+++ b/source/blender/makesrna/intern/rna_context.c
@@ -41,25 +41,25 @@
static PointerRNA rna_Context_manager_get(PointerRNA *ptr)
{
- bContext *C= (bContext*)ptr->data;
+ bContext *C = (bContext*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_WindowManager, CTX_wm_manager(C));
}
static PointerRNA rna_Context_window_get(PointerRNA *ptr)
{
- bContext *C= (bContext*)ptr->data;
+ bContext *C = (bContext*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_Window, CTX_wm_window(C));
}
static PointerRNA rna_Context_screen_get(PointerRNA *ptr)
{
- bContext *C= (bContext*)ptr->data;
+ bContext *C = (bContext*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_Screen, CTX_wm_screen(C));
}
static PointerRNA rna_Context_area_get(PointerRNA *ptr)
{
- bContext *C= (bContext*)ptr->data;
+ bContext *C = (bContext*)ptr->data;
PointerRNA newptr;
RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Area, CTX_wm_area(C), &newptr);
return newptr;
@@ -67,7 +67,7 @@ static PointerRNA rna_Context_area_get(PointerRNA *ptr)
static PointerRNA rna_Context_space_data_get(PointerRNA *ptr)
{
- bContext *C= (bContext*)ptr->data;
+ bContext *C = (bContext*)ptr->data;
PointerRNA newptr;
RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Space, CTX_wm_space_data(C), &newptr);
return newptr;
@@ -75,7 +75,7 @@ static PointerRNA rna_Context_space_data_get(PointerRNA *ptr)
static PointerRNA rna_Context_region_get(PointerRNA *ptr)
{
- bContext *C= (bContext*)ptr->data;
+ bContext *C = (bContext*)ptr->data;
PointerRNA newptr;
RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Region, CTX_wm_region(C), &newptr);
return newptr;
@@ -83,10 +83,10 @@ static PointerRNA rna_Context_region_get(PointerRNA *ptr)
static PointerRNA rna_Context_region_data_get(PointerRNA *ptr)
{
- bContext *C= (bContext*)ptr->data;
+ bContext *C = (bContext*)ptr->data;
/* only exists for one space still, no generic system yet */
- if(CTX_wm_view3d(C)) {
+ if (CTX_wm_view3d(C)) {
PointerRNA newptr;
RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_RegionView3D, CTX_wm_region_data(C), &newptr);
return newptr;
@@ -97,20 +97,20 @@ static PointerRNA rna_Context_region_data_get(PointerRNA *ptr)
static PointerRNA rna_Context_main_get(PointerRNA *ptr)
{
- bContext *C= (bContext*)ptr->data;
+ bContext *C = (bContext*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_BlendData, CTX_data_main(C));
}
static PointerRNA rna_Context_scene_get(PointerRNA *ptr)
{
- bContext *C= (bContext*)ptr->data;
+ bContext *C = (bContext*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_Scene, CTX_data_scene(C));
}
static PointerRNA rna_Context_tool_settings_get(PointerRNA *ptr)
{
- bContext *C= (bContext*)ptr->data;
- ptr->id.data= CTX_data_scene(C);
+ bContext *C = (bContext*)ptr->data;
+ ptr->id.data = CTX_data_scene(C);
return rna_pointer_inherit_refine(ptr, &RNA_ToolSettings, CTX_data_tool_settings(C));
}
@@ -123,7 +123,7 @@ static PointerRNA rna_Context_user_preferences_get(PointerRNA *UNUSED(ptr))
static int rna_Context_mode_get(PointerRNA *ptr)
{
- bContext *C= (bContext*)ptr->data;
+ bContext *C = (bContext*)ptr->data;
return CTX_data_mode_enum(C);
}
@@ -139,7 +139,7 @@ void RNA_def_context(BlenderRNA *brna)
{CTX_MODE_EDIT_CURVE, "EDIT_CURVE", 0, "Curve Edit", ""},
{CTX_MODE_EDIT_SURFACE, "EDIT_SURFACE", 0, "Surface Edit", ""},
{CTX_MODE_EDIT_TEXT, "EDIT_TEXT", 0, "Edit Edit", ""},
- {CTX_MODE_EDIT_ARMATURE, "EDIT_ARMATURE", 0, "Armature Edit", ""}, // PARSKEL reuse will give issues
+ {CTX_MODE_EDIT_ARMATURE, "EDIT_ARMATURE", 0, "Armature Edit", ""}, /* PARSKEL reuse will give issues */
{CTX_MODE_EDIT_METABALL, "EDIT_METABALL", 0, "Metaball Edit", ""},
{CTX_MODE_EDIT_LATTICE, "EDIT_LATTICE", 0, "Lattice Edit", ""},
{CTX_MODE_POSE, "POSE", 0, "Pose ", ""},
@@ -151,68 +151,68 @@ void RNA_def_context(BlenderRNA *brna)
{CTX_MODE_OBJECT, "OBJECT", 0, "Object", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Context", NULL);
+ srna = RNA_def_struct(brna, "Context", NULL);
RNA_def_struct_ui_text(srna, "Context", "Current windowmanager and data context");
RNA_def_struct_sdna(srna, "bContext");
/* WM */
- prop= RNA_def_property(srna, "window_manager", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "window_manager", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "WindowManager");
RNA_def_property_pointer_funcs(prop, "rna_Context_manager_get", NULL, NULL, NULL);
- prop= RNA_def_property(srna, "window", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "window", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Window");
RNA_def_property_pointer_funcs(prop, "rna_Context_window_get", NULL, NULL, NULL);
- prop= RNA_def_property(srna, "screen", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "screen", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Screen");
RNA_def_property_pointer_funcs(prop, "rna_Context_screen_get", NULL, NULL, NULL);
- prop= RNA_def_property(srna, "area", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "area", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Area");
RNA_def_property_pointer_funcs(prop, "rna_Context_area_get", NULL, NULL, NULL);
- prop= RNA_def_property(srna, "space_data", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "space_data", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Space");
RNA_def_property_pointer_funcs(prop, "rna_Context_space_data_get", NULL, NULL, NULL);
- prop= RNA_def_property(srna, "region", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "region", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Region");
RNA_def_property_pointer_funcs(prop, "rna_Context_region_get", NULL, NULL, NULL);
- prop= RNA_def_property(srna, "region_data", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "region_data", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "RegionView3D");
RNA_def_property_pointer_funcs(prop, "rna_Context_region_data_get", NULL, NULL, NULL);
/* Data */
- prop= RNA_def_property(srna, "blend_data", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "blend_data", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "BlendData");
RNA_def_property_pointer_funcs(prop, "rna_Context_main_get", NULL, NULL, NULL);
- prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Scene");
RNA_def_property_pointer_funcs(prop, "rna_Context_scene_get", NULL, NULL, NULL);
- prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "ToolSettings");
RNA_def_property_pointer_funcs(prop, "rna_Context_tool_settings_get", NULL, NULL, NULL);
- prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "UserPreferences");
RNA_def_property_pointer_funcs(prop, "rna_Context_user_preferences_get", NULL, NULL, NULL);
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, mode_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_funcs(prop, "rna_Context_mode_get", NULL, NULL);
diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c
index 7dfb3597a29..b066114a0cb 100644
--- a/source/blender/makesrna/intern/rna_controller.c
+++ b/source/blender/makesrna/intern/rna_controller.c
@@ -34,7 +34,7 @@
#include "DNA_object_types.h"
#include "DNA_controller_types.h"
-EnumPropertyItem controller_type_items[] ={
+EnumPropertyItem controller_type_items[] = {
{CONT_LOGIC_AND, "LOGIC_AND", 0, "And", "Logic And"},
{CONT_LOGIC_OR, "LOGIC_OR", 0, "Or", "Logic Or"},
{CONT_LOGIC_NAND, "LOGIC_NAND", 0, "Nand", "Logic Nand"},
@@ -52,9 +52,9 @@ EnumPropertyItem controller_type_items[] ={
static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr)
{
- bController *controller= (bController*)ptr->data;
+ bController *controller = (bController*)ptr->data;
- switch(controller->type) {
+ switch (controller->type) {
case CONT_LOGIC_AND:
return &RNA_AndController;
case CONT_LOGIC_OR:
@@ -78,21 +78,21 @@ static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr)
void rna_Constroller_name_set(PointerRNA *ptr, const char *value)
{
- bController *cont= (bController *)ptr->data;
+ bController *cont = (bController *)ptr->data;
BLI_strncpy_utf8(cont->name, value, sizeof(cont->name));
if (ptr->id.data) {
- Object *ob= (Object *)ptr->id.data;
+ Object *ob = (Object *)ptr->id.data;
BLI_uniquename(&ob->controllers, cont, "Controller", '.', offsetof(bController, name), sizeof(cont->name));
}
}
static void rna_Controller_type_set(struct PointerRNA *ptr, int value)
{
- bController *cont= (bController *)ptr->data;
- if (value != cont->type)
- {
+ bController *cont = (bController *)ptr->data;
+
+ if (value != cont->type) {
cont->type = value;
init_controller(cont);
}
@@ -100,13 +100,12 @@ static void rna_Controller_type_set(struct PointerRNA *ptr, int value)
static void rna_Controller_mode_set(struct PointerRNA *ptr, int value)
{
- bController *cont= (bController *)ptr->data;
- bPythonCont *pycon= (bPythonCont *)cont->data;
+ bController *cont = (bController *)ptr->data;
+ bPythonCont *pycon = (bPythonCont *)cont->data;
- // if mode changed and previous mode were Script
- if (value != pycon->mode && pycon->mode == CONT_PY_SCRIPT)
- {
- // clear script to avoid it to get linked with the controller
+ /* if mode changed and previous mode were Script */
+ if (value != pycon->mode && pycon->mode == CONT_PY_SCRIPT) {
+ /* clear script to avoid it to get linked with the controller */
pycon->text = NULL;
}
pycon->mode = value;
@@ -114,10 +113,10 @@ static void rna_Controller_mode_set(struct PointerRNA *ptr, int value)
static int rna_Controller_state_number_get(struct PointerRNA *ptr)
{
- bController *cont= (bController *)ptr->data;
+ bController *cont = (bController *)ptr->data;
int bit;
- for (bit=0; bit<32; bit++) {
+ for (bit = 0; bit<32; bit++) {
if (cont->state_mask & (1<<bit))
return bit+1;
}
@@ -126,7 +125,7 @@ static int rna_Controller_state_number_get(struct PointerRNA *ptr)
static void rna_Controller_state_number_set(struct PointerRNA *ptr, const int value)
{
- bController *cont= (bController *)ptr->data;
+ bController *cont = (bController *)ptr->data;
if (value < 1 || value > OB_MAX_STATES)
return;
@@ -148,33 +147,33 @@ static int rna_Controller_actuators_length(PointerRNA *ptr)
#if 0 /* editable is set to false, comment for now. */
static void rna_Controller_state_get(PointerRNA *ptr, int *values)
{
- bController *cont= (bController *)ptr->data;
+ bController *cont = (bController *)ptr->data;
int i;
memset(values, 0, sizeof(int)*OB_MAX_STATES);
- for(i=0; i<OB_MAX_STATES; i++)
+ for (i = 0; i<OB_MAX_STATES; i++)
values[i] = (cont->state_mask & (1<<i));
}
static void rna_Controller_state_set(PointerRNA *ptr, const int *values)
{
- bController *cont= (bController *)ptr->data;
- int i, tot= 0;
+ bController *cont = (bController *)ptr->data;
+ int i, tot = 0;
/* ensure we always have some state selected */
- for(i=0; i<OB_MAX_STATES; i++)
- if(values[i])
+ for (i = 0; i<OB_MAX_STATES; i++)
+ if (values[i])
tot++;
- if(tot==0)
+ if (tot == 0)
return;
/* only works for one state at once */
- if(tot>1)
+ if (tot>1)
return;
- for(i=0; i<OB_MAX_STATES; i++) {
- if(values[i]) cont->state_mask |= (1<<i);
+ for (i = 0; i<OB_MAX_STATES; i++) {
+ if (values[i]) cont->state_mask |= (1<<i);
else cont->state_mask &= ~(1<<i);
}
}
@@ -187,45 +186,45 @@ void RNA_def_controller(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem python_controller_modes[] ={
+ static EnumPropertyItem python_controller_modes[] = {
{CONT_PY_SCRIPT, "SCRIPT", 0, "Script", ""},
{CONT_PY_MODULE, "MODULE", 0, "Module", ""},
{0, NULL, 0, NULL, NULL}};
/* Controller */
- srna= RNA_def_struct(brna, "Controller", NULL);
+ srna = RNA_def_struct(brna, "Controller", NULL);
RNA_def_struct_sdna(srna, "bController");
RNA_def_struct_refine_func(srna, "rna_Controller_refine");
RNA_def_struct_ui_text(srna, "Controller", "Game engine logic brick to process events, connecting sensors to actuators");
RNA_api_controller(srna);
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constroller_name_set");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_type_set", NULL);
RNA_def_property_enum_items(prop, controller_type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_SHOW);
RNA_def_property_ui_text(prop, "Expanded", "Set controller expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_priority", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_priority", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PRIO);
RNA_def_property_ui_text(prop, "Priority", "Mark controller for execution before all non-marked controllers (good for startup scripts)");
RNA_def_property_ui_icon(prop, ICON_BOOKMARKS, 1);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "links", NULL);
RNA_def_property_struct_type(prop, "Actuator");
RNA_def_property_ui_text(prop, "Actuators", "The list containing the actuators connected to the controller");
@@ -233,16 +232,16 @@ void RNA_def_controller(BlenderRNA *brna)
/* State */
- // array of OB_MAX_STATES
- //prop= RNA_def_property(srna, "states", PROP_BOOLEAN, PROP_LAYER_MEMBER);
- //RNA_def_property_array(prop, OB_MAX_STATES);
- //RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- //RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)");
- //RNA_def_property_boolean_funcs(prop, "rna_Controller_state_get", "rna_Controller_state_set");
- //RNA_def_property_update(prop, NC_LOGIC, NULL);
-
- // number of the state
- prop= RNA_def_property(srna, "states", PROP_INT, PROP_UNSIGNED);
+ /* array of OB_MAX_STATES */
+ /*prop= RNA_def_property(srna, "states", PROP_BOOLEAN, PROP_LAYER_MEMBER); */
+ /*RNA_def_property_array(prop, OB_MAX_STATES); */
+ /*RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
+ /*RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)"); */
+ /*RNA_def_property_boolean_funcs(prop, "rna_Controller_state_get", "rna_Controller_state_set"); */
+ /*RNA_def_property_update(prop, NC_LOGIC, NULL); */
+
+ /* number of the state */
+ prop = RNA_def_property(srna, "states", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "state_mask");
RNA_def_property_range(prop, 1, OB_MAX_STATES);
RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)");
@@ -250,58 +249,58 @@ void RNA_def_controller(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Expression Controller */
- srna= RNA_def_struct(brna, "ExpressionController", "Controller");
+ srna = RNA_def_struct(brna, "ExpressionController", "Controller");
RNA_def_struct_sdna_from(srna, "bExpressionCont", "data");
RNA_def_struct_ui_text(srna, "Expression Controller", "Controller passing on events based on the evaluation of an expression");
- prop= RNA_def_property(srna, "expression", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "expression", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "str");
RNA_def_property_ui_text(prop, "Expression", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Python Controller */
- srna= RNA_def_struct(brna, "PythonController", "Controller" );
+ srna = RNA_def_struct(brna, "PythonController", "Controller" );
RNA_def_struct_sdna_from(srna, "bPythonCont", "data");
RNA_def_struct_ui_text(srna, "Python Controller", "Controller executing a python script");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, python_controller_modes);
RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_mode_set", NULL);
RNA_def_property_ui_text(prop, "Execution Method", "Python script type (textblock or module - faster)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Text");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Text", "Text datablock with the python script");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Module", "Module name and function to run, e.g. \"someModule.main\" (internal texts and external python files can be used)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_debug", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_debug", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PY_DEBUG);
RNA_def_property_ui_text(prop, "D", "Continuously reload the module from disk for editing external modules without restarting");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Other Controllers */
- srna= RNA_def_struct(brna, "AndController", "Controller");
+ srna = RNA_def_struct(brna, "AndController", "Controller");
RNA_def_struct_ui_text(srna, "And Controller", "Controller passing on events based on a logical AND operation");
- srna= RNA_def_struct(brna, "OrController", "Controller");
+ srna = RNA_def_struct(brna, "OrController", "Controller");
RNA_def_struct_ui_text(srna, "Or Controller", "Controller passing on events based on a logical OR operation");
- srna= RNA_def_struct(brna, "NorController", "Controller");
+ srna = RNA_def_struct(brna, "NorController", "Controller");
RNA_def_struct_ui_text(srna, "Nor Controller", "Controller passing on events based on a logical NOR operation");
- srna= RNA_def_struct(brna, "NandController", "Controller");
+ srna = RNA_def_struct(brna, "NandController", "Controller");
RNA_def_struct_ui_text(srna, "Nand Controller", "Controller passing on events based on a logical NAND operation");
- srna= RNA_def_struct(brna, "XorController", "Controller");
+ srna = RNA_def_struct(brna, "XorController", "Controller");
RNA_def_struct_ui_text(srna, "Xor Controller", "Controller passing on events based on a logical XOR operation");
- srna= RNA_def_struct(brna, "XnorController", "Controller");
+ srna = RNA_def_struct(brna, "XnorController", "Controller");
RNA_def_struct_ui_text(srna, "Xnor Controller", "Controller passing on events based on a logical XNOR operation");
}
diff --git a/source/blender/makesrna/intern/rna_controller_api.c b/source/blender/makesrna/intern/rna_controller_api.c
index 5f766e28005..3c517868baf 100644
--- a/source/blender/makesrna/intern/rna_controller_api.c
+++ b/source/blender/makesrna/intern/rna_controller_api.c
@@ -44,17 +44,17 @@
static void rna_Controller_link(bController *cont, bSensor *sens, bActuator *act)
{
- if(sens)
+ if (sens)
link_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks, sizeof(bController *));
- if(act)
+ if (act)
link_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks, sizeof(bActuator *));
}
static void rna_Controller_unlink(bController *cont, bSensor *sens, bActuator *act)
{
- if(sens)
+ if (sens)
unlink_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks);
- if(act)
+ if (act)
unlink_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks);
}
@@ -65,18 +65,18 @@ void RNA_api_controller(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "link", "rna_Controller_link");
+ func = RNA_def_function(srna, "link", "rna_Controller_link");
RNA_def_function_ui_description(func, "Link the controller with a sensor/actuator");
- parm= RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to link the controller to");
+ parm = RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to link the controller to");
RNA_def_property_update(parm, NC_LOGIC, NULL);
- parm= RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to link the controller to");
+ parm = RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to link the controller to");
RNA_def_property_update(parm, NC_LOGIC, NULL);
- func= RNA_def_function(srna, "unlink", "rna_Controller_unlink");
+ func = RNA_def_function(srna, "unlink", "rna_Controller_unlink");
RNA_def_function_ui_description(func, "Unlink the controller from a sensor/actuator");
- parm= RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to unlink the controller from");
+ parm = RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to unlink the controller from");
RNA_def_property_update(parm, NC_LOGIC, NULL);
- parm= RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to unlink the controller from");
+ parm = RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to unlink the controller from");
RNA_def_property_update(parm, NC_LOGIC, NULL);
}
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 91d3c3a0d3f..dbd0320bd2f 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -72,14 +72,14 @@ EnumPropertyItem curve_type_items[] = {
{CU_NURBS, "NURBS", 0, "Ease", ""},
{0, NULL, 0, NULL, NULL}};
-static const EnumPropertyItem curve3d_fill_mode_items[]= {
+static const EnumPropertyItem curve3d_fill_mode_items[] = {
{0, "FULL", 0, "Full", ""},
{CU_BACK, "BACK", 0, "Back", ""},
{CU_FRONT, "FRONT", 0, "Front", ""},
{CU_FRONT|CU_BACK, "HALF", 0, "Half", ""},
{0, NULL, 0, NULL, NULL}};
-static const EnumPropertyItem curve2d_fill_mode_items[]= {
+static const EnumPropertyItem curve2d_fill_mode_items[] = {
{0, "NONE", 0, "None", ""},
{CU_BACK, "BACK", 0, "Back", ""},
{CU_FRONT, "FRONT", 0, "Front", ""},
@@ -105,31 +105,31 @@ static const EnumPropertyItem curve2d_fill_mode_items[]= {
/* highly irritating but from RNA we cant know this */
static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index, int *pt_index)
{
- ListBase *nurbs= BKE_curve_nurbs(cu);
+ ListBase *nurbs = BKE_curve_nurbs(cu);
Nurb *nu;
- int i= 0;
+ int i = 0;
- for(nu= nurbs->first; nu; nu= nu->next, i++) {
- if(nu->type == CU_BEZIER) {
- if(point >= (void *)nu->bezt && point < (void *)(nu->bezt + nu->pntsu)) {
+ for (nu = nurbs->first; nu; nu = nu->next, i++) {
+ if (nu->type == CU_BEZIER) {
+ if (point >= (void *)nu->bezt && point < (void *)(nu->bezt + nu->pntsu)) {
break;
}
}
else {
- if(point >= (void *)nu->bp && point < (void *)(nu->bp + (nu->pntsu * nu->pntsv))) {
+ if (point >= (void *)nu->bp && point < (void *)(nu->bp + (nu->pntsu * nu->pntsv))) {
break;
}
}
}
- if(nu) {
- if(nu_index) {
- *nu_index= i;
+ if (nu) {
+ if (nu_index) {
+ *nu_index = i;
}
- if(pt_index) {
- if(nu->type == CU_BEZIER) *pt_index= (int)((BezTriple *)point - nu->bezt);
- else *pt_index= (int)((BPoint *)point - nu->bp);
+ if (pt_index) {
+ if (nu->type == CU_BEZIER) *pt_index = (int)((BezTriple *)point - nu->bezt);
+ else *pt_index = (int)((BPoint *)point - nu->bp);
}
}
@@ -138,71 +138,71 @@ static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index,
static StructRNA *rna_Curve_refine(PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->data;
- short obtype= curve_type(cu);
+ Curve *cu = (Curve*)ptr->data;
+ short obtype = curve_type(cu);
- if(obtype == OB_FONT) return &RNA_TextCurve;
- else if(obtype == OB_SURF) return &RNA_SurfaceCurve;
+ if (obtype == OB_FONT) return &RNA_TextCurve;
+ else if (obtype == OB_SURF) return &RNA_SurfaceCurve;
else return &RNA_Curve;
}
static void rna_BezTriple_handle1_get(PointerRNA *ptr, float *values)
{
- BezTriple *bt= (BezTriple*)ptr->data;
+ BezTriple *bt = (BezTriple*)ptr->data;
- values[0]= bt->vec[0][0];
- values[1]= bt->vec[0][1];
- values[2]= bt->vec[0][2];
+ values[0] = bt->vec[0][0];
+ values[1] = bt->vec[0][1];
+ values[2] = bt->vec[0][2];
}
static void rna_BezTriple_handle1_set(PointerRNA *ptr, const float *values)
{
- BezTriple *bt= (BezTriple*)ptr->data;
+ BezTriple *bt = (BezTriple*)ptr->data;
- bt->vec[0][0]= values[0];
- bt->vec[0][1]= values[1];
- bt->vec[0][2]= values[2];
+ bt->vec[0][0] = values[0];
+ bt->vec[0][1] = values[1];
+ bt->vec[0][2] = values[2];
}
static void rna_BezTriple_handle2_get(PointerRNA *ptr, float *values)
{
- BezTriple *bt= (BezTriple*)ptr->data;
+ BezTriple *bt = (BezTriple*)ptr->data;
- values[0]= bt->vec[2][0];
- values[1]= bt->vec[2][1];
- values[2]= bt->vec[2][2];
+ values[0] = bt->vec[2][0];
+ values[1] = bt->vec[2][1];
+ values[2] = bt->vec[2][2];
}
static void rna_BezTriple_handle2_set(PointerRNA *ptr, const float *values)
{
- BezTriple *bt= (BezTriple*)ptr->data;
+ BezTriple *bt = (BezTriple*)ptr->data;
- bt->vec[2][0]= values[0];
- bt->vec[2][1]= values[1];
- bt->vec[2][2]= values[2];
+ bt->vec[2][0] = values[0];
+ bt->vec[2][1] = values[1];
+ bt->vec[2][2] = values[2];
}
static void rna_BezTriple_ctrlpoint_get(PointerRNA *ptr, float *values)
{
- BezTriple *bt= (BezTriple*)ptr->data;
+ BezTriple *bt = (BezTriple*)ptr->data;
- values[0]= bt->vec[1][0];
- values[1]= bt->vec[1][1];
- values[2]= bt->vec[1][2];
+ values[0] = bt->vec[1][0];
+ values[1] = bt->vec[1][1];
+ values[2] = bt->vec[1][2];
}
static void rna_BezTriple_ctrlpoint_set(PointerRNA *ptr, const float *values)
{
- BezTriple *bt= (BezTriple*)ptr->data;
+ BezTriple *bt = (BezTriple*)ptr->data;
- bt->vec[1][0]= values[0];
- bt->vec[1][1]= values[1];
- bt->vec[1][2]= values[2];
+ bt->vec[1][0] = values[0];
+ bt->vec[1][1] = values[1];
+ bt->vec[1][2] = values[2];
}
static void rna_Curve_texspace_set(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->data;
+ Curve *cu = (Curve*)ptr->data;
if (cu->texflag & CU_AUTOSPACE)
tex_space_curve(cu);
@@ -210,13 +210,13 @@ static void rna_Curve_texspace_set(Main *UNUSED(bmain), Scene *UNUSED(scene), Po
static int rna_Curve_texspace_editable(PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->data;
+ Curve *cu = (Curve*)ptr->data;
return (cu->texflag & CU_AUTOSPACE)? 0: PROP_EDITABLE;
}
static void rna_Curve_texspace_loc_get(PointerRNA *ptr, float *values)
{
- Curve *cu= (Curve *)ptr->data;
+ Curve *cu = (Curve *)ptr->data;
if (!cu->bb)
tex_space_curve(cu);
@@ -226,14 +226,14 @@ static void rna_Curve_texspace_loc_get(PointerRNA *ptr, float *values)
static void rna_Curve_texspace_loc_set(PointerRNA *ptr, const float *values)
{
- Curve *cu= (Curve *)ptr->data;
+ Curve *cu = (Curve *)ptr->data;
copy_v3_v3(cu->loc, values);
}
static void rna_Curve_texspace_size_get(PointerRNA *ptr, float *values)
{
- Curve *cu= (Curve *)ptr->data;
+ Curve *cu = (Curve *)ptr->data;
if (!cu->bb)
tex_space_curve(cu);
@@ -243,32 +243,32 @@ static void rna_Curve_texspace_size_get(PointerRNA *ptr, float *values)
static void rna_Curve_texspace_size_set(PointerRNA *ptr, const float *values)
{
- Curve *cu= (Curve *)ptr->data;
+ Curve *cu = (Curve *)ptr->data;
copy_v3_v3(cu->size, values);
}
static void rna_Curve_material_index_range(PointerRNA *ptr, int *min, int *max)
{
- Curve *cu= (Curve*)ptr->id.data;
- *min= 0;
- *max= cu->totcol-1;
- *max= MAX2(0, *max);
+ Curve *cu = (Curve*)ptr->id.data;
+ *min = 0;
+ *max = cu->totcol-1;
+ *max = MAX2(0, *max);
}
static void rna_Curve_active_textbox_index_range(PointerRNA *ptr, int *min, int *max)
{
- Curve *cu= (Curve*)ptr->id.data;
- *min= 0;
- *max= cu->totbox-1;
- *max= MAX2(0, *max);
+ Curve *cu = (Curve*)ptr->id.data;
+ *min = 0;
+ *max = cu->totbox-1;
+ *max = MAX2(0, *max);
}
static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
{
- Curve *cu= (Curve*)ptr->id.data;
- if(value==CU_3D) cu->flag |= CU_3D;
+ Curve *cu = (Curve*)ptr->id.data;
+ if (value == CU_3D) cu->flag |= CU_3D;
else cu->flag &= ~CU_3D;
update_curve_dimension(cu);
@@ -276,7 +276,7 @@ static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
- Curve *cu= (Curve*)ptr->id.data;
+ Curve *cu = (Curve*)ptr->id.data;
/* cast to quiet warning it IS a const still */
return (EnumPropertyItem *)((cu->flag & CU_3D) ? curve3d_fill_mode_items : curve2d_fill_mode_items);
@@ -284,20 +284,20 @@ static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerR
static int rna_Nurb_length(PointerRNA *ptr)
{
- Nurb *nu= (Nurb*)ptr->data;
- if(nu->type == CU_BEZIER) return 0;
+ Nurb *nu = (Nurb*)ptr->data;
+ if (nu->type == CU_BEZIER) return 0;
return nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu;
}
static void rna_Nurb_type_set(PointerRNA *ptr, int value)
{
- Nurb *nu= (Nurb*)ptr->data;
+ Nurb *nu = (Nurb*)ptr->data;
ED_nurb_set_spline_type(nu, value);
}
static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Nurb *nu= (Nurb*)ptr->data;
+ Nurb *nu = (Nurb*)ptr->data;
rna_iterator_array_begin(iter, (void*)nu->bp, sizeof(BPoint), nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu, 0, NULL);
}
@@ -320,10 +320,10 @@ static void rna_Curve_update_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Curve_update_points(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->id.data;
- Nurb *nu= curve_nurb_from_point(cu, ptr->data, NULL, NULL);
+ Curve *cu = (Curve*)ptr->id.data;
+ Nurb *nu = curve_nurb_from_point(cu, ptr->data, NULL, NULL);
- if(nu)
+ if (nu)
calchandlesNurb(nu);
rna_Curve_update_data(bmain, scene, ptr);
@@ -331,10 +331,10 @@ static void rna_Curve_update_points(Main *bmain, Scene *scene, PointerRNA *ptr)
static PointerRNA rna_Curve_bevelObject_get(PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->id.data;
- Object *ob= cu->bevobj;
+ Curve *cu = (Curve*)ptr->id.data;
+ Object *ob = cu->bevobj;
- if(ob)
+ if (ob)
return rna_pointer_inherit_refine(ptr, &RNA_Object, ob);
return rna_pointer_inherit_refine(ptr, NULL, NULL);
@@ -342,8 +342,8 @@ static PointerRNA rna_Curve_bevelObject_get(PointerRNA *ptr)
static void rna_Curve_bevelObject_set(PointerRNA *ptr, PointerRNA value)
{
- Curve *cu= (Curve*)ptr->id.data;
- Object *ob= (Object*)value.data;
+ Curve *cu = (Curve*)ptr->id.data;
+ Object *ob = (Object*)value.data;
if (ob) {
/* if bevel object has got the save curve, as object, for which it's */
@@ -358,8 +358,8 @@ static void rna_Curve_bevelObject_set(PointerRNA *ptr, PointerRNA value)
static int rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value)
{
- Curve *cu= (Curve*)ptr->id.data;
- Object *ob= (Object*)value.data;
+ Curve *cu = (Curve*)ptr->id.data;
+ Object *ob = (Object*)value.data;
if (ob) {
if (ob->type == OB_CURVE && ob->data != cu) {
@@ -372,10 +372,10 @@ static int rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value)
static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->id.data;
- Object *ob= cu->taperobj;
+ Curve *cu = (Curve*)ptr->id.data;
+ Object *ob = cu->taperobj;
- if(ob)
+ if (ob)
return rna_pointer_inherit_refine(ptr, &RNA_Object, ob);
return rna_pointer_inherit_refine(ptr, NULL, NULL);
@@ -383,8 +383,8 @@ static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr)
static void rna_Curve_taperObject_set(PointerRNA *ptr, PointerRNA value)
{
- Curve *cu= (Curve*)ptr->id.data;
- Object *ob= (Object*)value.data;
+ Curve *cu = (Curve*)ptr->id.data;
+ Object *ob = (Object*)value.data;
if (ob) {
/* if taper object has got the save curve, as object, for which it's */
@@ -399,13 +399,13 @@ static void rna_Curve_taperObject_set(PointerRNA *ptr, PointerRNA value)
static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->id.data;
- ListBase *nurbs= BKE_curve_nurbs(cu);
- Nurb *nu= nurbs->first;
+ Curve *cu = (Curve*)ptr->id.data;
+ ListBase *nurbs = BKE_curve_nurbs(cu);
+ Nurb *nu = nurbs->first;
- while(nu) {
- nu->resolu= cu->resolu;
- nu= nu->next;
+ while (nu) {
+ nu->resolu = cu->resolu;
+ nu = nu->next;
}
rna_Curve_update_data(bmain, scene, ptr);
@@ -413,14 +413,14 @@ static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, Pointe
static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->id.data;
- ListBase *nurbs= BKE_curve_nurbs(cu);
- Nurb *nu=nurbs->first;
+ Curve *cu = (Curve*)ptr->id.data;
+ ListBase *nurbs = BKE_curve_nurbs(cu);
+ Nurb *nu = nurbs->first;
- while(nu) {
- nu->resolv= cu->resolv;
- nu= nu->next;
+ while (nu) {
+ nu->resolv = cu->resolv;
+ nu = nu->next;
}
rna_Curve_update_data(bmain, scene, ptr);
@@ -428,52 +428,52 @@ static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, Pointe
static float rna_Curve_offset_get(PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->id.data;
+ Curve *cu = (Curve*)ptr->id.data;
return cu->width - 1.0f;
}
static void rna_Curve_offset_set(PointerRNA *ptr, float value)
{
- Curve *cu= (Curve*)ptr->id.data;
- cu->width= 1.0f + value;
+ Curve *cu = (Curve*)ptr->id.data;
+ cu->width = 1.0f + value;
}
/* name functions that ignore the first two ID characters */
void rna_Curve_body_get(PointerRNA *ptr, char *value)
{
- Curve *cu= (Curve*)ptr->id.data;
+ Curve *cu = (Curve*)ptr->id.data;
BLI_strncpy(value, cu->str, cu->len+1);
}
int rna_Curve_body_length(PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->id.data;
+ Curve *cu = (Curve*)ptr->id.data;
return cu->len;
}
/* TODO - check UTF & python play nice */
void rna_Curve_body_set(PointerRNA *ptr, const char *value)
{
- int len= strlen(value);
- Curve *cu= (Curve*)ptr->id.data;
+ int len = strlen(value);
+ Curve *cu = (Curve*)ptr->id.data;
- cu->len= cu->pos = len;
+ cu->len = cu->pos = len;
- if(cu->str) MEM_freeN(cu->str);
- if(cu->strinfo) MEM_freeN(cu->strinfo);
+ if (cu->str) MEM_freeN(cu->str);
+ if (cu->strinfo) MEM_freeN(cu->strinfo);
cu->str = MEM_callocN(len + sizeof(wchar_t), "str");
cu->strinfo = MEM_callocN( (len+4) *sizeof(CharInfo), "strinfo"); /* don't know why this is +4, just duplicating load_editText() */
- //BLI_strncpy_wchar_as_utf8(cu->str, value, len+1); // value is not wchar_t
+ /*BLI_strncpy_wchar_as_utf8(cu->str, value, len+1); *//* value is not wchar_t */
BLI_strncpy(cu->str, value, len+1);
}
static void rna_Nurb_update_cyclic_u(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Nurb *nu= (Nurb*)ptr->data;
+ Nurb *nu = (Nurb*)ptr->data;
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
calchandlesNurb(nu);
} else {
nurbs_knot_calc_u(nu);
@@ -484,7 +484,7 @@ static void rna_Nurb_update_cyclic_u(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Nurb_update_cyclic_v(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Nurb *nu= (Nurb*)ptr->data;
+ Nurb *nu = (Nurb*)ptr->data;
nurbs_knot_calc_v(nu);
@@ -493,7 +493,7 @@ static void rna_Nurb_update_cyclic_v(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Nurb_update_knot_u(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Nurb *nu= (Nurb*)ptr->data;
+ Nurb *nu = (Nurb*)ptr->data;
clamp_nurb_order_u(nu);
nurbs_knot_calc_u(nu);
@@ -503,7 +503,7 @@ static void rna_Nurb_update_knot_u(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Nurb_update_knot_v(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Nurb *nu= (Nurb*)ptr->data;
+ Nurb *nu = (Nurb*)ptr->data;
clamp_nurb_order_v(nu);
nurbs_knot_calc_v(nu);
@@ -513,11 +513,11 @@ static void rna_Nurb_update_knot_v(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Curve_spline_points_add(ID *id, Nurb *nu, ReportList *reports, int number)
{
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
BKE_report(reports, RPT_ERROR, "Bezier spline can't have points added");
}
- else if(number==0) {
- // do nothing
+ else if (number == 0) {
+ /* do nothing */
} else {
addNurbPoints(nu, number);
@@ -531,11 +531,11 @@ static void rna_Curve_spline_points_add(ID *id, Nurb *nu, ReportList *reports, i
static void rna_Curve_spline_bezpoints_add(ID *id, Nurb *nu, ReportList *reports, int number)
{
- if(nu->type != CU_BEZIER) {
+ if (nu->type != CU_BEZIER) {
BKE_report(reports, RPT_ERROR, "Only Bezier splines can be added");
}
- else if(number==0) {
- // do nothing
+ else if (number == 0) {
+ /* do nothing */
} else {
addNurbPointsBezier(nu, number);
@@ -548,26 +548,26 @@ static void rna_Curve_spline_bezpoints_add(ID *id, Nurb *nu, ReportList *reports
static Nurb *rna_Curve_spline_new(Curve *cu, int type)
{
- Nurb *nu= ( Nurb * ) MEM_callocN( sizeof( Nurb ), "spline.new" );
+ Nurb *nu = ( Nurb * ) MEM_callocN( sizeof( Nurb ), "spline.new" );
- if(type==CU_BEZIER) {
- BezTriple *bezt= (BezTriple *)MEM_callocN(sizeof(BezTriple), "spline.new.bezt");
- bezt->radius= 1.0;
- nu->bezt= bezt;
+ if (type == CU_BEZIER) {
+ BezTriple *bezt = (BezTriple *)MEM_callocN(sizeof(BezTriple), "spline.new.bezt");
+ bezt->radius = 1.0;
+ nu->bezt = bezt;
}
else {
- BPoint *bp= (BPoint *)MEM_callocN(sizeof(BPoint), "spline.new.bp");
- bp->radius= 1.0f;
- nu->bp= bp;
+ BPoint *bp = (BPoint *)MEM_callocN(sizeof(BPoint), "spline.new.bp");
+ bp->radius = 1.0f;
+ nu->bp = bp;
}
- nu->type= type;
- nu->pntsu= 1;
- nu->pntsv= 1;
+ nu->type = type;
+ nu->pntsu = 1;
+ nu->pntsv = 1;
- nu->orderu= nu->orderv= 4;
- nu->resolu= nu->resolv= 12;
- nu->flag= CU_SMOOTH;
+ nu->orderu = nu->orderv = 4;
+ nu->resolu = nu->resolv = 12;
+ nu->flag = CU_SMOOTH;
BLI_addtail(BKE_curve_nurbs(cu), nu);
@@ -576,12 +576,12 @@ static Nurb *rna_Curve_spline_new(Curve *cu, int type)
static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, Nurb *nu)
{
- int found= 0;
- ListBase *nurbs= BKE_curve_nurbs(cu);
+ int found = 0;
+ ListBase *nurbs = BKE_curve_nurbs(cu);
- found= BLI_remlink_safe(nurbs, nu);
+ found = BLI_remlink_safe(nurbs, nu);
- if(!found) {
+ if (!found) {
BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" does not contain spline given", cu->id.name+2);
return;
}
@@ -595,7 +595,7 @@ static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, Nurb *nu)
static void rna_Curve_spline_clear(Curve *cu)
{
- ListBase *nurbs= BKE_curve_nurbs(cu);
+ ListBase *nurbs = BKE_curve_nurbs(cu);
freeNurblist(nurbs);
@@ -605,14 +605,14 @@ static void rna_Curve_spline_clear(Curve *cu)
static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->data;
+ Curve *cu = (Curve*)ptr->data;
Nurb *nu;
- ListBase *nurbs= BKE_curve_nurbs(cu);
+ ListBase *nurbs = BKE_curve_nurbs(cu);
- // for curve outside editmode will set to -1, should be changed to be allowed outside of editmode.
- nu= BLI_findlink(nurbs, cu->actnu);
+ /* for curve outside editmode will set to -1, should be changed to be allowed outside of editmode. */
+ nu = BLI_findlink(nurbs, cu->actnu);
- if(nu)
+ if (nu)
return rna_pointer_inherit_refine(ptr, &RNA_Spline, nu);
return rna_pointer_inherit_refine(ptr, NULL, NULL);
@@ -620,23 +620,23 @@ static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr)
static void rna_Curve_active_spline_set(PointerRNA *ptr, PointerRNA value)
{
- Curve *cu= (Curve*)ptr->data;
- Nurb *nu= value.data;
- ListBase *nubase= BKE_curve_nurbs(cu);
+ Curve *cu = (Curve*)ptr->data;
+ Nurb *nu = value.data;
+ ListBase *nubase = BKE_curve_nurbs(cu);
/* -1 is ok for an unset index */
- if(nu==NULL)
- cu->actnu= -1;
+ if (nu == NULL)
+ cu->actnu = -1;
else
- cu->actnu= BLI_findindex(nubase, nu);
+ cu->actnu = BLI_findindex(nubase, nu);
}
static char *rna_Curve_spline_path(PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->id.data;
- ListBase *nubase= BKE_curve_nurbs(cu);
- Nurb *nu= ptr->data;
- int index= BLI_findindex(nubase, nu);
+ Curve *cu = (Curve*)ptr->id.data;
+ ListBase *nubase = BKE_curve_nurbs(cu);
+ Nurb *nu = ptr->data;
+ int index = BLI_findindex(nubase, nu);
if (index >= 0)
return BLI_sprintfN("splines[%d]", index);
@@ -647,20 +647,20 @@ static char *rna_Curve_spline_path(PointerRNA *ptr)
/* use for both bezier and nurbs */
static char *rna_Curve_spline_point_path(PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->id.data;
+ Curve *cu = (Curve*)ptr->id.data;
Nurb *nu;
- void *point= ptr->data;
+ void *point = ptr->data;
int nu_index, pt_index;
- nu= curve_nurb_from_point(cu, point, &nu_index, &pt_index);
+ nu = curve_nurb_from_point(cu, point, &nu_index, &pt_index);
if (nu) {
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
return BLI_sprintfN("splines[%d].bezier_points[%d]", nu_index, pt_index);
}
else {
return BLI_sprintfN("splines[%d].points[%d]", nu_index, pt_index);
- }
+ }
}
else {
return BLI_strdup("");
@@ -670,9 +670,9 @@ static char *rna_Curve_spline_point_path(PointerRNA *ptr)
static char *rna_TextBox_path(PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->id.data;
- TextBox *tb= ptr->data;
- int index= (int)(tb - cu->tb);
+ Curve *cu = (Curve*)ptr->id.data;
+ TextBox *tb = ptr->data;
+ int index = (int)(tb - cu->tb);
if (index >= 0 && index < cu->totbox)
return BLI_sprintfN("text_boxes[%d]", index);
@@ -682,7 +682,7 @@ static char *rna_TextBox_path(PointerRNA *ptr)
static void rna_Curve_splines_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Curve *cu= (Curve*)ptr->id.data;
+ Curve *cu = (Curve*)ptr->id.data;
rna_iterator_listbase_begin(iter, BKE_curve_nurbs(cu), NULL);
}
@@ -693,47 +693,47 @@ static void rna_def_bpoint(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SplinePoint", NULL);
+ srna = RNA_def_struct(brna, "SplinePoint", NULL);
RNA_def_struct_sdna(srna, "BPoint");
RNA_def_struct_ui_text(srna, "SplinePoint", "Spline point without handles");
/* Boolean values */
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
RNA_def_property_ui_text(prop, "Select", "Selection status");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "hide", 0);
RNA_def_property_ui_text(prop, "Hide", "Visibility status");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Vector value */
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_ui_text(prop, "Point", "Point coordinates");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vec[3]");
RNA_def_property_ui_text(prop, "Weight", "NURBS weight");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Number values */
- prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alfa");
/*RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);*/
RNA_def_property_ui_text(prop, "Tilt", "Tilt in 3D View");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "weight_softbody", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "weight_softbody", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight");
RNA_def_property_range(prop, 0.01f, 100.0f);
RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "radius");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for bevelling");
@@ -747,76 +747,76 @@ static void rna_def_beztriple(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "BezierSplinePoint", NULL);
+ srna = RNA_def_struct(brna, "BezierSplinePoint", NULL);
RNA_def_struct_sdna(srna, "BezTriple");
RNA_def_struct_ui_text(srna, "Bezier Curve Point", "Bezier curve point with two handles");
/* Boolean values */
- prop= RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
RNA_def_property_ui_text(prop, "Handle 1 selected", "Handle 1 selection status");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f3", 0);
RNA_def_property_ui_text(prop, "Handle 2 selected", "Handle 2 selection status");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "select_control_point", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_control_point", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f2", 0);
RNA_def_property_ui_text(prop, "Control Point selected", "Control point selection status");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "hide", 0);
RNA_def_property_ui_text(prop, "Hide", "Visibility status");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Enums */
- prop= RNA_def_property(srna, "handle_left_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "handle_left_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "h1");
RNA_def_property_enum_items(prop, beztriple_handle_type_items);
RNA_def_property_ui_text(prop, "Handle 1 Type", "Handle types");
RNA_def_property_update(prop, 0, "rna_Curve_update_points");
- prop= RNA_def_property(srna, "handle_right_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "handle_right_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "h2");
RNA_def_property_enum_items(prop, beztriple_handle_type_items);
RNA_def_property_ui_text(prop, "Handle 2 Type", "Handle types");
RNA_def_property_update(prop, 0, "rna_Curve_update_points");
/* Vector values */
- prop= RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_BezTriple_handle1_get", "rna_BezTriple_handle1_set", NULL);
RNA_def_property_ui_text(prop, "Handle 1", "Coordinates of the first handle");
RNA_def_property_update(prop, 0, "rna_Curve_update_points");
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_BezTriple_ctrlpoint_get", "rna_BezTriple_ctrlpoint_set", NULL);
RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point");
RNA_def_property_update(prop, 0, "rna_Curve_update_points");
- prop= RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_BezTriple_handle2_get", "rna_BezTriple_handle2_set", NULL);
RNA_def_property_ui_text(prop, "Handle 2", "Coordinates of the second handle");
RNA_def_property_update(prop, 0, "rna_Curve_update_points");
/* Number values */
- prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alfa");
/*RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);*/
RNA_def_property_ui_text(prop, "Tilt", "Tilt in 3D View");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01f, 100.0f);
RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "radius");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for bevelling");
@@ -830,41 +830,41 @@ static void rna_def_path(BlenderRNA *brna, StructRNA *srna)
PropertyRNA *prop;
/* number values */
- prop= RNA_def_property(srna, "path_duration", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "path_duration", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "pathlen");
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_ui_text(prop, "Path Length", "The number of frames that are needed to traverse the path, defining the maximum value for the 'Evaluation Time' setting");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* flags */
- prop= RNA_def_property(srna, "use_path", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_path", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_PATH);
RNA_def_property_ui_text(prop, "Path", "Enable the curve to become a translation path");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "use_path_follow", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_path_follow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FOLLOW);
RNA_def_property_ui_text(prop, "Follow", "Make curve path children to rotate along the path");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_STRETCH);
RNA_def_property_ui_text(prop, "Stretch", "Option for curve-deform: "
"make deformed child to stretch along entire path");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "use_deform_bounds", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_deform_bounds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CU_DEFORM_BOUNDS_OFF);
RNA_def_property_ui_text(prop, "Bounds Clamp", "Option for curve-deform: "
"Use the mesh bounds to clamp the deformation");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "use_time_offset", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_time_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_OFFS_PATHDIST);
RNA_def_property_ui_text(prop, "Offset Path Distance", "Children will use TimeOffs value as path distance offset");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "use_radius", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_radius", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_PATH_RADIUS);
RNA_def_property_ui_text(prop, "Radius", "Option for paths and curve-deform: "
"apply the curve radius with path following it and deforming");
@@ -876,7 +876,7 @@ static void rna_def_nurbs(BlenderRNA *brna, StructRNA *srna)
PropertyRNA *prop;
/* flags */
- prop= RNA_def_property(srna, "use_uv_as_generated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_uv_as_generated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO);
RNA_def_property_ui_text(prop, "Use UV for Mapping", "Uses the UV values as Generated textured coordinates");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
@@ -895,141 +895,141 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
{0, NULL, 0, NULL, NULL}};
/* Enums */
- prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "spacemode");
RNA_def_property_enum_items(prop, prop_align_items);
RNA_def_property_ui_text(prop, "Text Align", "Text align from the object center");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* number values */
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fsize");
RNA_def_property_range(prop, 0.0001f, 10000.0f);
RNA_def_property_ui_range(prop, 0.01, 10, 1, 3);
RNA_def_property_ui_text(prop, "Font size", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "small_caps_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "small_caps_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "smallcaps_scale");
RNA_def_property_ui_range(prop, 0, 1.0, 1, 2);
RNA_def_property_ui_text(prop, "Small Caps", "Scale of small capitals");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "space_line", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "space_line", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "linedist");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Distance between lines of text", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "space_word", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "space_word", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "wordspace");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Spacing between words", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "space_character", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "space_character", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spacing");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Global spacing between characters", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shear");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Shear", "Italic angle of the characters");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xof");
RNA_def_property_range(prop, -50.0f, 50.0f);
RNA_def_property_ui_text(prop, "X Offset", "Horizontal offset from the object origin");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yof");
RNA_def_property_range(prop, -50.0f, 50.0f);
RNA_def_property_ui_text(prop, "Y Offset", "Vertical offset from the object origin");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "underline_position", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "underline_position", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ulpos");
RNA_def_property_range(prop, -0.2f, 0.8f);
RNA_def_property_ui_text(prop, "Underline Position", "Vertical position of underline");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "underline_height", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "underline_height", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ulheight");
RNA_def_property_range(prop, -0.2f, 0.8f);
RNA_def_property_ui_text(prop, "Underline Thickness", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "text_boxes", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "text_boxes", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "tb", "totbox");
RNA_def_property_struct_type(prop, "TextBox");
RNA_def_property_ui_text(prop, "Textboxes", "");
- prop= RNA_def_property(srna, "active_textbox", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "active_textbox", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "actbox");
RNA_def_property_ui_text(prop, "The active text box", "");
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Curve_active_textbox_index_range");
/* strings */
- prop= RNA_def_property(srna, "family", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "family", PROP_STRING, PROP_NONE);
RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2);
RNA_def_property_ui_text(prop, "Object Font", "Use Blender Objects as font characters (give font objects a common name followed by the character they represent, eg. familya, familyb, etc, and turn on Verts Duplication)");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "str");
RNA_def_property_ui_text(prop, "Body Text", "Content of this text object");
RNA_def_property_string_funcs(prop, "rna_Curve_body_get", "rna_Curve_body_length", "rna_Curve_body_set");
RNA_def_property_string_maxlength(prop, 8192); /* note that originally str did not have a limit! */
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "body_format", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "body_format", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "strinfo", "len");
RNA_def_property_struct_type(prop, "TextCharacterFormat");
RNA_def_property_ui_text(prop, "Character Info", "Stores the style of each character");
/* pointers */
- prop= RNA_def_property(srna, "follow_curve", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "follow_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "textoncurve");
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_otherObject_poll");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Text on Curve", "Curve deforming text object");
RNA_def_property_update(prop, 0, "rna_Curve_update_deps");
- prop= RNA_def_property(srna, "font", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "font", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "vfont");
RNA_def_property_ui_text(prop, "Font", "");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "font_bold", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "font_bold", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "vfontb");
RNA_def_property_ui_text(prop, "Font Bold", "");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "font_italic", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "font_italic", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "vfonti");
RNA_def_property_ui_text(prop, "Font Italic", "");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "font_bold_italic", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "font_bold_italic", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "vfontbi");
RNA_def_property_ui_text(prop, "Font Bold Italic", "");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "edit_format", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "edit_format", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curinfo");
RNA_def_property_ui_text(prop, "Edit Format", "Editing settings character formatting");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* flags */
- prop= RNA_def_property(srna, "use_fast_edit", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_fast_edit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FAST);
RNA_def_property_ui_text(prop, "Fast Editing", "Don't fill polygons while editing");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
@@ -1040,29 +1040,29 @@ static void rna_def_textbox(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "TextBox", NULL);
+ srna = RNA_def_struct(brna, "TextBox", NULL);
RNA_def_struct_ui_text(srna, "Text Box", "Text bounding box for layout");
/* number values */
- prop= RNA_def_property(srna, "x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_range(prop, -50.0f, 50.0f);
RNA_def_property_ui_text(prop, "Textbox X Offset", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "y");
RNA_def_property_range(prop, -50.0f, 50.0f);
RNA_def_property_ui_text(prop, "Textbox Y Offset", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "width", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "w");
RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Textbox Width", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "h");
RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Textbox Height", "");
@@ -1076,22 +1076,22 @@ static void rna_def_charinfo(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "TextCharacterFormat", NULL);
+ srna = RNA_def_struct(brna, "TextCharacterFormat", NULL);
RNA_def_struct_sdna(srna, "CharInfo");
RNA_def_struct_ui_text(srna, "Text Character Format", "Text character formatting settings");
/* flags */
- prop= RNA_def_property(srna, "use_bold", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_bold", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_BOLD);
RNA_def_property_ui_text(prop, "Bold", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "use_italic", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_italic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_ITALIC);
RNA_def_property_ui_text(prop, "Italic", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "use_underline", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_underline", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_UNDERLINE);
RNA_def_property_ui_text(prop, "Underline", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
@@ -1102,7 +1102,7 @@ static void rna_def_charinfo(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Wrap", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data"); */
- prop= RNA_def_property(srna, "use_small_caps", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_small_caps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_SMALLCAPS);
RNA_def_property_ui_text(prop, "Small Caps", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
@@ -1112,7 +1112,7 @@ static void rna_def_surface(BlenderRNA *brna)
{
StructRNA *srna;
- srna= RNA_def_struct(brna, "SurfaceCurve", "Curve");
+ srna = RNA_def_struct(brna, "SurfaceCurve", "Curve");
RNA_def_struct_sdna(srna, "Curve");
RNA_def_struct_ui_text(srna, "Surface Curve", "Curve datablock used for storing surfaces");
RNA_def_struct_ui_icon(srna, ICON_SURFACE_DATA);
@@ -1124,7 +1124,7 @@ static void rna_def_text(BlenderRNA *brna)
{
StructRNA *srna;
- srna= RNA_def_struct(brna, "TextCurve", "Curve");
+ srna = RNA_def_struct(brna, "TextCurve", "Curve");
RNA_def_struct_sdna(srna, "Curve");
RNA_def_struct_ui_text(srna, "Text Curve", "Curve datablock used for storing text");
RNA_def_struct_ui_icon(srna, ICON_FONT_DATA);
@@ -1138,17 +1138,17 @@ static void rna_def_text(BlenderRNA *brna)
static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
- //PropertyRNA *prop;
+ /*PropertyRNA *prop; */
FunctionRNA *func;
- //PropertyRNA *parm;
+ /*PropertyRNA *parm; */
RNA_def_property_srna(cprop, "SplinePoints");
- srna= RNA_def_struct(brna, "SplinePoints", NULL);
+ srna = RNA_def_struct(brna, "SplinePoints", NULL);
RNA_def_struct_sdna(srna, "Nurb");
RNA_def_struct_ui_text(srna, "Spline Points", "Collection of spline points");
- func= RNA_def_function(srna, "add", "rna_Curve_spline_points_add");
+ func = RNA_def_function(srna, "add", "rna_Curve_spline_points_add");
RNA_def_function_ui_description(func, "Add a number of points to this spline");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
RNA_def_int(func, "count", 1, 1, INT_MAX, "Number", "Number of points to add to the spline", 1, INT_MAX);
@@ -1165,17 +1165,17 @@ static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
- //PropertyRNA *prop;
+ /*PropertyRNA *prop; */
FunctionRNA *func;
- //PropertyRNA *parm;
+ /*PropertyRNA *parm; */
RNA_def_property_srna(cprop, "SplineBezierPoints");
- srna= RNA_def_struct(brna, "SplineBezierPoints", NULL);
+ srna = RNA_def_struct(brna, "SplineBezierPoints", NULL);
RNA_def_struct_sdna(srna, "Nurb");
RNA_def_struct_ui_text(srna, "Spline Bezier Points", "Collection of spline bezirt points");
- func= RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add");
+ func = RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add");
RNA_def_function_ui_description(func, "Add a number of points to this spline");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
RNA_def_int(func, "count", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
@@ -1199,27 +1199,27 @@ static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "CurveSplines");
- srna= RNA_def_struct(brna, "CurveSplines", NULL);
+ srna = RNA_def_struct(brna, "CurveSplines", NULL);
RNA_def_struct_sdna(srna, "Curve");
RNA_def_struct_ui_text(srna, "Curve Splines", "Collection of curve splines");
- func= RNA_def_function(srna, "new", "rna_Curve_spline_new");
+ func = RNA_def_function(srna, "new", "rna_Curve_spline_new");
RNA_def_function_ui_description(func, "Add a new spline to the curve");
- parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline");
+ parm = RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline");
+ parm = RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
+ func = RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
RNA_def_function_ui_description(func, "Remove a spline from a curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
+ parm = RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "clear", "rna_Curve_spline_clear");
+ func = RNA_def_function(srna, "clear", "rna_Curve_spline_clear");
RNA_def_function_ui_description(func, "Remove all spline from a curve");
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_funcs(prop, "rna_Curve_active_spline_get", "rna_Curve_active_spline_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -1241,24 +1241,24 @@ static void rna_def_curve(BlenderRNA *brna)
{CU_TWIST_TANGENT, "TANGENT", 0, "Tangent", "Use the tangent to calculate twist"},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem curve_axis_items[]= {
+ static const EnumPropertyItem curve_axis_items[] = {
{0, "2D", 0, "2D", "Clamp the Z axis of the curve"},
{CU_3D, "3D", 0, "3D", "Allow editing on the Z axis of this curve, also allows tilt and curve radius to be used"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Curve", "ID");
+ srna = RNA_def_struct(brna, "Curve", "ID");
RNA_def_struct_ui_text(srna, "Curve", "Curve datablock storing curves, splines and NURBS");
RNA_def_struct_ui_icon(srna, ICON_CURVE_DATA);
RNA_def_struct_refine_func(srna, "rna_Curve_refine");
rna_def_animdata_common(srna);
- prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "key");
RNA_def_property_ui_text(prop, "Shape Keys", "");
- prop= RNA_def_property(srna, "splines", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "splines", PROP_COLLECTION, PROP_NONE);
#if 0
RNA_def_property_collection_sdna(prop, NULL, "nurb", NULL);
#else
@@ -1269,12 +1269,12 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Splines", "Collection of splines in this curve data object");
rna_def_curve_splines(brna, prop);
- prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "drawflag", CU_HIDE_HANDLES);
RNA_def_property_ui_text(prop, "Draw Handles", "Display Bezier handles in editmode");
RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
- prop= RNA_def_property(srna, "show_normal_face", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_normal_face", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "drawflag", CU_HIDE_NORMALS);
RNA_def_property_ui_text(prop, "Draw Normals", "Display 3D curve normals in editmode");
RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
@@ -1282,67 +1282,67 @@ static void rna_def_curve(BlenderRNA *brna)
rna_def_path(brna, srna);
/* Number values */
- prop= RNA_def_property(srna, "bevel_resolution", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "bevel_resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "bevresol");
RNA_def_property_range(prop, 0, 32);
RNA_def_property_ui_range(prop, 0, 32, 1.0, 0);
RNA_def_property_ui_text(prop, "Bevel Resolution", "Bevel resolution when depth is non-zero and no specific bevel object has been defined");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
+ prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "width");
RNA_def_property_ui_range(prop, -1.0, 1.0, 0.1, 3);
RNA_def_property_float_funcs(prop, "rna_Curve_offset_get", "rna_Curve_offset_set", NULL);
RNA_def_property_ui_text(prop, "Offset", "Offset the curve to adjust the width of a text");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "extrude", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
+ prop = RNA_def_property(srna, "extrude", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "ext1");
RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 3);
RNA_def_property_range(prop, 0.0, FLT_MAX);
RNA_def_property_ui_text(prop, "Extrude", "Amount of curve extrusion when not using a bevel object");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "bevel_depth", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
+ prop = RNA_def_property(srna, "bevel_depth", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "ext2");
RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Bevel Depth", "Bevel depth when not using a bevel object");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolu");
RNA_def_property_range(prop, 1, SHRT_MAX);
RNA_def_property_ui_range(prop, 1, 64, 1, 0);
RNA_def_property_ui_text(prop, "Resolution U", "Surface resolution in U direction");
RNA_def_property_update(prop, 0, "rna_Curve_resolution_u_update_data");
- prop= RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolv");
RNA_def_property_ui_range(prop, 1, 64, 1, 0);
RNA_def_property_range(prop, 1, SHRT_MAX);
RNA_def_property_ui_text(prop, "Resolution V", "Surface resolution in V direction");
RNA_def_property_update(prop, 0, "rna_Curve_resolution_v_update_data");
- prop= RNA_def_property(srna, "render_resolution_u", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "render_resolution_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolu_ren");
RNA_def_property_range(prop, 0, SHRT_MAX);
RNA_def_property_ui_range(prop, 0, 64, 1, 0);
RNA_def_property_ui_text(prop, "Render Resolution U", "Surface resolution in U direction used while rendering (zero skips this property)");
- prop= RNA_def_property(srna, "render_resolution_v", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "render_resolution_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolv_ren");
RNA_def_property_ui_range(prop, 0, 64, 1, 0);
RNA_def_property_range(prop, 0, SHRT_MAX);
RNA_def_property_ui_text(prop, "Render Resolution V", "Surface resolution in V direction used while rendering (zero skips this property)");
- prop= RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ctime");
RNA_def_property_ui_text(prop, "Evaluation Time", "Parametric position along the length of the curve that Objects 'following' it should be at (position is evaluated by dividing by the 'Path Length' value)");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* pointers */
- prop= RNA_def_property(srna, "bevel_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "bevel_object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "bevobj");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -1350,7 +1350,7 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Curve_update_deps");
RNA_def_property_pointer_funcs(prop, "rna_Curve_bevelObject_get", "rna_Curve_bevelObject_set", NULL, "rna_Curve_otherObject_poll");
- prop= RNA_def_property(srna, "taper_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "taper_object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "taperobj");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -1360,57 +1360,57 @@ static void rna_def_curve(BlenderRNA *brna)
/* Flags */
- prop= RNA_def_property(srna, "dimensions", PROP_ENUM, PROP_NONE); /* as an enum */
+ prop = RNA_def_property(srna, "dimensions", PROP_ENUM, PROP_NONE); /* as an enum */
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, curve_axis_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Curve_dimension_set", NULL);
RNA_def_property_ui_text(prop, "Dimensions", "Select 2D or 3D curve type");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "fill_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "fill_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, curve3d_fill_mode_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Curve_fill_mode_itemf");
RNA_def_property_ui_text(prop, "Fill Mode", "Mode of filling curve");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "twist_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "twist_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "twist_mode");
RNA_def_property_enum_items(prop, curve_twist_mode_items);
RNA_def_property_ui_text(prop, "Twist Method", "The type of tilt calculation for 3D Curves");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- // XXX - would be nice to have a better way to do this, only add for testing.
- prop= RNA_def_property(srna, "twist_smooth", PROP_FLOAT, PROP_NONE);
+ /* XXX - would be nice to have a better way to do this, only add for testing. */
+ prop = RNA_def_property(srna, "twist_smooth", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "twist_smooth");
RNA_def_property_ui_range(prop, 0, 100.0, 1, 2);
RNA_def_property_ui_text(prop, "Twist Smooth", "Smoothing iteration for tangents");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "use_fill_deform", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_fill_deform", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_DEFORM_FILL);
RNA_def_property_ui_text(prop, "Fill Deformed", "Fill curve after applying shape keys and all modifiers");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "use_fill_caps", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_fill_caps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FILL_CAPS);
RNA_def_property_ui_text(prop, "Fill Caps", "Fill caps for bevelled curves");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* texture space */
- prop= RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", CU_AUTOSPACE);
RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjust active object's texture space automatically when transforming object");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Curve_texspace_set");
- prop= RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Texture Space Location", "Texture space location");
RNA_def_property_editable_func(prop, "rna_Curve_texspace_editable");
RNA_def_property_float_funcs(prop, "rna_Curve_texspace_loc_get", "rna_Curve_texspace_loc_set", NULL);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size");
RNA_def_property_editable_func(prop, "rna_Curve_texspace_editable");
@@ -1425,13 +1425,13 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
*/
- prop= RNA_def_property(srna, "use_uv_as_generated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_uv_as_generated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO);
RNA_def_property_ui_text(prop, "Use UV for mapping", "Uses the UV values as Generated textured coordinates");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* materials */
- prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_ui_text(prop, "Materials", "");
@@ -1451,132 +1451,132 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Spline", NULL);
+ srna = RNA_def_struct(brna, "Spline", NULL);
RNA_def_struct_sdna(srna, "Nurb");
RNA_def_struct_ui_text(srna, "Spline", "Element of a curve, either NURBS, Bezier or Polyline or a character with text objects");
- prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "bp", NULL);
RNA_def_property_struct_type(prop, "SplinePoint");
RNA_def_property_collection_funcs(prop, "rna_BPoint_array_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_Nurb_length", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Points", "Collection of points that make up this poly or nurbs spline");
rna_def_curve_spline_points(brna, prop);
- prop= RNA_def_property(srna, "bezier_points", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "bezier_points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "BezierSplinePoint");
RNA_def_property_collection_sdna(prop, NULL, "bezt", "pntsu");
RNA_def_property_ui_text(prop, "Bezier Points", "Collection of points for Bezier curves only");
rna_def_curve_spline_bezpoints(brna, prop);
- prop= RNA_def_property(srna, "tilt_interpolation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "tilt_interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "tilt_interp");
RNA_def_property_enum_items(prop, spline_interpolation_items);
RNA_def_property_ui_text(prop, "Tilt Interpolation", "The type of tilt interpolation for 3D, Bezier curves");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "radius_interpolation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "radius_interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "radius_interp");
RNA_def_property_enum_items(prop, spline_interpolation_items);
RNA_def_property_ui_text(prop, "Radius Interpolation", "The type of radius interpolation for Bezier curves");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, curve_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Nurb_type_set", NULL);
RNA_def_property_ui_text(prop, "Type", "The interpolation type for this curve element");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "point_count_u", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "point_count_u", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* editing this needs knot recalc*/
RNA_def_property_int_sdna(prop, NULL, "pntsu");
RNA_def_property_ui_text(prop, "Points U", "Total number points for the curve or surface in the U direction");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "point_count_v", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "point_count_v", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* editing this needs knot recalc*/
RNA_def_property_int_sdna(prop, NULL, "pntsv");
RNA_def_property_ui_text(prop, "Points V", "Total number points for the surface on the V direction");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "order_u", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "order_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "orderu");
RNA_def_property_range(prop, 2, 6);
RNA_def_property_ui_text(prop, "Order U", "NURBS order in the U direction (for splines and surfaces, higher values let points influence a greater area)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");
- prop= RNA_def_property(srna, "order_v", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "order_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "orderv");
RNA_def_property_range(prop, 2, 6);
RNA_def_property_ui_text(prop, "Order V", "NURBS order in the V direction (for surfaces only, higher values let points influence a greater area)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
- prop= RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolu");
RNA_def_property_range(prop, 1, SHRT_MAX);
RNA_def_property_ui_range(prop, 1, 64, 1, 0);
RNA_def_property_ui_text(prop, "Resolution U", "Curve or Surface subdivisions per segment");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolv");
RNA_def_property_range(prop, 1, SHRT_MAX);
RNA_def_property_ui_range(prop, 1, 64, 1, 0);
RNA_def_property_ui_text(prop, "Resolution V", "Surface subdivisions per segment");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "use_cyclic_u", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_cyclic_u", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic U", "Make this curve or surface a closed loop in the U direction");
RNA_def_property_update(prop, 0, "rna_Nurb_update_cyclic_u");
- prop= RNA_def_property(srna, "use_cyclic_v", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_cyclic_v", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic V", "Make this surface a closed loop in the V direction");
RNA_def_property_update(prop, 0, "rna_Nurb_update_cyclic_v");
/* Note, endpoint and bezier flags should never be on at the same time! */
- prop= RNA_def_property(srna, "use_endpoint_u", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_endpoint_u", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_ENDPOINT);
RNA_def_property_ui_text(prop, "Endpoint U", "Make this nurbs curve or surface meet the endpoints in the U direction (Cyclic U must be disabled)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");
- prop= RNA_def_property(srna, "use_endpoint_v", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_endpoint_v", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_ENDPOINT);
RNA_def_property_ui_text(prop, "Endpoint V", "Make this nurbs surface meet the endpoints in the V direction (Cyclic V must be disabled)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
- prop= RNA_def_property(srna, "use_bezier_u", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_bezier_u", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_BEZIER);
RNA_def_property_ui_text(prop, "Bezier U", "Make this nurbs curve or surface act like a Bezier spline in the U direction (Order U must be 3 or 4, Cyclic U must be disabled)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");
- prop= RNA_def_property(srna, "use_bezier_v", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_bezier_v", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_BEZIER);
RNA_def_property_ui_text(prop, "Bezier V", "Make this nurbs surface act like a Bezier spline in the V direction (Order V must be 3 or 4, Cyclic V must be disabled)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
- prop= RNA_def_property(srna, "use_smooth", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_smooth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_SMOOTH);
RNA_def_property_ui_text(prop, "Smooth", "Smooth the normals of the surface or beveled curve");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "hide", 1);
RNA_def_property_ui_text(prop, "Hide", "Hide this curve in editmode");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "mat_nr");
RNA_def_property_ui_text(prop, "Material Index", "");
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Curve_material_index_range");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "character_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "character_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "charidx");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* editing this needs knot recalc*/
RNA_def_property_ui_text(prop, "Character Index", "Location of this character in the text data (only for text curves)");
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 2ea21baf257..202418205f3 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -58,9 +58,9 @@ BlenderDefRNA DefRNA = {NULL, {NULL, NULL}, {NULL, NULL}, NULL, 0, 0, 0, 1};
/* pedantic check for '.', do this since its a hassle for translators */
#ifndef NDEBUG
# define DESCR_CHECK(description, id1, id2) \
- if(description && (description)[0]) { \
+ if (description && (description)[0]) { \
int i = strlen(description); \
- if((description)[i - 1] == '.') { \
+ if ((description)[i - 1] == '.') { \
fprintf(stderr, "%s: '%s' '%s' description ends with a '.' !\n", \
__func__, id1 ? id1 : "", id2 ? id2 : ""); \
} \
@@ -72,7 +72,7 @@ BlenderDefRNA DefRNA = {NULL, {NULL, NULL}, {NULL, NULL}, NULL, 0, 0, 0, 1};
void rna_addtail(ListBase *listbase, void *vlink)
{
- Link *link= vlink;
+ Link *link = vlink;
link->next = NULL;
link->prev = listbase->last;
@@ -84,7 +84,7 @@ void rna_addtail(ListBase *listbase, void *vlink)
static void rna_remlink(ListBase *listbase, void *vlink)
{
- Link *link= vlink;
+ Link *link = vlink;
if (link->next) link->next->prev = link->prev;
if (link->prev) link->prev->next = link->next;
@@ -97,9 +97,9 @@ PropertyDefRNA *rna_findlink(ListBase *listbase, const char *identifier)
{
Link *link;
- for(link=listbase->first; link; link=link->next) {
- PropertyRNA *prop= ((PropertyDefRNA *)link)->prop;
- if(prop && (strcmp(prop->identifier, identifier)==0)) {
+ for (link = listbase->first; link; link = link->next) {
+ PropertyRNA *prop = ((PropertyDefRNA *)link)->prop;
+ if (prop && (strcmp(prop->identifier, identifier) == 0)) {
return (PropertyDefRNA *)link;
}
}
@@ -117,27 +117,27 @@ void rna_freelistN(ListBase *listbase)
{
Link *link, *next;
- for(link=listbase->first; link; link=next) {
- next= link->next;
+ for (link = listbase->first; link; link = next) {
+ next = link->next;
MEM_freeN(link);
}
- listbase->first= listbase->last= NULL;
+ listbase->first = listbase->last = NULL;
}
StructDefRNA *rna_find_struct_def(StructRNA *srna)
{
StructDefRNA *dsrna;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
/* we should never get here */
fprintf(stderr, "%s: only at preprocess time.\n", __func__);
return NULL;
}
- dsrna= DefRNA.structs.last;
- for (; dsrna; dsrna= dsrna->cont.prev)
- if (dsrna->srna==srna)
+ dsrna = DefRNA.structs.last;
+ for (; dsrna; dsrna = dsrna->cont.prev)
+ if (dsrna->srna == srna)
return dsrna;
return NULL;
@@ -148,23 +148,23 @@ PropertyDefRNA *rna_find_struct_property_def(StructRNA *srna, PropertyRNA *prop)
StructDefRNA *dsrna;
PropertyDefRNA *dprop;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
/* we should never get here */
fprintf(stderr, "%s: only at preprocess time.\n", __func__);
return NULL;
}
- dsrna= rna_find_struct_def(srna);
- dprop= dsrna->cont.properties.last;
- for (; dprop; dprop= dprop->prev)
- if (dprop->prop==prop)
+ dsrna = rna_find_struct_def(srna);
+ dprop = dsrna->cont.properties.last;
+ for (; dprop; dprop = dprop->prev)
+ if (dprop->prop == prop)
return dprop;
- dsrna= DefRNA.structs.last;
- for (; dsrna; dsrna= dsrna->cont.prev) {
- dprop= dsrna->cont.properties.last;
- for (; dprop; dprop= dprop->prev)
- if (dprop->prop==prop)
+ dsrna = DefRNA.structs.last;
+ for (; dsrna; dsrna = dsrna->cont.prev) {
+ dprop = dsrna->cont.properties.last;
+ for (; dprop; dprop = dprop->prev)
+ if (dprop->prop == prop)
return dprop;
}
@@ -176,17 +176,17 @@ static PropertyDefRNA *rna_find_property_def(PropertyRNA *prop)
{
PropertyDefRNA *dprop;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
/* we should never get here */
fprintf(stderr, "%s: only at preprocess time.\n", __func__);
return NULL;
}
- dprop= rna_find_struct_property_def(DefRNA.laststruct, prop);
+ dprop = rna_find_struct_property_def(DefRNA.laststruct, prop);
if (dprop)
return dprop;
- dprop= rna_find_parameter_def(prop);
+ dprop = rna_find_parameter_def(prop);
if (dprop)
return dprop;
@@ -199,23 +199,23 @@ FunctionDefRNA *rna_find_function_def(FunctionRNA *func)
StructDefRNA *dsrna;
FunctionDefRNA *dfunc;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
/* we should never get here */
fprintf(stderr, "%s: only at preprocess time.\n", __func__);
return NULL;
}
- dsrna= rna_find_struct_def(DefRNA.laststruct);
- dfunc= dsrna->functions.last;
- for (; dfunc; dfunc= dfunc->cont.prev)
- if (dfunc->func==func)
+ dsrna = rna_find_struct_def(DefRNA.laststruct);
+ dfunc = dsrna->functions.last;
+ for (; dfunc; dfunc = dfunc->cont.prev)
+ if (dfunc->func == func)
return dfunc;
- dsrna= DefRNA.structs.last;
- for (; dsrna; dsrna= dsrna->cont.prev) {
- dfunc= dsrna->functions.last;
- for (; dfunc; dfunc= dfunc->cont.prev)
- if (dfunc->func==func)
+ dsrna = DefRNA.structs.last;
+ for (; dsrna; dsrna = dsrna->cont.prev) {
+ dfunc = dsrna->functions.last;
+ for (; dfunc; dfunc = dfunc->cont.prev)
+ if (dfunc->func == func)
return dfunc;
}
@@ -228,28 +228,28 @@ PropertyDefRNA *rna_find_parameter_def(PropertyRNA *parm)
FunctionDefRNA *dfunc;
PropertyDefRNA *dparm;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
/* we should never get here */
fprintf(stderr, "%s: only at preprocess time.\n", __func__);
return NULL;
}
- dsrna= rna_find_struct_def(DefRNA.laststruct);
- dfunc= dsrna->functions.last;
- for (; dfunc; dfunc= dfunc->cont.prev) {
- dparm= dfunc->cont.properties.last;
- for (; dparm; dparm= dparm->prev)
- if (dparm->prop==parm)
+ dsrna = rna_find_struct_def(DefRNA.laststruct);
+ dfunc = dsrna->functions.last;
+ for (; dfunc; dfunc = dfunc->cont.prev) {
+ dparm = dfunc->cont.properties.last;
+ for (; dparm; dparm = dparm->prev)
+ if (dparm->prop == parm)
return dparm;
}
- dsrna= DefRNA.structs.last;
- for (; dsrna; dsrna= dsrna->cont.prev) {
- dfunc= dsrna->functions.last;
- for (; dfunc; dfunc= dfunc->cont.prev) {
- dparm= dfunc->cont.properties.last;
- for (; dparm; dparm= dparm->prev)
- if (dparm->prop==parm)
+ dsrna = DefRNA.structs.last;
+ for (; dsrna; dsrna = dsrna->cont.prev) {
+ dfunc = dsrna->functions.last;
+ for (; dfunc; dfunc = dfunc->cont.prev) {
+ dparm = dfunc->cont.properties.last;
+ for (; dparm; dparm = dparm->prev)
+ if (dparm->prop == parm)
return dparm;
}
}
@@ -262,18 +262,18 @@ static ContainerDefRNA *rna_find_container_def(ContainerRNA *cont)
StructDefRNA *ds;
FunctionDefRNA *dfunc;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
/* we should never get here */
fprintf(stderr, "%s: only at preprocess time.\n", __func__);
return NULL;
}
- ds= rna_find_struct_def((StructRNA*)cont);
- if(ds)
+ ds = rna_find_struct_def((StructRNA*)cont);
+ if (ds)
return &ds->cont;
- dfunc= rna_find_function_def((FunctionRNA*)cont);
- if(dfunc)
+ dfunc = rna_find_function_def((FunctionRNA*)cont);
+ if (dfunc)
return &dfunc->cont;
return NULL;
@@ -290,23 +290,23 @@ typedef struct DNAStructMember {
static int rna_member_cmp(const char *name, const char *oname)
{
- int a=0;
+ int a = 0;
/* compare without pointer or array part */
- while(name[0]=='*')
+ while (name[0] =='*')
name++;
- while(oname[0]=='*')
+ while (oname[0] =='*')
oname++;
- while(1) {
- if(name[a]=='[' && oname[a]==0) return 1;
- if(name[a]=='[' && oname[a]=='[') return 1;
- if(name[a]==0) break;
- if(name[a] != oname[a]) return 0;
+ while (1) {
+ if (name[a] =='[' && oname[a] == 0) return 1;
+ if (name[a] =='[' && oname[a] =='[') return 1;
+ if (name[a] == 0) break;
+ if (name[a] != oname[a]) return 0;
a++;
}
- if(name[a]==0 && oname[a] == '.') return 2;
- if(name[a]==0 && oname[a] == '-' && oname[a+1] == '>') return 3;
+ if (name[a] == 0 && oname[a] == '.') return 2;
+ if (name[a] == 0 && oname[a] == '-' && oname[a+1] == '>') return 3;
return (name[a] == oname[a]);
}
@@ -317,52 +317,52 @@ static int rna_find_sdna_member(SDNA *sdna, const char *structname, const char *
short *sp;
int a, b, structnr, totmember, cmp;
- structnr= DNA_struct_find_nr(sdna, structname);
- if(structnr == -1)
+ structnr = DNA_struct_find_nr(sdna, structname);
+ if (structnr == -1)
return 0;
- sp= sdna->structs[structnr];
- totmember= sp[1];
- sp+= 2;
+ sp = sdna->structs[structnr];
+ totmember = sp[1];
+ sp += 2;
- for(a=0; a<totmember; a++, sp+=2) {
- dnaname= sdna->names[sp[1]];
+ for (a = 0; a<totmember; a++, sp += 2) {
+ dnaname = sdna->names[sp[1]];
- cmp= rna_member_cmp(dnaname, membername);
+ cmp = rna_member_cmp(dnaname, membername);
- if(cmp == 1) {
- smember->type= sdna->types[sp[0]];
- smember->name= dnaname;
+ if (cmp == 1) {
+ smember->type = sdna->types[sp[0]];
+ smember->name = dnaname;
- if(strstr(membername, "["))
- smember->arraylength= 0;
+ if (strstr(membername, "["))
+ smember->arraylength = 0;
else
- smember->arraylength= DNA_elem_array_size(smember->name, strlen(smember->name));
+ smember->arraylength = DNA_elem_array_size(smember->name, strlen(smember->name));
- smember->pointerlevel= 0;
- for(b=0; dnaname[b] == '*'; b++)
+ smember->pointerlevel = 0;
+ for (b = 0; dnaname[b] == '*'; b++)
smember->pointerlevel++;
return 1;
}
- else if(cmp == 2) {
- smember->type= "";
- smember->name= dnaname;
- smember->pointerlevel= 0;
- smember->arraylength= 0;
+ else if (cmp == 2) {
+ smember->type = "";
+ smember->name = dnaname;
+ smember->pointerlevel = 0;
+ smember->arraylength = 0;
- membername= strstr(membername, ".") + strlen(".");
+ membername = strstr(membername, ".") + strlen(".");
rna_find_sdna_member(sdna, sdna->types[sp[0]], membername, smember);
return 1;
}
- else if(cmp == 3) {
- smember->type= "";
- smember->name= dnaname;
- smember->pointerlevel= 0;
- smember->arraylength= 0;
+ else if (cmp == 3) {
+ smember->type = "";
+ smember->name = dnaname;
+ smember->pointerlevel = 0;
+ smember->arraylength = 0;
- membername= strstr(membername, "->") + strlen("->");
+ membername = strstr(membername, "->") + strlen("->");
rna_find_sdna_member(sdna, sdna->types[sp[0]], membername, smember);
return 1;
@@ -374,7 +374,7 @@ static int rna_find_sdna_member(SDNA *sdna, const char *structname, const char *
static int rna_validate_identifier(const char *identifier, char *error, int property)
{
- int a=0;
+ int a = 0;
/* list from http://docs.python.org/reference/lexical_analysis.html#id5 */
static const char *kwlist[] = {
@@ -394,44 +394,44 @@ static int rna_validate_identifier(const char *identifier, char *error, int prop
return 0;
}
- for(a=0; identifier[a]; a++) {
- if(DefRNA.preprocess && property) {
- if(isalpha(identifier[a]) && isupper(identifier[a])) {
+ for (a = 0; identifier[a]; a++) {
+ if (DefRNA.preprocess && property) {
+ if (isalpha(identifier[a]) && isupper(identifier[a])) {
strcpy(error, "property names must contain lower case characters only");
return 0;
}
}
- if (identifier[a]=='_') {
+ if (identifier[a] =='_') {
continue;
}
- if (identifier[a]==' ') {
+ if (identifier[a] ==' ') {
strcpy(error, "spaces are not okay in identifier names");
return 0;
}
- if (isalnum(identifier[a])==0) {
+ if (isalnum(identifier[a]) == 0) {
strcpy(error, "one of the characters failed an isalnum() check and is not an underscore");
return 0;
}
}
- for(a=0; kwlist[a]; a++) {
+ for (a = 0; kwlist[a]; a++) {
if (strcmp(identifier, kwlist[a]) == 0) {
strcpy(error, "this keyword is reserved by python");
return 0;
}
}
- if(property) {
+ if (property) {
static const char *kwlist_prop[] = {
/* not keywords but reserved all the same because py uses */
"keys", "values", "items", "get",
NULL
};
- for(a=0; kwlist_prop[a]; a++) {
+ for (a = 0; kwlist_prop[a]; a++) {
if (strcmp(identifier, kwlist_prop[a]) == 0) {
strcpy(error, "this keyword is reserved by python");
return 0;
@@ -448,12 +448,12 @@ BlenderRNA *RNA_create(void)
{
BlenderRNA *brna;
- brna= MEM_callocN(sizeof(BlenderRNA), "BlenderRNA");
+ brna = MEM_callocN(sizeof(BlenderRNA), "BlenderRNA");
- DefRNA.sdna= DNA_sdna_from_data(DNAstr, DNAlen, 0);
- DefRNA.structs.first= DefRNA.structs.last= NULL;
- DefRNA.error= 0;
- DefRNA.preprocess= 1;
+ DefRNA.sdna = DNA_sdna_from_data(DNAstr, DNAlen, 0);
+ DefRNA.structs.first = DefRNA.structs.last = NULL;
+ DefRNA.error = 0;
+ DefRNA.preprocess = 1;
return brna;
}
@@ -464,12 +464,12 @@ void RNA_define_free(BlenderRNA *UNUSED(brna))
FunctionDefRNA *dfunc;
AllocDefRNA *alloc;
- for(alloc=DefRNA.allocs.first; alloc; alloc=alloc->next)
+ for (alloc = DefRNA.allocs.first; alloc; alloc = alloc->next)
MEM_freeN(alloc->mem);
rna_freelistN(&DefRNA.allocs);
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next) {
- for (dfunc= ds->functions.first; dfunc; dfunc= dfunc->cont.next)
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
+ for (dfunc = ds->functions.first; dfunc; dfunc = dfunc->cont.next)
rna_freelistN(&dfunc->cont.properties);
rna_freelistN(&ds->cont.properties);
@@ -478,17 +478,17 @@ void RNA_define_free(BlenderRNA *UNUSED(brna))
rna_freelistN(&DefRNA.structs);
- if(DefRNA.sdna) {
+ if (DefRNA.sdna) {
DNA_sdna_free(DefRNA.sdna);
- DefRNA.sdna= NULL;
+ DefRNA.sdna = NULL;
}
- DefRNA.error= 0;
+ DefRNA.error = 0;
}
void RNA_define_verify_sdna(int verify)
{
- DefRNA.verify= verify;
+ DefRNA.verify = verify;
}
void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext)
@@ -497,7 +497,7 @@ void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext)
ext->free(ext->data); /* decref's the PyObject that the srna owns */
RNA_struct_blender_type_set(srna, NULL); /* this gets accessed again - XXX fixme */
RNA_struct_py_type_set(srna, NULL); /* NULL the srna's value so RNA_struct_free wont complain of a leak */
-#endif
+#endif
}
void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
@@ -514,36 +514,36 @@ void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
}
} */
- for(prop=srna->cont.properties.first; prop; prop=nextprop) {
- nextprop= prop->next;
+ for (prop = srna->cont.properties.first; prop; prop = nextprop) {
+ nextprop = prop->next;
RNA_def_property_free_pointers(prop);
- if(prop->flag & PROP_RUNTIME)
+ if (prop->flag & PROP_RUNTIME)
rna_freelinkN(&srna->cont.properties, prop);
}
- for(func=srna->functions.first; func; func=nextfunc) {
- nextfunc= func->cont.next;
+ for (func = srna->functions.first; func; func = nextfunc) {
+ nextfunc = func->cont.next;
- for(parm=func->cont.properties.first; parm; parm=nextparm) {
- nextparm= parm->next;
+ for (parm = func->cont.properties.first; parm; parm = nextparm) {
+ nextparm = parm->next;
RNA_def_property_free_pointers(parm);
- if(parm->flag & PROP_RUNTIME)
+ if (parm->flag & PROP_RUNTIME)
rna_freelinkN(&func->cont.properties, parm);
}
RNA_def_func_free_pointers(func);
- if(func->flag & FUNC_RUNTIME)
+ if (func->flag & FUNC_RUNTIME)
rna_freelinkN(&srna->functions, func);
}
RNA_def_struct_free_pointers(srna);
- if(srna->flag & STRUCT_RUNTIME)
+ if (srna->flag & STRUCT_RUNTIME)
rna_freelinkN(&brna->structs, srna);
#endif
@@ -554,11 +554,11 @@ void RNA_free(BlenderRNA *brna)
StructRNA *srna, *nextsrna;
FunctionRNA *func;
- if(DefRNA.preprocess) {
+ if (DefRNA.preprocess) {
RNA_define_free(brna);
- for(srna=brna->structs.first; srna; srna=srna->cont.next) {
- for (func= srna->functions.first; func; func= func->cont.next)
+ for (srna = brna->structs.first; srna; srna = srna->cont.next) {
+ for (func = srna->functions.first; func; func = func->cont.next)
rna_freelistN(&func->cont.properties);
rna_freelistN(&srna->cont.properties);
@@ -570,8 +570,8 @@ void RNA_free(BlenderRNA *brna)
MEM_freeN(brna);
}
else {
- for(srna=brna->structs.first; srna; srna=nextsrna) {
- nextsrna= srna->cont.next;
+ for (srna = brna->structs.first; srna; srna = nextsrna) {
+ nextsrna = srna->cont.next;
RNA_struct_free(brna, srna);
}
}
@@ -579,7 +579,7 @@ void RNA_free(BlenderRNA *brna)
static size_t rna_property_type_sizeof(PropertyType type)
{
- switch(type) {
+ switch (type) {
case PROP_BOOLEAN: return sizeof(BoolPropertyRNA);
case PROP_INT: return sizeof(IntPropertyRNA);
case PROP_FLOAT: return sizeof(FloatPropertyRNA);
@@ -595,8 +595,8 @@ static StructDefRNA *rna_find_def_struct(StructRNA *srna)
{
StructDefRNA *ds;
- for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
- if(ds->srna == srna)
+ for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
+ if (ds->srna == srna)
return ds;
return NULL;
@@ -606,112 +606,112 @@ static StructDefRNA *rna_find_def_struct(StructRNA *srna)
StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
{
- StructRNA *srna, *srnafrom= NULL;
- StructDefRNA *ds= NULL, *dsfrom= NULL;
+ StructRNA *srna, *srnafrom = NULL;
+ StructDefRNA *ds = NULL, *dsfrom = NULL;
PropertyRNA *prop;
- if(DefRNA.preprocess) {
+ if (DefRNA.preprocess) {
char error[512];
if (rna_validate_identifier(identifier, error, 0) == 0) {
fprintf(stderr, "%s: struct identifier \"%s\" error - %s\n", __func__, identifier, error);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
}
- if(from) {
+ if (from) {
/* find struct to derive from */
- for(srnafrom= brna->structs.first; srnafrom; srnafrom=srnafrom->cont.next)
- if(strcmp(srnafrom->identifier, from) == 0)
+ for (srnafrom = brna->structs.first; srnafrom; srnafrom = srnafrom->cont.next)
+ if (strcmp(srnafrom->identifier, from) == 0)
break;
- if(!srnafrom) {
+ if (!srnafrom) {
fprintf(stderr, "%s: struct %s not found to define %s.\n", __func__, from, identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
}
- srna= MEM_callocN(sizeof(StructRNA), "StructRNA");
- DefRNA.laststruct= srna;
+ srna = MEM_callocN(sizeof(StructRNA), "StructRNA");
+ DefRNA.laststruct = srna;
- if(srnafrom) {
+ if (srnafrom) {
/* copy from struct to derive stuff, a bit clumsy since we can't
* use MEM_dupallocN, data structs may not be alloced but builtin */
memcpy(srna, srnafrom, sizeof(StructRNA));
- srna->cont.prophash= NULL;
- srna->cont.properties.first= srna->cont.properties.last= NULL;
- srna->functions.first= srna->functions.last= NULL;
- srna->py_type= NULL;
+ srna->cont.prophash = NULL;
+ srna->cont.properties.first = srna->cont.properties.last = NULL;
+ srna->functions.first = srna->functions.last = NULL;
+ srna->py_type = NULL;
- if(DefRNA.preprocess) {
- srna->base= srnafrom;
- dsfrom= rna_find_def_struct(srnafrom);
+ if (DefRNA.preprocess) {
+ srna->base = srnafrom;
+ dsfrom = rna_find_def_struct(srnafrom);
}
else
- srna->base= srnafrom;
+ srna->base = srnafrom;
}
- srna->identifier= identifier;
- srna->name= identifier; /* may be overwritten later RNA_def_struct_ui_text */
- srna->description= "";
+ srna->identifier = identifier;
+ srna->name = identifier; /* may be overwritten later RNA_def_struct_ui_text */
+ srna->description = "";
srna->flag |= STRUCT_UNDO;
- if(!srnafrom)
- srna->icon= ICON_DOT;
+ if (!srnafrom)
+ srna->icon = ICON_DOT;
rna_addtail(&brna->structs, srna);
- if(DefRNA.preprocess) {
- ds= MEM_callocN(sizeof(StructDefRNA), "StructDefRNA");
- ds->srna= srna;
+ if (DefRNA.preprocess) {
+ ds = MEM_callocN(sizeof(StructDefRNA), "StructDefRNA");
+ ds->srna = srna;
rna_addtail(&DefRNA.structs, ds);
- if(dsfrom)
- ds->dnafromname= dsfrom->dnaname;
+ if (dsfrom)
+ ds->dnafromname = dsfrom->dnaname;
}
/* in preprocess, try to find sdna */
- if(DefRNA.preprocess)
+ if (DefRNA.preprocess)
RNA_def_struct_sdna(srna, srna->identifier);
else
srna->flag |= STRUCT_RUNTIME;
- if(srnafrom) {
- srna->nameproperty= srnafrom->nameproperty;
- srna->iteratorproperty= srnafrom->iteratorproperty;
+ if (srnafrom) {
+ srna->nameproperty = srnafrom->nameproperty;
+ srna->iteratorproperty = srnafrom->iteratorproperty;
}
else {
/* define some builtin properties */
- prop= RNA_def_property(&srna->cont, "rna_properties", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(&srna->cont, "rna_properties", PROP_COLLECTION, PROP_NONE);
RNA_def_property_flag(prop, PROP_BUILTIN);
RNA_def_property_ui_text(prop, "Properties", "RNA property collection");
- if(DefRNA.preprocess) {
+ if (DefRNA.preprocess) {
RNA_def_property_struct_type(prop, "Property");
RNA_def_property_collection_funcs(prop, "rna_builtin_properties_begin", "rna_builtin_properties_next", "rna_iterator_listbase_end", "rna_builtin_properties_get", NULL, NULL, "rna_builtin_properties_lookup_string", NULL);
}
else {
#ifdef RNA_RUNTIME
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
- cprop->begin= rna_builtin_properties_begin;
- cprop->next= rna_builtin_properties_next;
- cprop->get= rna_builtin_properties_get;
- cprop->item_type= &RNA_Property;
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
+ cprop->begin = rna_builtin_properties_begin;
+ cprop->next = rna_builtin_properties_next;
+ cprop->get = rna_builtin_properties_get;
+ cprop->item_type = &RNA_Property;
#endif
}
- prop= RNA_def_property(&srna->cont, "rna_type", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(&srna->cont, "rna_type", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_HIDDEN);
RNA_def_property_ui_text(prop, "RNA", "RNA type definition");
- if(DefRNA.preprocess) {
+ if (DefRNA.preprocess) {
RNA_def_property_struct_type(prop, "Struct");
RNA_def_property_pointer_funcs(prop, "rna_builtin_type_get", NULL, NULL, NULL);
}
else {
#ifdef RNA_RUNTIME
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
- pprop->get= rna_builtin_type_get;
- pprop->type= &RNA_Struct;
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
+ pprop->get = rna_builtin_type_get;
+ pprop->type = &RNA_Struct;
#endif
}
}
@@ -723,60 +723,60 @@ void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
{
StructDefRNA *ds;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- ds= rna_find_def_struct(srna);
+ ds = rna_find_def_struct(srna);
- if(!DNA_struct_find_nr(DefRNA.sdna, structname)) {
- if(!DefRNA.silent) {
+ if (!DNA_struct_find_nr(DefRNA.sdna, structname)) {
+ if (!DefRNA.silent) {
fprintf(stderr, "%s: %s not found.\n", __func__, structname);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
return;
}
- ds->dnaname= structname;
+ ds->dnaname = structname;
}
void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const char *propname)
{
StructDefRNA *ds;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- ds= rna_find_def_struct(srna);
+ ds = rna_find_def_struct(srna);
- if(!ds->dnaname) {
+ if (!ds->dnaname) {
fprintf(stderr, "%s: %s base struct must know DNA already.\n", __func__, structname);
return;
}
- if(!DNA_struct_find_nr(DefRNA.sdna, structname)) {
- if(!DefRNA.silent) {
+ if (!DNA_struct_find_nr(DefRNA.sdna, structname)) {
+ if (!DefRNA.silent) {
fprintf(stderr, "%s: %s not found.\n", __func__, structname);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
return;
}
- ds->dnafromprop= propname;
- ds->dnaname= structname;
+ ds->dnafromprop = propname;
+ ds->dnaname = structname;
}
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
{
- if(prop->type != PROP_STRING) {
+ if (prop->type != PROP_STRING) {
fprintf(stderr, "%s: \"%s.%s\", must be a string property.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
else
- srna->nameproperty= prop;
+ srna->nameproperty = prop;
}
void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname)
@@ -784,16 +784,16 @@ void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *struct
StructRNA *srnafrom;
/* find struct to derive from */
- for(srnafrom= brna->structs.first; srnafrom; srnafrom=srnafrom->cont.next)
- if(strcmp(srnafrom->identifier, structname) == 0)
+ for (srnafrom = brna->structs.first; srnafrom; srnafrom = srnafrom->cont.next)
+ if (strcmp(srnafrom->identifier, structname) == 0)
break;
- if(!srnafrom) {
+ if (!srnafrom) {
fprintf(stderr, "%s: struct %s not found for %s.\n", __func__, structname, srna->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
- srna->nested= srnafrom;
+ srna->nested = srnafrom;
}
void RNA_def_struct_flag(StructRNA *srna, int flag)
@@ -808,67 +808,67 @@ void RNA_def_struct_clear_flag(StructRNA *srna, int flag)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
{
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- if(refine) srna->refine= (StructRefineFunc)refine;
+ if (refine) srna->refine = (StructRefineFunc)refine;
}
void RNA_def_struct_idprops_func(StructRNA *srna, const char *idproperties)
{
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- if(idproperties) srna->idproperties= (IDPropertiesFunc)idproperties;
+ if (idproperties) srna->idproperties = (IDPropertiesFunc)idproperties;
}
void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char *unreg, const char *instance)
{
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- if(reg) srna->reg= (StructRegisterFunc)reg;
- if(unreg) srna->unreg= (StructUnregisterFunc)unreg;
- if(instance) srna->instance= (StructInstanceFunc)instance;
+ if (reg) srna->reg = (StructRegisterFunc)reg;
+ if (unreg) srna->unreg = (StructUnregisterFunc)unreg;
+ if (instance) srna->instance = (StructInstanceFunc)instance;
}
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
{
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- if(path) srna->path= (StructPathFunc)path;
+ if (path) srna->path = (StructPathFunc)path;
}
void RNA_def_struct_identifier(StructRNA *srna, const char *identifier)
{
- if(DefRNA.preprocess) {
+ if (DefRNA.preprocess) {
fprintf(stderr, "%s: only at runtime.\n", __func__);
return;
}
- srna->identifier= identifier;
+ srna->identifier = identifier;
}
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
{
DESCR_CHECK(description, srna->identifier, NULL);
- srna->name= name;
- srna->description= description;
+ srna->name = name;
+ srna->description = description;
}
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
{
- srna->icon= icon;
+ srna->icon = icon;
}
/* Property Definition */
@@ -876,74 +876,74 @@ void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
{
/*StructRNA *srna= DefRNA.laststruct;*/ /* invalid for python defined props */
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
ContainerDefRNA *dcont;
- PropertyDefRNA *dprop= NULL;
+ PropertyDefRNA *dprop = NULL;
PropertyRNA *prop;
- if(DefRNA.preprocess) {
+ if (DefRNA.preprocess) {
char error[512];
if (rna_validate_identifier(identifier, error, 1) == 0) {
fprintf(stderr, "%s: property identifier \"%s.%s\" - %s\n", __func__, CONTAINER_RNA_ID(cont), identifier, error);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
- dcont= rna_find_container_def(cont);
+ dcont = rna_find_container_def(cont);
/* XXX - toto, detect supertype collisions */
- if(rna_findlink(&dcont->properties, identifier)) {
+ if (rna_findlink(&dcont->properties, identifier)) {
fprintf(stderr, "%s: duplicate identifier \"%s.%s\"\n", __func__, CONTAINER_RNA_ID(cont), identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
- dprop= MEM_callocN(sizeof(PropertyDefRNA), "PropertyDefRNA");
+ dprop = MEM_callocN(sizeof(PropertyDefRNA), "PropertyDefRNA");
rna_addtail(&dcont->properties, dprop);
}
- prop= MEM_callocN(rna_property_type_sizeof(type), "PropertyRNA");
+ prop = MEM_callocN(rna_property_type_sizeof(type), "PropertyRNA");
- switch(type) {
+ switch (type) {
case PROP_BOOLEAN:
break;
case PROP_INT: {
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
- iprop->hardmin= (subtype == PROP_UNSIGNED)? 0: INT_MIN;
- iprop->hardmax= INT_MAX;
+ iprop->hardmin = (subtype == PROP_UNSIGNED)? 0: INT_MIN;
+ iprop->hardmax = INT_MAX;
- iprop->softmin= (subtype == PROP_UNSIGNED)? 0: -10000; /* rather arbitrary .. */
- iprop->softmax= 10000;
- iprop->step= 1;
+ iprop->softmin = (subtype == PROP_UNSIGNED)? 0: -10000; /* rather arbitrary .. */
+ iprop->softmax = 10000;
+ iprop->step = 1;
break;
}
case PROP_FLOAT: {
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
- fprop->hardmin= (subtype == PROP_UNSIGNED)? 0.0f: -FLT_MAX;
- fprop->hardmax= FLT_MAX;
+ fprop->hardmin = (subtype == PROP_UNSIGNED)? 0.0f: -FLT_MAX;
+ fprop->hardmax = FLT_MAX;
- if(ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA)) {
- fprop->softmin= 0.0f;
- fprop->softmax= 1.0f;
+ if (ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA)) {
+ fprop->softmin = 0.0f;
+ fprop->softmax = 1.0f;
}
- else if(subtype == PROP_FACTOR) {
- fprop->softmin= fprop->hardmin= 0.0f;
- fprop->softmax= fprop->hardmax= 1.0f;
+ else if (subtype == PROP_FACTOR) {
+ fprop->softmin = fprop->hardmin = 0.0f;
+ fprop->softmax = fprop->hardmax = 1.0f;
}
else {
- fprop->softmin= (subtype == PROP_UNSIGNED)? 0.0f: -10000.0f; /* rather arbitrary .. */
- fprop->softmax= 10000.0f;
+ fprop->softmin = (subtype == PROP_UNSIGNED)? 0.0f: -10000.0f; /* rather arbitrary .. */
+ fprop->softmax = 10000.0f;
}
- fprop->step= 10;
- fprop->precision= 3;
+ fprop->step = 10;
+ fprop->precision = 3;
break;
}
case PROP_STRING: {
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
- sprop->defaultvalue= "";
- sprop->maxlength= 0;
+ sprop->defaultvalue = "";
+ sprop->maxlength = 0;
break;
}
case PROP_ENUM:
@@ -952,77 +952,77 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
break;
default:
fprintf(stderr, "%s: \"%s.%s\", invalid property type.\n", __func__, CONTAINER_RNA_ID(cont), identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return NULL;
}
- if(DefRNA.preprocess) {
- dprop->cont= cont;
- dprop->prop= prop;
+ if (DefRNA.preprocess) {
+ dprop->cont = cont;
+ dprop->prop = prop;
}
- prop->magic= RNA_MAGIC;
- prop->identifier= identifier;
- prop->type= type;
- prop->subtype= subtype;
- prop->name= identifier;
- prop->description= "";
+ prop->magic = RNA_MAGIC;
+ prop->identifier = identifier;
+ prop->type = type;
+ prop->subtype = subtype;
+ prop->name = identifier;
+ prop->description = "";
/* a priori not raw editable */
prop->rawtype = -1;
- if(type != PROP_COLLECTION && type != PROP_POINTER) {
- prop->flag= PROP_EDITABLE;
+ if (type != PROP_COLLECTION && type != PROP_POINTER) {
+ prop->flag = PROP_EDITABLE;
- if(type != PROP_STRING)
+ if (type != PROP_STRING)
prop->flag |= PROP_ANIMATABLE;
}
- if(DefRNA.preprocess) {
- switch(type) {
+ if (DefRNA.preprocess) {
+ switch (type) {
case PROP_BOOLEAN:
- DefRNA.silent= 1;
+ DefRNA.silent = 1;
RNA_def_property_boolean_sdna(prop, NULL, identifier, 0);
- DefRNA.silent= 0;
+ DefRNA.silent = 0;
break;
case PROP_INT: {
- DefRNA.silent= 1;
+ DefRNA.silent = 1;
RNA_def_property_int_sdna(prop, NULL, identifier);
- DefRNA.silent= 0;
+ DefRNA.silent = 0;
break;
}
case PROP_FLOAT: {
- DefRNA.silent= 1;
+ DefRNA.silent = 1;
RNA_def_property_float_sdna(prop, NULL, identifier);
- DefRNA.silent= 0;
+ DefRNA.silent = 0;
break;
}
case PROP_STRING: {
- DefRNA.silent= 1;
+ DefRNA.silent = 1;
RNA_def_property_string_sdna(prop, NULL, identifier);
- DefRNA.silent= 0;
+ DefRNA.silent = 0;
break;
}
case PROP_ENUM:
- DefRNA.silent= 1;
+ DefRNA.silent = 1;
RNA_def_property_enum_sdna(prop, NULL, identifier);
- DefRNA.silent= 0;
+ DefRNA.silent = 0;
break;
case PROP_POINTER:
- DefRNA.silent= 1;
+ DefRNA.silent = 1;
RNA_def_property_pointer_sdna(prop, NULL, identifier);
- DefRNA.silent= 0;
+ DefRNA.silent = 0;
break;
case PROP_COLLECTION:
- DefRNA.silent= 1;
+ DefRNA.silent = 1;
RNA_def_property_collection_sdna(prop, NULL, identifier, NULL);
- DefRNA.silent= 0;
+ DefRNA.silent = 0;
break;
}
}
else {
prop->flag |= PROP_IDPROPERTY|PROP_RUNTIME;
#ifdef RNA_RUNTIME
- if(cont->prophash)
+ if (cont->prophash)
BLI_ghash_insert(cont->prophash, (void*)prop->identifier, prop);
#endif
}
@@ -1044,76 +1044,76 @@ void RNA_def_property_clear_flag(PropertyRNA *prop, int flag)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
{
- prop->subtype= subtype;
+ prop->subtype = subtype;
}
void RNA_def_property_array(PropertyRNA *prop, int length)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- if(length<0) {
+ if (length<0) {
fprintf(stderr, "%s: \"%s.%s\", array length must be zero of greater.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
- if(length>RNA_MAX_ARRAY_LENGTH) {
+ if (length>RNA_MAX_ARRAY_LENGTH) {
fprintf(stderr, "%s: \"%s.%s\", array length must be smaller than %d.\n", __func__, srna->identifier, prop->identifier, RNA_MAX_ARRAY_LENGTH);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
- if(prop->arraydimension > 1) {
+ if (prop->arraydimension > 1) {
fprintf(stderr, "%s: \"%s.%s\", array dimensions has been set to %u but would be overwritten as 1.\n", __func__, srna->identifier, prop->identifier, prop->arraydimension);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
- switch(prop->type) {
+ switch (prop->type) {
case PROP_BOOLEAN:
case PROP_INT:
case PROP_FLOAT:
- prop->arraylength[0]= length;
- prop->totarraylength= length;
- prop->arraydimension= 1;
+ prop->arraylength[0] = length;
+ prop->totarraylength = length;
+ prop->arraydimension = 1;
break;
default:
fprintf(stderr, "%s: \"%s.%s\", only boolean/int/float can be array.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
int i;
if (dimension < 1 || dimension > RNA_MAX_ARRAY_DIMENSION) {
fprintf(stderr, "%s: \"%s.%s\", array dimension must be between 1 and %d.\n", __func__, srna->identifier, prop->identifier, RNA_MAX_ARRAY_DIMENSION);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
- switch(prop->type) {
+ switch (prop->type) {
case PROP_BOOLEAN:
case PROP_INT:
case PROP_FLOAT:
break;
default:
fprintf(stderr, "%s: \"%s.%s\", only boolean/int/float can be array.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
- prop->arraydimension= dimension;
- prop->totarraylength= 0;
+ prop->arraydimension = dimension;
+ prop->totarraylength = 0;
- if(length) {
+ if (length) {
memcpy(prop->arraylength, length, sizeof(int)*dimension);
- prop->totarraylength= length[0];
- for(i=1; i<dimension; i++)
+ prop->totarraylength = length[0];
+ for (i = 1; i<dimension; i++)
prop->totarraylength *= length[i];
}
else
@@ -1126,151 +1126,151 @@ void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *d
{
DESCR_CHECK(description, prop->identifier, NULL);
- prop->name= name;
- prop->description= description;
+ prop->name = name;
+ prop->description = description;
}
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
{
- prop->icon= icon;
- if(consecutive)
+ prop->icon = icon;
+ if (consecutive)
prop->flag |= PROP_ICONS_CONSECUTIVE;
}
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- switch(prop->type) {
+ switch (prop->type) {
case PROP_INT: {
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
- iprop->softmin= (int)min;
- iprop->softmax= (int)max;
- iprop->step= (int)step;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
+ iprop->softmin = (int)min;
+ iprop->softmax = (int)max;
+ iprop->step = (int)step;
break;
}
case PROP_FLOAT: {
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
- fprop->softmin= (float)min;
- fprop->softmax= (float)max;
- fprop->step= (float)step;
- fprop->precision= (int)precision;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
+ fprop->softmin = (float)min;
+ fprop->softmax = (float)max;
+ fprop->step = (float)step;
+ fprop->precision = (int)precision;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", invalid type for ui range.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- switch(prop->type) {
+ switch (prop->type) {
case PROP_INT: {
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
- iprop->hardmin= (int)min;
- iprop->hardmax= (int)max;
- iprop->softmin= MAX2((int)min, iprop->hardmin);
- iprop->softmax= MIN2((int)max, iprop->hardmax);
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
+ iprop->hardmin = (int)min;
+ iprop->hardmax = (int)max;
+ iprop->softmin = MAX2((int)min, iprop->hardmin);
+ iprop->softmax = MIN2((int)max, iprop->hardmax);
break;
}
case PROP_FLOAT: {
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
- fprop->hardmin= (float)min;
- fprop->hardmax= (float)max;
- fprop->softmin= MAX2((float)min, fprop->hardmin);
- fprop->softmax= MIN2((float)max, fprop->hardmax);
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
+ fprop->hardmin = (float)min;
+ fprop->hardmax = (float)max;
+ fprop->softmin = MAX2((float)min, fprop->hardmin);
+ fprop->softmax = MIN2((float)max, fprop->hardmax);
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", invalid type for range.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s \"%s.%s\": only during preprocessing.\n", __func__, srna->identifier, prop->identifier);
return;
}
- switch(prop->type) {
+ switch (prop->type) {
case PROP_POINTER: {
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
pprop->type = (StructRNA*)type;
break;
}
case PROP_COLLECTION: {
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
cprop->item_type = (StructRNA*)type;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", invalid type for struct type.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- if(DefRNA.preprocess) {
+ if (DefRNA.preprocess) {
fprintf(stderr, "%s: only at runtime.\n", __func__);
return;
}
- switch(prop->type) {
+ switch (prop->type) {
case PROP_POINTER: {
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
pprop->type = type;
- if(type && (type->flag & STRUCT_ID_REFCOUNT))
+ if (type && (type->flag & STRUCT_ID_REFCOUNT))
prop->flag |= PROP_ID_REFCOUNT;
break;
}
case PROP_COLLECTION: {
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
cprop->item_type = type;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", invalid type for struct type.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
{
- StructRNA *srna= DefRNA.laststruct;
- int i, defaultfound= 0;
+ StructRNA *srna = DefRNA.laststruct;
+ int i, defaultfound = 0;
- switch(prop->type) {
+ switch (prop->type) {
case PROP_ENUM: {
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
- eprop->item= (EnumPropertyItem*)item;
- eprop->totitem= 0;
- for(i=0; item[i].identifier; i++) {
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
+ eprop->item = (EnumPropertyItem*)item;
+ eprop->totitem = 0;
+ for (i = 0; item[i].identifier; i++) {
eprop->totitem++;
- if(item[i].identifier[0] && item[i].value == eprop->defaultvalue)
- defaultfound= 1;
+ if (item[i].identifier[0] && item[i].value == eprop->defaultvalue)
+ defaultfound = 1;
}
- if(!defaultfound) {
- for(i=0; item[i].identifier; i++) {
- if(item[i].identifier[0]) {
- eprop->defaultvalue= item[i].value;
+ if (!defaultfound) {
+ for (i = 0; item[i].identifier; i++) {
+ if (item[i].identifier[0]) {
+ eprop->defaultvalue = item[i].value;
break;
}
}
@@ -1280,184 +1280,184 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item
}
default:
fprintf(stderr, "%s: \"%s.%s\", invalid type for struct type.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- switch(prop->type) {
+ switch (prop->type) {
case PROP_STRING: {
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
- sprop->maxlength= maxlength;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
+ sprop->maxlength = maxlength;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not string.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_boolean_default(PropertyRNA *prop, int value)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- switch(prop->type) {
+ switch (prop->type) {
case PROP_BOOLEAN: {
- BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
- bprop->defaultvalue= value;
+ BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
+ bprop->defaultvalue = value;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not boolean.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- switch(prop->type) {
+ switch (prop->type) {
case PROP_BOOLEAN: {
- BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
- bprop->defaultarray= array;
+ BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
+ bprop->defaultarray = array;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not boolean.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_int_default(PropertyRNA *prop, int value)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- switch(prop->type) {
+ switch (prop->type) {
case PROP_INT: {
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
- iprop->defaultvalue= value;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
+ iprop->defaultvalue = value;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not int.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- switch(prop->type) {
+ switch (prop->type) {
case PROP_INT: {
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
- iprop->defaultarray= array;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
+ iprop->defaultarray = array;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not int.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_float_default(PropertyRNA *prop, float value)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- switch(prop->type) {
+ switch (prop->type) {
case PROP_FLOAT: {
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
- fprop->defaultvalue= value;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
+ fprop->defaultvalue = value;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not float.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
/* array must remain valid after this function finishes */
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- switch(prop->type) {
+ switch (prop->type) {
case PROP_FLOAT: {
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
- fprop->defaultarray= array; /* WARNING, this array must not come from the stack and lost */
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
+ fprop->defaultarray = array; /* WARNING, this array must not come from the stack and lost */
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not float.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- switch(prop->type) {
+ switch (prop->type) {
case PROP_STRING: {
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
- sprop->defaultvalue= value;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
+ sprop->defaultvalue = value;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not string.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
{
- StructRNA *srna= DefRNA.laststruct;
- int i, defaultfound= 0;
+ StructRNA *srna = DefRNA.laststruct;
+ int i, defaultfound = 0;
- switch(prop->type) {
+ switch (prop->type) {
case PROP_ENUM: {
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
- eprop->defaultvalue= value;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
+ eprop->defaultvalue = value;
- if(prop->flag & PROP_ENUM_FLAG) {
+ if (prop->flag & PROP_ENUM_FLAG) {
/* check all bits are accounted for */
- int totflag= 0;
- for(i=0; i<eprop->totitem; i++) {
- if(eprop->item[i].identifier[0]) {
+ int totflag = 0;
+ for (i = 0; i<eprop->totitem; i++) {
+ if (eprop->item[i].identifier[0]) {
totflag |= eprop->item[i].value;
}
}
- if(eprop->defaultvalue & ~totflag) {
+ if (eprop->defaultvalue & ~totflag) {
fprintf(stderr, "%s: \"%s.%s\", default includes unused bits (%d).\n", __func__, srna->identifier, prop->identifier, eprop->defaultvalue & ~totflag);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
}
else {
- for(i=0; i<eprop->totitem; i++) {
- if(eprop->item[i].identifier[0] && eprop->item[i].value == eprop->defaultvalue)
- defaultfound= 1;
+ for (i = 0; i<eprop->totitem; i++) {
+ if (eprop->item[i].identifier[0] && eprop->item[i].value == eprop->defaultvalue)
+ defaultfound = 1;
}
- if(!defaultfound && eprop->totitem) {
- if(value == 0) {
- eprop->defaultvalue= eprop->item[0].value;
+ if (!defaultfound && eprop->totitem) {
+ if (value == 0) {
+ eprop->defaultvalue = eprop->item[0].value;
}
else {
fprintf(stderr, "%s: \"%s.%s\", default is not in items.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
}
}
@@ -1466,7 +1466,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value)
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not enum.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
@@ -1479,55 +1479,55 @@ static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop, const char *stru
StructDefRNA *ds;
PropertyDefRNA *dp;
- dp= rna_find_struct_property_def(DefRNA.laststruct, prop);
- if (dp==NULL) return NULL;
+ dp = rna_find_struct_property_def(DefRNA.laststruct, prop);
+ if (dp == NULL) return NULL;
- ds= rna_find_struct_def((StructRNA*)dp->cont);
+ ds = rna_find_struct_def((StructRNA*)dp->cont);
- if(!structname)
- structname= ds->dnaname;
- if(!propname)
- propname= prop->identifier;
+ if (!structname)
+ structname = ds->dnaname;
+ if (!propname)
+ propname = prop->identifier;
- if(!rna_find_sdna_member(DefRNA.sdna, structname, propname, &smember)) {
- if(DefRNA.silent) {
+ if (!rna_find_sdna_member(DefRNA.sdna, structname, propname, &smember)) {
+ if (DefRNA.silent) {
return NULL;
}
- else if(!DefRNA.verify) {
+ else if (!DefRNA.verify) {
/* some basic values to survive even with sdna info */
- dp->dnastructname= structname;
- dp->dnaname= propname;
- if(prop->type == PROP_BOOLEAN)
- dp->dnaarraylength= 1;
- if(prop->type == PROP_POINTER)
- dp->dnapointerlevel= 1;
+ dp->dnastructname = structname;
+ dp->dnaname = propname;
+ if (prop->type == PROP_BOOLEAN)
+ dp->dnaarraylength = 1;
+ if (prop->type == PROP_POINTER)
+ dp->dnapointerlevel = 1;
return dp;
}
else {
fprintf(stderr, "%s: \"%s.%s\" (identifier \"%s\") not found.\n",
__func__, structname, propname, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return NULL;
}
}
- if(smember.arraylength > 1) {
- prop->arraylength[0]= smember.arraylength;
- prop->totarraylength= smember.arraylength;
- prop->arraydimension= 1;
+ if (smember.arraylength > 1) {
+ prop->arraylength[0] = smember.arraylength;
+ prop->totarraylength = smember.arraylength;
+ prop->arraydimension = 1;
}
else {
- prop->arraydimension= 0;
- prop->totarraylength= 0;
+ prop->arraydimension = 0;
+ prop->totarraylength = 0;
}
- dp->dnastructname= structname;
- dp->dnastructfromname= ds->dnafromname;
- dp->dnastructfromprop= ds->dnafromprop;
- dp->dnaname= propname;
- dp->dnatype= smember.type;
- dp->dnaarraylength= smember.arraylength;
- dp->dnapointerlevel= smember.pointerlevel;
+ dp->dnastructname = structname;
+ dp->dnastructfromname = ds->dnafromname;
+ dp->dnastructfromprop = ds->dnafromprop;
+ dp->dnaname = propname;
+ dp->dnatype = smember.type;
+ dp->dnaarraylength = smember.arraylength;
+ dp->dnapointerlevel = smember.pointerlevel;
return dp;
}
@@ -1535,31 +1535,31 @@ static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop, const char *stru
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int bit)
{
PropertyDefRNA *dp;
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- if(prop->type != PROP_BOOLEAN) {
+ if (prop->type != PROP_BOOLEAN) {
fprintf(stderr, "%s: \"%s.%s\", type is not boolean.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
- if((dp=rna_def_property_sdna(prop, structname, propname))) {
+ if ((dp = rna_def_property_sdna(prop, structname, propname))) {
- if(DefRNA.silent == 0) {
+ if (DefRNA.silent == 0) {
/* error check to ensure floats are not wrapped as ints/bools */
- if(dp->dnatype && *dp->dnatype && IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) {
+ if (dp->dnatype && *dp->dnatype && IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) {
fprintf(stderr, "%s: %s.%s is a '%s' but wrapped as type '%s'.\n", __func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
}
- dp->booleanbit= bit;
+ dp->booleanbit = bit;
}
}
@@ -1569,94 +1569,94 @@ void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *struc
RNA_def_property_boolean_sdna(prop, structname, propname, booleanbit);
- dp= rna_find_struct_property_def(DefRNA.laststruct, prop);
+ dp = rna_find_struct_property_def(DefRNA.laststruct, prop);
- if(dp)
- dp->booleannegative= 1;
+ if (dp)
+ dp->booleannegative = 1;
}
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
{
PropertyDefRNA *dp;
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
- StructRNA *srna= DefRNA.laststruct;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- if(prop->type != PROP_INT) {
+ if (prop->type != PROP_INT) {
fprintf(stderr, "%s: \"%s.%s\", type is not int.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
- if((dp= rna_def_property_sdna(prop, structname, propname))) {
+ if ((dp = rna_def_property_sdna(prop, structname, propname))) {
/* error check to ensure floats are not wrapped as ints/bools */
- if(DefRNA.silent == 0) {
- if(dp->dnatype && *dp->dnatype && IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) {
+ if (DefRNA.silent == 0) {
+ if (dp->dnatype && *dp->dnatype && IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) {
fprintf(stderr, "%s: %s.%s is a '%s' but wrapped as type '%s'.\n", __func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
}
/* SDNA doesn't pass us unsigned unfortunately .. */
- if(dp->dnatype && strcmp(dp->dnatype, "char") == 0) {
- iprop->hardmin= iprop->softmin= CHAR_MIN;
- iprop->hardmax= iprop->softmax= CHAR_MAX;
+ if (dp->dnatype && strcmp(dp->dnatype, "char") == 0) {
+ iprop->hardmin = iprop->softmin = CHAR_MIN;
+ iprop->hardmax = iprop->softmax = CHAR_MAX;
}
- else if(dp->dnatype && strcmp(dp->dnatype, "short") == 0) {
- iprop->hardmin= iprop->softmin= SHRT_MIN;
- iprop->hardmax= iprop->softmax= SHRT_MAX;
+ else if (dp->dnatype && strcmp(dp->dnatype, "short") == 0) {
+ iprop->hardmin = iprop->softmin = SHRT_MIN;
+ iprop->hardmax = iprop->softmax = SHRT_MAX;
}
- else if(dp->dnatype && strcmp(dp->dnatype, "int") == 0) {
- iprop->hardmin= INT_MIN;
- iprop->hardmax= INT_MAX;
+ else if (dp->dnatype && strcmp(dp->dnatype, "int") == 0) {
+ iprop->hardmin = INT_MIN;
+ iprop->hardmax = INT_MAX;
- iprop->softmin= -10000; /* rather arbitrary .. */
- iprop->softmax= 10000;
+ iprop->softmin = -10000; /* rather arbitrary .. */
+ iprop->softmax = 10000;
}
- if(prop->subtype == PROP_UNSIGNED || prop->subtype == PROP_PERCENTAGE || prop->subtype == PROP_FACTOR)
- iprop->hardmin= iprop->softmin= 0;
+ if (prop->subtype == PROP_UNSIGNED || prop->subtype == PROP_PERCENTAGE || prop->subtype == PROP_FACTOR)
+ iprop->hardmin = iprop->softmin = 0;
}
}
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
{
PropertyDefRNA *dp;
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
- StructRNA *srna= DefRNA.laststruct;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- if(prop->type != PROP_FLOAT) {
+ if (prop->type != PROP_FLOAT) {
fprintf(stderr, "%s: \"%s.%s\", type is not float.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
- if((dp= rna_def_property_sdna(prop, structname, propname))) {
+ if ((dp = rna_def_property_sdna(prop, structname, propname))) {
/* silent is for internal use */
- if(DefRNA.silent == 0) {
- if(dp->dnatype && *dp->dnatype && IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) {
- if(prop->subtype != PROP_COLOR_GAMMA) { /* colors are an exception. these get translated */
+ if (DefRNA.silent == 0) {
+ if (dp->dnatype && *dp->dnatype && IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) {
+ if (prop->subtype != PROP_COLOR_GAMMA) { /* colors are an exception. these get translated */
fprintf(stderr, "%s: %s.%s is a '%s' but wrapped as type '%s'.\n", __func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
}
}
- if(dp->dnatype && strcmp(dp->dnatype, "char") == 0) {
- fprop->hardmin= fprop->softmin= 0.0f;
- fprop->hardmax= fprop->softmax= 1.0f;
+ if (dp->dnatype && strcmp(dp->dnatype, "char") == 0) {
+ fprop->hardmin = fprop->softmin = 0.0f;
+ fprop->hardmax = fprop->softmax = 1.0f;
}
}
@@ -1666,27 +1666,27 @@ void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, cons
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
{
/* PropertyDefRNA *dp; */
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- if(prop->type != PROP_ENUM) {
+ if (prop->type != PROP_ENUM) {
fprintf(stderr, "%s: \"%s.%s\", type is not enum.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
- if(( /* dp= */ rna_def_property_sdna(prop, structname, propname))) {
- if(prop->arraydimension) {
- prop->arraydimension= 0;
- prop->totarraylength= 0;
+ if (( /* dp= */ rna_def_property_sdna(prop, structname, propname))) {
+ if (prop->arraydimension) {
+ prop->arraydimension = 0;
+ prop->totarraylength = 0;
- if(!DefRNA.silent) {
+ if (!DefRNA.silent) {
fprintf(stderr, "%s: \"%s.%s\", array not supported for enum type.\n", __func__, structname, propname);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
}
}
@@ -1698,34 +1698,34 @@ void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structnam
RNA_def_property_enum_sdna(prop, structname, propname);
- dp= rna_find_struct_property_def(DefRNA.laststruct, prop);
+ dp = rna_find_struct_property_def(DefRNA.laststruct, prop);
- if(dp)
- dp->enumbitflags= 1;
+ if (dp)
+ dp->enumbitflags = 1;
}
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
{
/* PropertyDefRNA *dp; */
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
- StructRNA *srna= DefRNA.laststruct;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- if(prop->type != PROP_STRING) {
+ if (prop->type != PROP_STRING) {
fprintf(stderr, "%s: \"%s.%s\", type is not string.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
- if((/* dp= */ rna_def_property_sdna(prop, structname, propname))) {
- if(prop->arraydimension) {
- sprop->maxlength= prop->totarraylength;
- prop->arraydimension= 0;
- prop->totarraylength= 0;
+ if ((/* dp= */ rna_def_property_sdna(prop, structname, propname))) {
+ if (prop->arraydimension) {
+ sprop->maxlength = prop->totarraylength;
+ prop->arraydimension = 0;
+ prop->totarraylength = 0;
}
}
}
@@ -1733,27 +1733,27 @@ void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, con
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
{
/* PropertyDefRNA *dp; */
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- if(prop->type != PROP_POINTER) {
+ if (prop->type != PROP_POINTER) {
fprintf(stderr, "%s: \"%s.%s\", type is not pointer.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
- if((/* dp= */ rna_def_property_sdna(prop, structname, propname))) {
- if(prop->arraydimension) {
- prop->arraydimension= 0;
- prop->totarraylength= 0;
+ if ((/* dp= */ rna_def_property_sdna(prop, structname, propname))) {
+ if (prop->arraydimension) {
+ prop->arraydimension = 0;
+ prop->totarraylength = 0;
- if(!DefRNA.silent) {
+ if (!DefRNA.silent) {
fprintf(stderr, "%s: \"%s.%s\", array not supported for pointer type.\n", __func__, structname, propname);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
}
}
@@ -1762,69 +1762,69 @@ void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, co
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
{
PropertyDefRNA *dp;
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
- StructRNA *srna= DefRNA.laststruct;
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- if(prop->type != PROP_COLLECTION) {
+ if (prop->type != PROP_COLLECTION) {
fprintf(stderr, "%s: \"%s.%s\", type is not collection.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
- if((dp=rna_def_property_sdna(prop, structname, propname))) {
- if(prop->arraydimension && !lengthpropname) {
- prop->arraydimension= 0;
- prop->totarraylength= 0;
+ if ((dp = rna_def_property_sdna(prop, structname, propname))) {
+ if (prop->arraydimension && !lengthpropname) {
+ prop->arraydimension = 0;
+ prop->totarraylength = 0;
- if(!DefRNA.silent) {
+ if (!DefRNA.silent) {
fprintf(stderr, "%s: \"%s.%s\", array of collections not supported.\n", __func__, structname, propname);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
}
- if(dp->dnatype && strcmp(dp->dnatype, "ListBase") == 0) {
- cprop->next= (PropCollectionNextFunc)"rna_iterator_listbase_next";
- cprop->get= (PropCollectionGetFunc)"rna_iterator_listbase_get";
- cprop->end= (PropCollectionEndFunc)"rna_iterator_listbase_end";
+ if (dp->dnatype && strcmp(dp->dnatype, "ListBase") == 0) {
+ cprop->next = (PropCollectionNextFunc)"rna_iterator_listbase_next";
+ cprop->get = (PropCollectionGetFunc)"rna_iterator_listbase_get";
+ cprop->end = (PropCollectionEndFunc)"rna_iterator_listbase_end";
}
}
- if(dp && lengthpropname) {
+ if (dp && lengthpropname) {
DNAStructMember smember;
- StructDefRNA *ds= rna_find_struct_def((StructRNA*)dp->cont);
+ StructDefRNA *ds = rna_find_struct_def((StructRNA*)dp->cont);
- if(!structname)
- structname= ds->dnaname;
+ if (!structname)
+ structname = ds->dnaname;
- if(lengthpropname[0] == 0 || rna_find_sdna_member(DefRNA.sdna, structname, lengthpropname, &smember)) {
- if(lengthpropname[0] == 0) {
- dp->dnalengthfixed= prop->totarraylength;
- prop->arraydimension= 0;
- prop->totarraylength= 0;
+ if (lengthpropname[0] == 0 || rna_find_sdna_member(DefRNA.sdna, structname, lengthpropname, &smember)) {
+ if (lengthpropname[0] == 0) {
+ dp->dnalengthfixed = prop->totarraylength;
+ prop->arraydimension = 0;
+ prop->totarraylength = 0;
}
else {
- dp->dnalengthstructname= structname;
- dp->dnalengthname= lengthpropname;
- prop->totarraylength= 0;
+ dp->dnalengthstructname = structname;
+ dp->dnalengthname = lengthpropname;
+ prop->totarraylength = 0;
}
- cprop->next= (PropCollectionNextFunc)"rna_iterator_array_next";
- cprop->end= (PropCollectionEndFunc)"rna_iterator_array_end";
+ cprop->next = (PropCollectionNextFunc)"rna_iterator_array_next";
+ cprop->end = (PropCollectionEndFunc)"rna_iterator_array_end";
- if(dp->dnapointerlevel >= 2)
- cprop->get= (PropCollectionGetFunc)"rna_iterator_array_dereference_get";
+ if (dp->dnapointerlevel >= 2)
+ cprop->get = (PropCollectionGetFunc)"rna_iterator_array_dereference_get";
else
- cprop->get= (PropCollectionGetFunc)"rna_iterator_array_get";
+ cprop->get = (PropCollectionGetFunc)"rna_iterator_array_get";
}
else {
- if(!DefRNA.silent) {
+ if (!DefRNA.silent) {
fprintf(stderr, "%s: \"%s.%s\" not found.\n", __func__, structname, lengthpropname);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
}
}
@@ -1832,279 +1832,279 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname,
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
{
- prop->translation_context= context;
+ prop->translation_context = context;
}
/* Functions */
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
{
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- if(editable) prop->editable= (EditableFunc)editable;
+ if (editable) prop->editable = (EditableFunc)editable;
}
void RNA_def_property_editable_array_func(PropertyRNA *prop, const char *editable)
{
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- if(editable) prop->itemeditable= (ItemEditableFunc)editable;
+ if (editable) prop->itemeditable = (ItemEditableFunc)editable;
}
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
{
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- prop->noteflag= noteflag;
- prop->update= (UpdateFunc)func;
+ prop->noteflag = noteflag;
+ prop->update = (UpdateFunc)func;
}
void RNA_def_property_update_runtime(PropertyRNA *prop, void *func)
{
- prop->update= func;
+ prop->update = func;
}
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
{
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
if (!(prop->flag & PROP_DYNAMIC)) {
fprintf(stderr, "%s: property is a not dynamic array.\n", __func__);
- DefRNA.error= 1;
+ DefRNA.error = 1;
return;
}
- if(getlength) prop->getlength= (PropArrayLengthGetFunc)getlength;
+ if (getlength) prop->getlength = (PropArrayLengthGetFunc)getlength;
}
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- switch(prop->type) {
+ switch (prop->type) {
case PROP_BOOLEAN: {
- BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+ BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
- if(prop->arraydimension) {
- if(get) bprop->getarray= (PropBooleanArrayGetFunc)get;
- if(set) bprop->setarray= (PropBooleanArraySetFunc)set;
+ if (prop->arraydimension) {
+ if (get) bprop->getarray = (PropBooleanArrayGetFunc)get;
+ if (set) bprop->setarray = (PropBooleanArraySetFunc)set;
}
else {
- if(get) bprop->get= (PropBooleanGetFunc)get;
- if(set) bprop->set= (PropBooleanSetFunc)set;
+ if (get) bprop->get = (PropBooleanGetFunc)get;
+ if (set) bprop->set = (PropBooleanSetFunc)set;
}
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not boolean.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- switch(prop->type) {
+ switch (prop->type) {
case PROP_INT: {
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
- if(prop->arraydimension) {
- if(get) iprop->getarray= (PropIntArrayGetFunc)get;
- if(set) iprop->setarray= (PropIntArraySetFunc)set;
+ if (prop->arraydimension) {
+ if (get) iprop->getarray = (PropIntArrayGetFunc)get;
+ if (set) iprop->setarray = (PropIntArraySetFunc)set;
}
else {
- if(get) iprop->get= (PropIntGetFunc)get;
- if(set) iprop->set= (PropIntSetFunc)set;
+ if (get) iprop->get = (PropIntGetFunc)get;
+ if (set) iprop->set = (PropIntSetFunc)set;
}
- if(range) iprop->range= (PropIntRangeFunc)range;
+ if (range) iprop->range = (PropIntRangeFunc)range;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not int.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- switch(prop->type) {
+ switch (prop->type) {
case PROP_FLOAT: {
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
- if(prop->arraydimension) {
- if(get) fprop->getarray= (PropFloatArrayGetFunc)get;
- if(set) fprop->setarray= (PropFloatArraySetFunc)set;
+ if (prop->arraydimension) {
+ if (get) fprop->getarray = (PropFloatArrayGetFunc)get;
+ if (set) fprop->setarray = (PropFloatArraySetFunc)set;
}
else {
- if(get) fprop->get= (PropFloatGetFunc)get;
- if(set) fprop->set= (PropFloatSetFunc)set;
+ if (get) fprop->get = (PropFloatGetFunc)get;
+ if (set) fprop->set = (PropFloatSetFunc)set;
}
- if(range) fprop->range= (PropFloatRangeFunc)range;
+ if (range) fprop->range = (PropFloatRangeFunc)range;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not float.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- switch(prop->type) {
+ switch (prop->type) {
case PROP_ENUM: {
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
- if(get) eprop->get= (PropEnumGetFunc)get;
- if(set) eprop->set= (PropEnumSetFunc)set;
- if(item) eprop->itemf= (PropEnumItemFunc)item;
+ if (get) eprop->get = (PropEnumGetFunc)get;
+ if (set) eprop->set = (PropEnumSetFunc)set;
+ if (item) eprop->itemf = (PropEnumItemFunc)item;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not enum.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- switch(prop->type) {
+ switch (prop->type) {
case PROP_STRING: {
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
- if(get) sprop->get= (PropStringGetFunc)get;
- if(length) sprop->length= (PropStringLengthFunc)length;
- if(set) sprop->set= (PropStringSetFunc)set;
+ if (get) sprop->get = (PropStringGetFunc)get;
+ if (length) sprop->length = (PropStringLengthFunc)length;
+ if (set) sprop->set = (PropStringSetFunc)set;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not string.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *typef, const char *poll)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- switch(prop->type) {
+ switch (prop->type) {
case PROP_POINTER: {
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
- if(get) pprop->get= (PropPointerGetFunc)get;
- if(set) pprop->set= (PropPointerSetFunc)set;
- if(typef) pprop->typef= (PropPointerTypeFunc)typef;
- if(poll) pprop->poll= (PropPointerPollFunc)poll;
+ if (get) pprop->get = (PropPointerGetFunc)get;
+ if (set) pprop->set = (PropPointerSetFunc)set;
+ if (typef) pprop->typef = (PropPointerTypeFunc)typef;
+ if (poll) pprop->poll = (PropPointerPollFunc)poll;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not pointer.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
{
- StructRNA *srna= DefRNA.laststruct;
+ StructRNA *srna = DefRNA.laststruct;
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
- switch(prop->type) {
+ switch (prop->type) {
case PROP_COLLECTION: {
- CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
-
- if(begin) cprop->begin= (PropCollectionBeginFunc)begin;
- if(next) cprop->next= (PropCollectionNextFunc)next;
- if(end) cprop->end= (PropCollectionEndFunc)end;
- if(get) cprop->get= (PropCollectionGetFunc)get;
- if(length) cprop->length= (PropCollectionLengthFunc)length;
- if(lookupint) cprop->lookupint= (PropCollectionLookupIntFunc)lookupint;
- if(lookupstring) cprop->lookupstring= (PropCollectionLookupStringFunc)lookupstring;
- if(assignint) cprop->assignint= (PropCollectionAssignIntFunc)assignint;
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
+
+ if (begin) cprop->begin = (PropCollectionBeginFunc)begin;
+ if (next) cprop->next = (PropCollectionNextFunc)next;
+ if (end) cprop->end = (PropCollectionEndFunc)end;
+ if (get) cprop->get = (PropCollectionGetFunc)get;
+ if (length) cprop->length = (PropCollectionLengthFunc)length;
+ if (lookupint) cprop->lookupint = (PropCollectionLookupIntFunc)lookupint;
+ if (lookupstring) cprop->lookupstring = (PropCollectionLookupStringFunc)lookupstring;
+ if (assignint) cprop->assignint = (PropCollectionAssignIntFunc)assignint;
break;
}
default:
fprintf(stderr, "%s: \"%s.%s\", type is not collection.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ DefRNA.error = 1;
break;
}
}
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
{
- prop->srna= (StructRNA*)type;
+ prop->srna = (StructRNA*)type;
}
void RNA_def_py_data(PropertyRNA *prop, void *py_data)
{
- prop->py_data= py_data;
+ prop->py_data = py_data;
}
/* Compact definitions */
PropertyRNA *RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, int default_value, const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_default(prop, default_value);
RNA_def_property_ui_text(prop, ui_name, ui_description);
@@ -2114,12 +2114,12 @@ PropertyRNA *RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier,
PropertyRNA *RNA_def_boolean_array(StructOrFunctionRNA *cont_, const char *identifier, int len, int *default_value,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_NONE);
- if(len != 0) RNA_def_property_array(prop, len);
- if(default_value) RNA_def_property_boolean_array_default(prop, default_value);
+ prop = RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_NONE);
+ if (len != 0) RNA_def_property_array(prop, len);
+ if (default_value) RNA_def_property_boolean_array_default(prop, default_value);
RNA_def_property_ui_text(prop, ui_name, ui_description);
return prop;
@@ -2128,12 +2128,12 @@ PropertyRNA *RNA_def_boolean_array(StructOrFunctionRNA *cont_, const char *ident
PropertyRNA *RNA_def_boolean_layer(StructOrFunctionRNA *cont_, const char *identifier, int len, int *default_value,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_LAYER);
- if(len != 0) RNA_def_property_array(prop, len);
- if(default_value) RNA_def_property_boolean_array_default(prop, default_value);
+ prop = RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_LAYER);
+ if (len != 0) RNA_def_property_array(prop, len);
+ if (default_value) RNA_def_property_boolean_array_default(prop, default_value);
RNA_def_property_ui_text(prop, ui_name, ui_description);
return prop;
@@ -2142,12 +2142,12 @@ PropertyRNA *RNA_def_boolean_layer(StructOrFunctionRNA *cont_, const char *ident
PropertyRNA *RNA_def_boolean_layer_member(StructOrFunctionRNA *cont_, const char *identifier, int len, int *default_value,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_LAYER_MEMBER);
- if(len != 0) RNA_def_property_array(prop, len);
- if(default_value) RNA_def_property_boolean_array_default(prop, default_value);
+ prop = RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ if (len != 0) RNA_def_property_array(prop, len);
+ if (default_value) RNA_def_property_boolean_array_default(prop, default_value);
RNA_def_property_ui_text(prop, ui_name, ui_description);
return prop;
@@ -2156,12 +2156,12 @@ PropertyRNA *RNA_def_boolean_layer_member(StructOrFunctionRNA *cont_, const char
PropertyRNA *RNA_def_boolean_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, int *default_value,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_XYZ); // XXX
- if(len != 0) RNA_def_property_array(prop, len);
- if(default_value) RNA_def_property_boolean_array_default(prop, default_value);
+ prop = RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_XYZ); /* XXX */
+ if (len != 0) RNA_def_property_array(prop, len);
+ if (default_value) RNA_def_property_boolean_array_default(prop, default_value);
RNA_def_property_ui_text(prop, ui_name, ui_description);
return prop;
@@ -2170,12 +2170,12 @@ PropertyRNA *RNA_def_boolean_vector(StructOrFunctionRNA *cont_, const char *iden
PropertyRNA *RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax,
const char *ui_name, const char *ui_description, int softmin, int softmax)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_INT, PROP_NONE);
+ prop = RNA_def_property(cont, identifier, PROP_INT, PROP_NONE);
RNA_def_property_int_default(prop, default_value);
- if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
+ if (hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
RNA_def_property_ui_text(prop, ui_name, ui_description);
RNA_def_property_ui_range(prop, softmin, softmax, 1, 3);
@@ -2185,13 +2185,13 @@ PropertyRNA *RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int
PropertyRNA *RNA_def_int_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, const int *default_value,
int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_INT, PROP_XYZ); // XXX
- if(len != 0) RNA_def_property_array(prop, len);
- if(default_value) RNA_def_property_int_array_default(prop, default_value);
- if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
+ prop = RNA_def_property(cont, identifier, PROP_INT, PROP_XYZ); /* XXX */
+ if (len != 0) RNA_def_property_array(prop, len);
+ if (default_value) RNA_def_property_int_array_default(prop, default_value);
+ if (hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
RNA_def_property_ui_text(prop, ui_name, ui_description);
RNA_def_property_ui_range(prop, softmin, softmax, 1, 3);
@@ -2201,13 +2201,13 @@ PropertyRNA *RNA_def_int_vector(StructOrFunctionRNA *cont_, const char *identifi
PropertyRNA *RNA_def_int_array(StructOrFunctionRNA *cont_, const char *identifier, int len, const int *default_value,
int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_INT, PROP_NONE);
- if(len != 0) RNA_def_property_array(prop, len);
- if(default_value) RNA_def_property_int_array_default(prop, default_value);
- if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
+ prop = RNA_def_property(cont, identifier, PROP_INT, PROP_NONE);
+ if (len != 0) RNA_def_property_array(prop, len);
+ if (default_value) RNA_def_property_int_array_default(prop, default_value);
+ if (hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
RNA_def_property_ui_text(prop, ui_name, ui_description);
RNA_def_property_ui_range(prop, softmin, softmax, 1, 3);
@@ -2217,12 +2217,12 @@ PropertyRNA *RNA_def_int_array(StructOrFunctionRNA *cont_, const char *identifie
PropertyRNA *RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_STRING, PROP_NONE);
- if(maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen);
- if(default_value) RNA_def_property_string_default(prop, default_value);
+ prop = RNA_def_property(cont, identifier, PROP_STRING, PROP_NONE);
+ if (maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen);
+ if (default_value) RNA_def_property_string_default(prop, default_value);
RNA_def_property_ui_text(prop, ui_name, ui_description);
return prop;
@@ -2231,12 +2231,12 @@ PropertyRNA *RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier,
PropertyRNA *RNA_def_string_file_path(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_STRING, PROP_FILEPATH);
- if(maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen);
- if(default_value) RNA_def_property_string_default(prop, default_value);
+ prop = RNA_def_property(cont, identifier, PROP_STRING, PROP_FILEPATH);
+ if (maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen);
+ if (default_value) RNA_def_property_string_default(prop, default_value);
RNA_def_property_ui_text(prop, ui_name, ui_description);
return prop;
@@ -2245,12 +2245,12 @@ PropertyRNA *RNA_def_string_file_path(StructOrFunctionRNA *cont_, const char *id
PropertyRNA *RNA_def_string_dir_path(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_STRING, PROP_DIRPATH);
- if(maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen);
- if(default_value) RNA_def_property_string_default(prop, default_value);
+ prop = RNA_def_property(cont, identifier, PROP_STRING, PROP_DIRPATH);
+ if (maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen);
+ if (default_value) RNA_def_property_string_default(prop, default_value);
RNA_def_property_ui_text(prop, ui_name, ui_description);
return prop;
@@ -2259,12 +2259,12 @@ PropertyRNA *RNA_def_string_dir_path(StructOrFunctionRNA *cont_, const char *ide
PropertyRNA *RNA_def_string_file_name(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_STRING, PROP_FILENAME);
- if(maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen);
- if(default_value) RNA_def_property_string_default(prop, default_value);
+ prop = RNA_def_property(cont, identifier, PROP_STRING, PROP_FILENAME);
+ if (maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen);
+ if (default_value) RNA_def_property_string_default(prop, default_value);
RNA_def_property_ui_text(prop, ui_name, ui_description);
return prop;
@@ -2273,12 +2273,12 @@ PropertyRNA *RNA_def_string_file_name(StructOrFunctionRNA *cont_, const char *id
PropertyRNA *RNA_def_string_translate(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_STRING, PROP_TRANSLATE);
- if(maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen);
- if(default_value) RNA_def_property_string_default(prop, default_value);
+ prop = RNA_def_property(cont, identifier, PROP_STRING, PROP_TRANSLATE);
+ if (maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen);
+ if (default_value) RNA_def_property_string_default(prop, default_value);
RNA_def_property_ui_text(prop, ui_name, ui_description);
return prop;
@@ -2287,16 +2287,16 @@ PropertyRNA *RNA_def_string_translate(StructOrFunctionRNA *cont_, const char *id
PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- if(!items) {
+ if (!items) {
printf("%s: items not allowed to be NULL.\n", __func__);
return NULL;
}
- prop= RNA_def_property(cont, identifier, PROP_ENUM, PROP_NONE);
- if(items) RNA_def_property_enum_items(prop, items);
+ prop = RNA_def_property(cont, identifier, PROP_ENUM, PROP_NONE);
+ if (items) RNA_def_property_enum_items(prop, items);
RNA_def_property_enum_default(prop, default_value);
RNA_def_property_ui_text(prop, ui_name, ui_description);
@@ -2307,17 +2307,17 @@ PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, co
PropertyRNA *RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- if(!items) {
+ if (!items) {
printf("%s: items not allowed to be NULL.\n", __func__);
return NULL;
}
- prop= RNA_def_property(cont, identifier, PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(cont, identifier, PROP_ENUM, PROP_NONE);
RNA_def_property_flag(prop, PROP_ENUM_FLAG); /* important to run before default set */
- if(items) RNA_def_property_enum_items(prop, items);
+ if (items) RNA_def_property_enum_items(prop, items);
RNA_def_property_enum_default(prop, default_value);
RNA_def_property_ui_text(prop, ui_name, ui_description);
@@ -2326,25 +2326,25 @@ PropertyRNA *RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifie
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
{
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
- eprop->itemf= itemfunc;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
+ eprop->itemf = itemfunc;
}
void RNA_def_enum_py_data(PropertyRNA *prop, void *py_data)
{
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
- eprop->py_data= py_data;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
+ eprop->py_data = py_data;
}
PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value,
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(cont, identifier, PROP_FLOAT, PROP_NONE);
RNA_def_property_float_default(prop, default_value);
- if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
+ if (hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
RNA_def_property_ui_text(prop, ui_name, ui_description);
RNA_def_property_ui_range(prop, softmin, softmax, 1, 3);
@@ -2354,13 +2354,13 @@ PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, f
PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value,
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_XYZ);
- if(len != 0) RNA_def_property_array(prop, len);
- if(default_value) RNA_def_property_float_array_default(prop, default_value);
- if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
+ prop = RNA_def_property(cont, identifier, PROP_FLOAT, PROP_XYZ);
+ if (len != 0) RNA_def_property_array(prop, len);
+ if (default_value) RNA_def_property_float_array_default(prop, default_value);
+ if (hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
RNA_def_property_ui_text(prop, ui_name, ui_description);
RNA_def_property_ui_range(prop, softmin, softmax, 1, 3);
@@ -2372,7 +2372,7 @@ PropertyRNA *RNA_def_float_vector_xyz(StructOrFunctionRNA *cont_, const char *id
{
PropertyRNA *prop;
- prop= RNA_def_float_vector(cont_, identifier, len, default_value, hardmin, hardmax, ui_name, ui_description, softmin, softmax);
+ prop = RNA_def_float_vector(cont_, identifier, len, default_value, hardmin, hardmax, ui_name, ui_description, softmin, softmax);
prop->subtype = PROP_XYZ_LENGTH;
return prop;
@@ -2381,13 +2381,13 @@ PropertyRNA *RNA_def_float_vector_xyz(StructOrFunctionRNA *cont_, const char *id
PropertyRNA *RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value,
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_COLOR);
- if(len != 0) RNA_def_property_array(prop, len);
- if(default_value) RNA_def_property_float_array_default(prop, default_value);
- if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
+ prop = RNA_def_property(cont, identifier, PROP_FLOAT, PROP_COLOR);
+ if (len != 0) RNA_def_property_array(prop, len);
+ if (default_value) RNA_def_property_float_array_default(prop, default_value);
+ if (hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
RNA_def_property_ui_text(prop, ui_name, ui_description);
RNA_def_property_ui_range(prop, softmin, softmax, 1, 3);
@@ -2398,17 +2398,17 @@ PropertyRNA *RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identif
PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, int rows, int columns, const float *default_value,
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
int length[2];
- length[0]= rows;
- length[1]= columns;
+ length[0] = rows;
+ length[1] = columns;
- prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(cont, identifier, PROP_FLOAT, PROP_MATRIX);
RNA_def_property_multi_array(prop, 2, length);
- if(default_value) RNA_def_property_float_array_default(prop, default_value);
- if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
+ if (default_value) RNA_def_property_float_array_default(prop, default_value);
+ if (hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
RNA_def_property_ui_text(prop, ui_name, ui_description);
RNA_def_property_ui_range(prop, softmin, softmax, 1, 3);
@@ -2418,19 +2418,19 @@ PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identi
PropertyRNA *RNA_def_float_rotation(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value,
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_FLOAT, (len != 0) ? PROP_EULER : PROP_ANGLE);
- if(len != 0) {
+ prop = RNA_def_property(cont, identifier, PROP_FLOAT, (len != 0) ? PROP_EULER : PROP_ANGLE);
+ if (len != 0) {
RNA_def_property_array(prop, len);
- if(default_value) RNA_def_property_float_array_default(prop, default_value);
+ if (default_value) RNA_def_property_float_array_default(prop, default_value);
}
else {
/* RNA_def_property_float_default must be called outside */
BLI_assert(default_value == NULL);
}
- if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
+ if (hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
RNA_def_property_ui_text(prop, ui_name, ui_description);
RNA_def_property_ui_range(prop, softmin, softmax, 1, 3);
@@ -2440,13 +2440,13 @@ PropertyRNA *RNA_def_float_rotation(StructOrFunctionRNA *cont_, const char *iden
PropertyRNA *RNA_def_float_array(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value,
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_NONE);
- if(len != 0) RNA_def_property_array(prop, len);
- if(default_value) RNA_def_property_float_array_default(prop, default_value);
- if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
+ prop = RNA_def_property(cont, identifier, PROP_FLOAT, PROP_NONE);
+ if (len != 0) RNA_def_property_array(prop, len);
+ if (default_value) RNA_def_property_float_array_default(prop, default_value);
+ if (hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
RNA_def_property_ui_text(prop, ui_name, ui_description);
RNA_def_property_ui_range(prop, softmin, softmax, 1, 3);
@@ -2456,12 +2456,12 @@ PropertyRNA *RNA_def_float_array(StructOrFunctionRNA *cont_, const char *identif
PropertyRNA *RNA_def_float_percentage(StructOrFunctionRNA *cont_, const char *identifier, float default_value,
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_PERCENTAGE);
+ prop = RNA_def_property(cont, identifier, PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_default(prop, default_value);
- if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
+ if (hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
RNA_def_property_ui_text(prop, ui_name, ui_description);
RNA_def_property_ui_range(prop, softmin, softmax, 1, 3);
@@ -2471,12 +2471,12 @@ PropertyRNA *RNA_def_float_percentage(StructOrFunctionRNA *cont_, const char *id
PropertyRNA *RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identifier, float default_value,
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(cont, identifier, PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_default(prop, default_value);
- if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
+ if (hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
RNA_def_property_ui_text(prop, ui_name, ui_description);
RNA_def_property_ui_range(prop, softmin, softmax, 1, 3);
@@ -2486,10 +2486,10 @@ PropertyRNA *RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identi
PropertyRNA *RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(cont, identifier, PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, type);
RNA_def_property_ui_text(prop, ui_name, ui_description);
@@ -2499,10 +2499,10 @@ PropertyRNA *RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier,
PropertyRNA *RNA_def_pointer_runtime(StructOrFunctionRNA *cont_, const char *identifier, StructRNA *type,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(cont, identifier, PROP_POINTER, PROP_NONE);
RNA_def_property_struct_runtime(prop, type);
RNA_def_property_ui_text(prop, ui_name, ui_description);
@@ -2512,10 +2512,10 @@ PropertyRNA *RNA_def_pointer_runtime(StructOrFunctionRNA *cont_, const char *ide
PropertyRNA *RNA_def_collection(StructOrFunctionRNA *cont_, const char *identifier, const char *type,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(cont, identifier, PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, type);
RNA_def_property_ui_text(prop, ui_name, ui_description);
@@ -2525,10 +2525,10 @@ PropertyRNA *RNA_def_collection(StructOrFunctionRNA *cont_, const char *identifi
PropertyRNA *RNA_def_collection_runtime(StructOrFunctionRNA *cont_, const char *identifier, StructRNA *type,
const char *ui_name, const char *ui_description)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(cont, identifier, PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, type);
RNA_def_property_ui_text(prop, ui_name, ui_description);
@@ -2543,29 +2543,29 @@ static FunctionRNA *rna_def_function(StructRNA *srna, const char *identifier)
StructDefRNA *dsrna;
FunctionDefRNA *dfunc;
- if(DefRNA.preprocess) {
+ if (DefRNA.preprocess) {
char error[512];
if (rna_validate_identifier(identifier, error, 0) == 0) {
fprintf(stderr, "%s: function identifier \"%s\" - %s\n", __func__, identifier, error);
- DefRNA.error= 1;
+ DefRNA.error = 1;
}
}
- func= MEM_callocN(sizeof(FunctionRNA), "FunctionRNA");
- func->identifier= identifier;
- func->description= identifier;
+ func = MEM_callocN(sizeof(FunctionRNA), "FunctionRNA");
+ func->identifier = identifier;
+ func->description = identifier;
rna_addtail(&srna->functions, func);
- if(DefRNA.preprocess) {
- dsrna= rna_find_struct_def(srna);
- dfunc= MEM_callocN(sizeof(FunctionDefRNA), "FunctionDefRNA");
+ if (DefRNA.preprocess) {
+ dsrna = rna_find_struct_def(srna);
+ dfunc = MEM_callocN(sizeof(FunctionDefRNA), "FunctionDefRNA");
rna_addtail(&dsrna->functions, dfunc);
- dfunc->func= func;
+ dfunc->func = func;
}
else
- func->flag|= FUNC_RUNTIME;
+ func->flag |= FUNC_RUNTIME;
return func;
}
@@ -2575,15 +2575,15 @@ FunctionRNA *RNA_def_function(StructRNA *srna, const char *identifier, const cha
FunctionRNA *func;
FunctionDefRNA *dfunc;
- func= rna_def_function(srna, identifier);
+ func = rna_def_function(srna, identifier);
- if(!DefRNA.preprocess) {
+ if (!DefRNA.preprocess) {
fprintf(stderr, "%s: only at preprocess time.\n", __func__);
return func;
}
- dfunc= rna_find_function_def(func);
- dfunc->call= call;
+ dfunc = rna_find_function_def(func);
+ dfunc->call = call;
return func;
}
@@ -2592,14 +2592,14 @@ FunctionRNA *RNA_def_function_runtime(StructRNA *srna, const char *identifier, C
{
FunctionRNA *func;
- func= rna_def_function(srna, identifier);
+ func = rna_def_function(srna, identifier);
- if(DefRNA.preprocess) {
+ if (DefRNA.preprocess) {
fprintf(stderr, "%s: only at runtime.\n", __func__);
return func;
}
- func->call= call;
+ func->call = call;
return func;
@@ -2617,32 +2617,32 @@ void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
return;
}
- func->c_ret= ret;
+ func->c_ret = ret;
RNA_def_function_output(func, ret);
}
void RNA_def_function_output(FunctionRNA *UNUSED(func), PropertyRNA *ret)
{
- ret->flag|= PROP_OUTPUT;
+ ret->flag |= PROP_OUTPUT;
}
void RNA_def_function_flag(FunctionRNA *func, int flag)
{
- func->flag|= flag;
+ func->flag |= flag;
}
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
{
- func->description= description;
+ func->description = description;
}
int rna_parameter_size(PropertyRNA *parm)
{
- PropertyType ptype= parm->type;
- int len= parm->totarraylength; /* only supports fixed length at the moment */
+ PropertyType ptype = parm->type;
+ int len = parm->totarraylength; /* only supports fixed length at the moment */
- if(len > 0) {
+ if (len > 0) {
/* XXX in other parts is mentioned that strings can be dynamic as well */
if (parm->flag & PROP_DYNAMIC)
return sizeof(void *);
@@ -2667,19 +2667,19 @@ int rna_parameter_size(PropertyRNA *parm)
return sizeof(float);
case PROP_STRING:
/* return values don't store a pointer to the original */
- if(parm->flag & PROP_THICK_WRAP) {
- StringPropertyRNA *sparm= (StringPropertyRNA*)parm;
+ if (parm->flag & PROP_THICK_WRAP) {
+ StringPropertyRNA *sparm = (StringPropertyRNA*)parm;
return sizeof(char) * sparm->maxlength;
} else
return sizeof(char *);
case PROP_POINTER: {
#ifdef RNA_RUNTIME
- if(parm->flag & PROP_RNAPTR)
+ if (parm->flag & PROP_RNAPTR)
return sizeof(PointerRNA);
else
return sizeof(void *);
#else
- if(parm->flag & PROP_RNAPTR)
+ if (parm->flag & PROP_RNAPTR)
return sizeof(PointerRNA);
else
return sizeof(void *);
@@ -2694,13 +2694,13 @@ int rna_parameter_size(PropertyRNA *parm)
}
/* this function returns the size of the memory allocated for the parameter,
- useful for instance for memory alignment or for storing additional information */
+ * useful for instance for memory alignment or for storing additional information */
int rna_parameter_size_alloc(PropertyRNA *parm)
{
int size = rna_parameter_size(parm);
if (parm->flag & PROP_DYNAMIC)
- size+= sizeof(((ParameterDynAlloc *)NULL)->array_tot);
+ size += sizeof(((ParameterDynAlloc *)NULL)->array_tot);
return size;
}
@@ -2710,21 +2710,21 @@ int rna_parameter_size_alloc(PropertyRNA *parm)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
{
EnumPropertyItem *newitems;
- int tot= *totitem;
+ int tot = *totitem;
- if(tot == 0) {
- *items= MEM_callocN(sizeof(EnumPropertyItem)*8, "RNA_enum_items_add");
+ if (tot == 0) {
+ *items = MEM_callocN(sizeof(EnumPropertyItem)*8, "RNA_enum_items_add");
}
- else if(tot >= 8 && (tot&(tot-1)) == 0){
+ else if (tot >= 8 && (tot&(tot-1)) == 0){
/* power of two > 8 */
- newitems= MEM_callocN(sizeof(EnumPropertyItem)*tot*2, "RNA_enum_items_add");
+ newitems = MEM_callocN(sizeof(EnumPropertyItem)*tot*2, "RNA_enum_items_add");
memcpy(newitems, *items, sizeof(EnumPropertyItem)*tot);
MEM_freeN(*items);
- *items= newitems;
+ *items = newitems;
}
- (*items)[tot]= *item;
- *totitem= tot+1;
+ (*items)[tot] = *item;
+ *totitem = tot+1;
}
void RNA_enum_item_add_separator(EnumPropertyItem **items, int *totitem)
@@ -2735,16 +2735,16 @@ void RNA_enum_item_add_separator(EnumPropertyItem **items, int *totitem)
void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, EnumPropertyItem *item)
{
- for(; item->identifier; item++)
+ for (; item->identifier; item++)
RNA_enum_item_add(items, totitem, item);
}
void RNA_enum_items_add_value(EnumPropertyItem **items, int *totitem, EnumPropertyItem *item, int value)
{
- for(; item->identifier; item++) {
- if(item->value == value) {
+ for (; item->identifier; item++) {
+ if (item->value == value) {
RNA_enum_item_add(items, totitem, item);
- break; // break on first match - does this break anything? (is quick hack to get object->parent_type working ok for armature/lattice)
+ break; /* break on first match - does this break anything? (is quick hack to get object->parent_type working ok for armature/lattice) */
}
}
}
@@ -2760,111 +2760,111 @@ void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
#ifdef RNA_RUNTIME
void RNA_def_struct_duplicate_pointers(StructRNA *srna)
{
- if(srna->identifier) srna->identifier= BLI_strdup(srna->identifier);
- if(srna->name) srna->name= BLI_strdup(srna->name);
- if(srna->description) srna->description= BLI_strdup(srna->description);
+ if (srna->identifier) srna->identifier = BLI_strdup(srna->identifier);
+ if (srna->name) srna->name = BLI_strdup(srna->name);
+ if (srna->description) srna->description = BLI_strdup(srna->description);
srna->flag |= STRUCT_FREE_POINTERS;
}
void RNA_def_struct_free_pointers(StructRNA *srna)
{
- if(srna->flag & STRUCT_FREE_POINTERS) {
- if(srna->identifier) MEM_freeN((void*)srna->identifier);
- if(srna->name) MEM_freeN((void*)srna->name);
- if(srna->description) MEM_freeN((void*)srna->description);
+ if (srna->flag & STRUCT_FREE_POINTERS) {
+ if (srna->identifier) MEM_freeN((void*)srna->identifier);
+ if (srna->name) MEM_freeN((void*)srna->name);
+ if (srna->description) MEM_freeN((void*)srna->description);
}
}
void RNA_def_func_duplicate_pointers(FunctionRNA *func)
{
- if(func->identifier) func->identifier= BLI_strdup(func->identifier);
- if(func->description) func->description= BLI_strdup(func->description);
+ if (func->identifier) func->identifier = BLI_strdup(func->identifier);
+ if (func->description) func->description = BLI_strdup(func->description);
func->flag |= FUNC_FREE_POINTERS;
}
void RNA_def_func_free_pointers(FunctionRNA *func)
{
- if(func->flag & FUNC_FREE_POINTERS) {
- if(func->identifier) MEM_freeN((void*)func->identifier);
- if(func->description) MEM_freeN((void*)func->description);
+ if (func->flag & FUNC_FREE_POINTERS) {
+ if (func->identifier) MEM_freeN((void*)func->identifier);
+ if (func->description) MEM_freeN((void*)func->description);
}
}
void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA *prop)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
EnumPropertyItem *earray;
float *farray;
int *iarray;
int a;
/* annoying since we just added this to a hash, could make this add the correct key to the hash in the first place */
- if(prop->identifier) {
- if(cont->prophash) {
+ if (prop->identifier) {
+ if (cont->prophash) {
BLI_ghash_remove(cont->prophash, (void*)prop->identifier, NULL, NULL);
- prop->identifier= BLI_strdup(prop->identifier);
+ prop->identifier = BLI_strdup(prop->identifier);
BLI_ghash_insert(cont->prophash, (void*)prop->identifier, prop);
}
else {
- prop->identifier= BLI_strdup(prop->identifier);
+ prop->identifier = BLI_strdup(prop->identifier);
}
}
- if(prop->name) prop->name= BLI_strdup(prop->name);
- if(prop->description) prop->description= BLI_strdup(prop->description);
+ if (prop->name) prop->name = BLI_strdup(prop->name);
+ if (prop->description) prop->description = BLI_strdup(prop->description);
- switch(prop->type) {
+ switch (prop->type) {
case PROP_BOOLEAN: {
- BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+ BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
- if(bprop->defaultarray) {
- iarray= MEM_callocN(sizeof(int)*prop->totarraylength, "RNA_def_property_store");
+ if (bprop->defaultarray) {
+ iarray = MEM_callocN(sizeof(int)*prop->totarraylength, "RNA_def_property_store");
memcpy(iarray, bprop->defaultarray, sizeof(int)*prop->totarraylength);
- bprop->defaultarray= iarray;
+ bprop->defaultarray = iarray;
}
break;
}
case PROP_INT: {
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
- if(iprop->defaultarray) {
- iarray= MEM_callocN(sizeof(int)*prop->totarraylength, "RNA_def_property_store");
+ if (iprop->defaultarray) {
+ iarray = MEM_callocN(sizeof(int)*prop->totarraylength, "RNA_def_property_store");
memcpy(iarray, iprop->defaultarray, sizeof(int)*prop->totarraylength);
- iprop->defaultarray= iarray;
+ iprop->defaultarray = iarray;
}
break;
}
case PROP_ENUM: {
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
- if(eprop->item) {
- earray= MEM_callocN(sizeof(EnumPropertyItem)*(eprop->totitem+1), "RNA_def_property_store"),
+ if (eprop->item) {
+ earray = MEM_callocN(sizeof(EnumPropertyItem)*(eprop->totitem+1), "RNA_def_property_store"),
memcpy(earray, eprop->item, sizeof(EnumPropertyItem)*(eprop->totitem+1));
- eprop->item= earray;
+ eprop->item = earray;
- for(a=0; a<eprop->totitem; a++) {
- if(eprop->item[a].identifier) eprop->item[a].identifier= BLI_strdup(eprop->item[a].identifier);
- if(eprop->item[a].name) eprop->item[a].name= BLI_strdup(eprop->item[a].name);
- if(eprop->item[a].description) eprop->item[a].description= BLI_strdup(eprop->item[a].description);
+ for (a = 0; a<eprop->totitem; a++) {
+ if (eprop->item[a].identifier) eprop->item[a].identifier = BLI_strdup(eprop->item[a].identifier);
+ if (eprop->item[a].name) eprop->item[a].name = BLI_strdup(eprop->item[a].name);
+ if (eprop->item[a].description) eprop->item[a].description = BLI_strdup(eprop->item[a].description);
}
}
break;
}
case PROP_FLOAT: {
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
- if(fprop->defaultarray) {
- farray= MEM_callocN(sizeof(float)*prop->totarraylength, "RNA_def_property_store");
+ if (fprop->defaultarray) {
+ farray = MEM_callocN(sizeof(float)*prop->totarraylength, "RNA_def_property_store");
memcpy(farray, fprop->defaultarray, sizeof(float)*prop->totarraylength);
- fprop->defaultarray= farray;
+ fprop->defaultarray = farray;
}
break;
}
case PROP_STRING: {
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
- if(sprop->defaultvalue) sprop->defaultvalue= BLI_strdup(sprop->defaultvalue);
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
+ if (sprop->defaultvalue) sprop->defaultvalue = BLI_strdup(sprop->defaultvalue);
break;
}
default:
@@ -2876,45 +2876,45 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA
void RNA_def_property_free_pointers(PropertyRNA *prop)
{
- if(prop->flag & PROP_FREE_POINTERS) {
+ if (prop->flag & PROP_FREE_POINTERS) {
int a;
- if(prop->identifier) MEM_freeN((void*)prop->identifier);
- if(prop->name) MEM_freeN((void*)prop->name);
- if(prop->description) MEM_freeN((void*)prop->description);
- if(prop->py_data) MEM_freeN(prop->py_data);
+ if (prop->identifier) MEM_freeN((void*)prop->identifier);
+ if (prop->name) MEM_freeN((void*)prop->name);
+ if (prop->description) MEM_freeN((void*)prop->description);
+ if (prop->py_data) MEM_freeN(prop->py_data);
- switch(prop->type) {
+ switch (prop->type) {
case PROP_BOOLEAN: {
- BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
- if(bprop->defaultarray) MEM_freeN((void*)bprop->defaultarray);
+ BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
+ if (bprop->defaultarray) MEM_freeN((void*)bprop->defaultarray);
break;
}
case PROP_INT: {
- IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
- if(iprop->defaultarray) MEM_freeN((void*)iprop->defaultarray);
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
+ if (iprop->defaultarray) MEM_freeN((void*)iprop->defaultarray);
break;
}
case PROP_FLOAT: {
- FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
- if(fprop->defaultarray) MEM_freeN((void*)fprop->defaultarray);
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
+ if (fprop->defaultarray) MEM_freeN((void*)fprop->defaultarray);
break;
}
case PROP_ENUM: {
- EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
- for(a=0; a<eprop->totitem; a++) {
- if(eprop->item[a].identifier) MEM_freeN((void*)eprop->item[a].identifier);
- if(eprop->item[a].name) MEM_freeN((void*)eprop->item[a].name);
- if(eprop->item[a].description) MEM_freeN((void*)eprop->item[a].description);
+ for (a = 0; a<eprop->totitem; a++) {
+ if (eprop->item[a].identifier) MEM_freeN((void*)eprop->item[a].identifier);
+ if (eprop->item[a].name) MEM_freeN((void*)eprop->item[a].name);
+ if (eprop->item[a].description) MEM_freeN((void*)eprop->item[a].description);
}
- if(eprop->item) MEM_freeN((void*)eprop->item);
+ if (eprop->item) MEM_freeN((void*)eprop->item);
break;
}
case PROP_STRING: {
- StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
- if(sprop->defaultvalue) MEM_freeN((void*)sprop->defaultvalue);
+ StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
+ if (sprop->defaultvalue) MEM_freeN((void*)sprop->defaultvalue);
break;
}
default:
@@ -2925,10 +2925,10 @@ void RNA_def_property_free_pointers(PropertyRNA *prop)
static void rna_def_property_free(StructOrFunctionRNA *cont_, PropertyRNA *prop)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
- if(prop->flag & PROP_RUNTIME) {
- if(cont->prophash)
+ if (prop->flag & PROP_RUNTIME) {
+ if (cont->prophash)
BLI_ghash_remove(cont->prophash, (void*)prop->identifier, NULL, NULL);
RNA_def_property_free_pointers(prop);
@@ -2942,12 +2942,12 @@ static void rna_def_property_free(StructOrFunctionRNA *cont_, PropertyRNA *prop)
/* note: only intended for removing dynamic props */
int RNA_def_property_free_identifier(StructOrFunctionRNA *cont_, const char *identifier)
{
- ContainerRNA *cont= cont_;
+ ContainerRNA *cont = cont_;
PropertyRNA *prop;
- for(prop= cont->properties.first; prop; prop= prop->next) {
- if(strcmp(prop->identifier, identifier)==0) {
- if(prop->flag & PROP_RUNTIME) {
+ for (prop = cont->properties.first; prop; prop = prop->next) {
+ if (strcmp(prop->identifier, identifier) == 0) {
+ if (prop->flag & PROP_RUNTIME) {
rna_def_property_free(cont_, prop);
return 1;
}
@@ -2962,7 +2962,7 @@ int RNA_def_property_free_identifier(StructOrFunctionRNA *cont_, const char *ide
const char *RNA_property_typename(PropertyType type)
{
- switch(type) {
+ switch (type) {
case PROP_BOOLEAN: return "PROP_BOOLEAN";
case PROP_INT: return "PROP_INT";
case PROP_FLOAT: return "PROP_FLOAT";
diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c
index 95770685077..e9e7f58b638 100644
--- a/source/blender/makesrna/intern/rna_dynamicpaint.c
+++ b/source/blender/makesrna/intern/rna_dynamicpaint.c
@@ -45,7 +45,7 @@ EnumPropertyItem prop_dynamicpaint_type_items[] = {
static char *rna_DynamicPaintCanvasSettings_path(PointerRNA *ptr)
{
DynamicPaintCanvasSettings *settings = (DynamicPaintCanvasSettings*)ptr->data;
- ModifierData *md= (ModifierData *)settings->pmd;
+ ModifierData *md = (ModifierData *)settings->pmd;
return BLI_sprintfN("modifiers[\"%s\"].canvas_settings", md->name);
}
@@ -53,7 +53,7 @@ static char *rna_DynamicPaintCanvasSettings_path(PointerRNA *ptr)
static char *rna_DynamicPaintBrushSettings_path(PointerRNA *ptr)
{
DynamicPaintBrushSettings *settings = (DynamicPaintBrushSettings*)ptr->data;
- ModifierData *md= (ModifierData *)settings->pmd;
+ ModifierData *md = (ModifierData *)settings->pmd;
return BLI_sprintfN("modifiers[\"%s\"].brush_settings", md->name);
}
@@ -61,15 +61,15 @@ static char *rna_DynamicPaintBrushSettings_path(PointerRNA *ptr)
static char *rna_DynamicPaintSurface_path(PointerRNA *ptr)
{
DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data;
- ModifierData *md= (ModifierData *)surface->canvas->pmd;
+ ModifierData *md = (ModifierData *)surface->canvas->pmd;
return BLI_sprintfN("modifiers[\"%s\"].canvas_settings.canvas_surfaces[\"%s\"]", md->name, surface->name);
}
/*
-* Surfaces
-*/
+ * Surfaces
+ */
static void rna_DynamicPaint_redoModifier(Main *bmain, Scene *scene, PointerRNA *ptr)
{
@@ -102,9 +102,9 @@ static void rna_DynamicPaintSurface_changePreview(Main *bmain, Scene *scene, Poi
DynamicPaintSurface *surface = act_surface->canvas->surfaces.first;
/* since only one color surface can show preview at time
- * disable preview on other surfaces*/
- for(; surface; surface=surface->next) {
- if(surface != act_surface)
+ * disable preview on other surfaces*/
+ for (; surface; surface = surface->next) {
+ if (surface != act_surface)
surface->flags &= ~MOD_DPAINT_PREVIEW;
}
rna_DynamicPaint_redoModifier(bmain, scene, ptr);
@@ -140,12 +140,12 @@ static void rna_DynamicPaint_resetDependancy(Main *bmain, Scene *scene, PointerR
static PointerRNA rna_PaintSurface_active_get(PointerRNA *ptr)
{
- DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data;
+ DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data;
DynamicPaintSurface *surface = canvas->surfaces.first;
- int id=0;
+ int id = 0;
- for(; surface; surface=surface->next) {
- if(id == canvas->active_sur)
+ for (; surface; surface = surface->next) {
+ if (id == canvas->active_sur)
return rna_pointer_inherit_refine(ptr, &RNA_DynamicPaintSurface, surface);
id++;
}
@@ -154,41 +154,41 @@ static PointerRNA rna_PaintSurface_active_get(PointerRNA *ptr)
static void rna_DynamicPaint_surfaces_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data;
- //rna_iterator_array_begin(iter, (void*)canvas->surfaces, sizeof(PaintSurface), canvas->totsur, 0, 0);
+ DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data;
+ /*rna_iterator_array_begin(iter, (void*)canvas->surfaces, sizeof(PaintSurface), canvas->totsur, 0, 0); */
rna_iterator_listbase_begin(iter, &canvas->surfaces, NULL);
}
static int rna_Surface_active_point_index_get(PointerRNA *ptr)
{
- DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data;
+ DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data;
return canvas->active_sur;
}
static void rna_Surface_active_point_index_set(struct PointerRNA *ptr, int value)
{
- DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data;
+ DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data;
canvas->active_sur = value;
return;
}
static void rna_Surface_active_point_range(PointerRNA *ptr, int *min, int *max)
{
- DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data;
+ DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data;
- *min= 0;
- *max= BLI_countlist(&canvas->surfaces)-1;
+ *min = 0;
+ *max = BLI_countlist(&canvas->surfaces)-1;
}
/* uvlayer */
static void rna_DynamicPaint_uvlayer_set(PointerRNA *ptr, const char *value)
{
- DynamicPaintCanvasSettings *canvas= ((DynamicPaintSurface*)ptr->data)->canvas;
+ DynamicPaintCanvasSettings *canvas = ((DynamicPaintSurface*)ptr->data)->canvas;
DynamicPaintSurface *surface = canvas->surfaces.first;
- int id=0;
+ int id = 0;
- for(; surface; surface=surface->next) {
- if(id == canvas->active_sur) {
+ for (; surface; surface = surface->next) {
+ if (id == canvas->active_sur) {
rna_object_uvlayer_name_set(ptr, value, surface->uvlayer_name, sizeof(surface->uvlayer_name));
return;
}
@@ -199,7 +199,7 @@ static void rna_DynamicPaint_uvlayer_set(PointerRNA *ptr, const char *value)
/* is point cache used */
static int rna_DynamicPaint_is_cache_user_get(PointerRNA *ptr)
{
- DynamicPaintSurface *surface= (DynamicPaintSurface*)ptr->data;
+ DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data;
return (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) ? 1 : 0;
}
@@ -213,11 +213,11 @@ static int rna_DynamicPaint_is_output_exists(DynamicPaintSurface *surface, Objec
static EnumPropertyItem *rna_DynamicPaint_surface_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{
- DynamicPaintSurface *surface= (DynamicPaintSurface*)ptr->data;
+ DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data;
- EnumPropertyItem *item= NULL;
- EnumPropertyItem tmp= {0, "", 0, "", ""};
- int totitem= 0;
+ EnumPropertyItem *item = NULL;
+ EnumPropertyItem tmp = {0, "", 0, "", ""};
+ int totitem = 0;
/* Paint type - available for all formats */
tmp.value = MOD_DPAINT_SURFACE_T_PAINT;
@@ -265,16 +265,16 @@ static void rna_def_canvas_surfaces(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "DynamicPaintSurfaces");
- srna= RNA_def_struct(brna, "DynamicPaintSurfaces", NULL);
+ srna = RNA_def_struct(brna, "DynamicPaintSurfaces", NULL);
RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings");
RNA_def_struct_ui_text(srna, "Canvas Surfaces", "Collection of Dynamic Paint Canvas surfaces");
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_funcs(prop, "rna_Surface_active_point_index_get", "rna_Surface_active_point_index_set", "rna_Surface_active_point_range");
RNA_def_property_ui_text(prop, "Active Point Cache Index", "");
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "DynamicPaintSurface");
RNA_def_property_pointer_funcs(prop, "rna_PaintSurface_active_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Surface", "Active Dynamic Paint surface being displayed");
@@ -291,7 +291,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
/* Surface format */
static EnumPropertyItem prop_dynamicpaint_surface_format[] = {
- //{MOD_DPAINT_SURFACE_F_PTEX, "PTEX", ICON_TEXTURE_SHADED, "Ptex", ""},
+ /*{MOD_DPAINT_SURFACE_F_PTEX, "PTEX", ICON_TEXTURE_SHADED, "Ptex", ""}, */
{MOD_DPAINT_SURFACE_F_VERTEX, "VERTEX", ICON_OUTLINER_DATA_MESH, "Vertex", ""},
{MOD_DPAINT_SURFACE_F_IMAGESEQ, "IMAGE", ICON_FILE_IMAGE, "Image Sequence", ""},
{0, NULL, 0, NULL, NULL}};
@@ -316,7 +316,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
/* Effect type
- * Only used by ui to view per effect settings */
+ * Only used by ui to view per effect settings */
static EnumPropertyItem prop_dynamicpaint_effecttype[] = {
{1, "SPREAD", 0, "Spread", ""},
{2, "DRIP", 0, "Drip", ""},
@@ -340,19 +340,19 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
/* Surface */
- srna= RNA_def_struct(brna, "DynamicPaintSurface", NULL);
+ srna = RNA_def_struct(brna, "DynamicPaintSurface", NULL);
RNA_def_struct_sdna(srna, "DynamicPaintSurface");
RNA_def_struct_ui_text(srna, "Paint Surface", "A canvas surface layer");
RNA_def_struct_path_func(srna, "rna_DynamicPaintSurface_path");
- prop= RNA_def_property(srna, "surface_format", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "surface_format", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "format");
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_format);
RNA_def_property_ui_text(prop, "Format", "Surface Format");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_changeFormat");
- prop= RNA_def_property(srna, "surface_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "surface_type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_type);
@@ -360,22 +360,22 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Surface Type", "Surface Type");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_changeType");
- prop= RNA_def_property(srna, "is_active", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ACTIVE);
RNA_def_property_ui_text(prop, "Is Active", "Toggle whether surface is processed or ignored");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "show_preview", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PREVIEW);
RNA_def_property_ui_text(prop, "Show Preview", "Display surface preview in 3D-views");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_changePreview");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Surface name");
RNA_def_property_update(prop, NC_OBJECT, "rna_DynamicPaintSurface_uniqueName");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "brush_group", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "brush_group", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Brush Group", "Only use brush objects from this group");
@@ -383,43 +383,43 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
/*
- * Paint, wet and displace
- */
+ * Paint, wet and displace
+ */
- prop= RNA_def_property(srna, "use_dissolve", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_dissolve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE);
RNA_def_property_ui_text(prop, "Dissolve", "Enable to make surface changes disappear over time");
- prop= RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "diss_speed");
RNA_def_property_range(prop, 1.0, 10000.0);
RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, 0);
RNA_def_property_ui_text(prop, "Dissolve Speed", "Approximately in how many frames should dissolve happen");
- prop= RNA_def_property(srna, "use_drying", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_drying", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_USE_DRYING);
RNA_def_property_ui_text(prop, "Dry", "Enable to make surface wetness dry over time");
- prop= RNA_def_property(srna, "dry_speed", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "dry_speed", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1.0, 10000.0);
RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, 0);
RNA_def_property_ui_text(prop, "Dry Speed", "Approximately in how many frames should drying happen");
/*
- * Simulation settings
- */
- prop= RNA_def_property(srna, "image_resolution", PROP_INT, PROP_NONE);
+ * Simulation settings
+ */
+ prop = RNA_def_property(srna, "image_resolution", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 16.0, 4096.0);
RNA_def_property_ui_range(prop, 16.0, 4096.0, 1, 0);
RNA_def_property_ui_text(prop, "Resolution", "Output image resolution");
- prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
RNA_def_property_ui_text(prop, "UV Map", "UV map name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DynamicPaint_uvlayer_set");
- prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "start_frame");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1.0, 9999.0);
@@ -427,7 +427,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Start Frame", "Simulation start frame");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames");
- prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "end_frame");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1.0, 9999.0);
@@ -435,26 +435,26 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "End Frame", "Simulation end frame");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames");
- prop= RNA_def_property(srna, "frame_substeps", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_substeps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "substeps");
RNA_def_property_range(prop, 0.0, 20.0);
RNA_def_property_ui_range(prop, 0.0, 10, 1, 0);
RNA_def_property_ui_text(prop, "Sub-Steps", "Do extra frames between scene frames to ensure smooth motion");
- prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ANTIALIAS);
RNA_def_property_ui_text(prop, "Anti-aliasing", "Use 5x multisampling to smoothen paint edges");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
- prop= RNA_def_property(srna, "brush_influence_scale", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "brush_influence_scale", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "influence_scale");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
RNA_def_property_ui_text(prop, "Influence Scale", "Adjust influence brush objects have on this surface");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "brush_radius_scale", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "brush_radius_scale", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "radius_scale");
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
@@ -462,136 +462,136 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
/*
- * Initial Color
- */
+ * Initial Color
+ */
- prop= RNA_def_property(srna, "init_color_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "init_color_type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, prop_dynamicpaint_init_color_type);
RNA_def_property_ui_text(prop, "Initial Color", "");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_initialcolortype");
- prop= RNA_def_property(srna, "init_color", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "init_color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Color", "Initial color of the surface");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
- prop= RNA_def_property(srna, "init_texture", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "init_texture", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture", "");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
- prop= RNA_def_property(srna, "init_layername", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "init_layername", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Data Layer", "");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
/*
- * Effect Settings
- */
- prop= RNA_def_property(srna, "effect_ui", PROP_ENUM, PROP_NONE);
+ * Effect Settings
+ */
+ prop = RNA_def_property(srna, "effect_ui", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, prop_dynamicpaint_effecttype);
RNA_def_property_ui_text(prop, "Effect Type", "");
- prop= RNA_def_property(srna, "use_dry_log", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_dry_log", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DRY_LOG);
RNA_def_property_ui_text(prop, "Slow", "Use logarithmic drying (makes high values to dry faster than low values)");
- prop= RNA_def_property(srna, "use_dissolve_log", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_dissolve_log", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE_LOG);
RNA_def_property_ui_text(prop, "Slow", "Use logarithmic dissolve (makes high values to fade faster than low values)");
- prop= RNA_def_property(srna, "use_spread", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_spread", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SPREAD);
RNA_def_property_ui_text(prop, "Use Spread", "Process spread effect (spread wet paint around surface)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
- prop= RNA_def_property(srna, "spread_speed", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "spread_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spread_speed");
RNA_def_property_range(prop, 0.001, 10.0);
RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2);
RNA_def_property_ui_text(prop, "Spread Speed", "How fast spread effect moves on the canvas surface");
- prop= RNA_def_property(srna, "color_dry_threshold", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "color_dry_threshold", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "color_dry_threshold");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
RNA_def_property_ui_text(prop, "Color Dry", "The wetness level when colors start to shift to the background");
- prop= RNA_def_property(srna, "color_spread_speed", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "color_spread_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "color_spread_speed");
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_range(prop, 0.0, 2.0, 1, 2);
RNA_def_property_ui_text(prop, "Color Spread", "How fast colors get mixed within wet paint");
- prop= RNA_def_property(srna, "use_drip", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_drip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_DRIP);
RNA_def_property_ui_text(prop, "Use Drip", "Process drip effect (drip wet paint to gravity direction)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
- prop= RNA_def_property(srna, "use_shrink", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_shrink", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SHRINK);
RNA_def_property_ui_text(prop, "Use Shrink", "Process shrink effect (shrink paint areas)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
- prop= RNA_def_property(srna, "shrink_speed", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shrink_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shrink_speed");
RNA_def_property_range(prop, 0.001, 10.0);
RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2);
RNA_def_property_ui_text(prop, "Shrink Speed", "How fast shrink effect moves on the canvas surface");
- prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EffectorWeights");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Effector Weights", "");
- prop= RNA_def_property(srna, "drip_velocity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "drip_velocity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "drip_vel");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Velocity", "How much surface velocity affects dripping");
- prop= RNA_def_property(srna, "drip_acceleration", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "drip_acceleration", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "drip_acc");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Acceleration", "How much surface acceleration affects dripping");
/*
- * Output settings
- */
- prop= RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
+ * Output settings
+ */
+ prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_MULALPHA);
RNA_def_property_ui_text(prop, "Premultiply alpha", "Multiply color by alpha (recommended for Blender input)");
- prop= RNA_def_property(srna, "image_output_path", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "image_output_path", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "image_output_path");
RNA_def_property_ui_text(prop, "Output Path", "Directory to save the textures");
/* output for primary surface data */
- prop= RNA_def_property(srna, "output_name_a", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "output_name_a", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "output_name");
RNA_def_property_ui_text(prop, "Output Name", "Name used to save output from this surface");
- prop= RNA_def_property(srna, "use_output_a", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_output_a", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_OUT1);
RNA_def_property_ui_text(prop, "Use Output", "Save this output layer");
/* output for secondary sufrace data */
- prop= RNA_def_property(srna, "output_name_b", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "output_name_b", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "output_name2");
RNA_def_property_ui_text(prop, "Output Name", "Name used to save output from this surface");
- prop= RNA_def_property(srna, "use_output_b", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_output_b", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_OUT2);
RNA_def_property_ui_text(prop, "Use Output", "Save this output layer");
- prop= RNA_def_property(srna, "preview_id", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "preview_id", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "preview_id");
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_preview);
@@ -601,22 +601,22 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
/* to check if output name exists */
func = RNA_def_function(srna, "output_exists", "rna_DynamicPaint_is_output_exists");
RNA_def_function_ui_description(func, "Checks if surface output layer of given name exists");
- parm= RNA_def_pointer(func, "object", "Object", "", "");
+ parm = RNA_def_pointer(func, "object", "Object", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_int(func, "index", 0, 0, 1, "Index", "", 0, 1);
+ parm = RNA_def_int(func, "index", 0, 0, 1, "Index", "", 0, 1);
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_boolean(func, "exists", 0, "", "");
+ parm = RNA_def_boolean(func, "exists", 0, "", "");
RNA_def_function_return(func, parm);
- prop= RNA_def_property(srna, "depth_clamp", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "depth_clamp", PROP_FLOAT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.00, 50.0);
RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2);
RNA_def_property_ui_text(prop, "Max Displace", "Maximum level of depth intersection in object space (use 0.0 to disable)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "displace_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "displace_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "disp_factor");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, -50.0, 50.0);
@@ -624,57 +624,57 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Displace Factor", "Strength of displace when applied to the mesh");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "image_fileformat", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "image_fileformat", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, prop_dynamicpaint_image_fileformat);
RNA_def_property_ui_text(prop, "File Format", "");
- prop= RNA_def_property(srna, "displace_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "displace_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "disp_type");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, prop_dynamicpaint_displace_type);
RNA_def_property_ui_text(prop, "Data Type", "");
- prop= RNA_def_property(srna, "use_incremental_displace", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_incremental_displace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISP_INCREMENTAL);
RNA_def_property_ui_text(prop, "Incremental", "New displace is added cumulatively on top of existing");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
/* wave simulator settings */
- prop= RNA_def_property(srna, "wave_damping", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "wave_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2);
RNA_def_property_ui_text(prop, "Damping", "Wave damping factor");
- prop= RNA_def_property(srna, "wave_speed", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "wave_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 5.0);
RNA_def_property_ui_range(prop, 0.20, 4.0, 1, 2);
RNA_def_property_ui_text(prop, "Speed", "Wave propogation speed");
- prop= RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 3.0);
RNA_def_property_ui_range(prop, 0.01, 1.5, 1, 2);
RNA_def_property_ui_text(prop, "Timescale", "Wave time scaling factor");
- prop= RNA_def_property(srna, "wave_spring", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "wave_spring", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2);
RNA_def_property_ui_text(prop, "Spring", "Spring force that pulls water level back to zero");
- prop= RNA_def_property(srna, "use_wave_open_border", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_wave_open_border", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_WAVE_OPEN_BORDERS);
RNA_def_property_ui_text(prop, "Open Borders", "Pass waves through mesh edges");
/* cache */
- prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "pointcache");
RNA_def_property_ui_text(prop, "Point Cache", "");
/* is cache used */
- prop= RNA_def_property(srna, "is_cache_user", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_cache_user", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_DynamicPaint_is_cache_user_get", NULL);
RNA_def_property_ui_text(prop, "Use Cache", "");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE);
@@ -691,9 +691,9 @@ static void rna_def_dynamic_paint_canvas_settings(BlenderRNA *brna)
RNA_def_struct_path_func(srna, "rna_DynamicPaintCanvasSettings_path");
/*
- * Surface Slots
- */
- prop= RNA_def_property(srna, "canvas_surfaces", PROP_COLLECTION, PROP_NONE);
+ * Surface Slots
+ */
+ prop = RNA_def_property(srna, "canvas_surfaces", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_DynamicPaint_surfaces_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "DynamicPaintSurface");
RNA_def_property_ui_text(prop, "Paint Surface List", "Paint surface list");
@@ -739,89 +739,89 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
RNA_def_struct_path_func(srna, "rna_DynamicPaintBrushSettings_path");
/*
- * Paint
- */
- prop= RNA_def_property(srna, "paint_color", PROP_FLOAT, PROP_COLOR_GAMMA);
+ * Paint
+ */
+ prop = RNA_def_property(srna, "paint_color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Paint Color", "Color of the paint");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "paint_alpha", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "paint_alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
RNA_def_property_ui_text(prop, "Paint Alpha", "Paint alpha");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_USE_MATERIAL);
RNA_def_property_ui_text(prop, "Use object material", "Use object material to define color and influence");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mat");
RNA_def_property_ui_text(prop, "Material", "Material to use (if not defined, material linked to the mesh is used)");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "use_absolute_alpha", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_absolute_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ABS_ALPHA);
RNA_def_property_ui_text(prop, "Absolute Alpha", "Only increase alpha value if paint alpha is higher than existing");
- prop= RNA_def_property(srna, "paint_wetness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "paint_wetness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "wetness");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
RNA_def_property_ui_text(prop, "Paint Wetness", "Paint wetness, visible in wetmap (some effects only affect wet paint)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "use_paint_erase", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_paint_erase", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ERASE);
RNA_def_property_ui_text(prop, "Erase Paint", "Erase / remove paint instead of adding it");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_wave_type);
RNA_def_property_ui_text(prop, "Wave Type", "");
- prop= RNA_def_property(srna, "wave_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "wave_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -2.0, 2.0);
RNA_def_property_ui_range(prop, -1.0, 1.0, 5, 2);
RNA_def_property_ui_text(prop, "Factor", "Multiplier for wave influence of this brush");
- prop= RNA_def_property(srna, "wave_clamp", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "wave_clamp", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.00, 50.0);
RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2);
RNA_def_property_ui_text(prop, "Clamp Waves", "Maximum level of surface intersection used to influence waves (use 0.0 to disable)");
- prop= RNA_def_property(srna, "use_smudge", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_smudge", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DO_SMUDGE);
RNA_def_property_ui_text(prop, "Do Smudge", "Make this brush to smudge existing paint as it moves");
- prop= RNA_def_property(srna, "smudge_strength", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "smudge_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
RNA_def_property_ui_text(prop, "Smudge Strength", "Smudge effect strength");
- prop= RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max_velocity");
RNA_def_property_range(prop, 0.0001, 10.0);
RNA_def_property_ui_range(prop, 0.1, 2.0, 5, 2);
RNA_def_property_ui_text(prop, "Max Velocity", "Velocity considered as maximum influence (Blender units per frame)");
- prop= RNA_def_property(srna, "use_velocity_alpha", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_velocity_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_ALPHA);
RNA_def_property_ui_text(prop, "Multiply Alpha", "Multiply brush influence by velocity color ramp alpha");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "use_velocity_depth", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_velocity_depth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_DEPTH);
RNA_def_property_ui_text(prop, "Multiply Depth", "Multiply brush intersection depth (displace, waves) by velocity ramp alpha");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "use_velocity_color", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_velocity_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_COLOR);
RNA_def_property_ui_text(prop, "Replace Color", "Replace brush color by velocity color ramp");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
@@ -829,58 +829,58 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
/*
* Paint Area / Collision
*/
- prop= RNA_def_property(srna, "paint_source", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "paint_source", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "collision");
RNA_def_property_enum_items(prop, prop_dynamicpaint_collisiontype);
RNA_def_property_ui_text(prop, "Paint Source", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "paint_distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "paint_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "paint_distance");
RNA_def_property_range(prop, 0.0, 500.0);
RNA_def_property_ui_range(prop, 0.0, 500.0, 10, 3);
RNA_def_property_ui_text(prop, "Proximity Distance", "Maximum distance from brush to mesh surface to affect paint");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "use_proximity_ramp_alpha", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_proximity_ramp_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_RAMP_ALPHA);
RNA_def_property_ui_text(prop, "Only Use Alpha", "Only read color ramp alpha");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "proximity_falloff", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "proximity_falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "proximity_falloff");
RNA_def_property_enum_items(prop, prop_dynamicpaint_prox_falloff);
RNA_def_property_ui_text(prop, "Falloff", "Proximity falloff type");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "use_proximity_project", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_proximity_project", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PROX_PROJECT);
RNA_def_property_ui_text(prop, "Project", "Brush is projected to canvas from defined direction within brush proximity");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "ray_direction", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "ray_direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ray_dir");
RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_ray_dir);
RNA_def_property_ui_text(prop, "Ray Direction", "Ray direction to use for projection (if brush object is located in that direction it's painted)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "invert_proximity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_proximity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_INVERSE_PROX);
RNA_def_property_ui_text(prop, "Inner Proximity", "Proximity falloff is applied inside the volume");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "use_negative_volume", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_negative_volume", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_NEGATE_VOLUME);
RNA_def_property_ui_text(prop, "Negate Volume", "Negate influence inside the volume");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
/*
- * Particle
- */
- prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
+ * Particle
+ */
+ prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "psys");
RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -888,19 +888,19 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_resetDependancy");
- prop= RNA_def_property(srna, "use_particle_radius", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_particle_radius", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PART_RAD);
RNA_def_property_ui_text(prop, "Use Particle Radius", "Use radius from particle settings");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "solid_radius", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "solid_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "particle_radius");
RNA_def_property_range(prop, 0.01, 10.0);
RNA_def_property_ui_range(prop, 0.01, 2.0, 5, 3);
RNA_def_property_ui_text(prop, "Solid Radius", "Radius that will be painted solid");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "smooth_radius", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "smooth_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "particle_smooth");
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 0);
@@ -909,15 +909,15 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
/*
- * Color ramps
- */
- prop= RNA_def_property(srna, "paint_ramp", PROP_POINTER, PROP_NONE);
+ * Color ramps
+ */
+ prop = RNA_def_property(srna, "paint_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "paint_ramp");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Paint Color Ramp", "Color ramp used to define proximity falloff");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
- prop= RNA_def_property(srna, "velocity_ramp", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "velocity_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "vel_ramp");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Velocity Color Ramp", "Color ramp used to define brush velocity effect");
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index b8e21040c63..88878a5332f 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -56,7 +56,7 @@ EnumPropertyItem fmodifier_type_items[] = {
{FMODIFIER_TYPE_CYCLES, "CYCLES", 0, "Cycles", ""},
{FMODIFIER_TYPE_NOISE, "NOISE", 0, "Noise", ""},
{FMODIFIER_TYPE_FILTER, "FILTER", 0, "Filter", ""},
- //{FMODIFIER_TYPE_PYTHON, "PYTHON", 0, "Python", ""}, // FIXME: not implemented yet!
+ /*{FMODIFIER_TYPE_PYTHON, "PYTHON", 0, "Python", ""}, *//* FIXME: not implemented yet! */
{FMODIFIER_TYPE_LIMITS, "LIMITS", 0, "Limits", ""},
{FMODIFIER_TYPE_STEPPED, "STEPPED", 0, "Stepped Interpolation", ""},
{0, NULL, 0, NULL, NULL}};
@@ -74,7 +74,7 @@ EnumPropertyItem beztriple_keyframe_type_items[] = {
static StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr)
{
- FModifier *fcm= (FModifier *)ptr->data;
+ FModifier *fcm = (FModifier *)ptr->data;
switch (fcm->type) {
case FMODIFIER_TYPE_GENERATOR:
@@ -87,8 +87,8 @@ static StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr)
return &RNA_FModifierCycles;
case FMODIFIER_TYPE_NOISE:
return &RNA_FModifierNoise;
- //case FMODIFIER_TYPE_FILTER:
- // return &RNA_FModifierFilter;
+ /*case FMODIFIER_TYPE_FILTER: */
+ /* return &RNA_FModifierFilter; */
case FMODIFIER_TYPE_PYTHON:
return &RNA_FModifierPython;
case FMODIFIER_TYPE_LIMITS:
@@ -108,12 +108,12 @@ static StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr)
static void rna_ChannelDriver_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- ID *id= ptr->id.data;
- ChannelDriver *driver= ptr->data;
+ ID *id = ptr->id.data;
+ ChannelDriver *driver = ptr->data;
driver->flag &= ~DRIVER_FLAG_INVALID;
- // TODO: this really needs an update guard...
+ /* TODO: this really needs an update guard... */
DAG_scene_sort(bmain, scene);
DAG_id_tag_update(id, OB_RECALC_OB|OB_RECALC_DATA);
@@ -122,7 +122,7 @@ static void rna_ChannelDriver_update_data(Main *bmain, Scene *scene, PointerRNA
static void rna_ChannelDriver_update_expr(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- ChannelDriver *driver= ptr->data;
+ ChannelDriver *driver = ptr->data;
driver->flag |= DRIVER_FLAG_RECOMPILE;
rna_ChannelDriver_update_data(bmain, scene, ptr);
}
@@ -132,16 +132,16 @@ static void rna_DriverTarget_update_data(Main *bmain, Scene *scene, PointerRNA *
PointerRNA driverptr;
ChannelDriver *driver;
FCurve *fcu;
- AnimData *adt= BKE_animdata_from_id(ptr->id.data);
+ AnimData *adt = BKE_animdata_from_id(ptr->id.data);
/* find the driver this belongs to and update it */
- for (fcu=adt->drivers.first; fcu; fcu=fcu->next) {
- driver= fcu->driver;
+ for (fcu = adt->drivers.first; fcu; fcu = fcu->next) {
+ driver = fcu->driver;
fcu->flag &= ~FCURVE_DISABLED;
if (driver) {
- // FIXME: need to be able to search targets for required one...
- //BLI_findindex(&driver->targets, ptr->data) != -1)
+ /* FIXME: need to be able to search targets for required one... */
+ /*BLI_findindex(&driver->targets, ptr->data) != -1) */
RNA_pointer_create(ptr->id.data, &RNA_Driver, driver, &driverptr);
rna_ChannelDriver_update_data(bmain, scene, &driverptr);
return;
@@ -151,7 +151,7 @@ static void rna_DriverTarget_update_data(Main *bmain, Scene *scene, PointerRNA *
static void rna_DriverTarget_update_name(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- ChannelDriver *driver= ptr->data;
+ ChannelDriver *driver = ptr->data;
rna_DriverTarget_update_data(bmain, scene, ptr);
driver->flag |= DRIVER_FLAG_RENAMEVAR;
@@ -163,25 +163,25 @@ static void rna_DriverTarget_update_name(Main *bmain, Scene *scene, PointerRNA *
/* note: this function exists only to avoid id refcounting */
static void rna_DriverTarget_id_set(PointerRNA *ptr, PointerRNA value)
{
- DriverTarget *dtar= (DriverTarget*)ptr->data;
- dtar->id= value.data;
+ DriverTarget *dtar = (DriverTarget*)ptr->data;
+ dtar->id = value.data;
}
static StructRNA *rna_DriverTarget_id_typef(PointerRNA *ptr)
{
- DriverTarget *dtar= (DriverTarget*)ptr->data;
+ DriverTarget *dtar = (DriverTarget*)ptr->data;
return ID_code_to_RNA_type(dtar->idtype);
}
static int rna_DriverTarget_id_editable(PointerRNA *ptr)
{
- DriverTarget *dtar= (DriverTarget*)ptr->data;
+ DriverTarget *dtar = (DriverTarget*)ptr->data;
return (dtar->idtype)? PROP_EDITABLE : 0;
}
static int rna_DriverTarget_id_type_editable(PointerRNA *ptr)
{
- DriverTarget *dtar= (DriverTarget*)ptr->data;
+ DriverTarget *dtar = (DriverTarget*)ptr->data;
/* when the id-type can only be object, don't allow editing
* otherwise, there may be strange crashes
@@ -191,36 +191,36 @@ static int rna_DriverTarget_id_type_editable(PointerRNA *ptr)
static void rna_DriverTarget_id_type_set(PointerRNA *ptr, int value)
{
- DriverTarget *data= (DriverTarget*)(ptr->data);
+ DriverTarget *data = (DriverTarget*)(ptr->data);
/* check if ID-type is settable */
if ((data->flag & DTAR_FLAG_ID_OB_ONLY) == 0) {
/* change ID-type to the new type */
- data->idtype= value;
+ data->idtype = value;
}
else {
/* make sure ID-type is Object */
- data->idtype= ID_OB;
+ data->idtype = ID_OB;
}
/* clear the id-block if the type is invalid */
if ((data->id) && (GS(data->id->name) != data->idtype))
- data->id= NULL;
+ data->id = NULL;
}
static void rna_DriverTarget_RnaPath_get(PointerRNA *ptr, char *value)
{
- DriverTarget *dtar= (DriverTarget *)ptr->data;
+ DriverTarget *dtar = (DriverTarget *)ptr->data;
if (dtar->rna_path)
strcpy(value, dtar->rna_path);
else
- value[0]= '\0';
+ value[0] = '\0';
}
static int rna_DriverTarget_RnaPath_length(PointerRNA *ptr)
{
- DriverTarget *dtar= (DriverTarget *)ptr->data;
+ DriverTarget *dtar = (DriverTarget *)ptr->data;
if (dtar->rna_path)
return strlen(dtar->rna_path);
@@ -230,21 +230,21 @@ static int rna_DriverTarget_RnaPath_length(PointerRNA *ptr)
static void rna_DriverTarget_RnaPath_set(PointerRNA *ptr, const char *value)
{
- DriverTarget *dtar= (DriverTarget *)ptr->data;
+ DriverTarget *dtar = (DriverTarget *)ptr->data;
- // XXX in this case we need to be very careful, as this will require some new dependencies to be added!
+ /* XXX in this case we need to be very careful, as this will require some new dependencies to be added! */
if (dtar->rna_path)
MEM_freeN(dtar->rna_path);
if (value[0])
- dtar->rna_path= BLI_strdup(value);
- else
- dtar->rna_path= NULL;
+ dtar->rna_path = BLI_strdup(value);
+ else
+ dtar->rna_path = NULL;
}
static void rna_DriverVariable_type_set(PointerRNA *ptr, int value)
{
- DriverVar *dvar= (DriverVar *)ptr->data;
+ DriverVar *dvar = (DriverVar *)ptr->data;
/* call the API function for this */
driver_change_variable_type(dvar, value);
@@ -254,67 +254,67 @@ static void rna_DriverVariable_type_set(PointerRNA *ptr, int value)
static void rna_FKeyframe_handle1_get(PointerRNA *ptr, float *values)
{
- BezTriple *bezt= (BezTriple*)ptr->data;
+ BezTriple *bezt = (BezTriple*)ptr->data;
- values[0]= bezt->vec[0][0];
- values[1]= bezt->vec[0][1];
+ values[0] = bezt->vec[0][0];
+ values[1] = bezt->vec[0][1];
}
static void rna_FKeyframe_handle1_set(PointerRNA *ptr, const float *values)
{
- BezTriple *bezt= (BezTriple*)ptr->data;
+ BezTriple *bezt = (BezTriple*)ptr->data;
- bezt->vec[0][0]= values[0];
- bezt->vec[0][1]= values[1];
+ bezt->vec[0][0] = values[0];
+ bezt->vec[0][1] = values[1];
}
static void rna_FKeyframe_handle2_get(PointerRNA *ptr, float *values)
{
- BezTriple *bezt= (BezTriple*)ptr->data;
+ BezTriple *bezt = (BezTriple*)ptr->data;
- values[0]= bezt->vec[2][0];
- values[1]= bezt->vec[2][1];
+ values[0] = bezt->vec[2][0];
+ values[1] = bezt->vec[2][1];
}
static void rna_FKeyframe_handle2_set(PointerRNA *ptr, const float *values)
{
- BezTriple *bezt= (BezTriple*)ptr->data;
+ BezTriple *bezt = (BezTriple*)ptr->data;
- bezt->vec[2][0]= values[0];
- bezt->vec[2][1]= values[1];
+ bezt->vec[2][0] = values[0];
+ bezt->vec[2][1] = values[1];
}
static void rna_FKeyframe_ctrlpoint_get(PointerRNA *ptr, float *values)
{
- BezTriple *bezt= (BezTriple*)ptr->data;
+ BezTriple *bezt = (BezTriple*)ptr->data;
- values[0]= bezt->vec[1][0];
- values[1]= bezt->vec[1][1];
+ values[0] = bezt->vec[1][0];
+ values[1] = bezt->vec[1][1];
}
static void rna_FKeyframe_ctrlpoint_set(PointerRNA *ptr, const float *values)
{
- BezTriple *bezt= (BezTriple*)ptr->data;
+ BezTriple *bezt = (BezTriple*)ptr->data;
- bezt->vec[1][0]= values[0];
- bezt->vec[1][1]= values[1];
+ bezt->vec[1][0] = values[0];
+ bezt->vec[1][1] = values[1];
}
/* ****************************** */
static void rna_FCurve_RnaPath_get(PointerRNA *ptr, char *value)
{
- FCurve *fcu= (FCurve *)ptr->data;
+ FCurve *fcu = (FCurve *)ptr->data;
if (fcu->rna_path)
strcpy(value, fcu->rna_path);
else
- value[0]= '\0';
+ value[0] = '\0';
}
static int rna_FCurve_RnaPath_length(PointerRNA *ptr)
{
- FCurve *fcu= (FCurve *)ptr->data;
+ FCurve *fcu = (FCurve *)ptr->data;
if (fcu->rna_path)
return strlen(fcu->rna_path);
@@ -324,24 +324,24 @@ static int rna_FCurve_RnaPath_length(PointerRNA *ptr)
static void rna_FCurve_RnaPath_set(PointerRNA *ptr, const char *value)
{
- FCurve *fcu= (FCurve *)ptr->data;
+ FCurve *fcu = (FCurve *)ptr->data;
if (fcu->rna_path)
MEM_freeN(fcu->rna_path);
if (value[0]) {
- fcu->rna_path= BLI_strdup(value);
+ fcu->rna_path = BLI_strdup(value);
fcu->flag &= ~FCURVE_DISABLED;
}
- else
- fcu->rna_path= NULL;
+ else
+ fcu->rna_path = NULL;
}
static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value)
{
ID *pid = (ID *)ptr->id.data;
ID *vid = (ID *)value.id.data;
- FCurve *fcu= ptr->data;
+ FCurve *fcu = ptr->data;
bAction *act = NULL;
/* get action */
@@ -355,7 +355,7 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value)
return;
}
- if (GS(pid->name)==ID_AC && GS(vid->name)==ID_AC) {
+ if (GS(pid->name) == ID_AC && GS(vid->name) == ID_AC) {
/* the ID given is the action already - usually when F-Curve is obtained from an action's pointer */
act = (bAction *)pid;
}
@@ -369,7 +369,7 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value)
if (fcu->grp == value.data) {
/* nothing to do */
printf("ERROR: F-Curve already belongs to this group\n");
- return;
+ return;
}
/* can only change group if we have info about the action the F-Curve is in
@@ -390,7 +390,7 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value)
action_groups_remove_channel(act, fcu);
/* add the F-Curve back to the action now in the right place */
- // TODO: make the api function handle the case where there isn't any group to assign to
+ /* TODO: make the api function handle the case where there isn't any group to assign to */
if (value.data) {
/* add to its group using API function, which makes sure everything goes ok */
action_groups_add_channel(act, value.data, fcu);
@@ -409,7 +409,7 @@ DriverVar *rna_Driver_new_variable(ChannelDriver *driver)
void rna_Driver_remove_variable(ChannelDriver *driver, ReportList *reports, DriverVar *dvar)
{
- if(BLI_findindex(&driver->variables, dvar) == -1) {
+ if (BLI_findindex(&driver->variables, dvar) == -1) {
BKE_report(reports, RPT_ERROR, "Variable does not exist in this driver");
return;
}
@@ -420,14 +420,14 @@ void rna_Driver_remove_variable(ChannelDriver *driver, ReportList *reports, Driv
static PointerRNA rna_FCurve_active_modifier_get(PointerRNA *ptr)
{
- FCurve *fcu= (FCurve*)ptr->data;
- FModifier *fcm= find_active_fmodifier(&fcu->modifiers);
+ FCurve *fcu = (FCurve*)ptr->data;
+ FModifier *fcm = find_active_fmodifier(&fcu->modifiers);
return rna_pointer_inherit_refine(ptr, &RNA_FModifier, fcm);
}
static void rna_FCurve_active_modifier_set(PointerRNA *ptr, PointerRNA value)
{
- FCurve *fcu= (FCurve*)ptr->data;
+ FCurve *fcu = (FCurve*)ptr->data;
set_active_fmodifier(&fcu->modifiers, (FModifier *)value.data);
}
@@ -438,7 +438,7 @@ static FModifier *rna_FCurve_modifiers_new(FCurve *fcu, int type)
static void rna_FCurve_modifiers_remove(FCurve *fcu, ReportList *reports, FModifier *fcm)
{
- if(BLI_findindex(&fcu->modifiers, fcm) == -1) {
+ if (BLI_findindex(&fcu->modifiers, fcm) == -1) {
BKE_reportf(reports, RPT_ERROR, "F-Curve modifier '%s' not found in F-Curve", fcm->name);
return;
}
@@ -447,7 +447,7 @@ static void rna_FCurve_modifiers_remove(FCurve *fcu, ReportList *reports, FModif
static void rna_FModifier_active_set(PointerRNA *ptr, int UNUSED(value))
{
- FModifier *fm= (FModifier*)ptr->data;
+ FModifier *fm = (FModifier*)ptr->data;
/* don't toggle, always switch on */
fm->flag |= FMODIFIER_FLAG_ACTIVE;
@@ -455,38 +455,38 @@ static void rna_FModifier_active_set(PointerRNA *ptr, int UNUSED(value))
static void rna_FModifier_start_frame_range(PointerRNA *ptr, float *min, float *max)
{
- FModifier *fcm= (FModifier*)ptr->data;
+ FModifier *fcm = (FModifier*)ptr->data;
- *min= MINAFRAMEF;
- *max= (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT)? fcm->efra : MAXFRAMEF;
+ *min = MINAFRAMEF;
+ *max = (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT)? fcm->efra : MAXFRAMEF;
}
static void rna_FModifier_end_frame_range(PointerRNA *ptr, float *min, float *max)
{
- FModifier *fcm= (FModifier*)ptr->data;
+ FModifier *fcm = (FModifier*)ptr->data;
- *min= (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT)? fcm->sfra : MINAFRAMEF;
- *max= MAXFRAMEF;
+ *min = (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT)? fcm->sfra : MINAFRAMEF;
+ *max = MAXFRAMEF;
}
static void rna_FModifier_blending_range(PointerRNA *ptr, float *min, float *max)
{
- FModifier *fcm= (FModifier*)ptr->data;
+ FModifier *fcm = (FModifier*)ptr->data;
- *min= 0.0f;
- *max= fcm->efra - fcm->sfra;
+ *min = 0.0f;
+ *max = fcm->efra - fcm->sfra;
}
static void rna_FModifier_active_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- FModifier *fm, *fmo= (FModifier*)ptr->data;
+ FModifier *fm, *fmo = (FModifier*)ptr->data;
/* clear active state of other FModifiers in this list */
- for (fm=fmo->prev; fm; fm=fm->prev)
+ for (fm = fmo->prev; fm; fm = fm->prev)
{
fm->flag &= ~FMODIFIER_FLAG_ACTIVE;
}
- for (fm=fmo->next; fm; fm=fm->next)
+ for (fm = fmo->next; fm; fm = fm->next)
{
fm->flag &= ~FMODIFIER_FLAG_ACTIVE;
}
@@ -495,114 +495,114 @@ static void rna_FModifier_active_update(Main *UNUSED(bmain), Scene *UNUSED(scene
static int rna_FModifierGenerator_coefficients_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
- FModifier *fcm= (FModifier*)ptr->data;
- FMod_Generator *gen= fcm->data;
+ FModifier *fcm = (FModifier*)ptr->data;
+ FMod_Generator *gen = fcm->data;
- if(gen)
- length[0]= gen->arraysize;
+ if (gen)
+ length[0] = gen->arraysize;
else
- length[0]= 100; /* for raw_access, untested */
+ length[0] = 100; /* for raw_access, untested */
return length[0];
}
static void rna_FModifierGenerator_coefficients_get(PointerRNA *ptr, float *values)
{
- FModifier *fcm= (FModifier*)ptr->data;
- FMod_Generator *gen= fcm->data;
+ FModifier *fcm = (FModifier*)ptr->data;
+ FMod_Generator *gen = fcm->data;
memcpy(values, gen->coefficients, gen->arraysize * sizeof(float));
}
static void rna_FModifierGenerator_coefficients_set(PointerRNA *ptr, const float *values)
{
- FModifier *fcm= (FModifier*)ptr->data;
- FMod_Generator *gen= fcm->data;
+ FModifier *fcm = (FModifier*)ptr->data;
+ FMod_Generator *gen = fcm->data;
memcpy(gen->coefficients, values, gen->arraysize * sizeof(float));
}
static void rna_FModifierLimits_minx_range(PointerRNA *ptr, float *min, float *max)
{
- FModifier *fcm= (FModifier*)ptr->data;
- FMod_Limits *data= fcm->data;
+ FModifier *fcm = (FModifier*)ptr->data;
+ FMod_Limits *data = fcm->data;
- *min= MINAFRAMEF;
- *max= (data->flag & FCM_LIMIT_XMAX)? data->rect.xmax : MAXFRAMEF;
+ *min = MINAFRAMEF;
+ *max = (data->flag & FCM_LIMIT_XMAX)? data->rect.xmax : MAXFRAMEF;
}
static void rna_FModifierLimits_maxx_range(PointerRNA *ptr, float *min, float *max)
{
- FModifier *fcm= (FModifier*)ptr->data;
- FMod_Limits *data= fcm->data;
+ FModifier *fcm = (FModifier*)ptr->data;
+ FMod_Limits *data = fcm->data;
- *min= (data->flag & FCM_LIMIT_XMIN)? data->rect.xmin : MINAFRAMEF;
- *max= MAXFRAMEF;
+ *min = (data->flag & FCM_LIMIT_XMIN)? data->rect.xmin : MINAFRAMEF;
+ *max = MAXFRAMEF;
}
static void rna_FModifierLimits_miny_range(PointerRNA *ptr, float *min, float *max)
{
- FModifier *fcm= (FModifier*)ptr->data;
- FMod_Limits *data= fcm->data;
+ FModifier *fcm = (FModifier*)ptr->data;
+ FMod_Limits *data = fcm->data;
- *min= -FLT_MAX;
- *max= (data->flag & FCM_LIMIT_YMAX)? data->rect.ymax : FLT_MAX;
+ *min = -FLT_MAX;
+ *max = (data->flag & FCM_LIMIT_YMAX)? data->rect.ymax : FLT_MAX;
}
static void rna_FModifierLimits_maxy_range(PointerRNA *ptr, float *min, float *max)
{
- FModifier *fcm= (FModifier*)ptr->data;
- FMod_Limits *data= fcm->data;
+ FModifier *fcm = (FModifier*)ptr->data;
+ FMod_Limits *data = fcm->data;
- *min= (data->flag & FCM_LIMIT_YMIN)? data->rect.ymin : -FLT_MAX;
- *max= FLT_MAX;
+ *min = (data->flag & FCM_LIMIT_YMIN)? data->rect.ymin : -FLT_MAX;
+ *max = FLT_MAX;
}
static void rna_FModifierStepped_start_frame_range(PointerRNA *ptr, float *min, float *max)
{
- FModifier *fcm= (FModifier*)ptr->data;
- FMod_Stepped *data= fcm->data;
+ FModifier *fcm = (FModifier*)ptr->data;
+ FMod_Stepped *data = fcm->data;
- *min= MINAFRAMEF;
- *max= (data->flag & FCM_STEPPED_NO_AFTER)? data->end_frame : MAXFRAMEF;
+ *min = MINAFRAMEF;
+ *max = (data->flag & FCM_STEPPED_NO_AFTER)? data->end_frame : MAXFRAMEF;
}
static void rna_FModifierStepped_end_frame_range(PointerRNA *ptr, float *min, float *max)
{
- FModifier *fcm= (FModifier*)ptr->data;
- FMod_Stepped *data= fcm->data;
+ FModifier *fcm = (FModifier*)ptr->data;
+ FMod_Stepped *data = fcm->data;
- *min= (data->flag & FCM_STEPPED_NO_BEFORE)? data->start_frame : MINAFRAMEF;
- *max= MAXFRAMEF;
+ *min = (data->flag & FCM_STEPPED_NO_BEFORE)? data->start_frame : MINAFRAMEF;
+ *max = MAXFRAMEF;
}
static BezTriple *rna_FKeyframe_points_insert(FCurve *fcu, float frame, float value, int flag)
{
- int index= insert_vert_fcurve(fcu, frame, value, flag);
+ int index = insert_vert_fcurve(fcu, frame, value, flag);
return ((fcu->bezt) && (index >= 0))? (fcu->bezt + index) : NULL;
}
static void rna_FKeyframe_points_add(FCurve *fcu, int tot)
{
- if(tot > 0) {
+ if (tot > 0) {
BezTriple *bezt;
- if(fcu->totvert) {
- BezTriple *nbezt= MEM_callocN(sizeof(BezTriple) * (fcu->totvert + tot), "rna_FKeyframe_points_add");
+ if (fcu->totvert) {
+ BezTriple *nbezt = MEM_callocN(sizeof(BezTriple) * (fcu->totvert + tot), "rna_FKeyframe_points_add");
memcpy(nbezt, fcu->bezt, sizeof(BezTriple) * fcu->totvert);
MEM_freeN(fcu->bezt);
- fcu->bezt= nbezt;
+ fcu->bezt = nbezt;
}
else {
- fcu->bezt= MEM_callocN(sizeof(BezTriple) * tot, "rna_FKeyframe_points_add");
+ fcu->bezt = MEM_callocN(sizeof(BezTriple) * tot, "rna_FKeyframe_points_add");
}
- bezt= fcu->bezt + fcu->totvert;
+ bezt = fcu->bezt + fcu->totvert;
fcu->totvert += tot;
- while(tot--) {
+ while (tot--) {
/* 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;
+ bezt->f1 = bezt->f2 = bezt->f3 = SELECT;
+ bezt->ipo = BEZT_IPO_BEZ;
+ bezt->h1 = bezt->h2 = HD_AUTO_ANIM;
bezt++;
}
}
@@ -610,7 +610,7 @@ static void rna_FKeyframe_points_add(FCurve *fcu, int tot)
static void rna_FKeyframe_points_remove(FCurve *fcu, ReportList *reports, BezTriple *bezt, int do_fast)
{
- int index= (int)(bezt - fcu->bezt);
+ int index = (int)(bezt - fcu->bezt);
if (index < 0 || index >= fcu->totvert) {
BKE_report(reports, RPT_ERROR, "Keyframe not in F-Curve");
return;
@@ -636,34 +636,34 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
{FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", 0, "Factorized Polynomial", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "FModifierGenerator", "FModifier");
+ srna = RNA_def_struct(brna, "FModifierGenerator", "FModifier");
RNA_def_struct_ui_text(srna, "Generator F-Modifier", "Deterministically generate values for the modified F-Curve");
RNA_def_struct_sdna_from(srna, "FMod_Generator", "data");
/* define common props */
- prop= RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE);
RNA_def_property_ui_text(prop, "Additive",
"Values generated by this modifier are applied on top of "
"the existing values instead of overwriting them");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- // XXX this has a special validation func
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ /* XXX this has a special validation func */
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, generator_mode_items);
RNA_def_property_ui_text(prop, "Mode", "Type of generator to use");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* order of the polynomial */
- // XXX this has a special validation func
- prop= RNA_def_property(srna, "poly_order", PROP_INT, PROP_NONE);
+ /* XXX this has a special validation func */
+ prop = RNA_def_property(srna, "poly_order", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "Polynomial Order",
"The highest power of 'x' for this polynomial (number of coefficients - 1)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* coefficients array */
- prop= RNA_def_property(srna, "coefficients", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "coefficients", PROP_FLOAT, PROP_NONE);
RNA_def_property_array(prop, 32);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_FModifierGenerator_coefficients_get_length");
@@ -688,36 +688,36 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna)
{5, "SINC", 0, "Normalised Sine", "sin(x) / x"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "FModifierFunctionGenerator", "FModifier");
+ srna = RNA_def_struct(brna, "FModifierFunctionGenerator", "FModifier");
RNA_def_struct_ui_text(srna, "Built-In Function F-Modifier", "Generate values using a Built-In Function");
RNA_def_struct_sdna_from(srna, "FMod_FunctionGenerator", "data");
/* coefficients */
- prop= RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Amplitude", "Scale factor determining the maximum/minimum values");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "phase_multiplier", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "phase_multiplier", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Phase Multiplier", "Scale factor determining the 'speed' of the function");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "phase_offset", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "phase_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Phase Offset", "Constant factor to offset time by for function");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "value_offset", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "value_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Value Offset", "Constant factor to offset values by");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* flags */
- prop= RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE);
RNA_def_property_ui_text(prop, "Additive",
"Values generated by this modifier are applied on top of "
"the existing values instead of overwriting them");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "function_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "function_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of built-in function to use");
@@ -731,7 +731,7 @@ static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "FModifierEnvelopeControlPoint", NULL);
+ srna = RNA_def_struct(brna, "FModifierEnvelopeControlPoint", NULL);
RNA_def_struct_ui_text(srna, "Envelope Control Point", "Control point for envelope F-Modifier");
RNA_def_struct_sdna(srna, "FCM_EnvelopeData");
@@ -739,24 +739,24 @@ static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna)
* - for now, these are allowed to go past each other, so that we can have inverted action
* - technically, the range is limited by the settings in the envelope-modifier data, not here...
*/
- prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Minimum Value", "Lower bound of envelope at this control-point");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Maximum Value", "Upper bound of envelope at this control-point");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* Frame */
- prop= RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "time");
RNA_def_property_ui_text(prop, "Frame", "Frame this control-point occurs on");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- // TODO:
- // - selection flags (not implemented in UI yet though)
+ /* TODO: */
+ /* - selection flags (not implemented in UI yet though) */
}
static void rna_def_fmodifier_envelope(BlenderRNA *brna)
@@ -764,28 +764,28 @@ static void rna_def_fmodifier_envelope(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "FModifierEnvelope", "FModifier");
+ srna = RNA_def_struct(brna, "FModifierEnvelope", "FModifier");
RNA_def_struct_ui_text(srna, "Envelope F-Modifier", "Scale the values of the modified F-Curve");
RNA_def_struct_sdna_from(srna, "FMod_Envelope", "data");
/* Collections */
- prop= RNA_def_property(srna, "control_points", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "control_points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "data", "totvert");
RNA_def_property_struct_type(prop, "FModifierEnvelopeControlPoint");
RNA_def_property_ui_text(prop, "Control Points", "Control points defining the shape of the envelope");
/* Range Settings */
- prop= RNA_def_property(srna, "reference_value", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "reference_value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "midval");
RNA_def_property_ui_text(prop, "Reference Value", "Value that envelope's influence is centered around / based on");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "default_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "default_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Default Minimum", "Lower distance from Reference Value for 1:1 default influence");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "default_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "default_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Default Maximum", "Upper distance from Reference Value for 1:1 default influence");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
@@ -807,30 +807,30 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna)
"Alternate between forward and reverse playback of keyframe range"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "FModifierCycles", "FModifier");
+ srna = RNA_def_struct(brna, "FModifierCycles", "FModifier");
RNA_def_struct_ui_text(srna, "Cycles F-Modifier", "Repeat the values of the modified F-Curve");
RNA_def_struct_sdna_from(srna, "FMod_Cycles", "data");
/* before */
- prop= RNA_def_property(srna, "mode_before", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode_before", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "before_mode");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Before Mode", "Cycling mode to use before first keyframe");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "cycles_before", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "cycles_before", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "before_cycles");
RNA_def_property_ui_text(prop, "Before Cycles", "Maximum number of cycles to allow before first keyframe (0 = infinite)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* after */
- prop= RNA_def_property(srna, "mode_after", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode_after", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "after_mode");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "After Mode", "Cycling mode to use after last keyframe");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "cycles_after", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "cycles_after", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "after_cycles");
RNA_def_property_ui_text(prop, "After Cycles", "Maximum number of cycles to allow after last keyframe (0 = infinite)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
@@ -841,9 +841,9 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna)
static void rna_def_fmodifier_python(BlenderRNA *brna)
{
StructRNA *srna;
- //PropertyRNA *prop;
+ /*PropertyRNA *prop; */
- srna= RNA_def_struct(brna, "FModifierPython", "FModifier");
+ srna = RNA_def_struct(brna, "FModifierPython", "FModifier");
RNA_def_struct_ui_text(srna, "Python F-Modifier", "Perform user-defined operation on the modified F-Curve");
RNA_def_struct_sdna_from(srna, "FMod_Python", "data");
}
@@ -855,49 +855,49 @@ static void rna_def_fmodifier_limits(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "FModifierLimits", "FModifier");
+ srna = RNA_def_struct(brna, "FModifierLimits", "FModifier");
RNA_def_struct_ui_text(srna, "Limit F-Modifier", "Limit the time/value ranges of the modified F-Curve");
RNA_def_struct_sdna_from(srna, "FMod_Limits", "data");
- prop= RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMIN);
RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMIN);
RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMAX);
RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMAX);
RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.xmin");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_minx_range");
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.ymin");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_miny_range");
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.xmax");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_maxx_range");
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.ymax");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_maxy_range");
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
@@ -918,32 +918,32 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna)
{FCM_NOISE_MODIF_MULTIPLY, "MULTIPLY", 0, "Multiply", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "FModifierNoise", "FModifier");
+ srna = RNA_def_struct(brna, "FModifierNoise", "FModifier");
RNA_def_struct_ui_text(srna, "Noise F-Modifier", "Give randomness to the modified F-Curve");
RNA_def_struct_sdna_from(srna, "FMod_Noise", "data");
- prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "modification");
RNA_def_property_enum_items(prop, prop_modification_items);
RNA_def_property_ui_text(prop, "Blend Type", "Method of modifying the existing F-Curve");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Scale", "Scaling (in time) of the noise");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strength");
RNA_def_property_ui_text(prop, "Strength", "Amplitude of the noise - the amount that it modifies the underlying curve");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "phase");
RNA_def_property_ui_text(prop, "Phase", "A random seed for the noise effect");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "depth");
RNA_def_property_ui_text(prop, "Depth", "Amount of fine level detail present in the noise");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
@@ -957,41 +957,41 @@ static void rna_def_fmodifier_stepped(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "FModifierStepped", "FModifier");
+ srna = RNA_def_struct(brna, "FModifierStepped", "FModifier");
RNA_def_struct_ui_text(srna, "Stepped Interpolation F-Modifier",
"Hold each interpolated value from the F-Curve for several frames without changing the timing");
RNA_def_struct_sdna_from(srna, "FMod_Stepped", "data");
/* properties */
- prop= RNA_def_property(srna, "frame_step", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_step", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "step_size");
RNA_def_property_ui_text(prop, "Step Size", "Number of frames to hold each value");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "frame_offset", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "offset");
RNA_def_property_ui_text(prop, "Offset",
"Reference number of frames before frames get held "
"(use to get hold for '1-3' vs '5-7' holding patterns)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "use_frame_start", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_frame_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_STEPPED_NO_BEFORE);
RNA_def_property_ui_text(prop, "Use Start Frame", "Restrict modifier to only act after its 'start' frame");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "use_frame_end", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_frame_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_STEPPED_NO_AFTER);
RNA_def_property_ui_text(prop, "Use End Frame", "Restrict modifier to only act before its 'end' frame");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "start_frame");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierStepped_start_frame_range");
RNA_def_property_ui_text(prop, "Start Frame", "Frame that modifier's influence starts (if applicable)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "end_frame");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierStepped_end_frame_range");
RNA_def_property_ui_text(prop, "End Frame", "Frame that modifier's influence ends (if applicable)");
@@ -1007,43 +1007,43 @@ static void rna_def_fmodifier(BlenderRNA *brna)
PropertyRNA *prop;
/* base struct definition */
- srna= RNA_def_struct(brna, "FModifier", NULL);
+ srna = RNA_def_struct(brna, "FModifier", NULL);
RNA_def_struct_refine_func(srna, "rna_FModifierType_refine");
RNA_def_struct_ui_text(srna, "F-Modifier", "Modifier for values of F-Curve");
-#if 0 // XXX not used yet
+#if 0 /* XXX not used yet */
/* name */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_struct_name_property(srna, prop);
RNA_def_property_ui_text(prop, "Name", "Short description of F-Curve Modifier");
-#endif // XXX not used yet
+#endif /* XXX not used yet */
/* type */
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, fmodifier_type_items);
RNA_def_property_ui_text(prop, "Type", "F-Curve Modifier Type");
/* settings */
- prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_EXPANDED);
RNA_def_property_ui_text(prop, "Expanded", "F-Curve Modifier's panel is expanded in UI");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
- prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_MUTED);
RNA_def_property_ui_text(prop, "Muted", "F-Curve Modifier will not be evaluated");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_ui_icon(prop, ICON_MUTE_IPO_OFF, 1);
- prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FMODIFIER_FLAG_DISABLED);
RNA_def_property_ui_text(prop, "Disabled", "F-Curve Modifier has invalid settings and will not be evaluated");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
- // TODO: setting this to true must ensure that all others in stack are turned off too...
- prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ /* TODO: setting this to true must ensure that all others in stack are turned off too... */
+ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_ACTIVE);
RNA_def_property_ui_text(prop, "Active", "F-Curve Modifier is the one being edited ");
RNA_def_property_boolean_funcs(prop, NULL, "rna_FModifier_active_set");
@@ -1051,52 +1051,52 @@ static void rna_def_fmodifier(BlenderRNA *brna)
RNA_def_property_ui_icon(prop, ICON_RADIOBUT_OFF, 1);
/* restricted range */
- prop= RNA_def_property(srna, "use_restricted_range", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_restricted_range", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_RANGERESTRICT);
RNA_def_property_ui_text(prop, "Restrict Frame Range",
"F-Curve Modifier is only applied for the specified frame range to help "
"mask off effects in order to chain them");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
- RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); // XXX: depends on UI implementation
+ RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); /* XXX: depends on UI implementation */
- prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sfra");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_start_frame_range");
RNA_def_property_ui_text(prop, "Start Frame", "Frame that modifier's influence starts (if Restrict Frame Range is in use)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
- prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "efra");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_end_frame_range");
RNA_def_property_ui_text(prop, "End Frame", "Frame that modifier's influence ends (if Restrict Frame Range is in use)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
- prop= RNA_def_property(srna, "blend_in", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "blend_in", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "blendin");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_blending_range");
RNA_def_property_ui_text(prop, "Blend In", "Number of frames from start frame for influence to take effect");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
- prop= RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "blendout");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_blending_range");
RNA_def_property_ui_text(prop, "Blend Out", "Number of frames from end frame for influence to fade out");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
/* influence */
- prop= RNA_def_property(srna, "use_influence", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_influence", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_USEINFLUENCE);
RNA_def_property_ui_text(prop, "Use Influence", "F-Curve Modifier's effects will be tempered by a default factor");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
- RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); // XXX: depends on UI implementation
+ RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); /* XXX: depends on UI implementation */
- prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "influence");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Influence", "Amount of influence F-Curve Modifier will have when not fading in/out");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
-}
+}
/* *********************** */
@@ -1125,11 +1125,11 @@ static void rna_def_drivertarget(BlenderRNA *brna)
"Transforms include effects of constraints but not parenting/restpose"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "DriverTarget", NULL);
+ srna = RNA_def_struct(brna, "DriverTarget", NULL);
RNA_def_struct_ui_text(srna, "Driver Target", "Source of input values for driver variables");
/* Target Properties - ID-block to Drive */
- prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ID");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_editable_func(prop, "rna_DriverTarget_id_editable");
@@ -1139,7 +1139,7 @@ static void rna_def_drivertarget(BlenderRNA *brna)
"ID-block that the specific property used can be found from (id_type property must be set first)");
RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data");
- prop= RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "idtype");
RNA_def_property_enum_items(prop, id_type_items);
RNA_def_property_enum_default(prop, ID_OB);
@@ -1149,24 +1149,24 @@ static void rna_def_drivertarget(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data");
/* Target Properties - Property to Drive */
- prop= RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_DriverTarget_RnaPath_get", "rna_DriverTarget_RnaPath_length",
"rna_DriverTarget_RnaPath_set");
RNA_def_property_ui_text(prop, "Data Path", "RNA Path (from ID-block) to property used");
RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data");
- prop= RNA_def_property(srna, "bone_target", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "bone_target", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "pchan_name");
RNA_def_property_ui_text(prop, "Bone Name", "Name of PoseBone to use as target");
RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data");
- prop= RNA_def_property(srna, "transform_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "transform_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "transChan");
RNA_def_property_enum_items(prop, prop_trans_chan_items);
RNA_def_property_ui_text(prop, "Type", "Driver variable type");
RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data");
- prop= RNA_def_property(srna, "transform_space", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "transform_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_local_space_items);
RNA_def_property_ui_text(prop, "Transform Space", "Space in which transforms are used");
@@ -1186,28 +1186,28 @@ static void rna_def_drivervar(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "DriverVariable", NULL);
+ srna = RNA_def_struct(brna, "DriverVariable", NULL);
RNA_def_struct_sdna(srna, "DriverVar");
RNA_def_struct_ui_text(srna, "Driver Variable", "Variable from some source/target for driver relationship");
/* Variable Name */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_struct_name_property(srna, prop);
RNA_def_property_ui_text(prop, "Name",
"Name to use in scripted expressions/functions (no spaces or dots are allowed, "
"and must start with a letter)");
- RNA_def_property_update(prop, 0, "rna_DriverTarget_update_name"); // XXX
+ RNA_def_property_update(prop, 0, "rna_DriverTarget_update_name"); /* XXX */
/* Enums */
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_DriverVariable_type_set", NULL);
RNA_def_property_ui_text(prop, "Type", "Driver variable type");
- RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); // XXX
+ RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); /* XXX */
/* Targets */
- // TODO: for nicer api, only expose the relevant props via subclassing, instead of exposing the collection of targets
- prop= RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
+ /* TODO: for nicer api, only expose the relevant props via subclassing, instead of exposing the collection of targets */
+ prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "targets", "num_targets");
RNA_def_property_struct_type(prop, "DriverTarget");
RNA_def_property_ui_text(prop, "Targets", "Sources of input data for evaluating this variable");
@@ -1218,30 +1218,30 @@ static void rna_def_drivervar(BlenderRNA *brna)
static void rna_def_channeldriver_variables(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
-// PropertyRNA *prop;
+/* PropertyRNA *prop; */
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "ChannelDriverVariables");
- srna= RNA_def_struct(brna, "ChannelDriverVariables", NULL);
+ srna = RNA_def_struct(brna, "ChannelDriverVariables", NULL);
RNA_def_struct_sdna(srna, "ChannelDriver");
RNA_def_struct_ui_text(srna, "ChannelDriver Variables", "Collection of channel driver Variables");
/* add variable */
- func= RNA_def_function(srna, "new", "rna_Driver_new_variable");
+ func = RNA_def_function(srna, "new", "rna_Driver_new_variable");
RNA_def_function_ui_description(func, "Add a new variable for the driver");
/* return type */
- parm= RNA_def_pointer(func, "var", "DriverVariable", "", "Newly created Driver Variable");
+ parm = RNA_def_pointer(func, "var", "DriverVariable", "", "Newly created Driver Variable");
RNA_def_function_return(func, parm);
/* remove variable */
- func= RNA_def_function(srna, "remove", "rna_Driver_remove_variable");
+ func = RNA_def_function(srna, "remove", "rna_Driver_remove_variable");
RNA_def_function_ui_description(func, "Remove an existing variable from the driver");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* target to remove */
- parm= RNA_def_pointer(func, "variable", "DriverVariable", "", "Variable to remove from the driver");
+ parm = RNA_def_pointer(func, "variable", "DriverVariable", "", "Variable to remove from the driver");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -1258,37 +1258,37 @@ static void rna_def_channeldriver(BlenderRNA *brna)
{DRIVER_TYPE_MAX, "MAX", 0, "Maximum Value", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Driver", NULL);
+ srna = RNA_def_struct(brna, "Driver", NULL);
RNA_def_struct_sdna(srna, "ChannelDriver");
RNA_def_struct_ui_text(srna, "Driver", "Driver for the value of a setting based on an external value");
RNA_def_struct_ui_icon(srna, ICON_DRIVER);
/* Enums */
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Driver type");
RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data");
/* String values */
- prop= RNA_def_property(srna, "expression", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "expression", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Expression", "Expression to use for Scripted Expression");
RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_expr");
/* Collections */
- prop= RNA_def_property(srna, "variables", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "variables", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "variables", NULL);
RNA_def_property_struct_type(prop, "DriverVariable");
RNA_def_property_ui_text(prop, "Variables", "Properties acting as inputs for this driver");
rna_def_channeldriver_variables(brna, prop);
/* Settings */
- prop= RNA_def_property(srna, "show_debug_info", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_debug_info", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", DRIVER_FLAG_SHOWDEBUG);
RNA_def_property_ui_text(prop, "Show Debug Info",
"Show intermediate values for the driver calculations to allow debugging of drivers");
/* State Info (for Debugging) */
- prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", DRIVER_FLAG_INVALID);
RNA_def_property_ui_text(prop, "Invalid", "Driver could not be evaluated in past, so should be skipped");
@@ -1304,18 +1304,18 @@ static void rna_def_fpoint(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "FCurveSample", NULL);
+ srna = RNA_def_struct(brna, "FCurveSample", NULL);
RNA_def_struct_sdna(srna, "FPoint");
RNA_def_struct_ui_text(srna, "F-Curve Sample", "Sample point for F-Curve");
/* Boolean values */
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
RNA_def_property_ui_text(prop, "Select", "Selection status");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
/* Vector value */
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_array(prop, 2);
RNA_def_property_ui_text(prop, "Point", "Point coordinates");
@@ -1331,40 +1331,40 @@ static void rna_def_fkeyframe(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Keyframe", NULL);
+ srna = RNA_def_struct(brna, "Keyframe", NULL);
RNA_def_struct_sdna(srna, "BezTriple");
RNA_def_struct_ui_text(srna, "Keyframe", "Bezier curve point with two handles defining a Keyframe on an F-Curve");
/* Boolean values */
- prop= RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
RNA_def_property_ui_text(prop, "Handle 1 selected", "Left handle selection status");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
- prop= RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f3", 0);
RNA_def_property_ui_text(prop, "Handle 2 selected", "Right handle selection status");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
- prop= RNA_def_property(srna, "select_control_point", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_control_point", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f2", 0);
RNA_def_property_ui_text(prop, "Select", "Control point selection status");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
/* Enums */
- prop= RNA_def_property(srna, "handle_left_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "handle_left_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "h1");
RNA_def_property_enum_items(prop, keyframe_handle_type_items);
RNA_def_property_ui_text(prop, "Left Handle Type", "Handle types");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
- prop= RNA_def_property(srna, "handle_right_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "handle_right_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "h2");
RNA_def_property_enum_items(prop, keyframe_handle_type_items);
RNA_def_property_ui_text(prop, "Right Handle Type", "Handle types");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
- prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ipo");
RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items);
RNA_def_property_ui_text(prop, "Interpolation",
@@ -1372,26 +1372,26 @@ static void rna_def_fkeyframe(BlenderRNA *brna)
"this Keyframe until the next Keyframe");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "hide");
RNA_def_property_enum_items(prop, beztriple_keyframe_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of keyframe (for visual purposes only)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
/* Vector values */
- prop= RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */
+ prop = RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle1_get", "rna_FKeyframe_handle1_set", NULL);
RNA_def_property_ui_text(prop, "Left Handle", "Coordinates of the left handle (before the control point)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_FKeyframe_ctrlpoint_get", "rna_FKeyframe_ctrlpoint_set", NULL);
RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */
+ prop = RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle2_get", "rna_FKeyframe_handle2_set", NULL);
RNA_def_property_ui_text(prop, "Right Handle", "Coordinates of the right handle (after the control point)");
@@ -1408,33 +1408,33 @@ static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "FCurveModifiers");
- srna= RNA_def_struct(brna, "FCurveModifiers", NULL);
+ srna = RNA_def_struct(brna, "FCurveModifiers", NULL);
RNA_def_struct_sdna(srna, "FCurve");
RNA_def_struct_ui_text(srna, "F-Curve Modifiers", "Collection of F-Curve Modifiers");
/* Collection active property */
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "FModifier");
RNA_def_property_pointer_funcs(prop, "rna_FCurve_active_modifier_get", "rna_FCurve_active_modifier_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active F-Curve Modifier", "Active F-Curve Modifier");
/* Constraint collection */
- func= RNA_def_function(srna, "new", "rna_FCurve_modifiers_new");
+ func = RNA_def_function(srna, "new", "rna_FCurve_modifiers_new");
RNA_def_function_ui_description(func, "Add a constraint to this object");
/* return type */
- parm= RNA_def_pointer(func, "fmodifier", "FModifier", "", "New fmodifier");
+ parm = RNA_def_pointer(func, "fmodifier", "FModifier", "", "New fmodifier");
RNA_def_function_return(func, parm);
/* object to add */
- parm= RNA_def_enum(func, "type", fmodifier_type_items, 1, "", "Constraint type to add");
+ parm = RNA_def_enum(func, "type", fmodifier_type_items, 1, "", "Constraint type to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "remove", "rna_FCurve_modifiers_remove");
+ func = RNA_def_function(srna, "remove", "rna_FCurve_modifiers_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a modifier from this F-Curve");
/* modifier to remove */
- parm= RNA_def_pointer(func, "modifier", "FModifier", "", "Removed modifier");
+ parm = RNA_def_pointer(func, "modifier", "FModifier", "", "Removed modifier");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -1453,30 +1453,30 @@ static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop)
{0, NULL, 0, NULL, NULL}};
RNA_def_property_srna(cprop, "FCurveKeyframePoints");
- srna= RNA_def_struct(brna, "FCurveKeyframePoints", NULL);
+ srna = RNA_def_struct(brna, "FCurveKeyframePoints", NULL);
RNA_def_struct_sdna(srna, "FCurve");
RNA_def_struct_ui_text(srna, "Keyframe Points", "Collection of keyframe points");
- func= RNA_def_function(srna, "insert", "rna_FKeyframe_points_insert");
+ func = RNA_def_function(srna, "insert", "rna_FKeyframe_points_insert");
RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve");
- parm= RNA_def_float(func, "frame", 0.0f, -FLT_MAX, FLT_MAX, "", "X Value of this keyframe point", -FLT_MAX, FLT_MAX);
+ parm = RNA_def_float(func, "frame", 0.0f, -FLT_MAX, FLT_MAX, "", "X Value of this keyframe point", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_float(func, "value", 0.0f, -FLT_MAX, FLT_MAX, "", "Y Value of this keyframe point", -FLT_MAX, FLT_MAX);
+ parm = RNA_def_float(func, "value", 0.0f, -FLT_MAX, FLT_MAX, "", "Y Value of this keyframe point", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_enum_flag(func, "options", keyframe_flag_items, 0, "", "Keyframe options");
- parm= RNA_def_pointer(func, "keyframe", "Keyframe", "", "Newly created keyframe");
+ parm = RNA_def_pointer(func, "keyframe", "Keyframe", "", "Newly created keyframe");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "add", "rna_FKeyframe_points_add");
+ func = RNA_def_function(srna, "add", "rna_FKeyframe_points_add");
RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve");
RNA_def_int(func, "count", 1, 1, INT_MAX, "Number", "Number of points to add to the spline", 1, INT_MAX);
- func= RNA_def_function(srna, "remove", "rna_FKeyframe_points_remove");
+ func = RNA_def_function(srna, "remove", "rna_FKeyframe_points_remove");
RNA_def_function_ui_description(func, "Remove keyframe from an F-Curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "keyframe", "Keyframe", "", "Keyframe to remove");
+ parm = RNA_def_pointer(func, "keyframe", "Keyframe", "", "Keyframe to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* optional */
RNA_def_boolean(func, "fast", 0, "Fast", "Fast keyframe removal to avoid recalculating the curve each time");
@@ -1499,23 +1499,23 @@ static void rna_def_fcurve(BlenderRNA *brna)
{FCURVE_COLOR_CUSTOM, "CUSTOM", 0, "User Defined", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "FCurve", NULL);
+ srna = RNA_def_struct(brna, "FCurve", NULL);
RNA_def_struct_ui_text(srna, "F-Curve", "F-Curve defining values of a period of time");
RNA_def_struct_ui_icon(srna, ICON_ANIM_DATA);
/* Enums */
- prop= RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extend");
RNA_def_property_enum_items(prop, prop_mode_extend_items);
RNA_def_property_ui_text(prop, "Extrapolation", "");
- RNA_def_property_update(prop, NC_ANIMATION, NULL); // XXX need an update callback for this so that animation gets evaluated
+ RNA_def_property_update(prop, NC_ANIMATION, NULL); /* XXX need an update callback for this so that animation gets evaluated */
/* Pointers */
- prop= RNA_def_property(srna, "driver", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "driver", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Driver", "Channel Driver (only set for Driver F-Curves)");
- prop= RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "grp");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Group", "Action Group that this F-Curve belongs to");
@@ -1523,86 +1523,86 @@ static void rna_def_fcurve(BlenderRNA *brna)
RNA_def_property_update(prop, NC_ANIMATION, NULL);
/* Path + Array Index */
- prop= RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_FCurve_RnaPath_get", "rna_FCurve_RnaPath_length", "rna_FCurve_RnaPath_set");
RNA_def_property_ui_text(prop, "Data Path", "RNA Path to property affected by F-Curve");
- RNA_def_property_update(prop, NC_ANIMATION, NULL); // XXX need an update callback for this to that animation gets evaluated
+ RNA_def_property_update(prop, NC_ANIMATION, NULL); /* XXX need an update callback for this to that animation gets evaluated */
/* called 'index' when given as function arg */
- prop= RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific property affected by F-Curve if applicable");
- RNA_def_property_update(prop, NC_ANIMATION, NULL); // XXX need an update callback for this so that animation gets evaluated
+ RNA_def_property_update(prop, NC_ANIMATION, NULL); /* XXX need an update callback for this so that animation gets evaluated */
/* Color */
- prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_mode_color_items);
RNA_def_property_ui_text(prop, "Color Mode", "Method used to determine color of F-Curve in Graph Editor");
RNA_def_property_update(prop, NC_ANIMATION, NULL);
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Color", "Color of the F-Curve in the Graph Editor");
RNA_def_property_update(prop, NC_ANIMATION, NULL);
/* Flags */
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_SELECTED);
RNA_def_property_ui_text(prop, "Select", "F-Curve is selected for editing");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
- prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_PROTECTED);
RNA_def_property_ui_text(prop, "Lock", "F-Curve's settings cannot be edited");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_MUTED);
RNA_def_property_ui_text(prop, "Muted", "F-Curve is not evaluated");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FCURVE_VISIBLE);
RNA_def_property_ui_text(prop, "Hide", "F-Curve and its keyframes are hidden in the Graph Editor graphs");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
/* State Info (for Debugging) */
- prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FCURVE_DISABLED);
RNA_def_property_ui_text(prop, "Valid",
"False when F-Curve could not be evaluated in past, so should be skipped when evaluating");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
/* Collections */
- prop= RNA_def_property(srna, "sampled_points", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "sampled_points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fpt", "totvert");
RNA_def_property_struct_type(prop, "FCurveSample");
RNA_def_property_ui_text(prop, "Sampled Points", "Sampled animation data");
- prop= RNA_def_property(srna, "keyframe_points", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "keyframe_points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "bezt", "totvert");
RNA_def_property_struct_type(prop, "Keyframe");
RNA_def_property_ui_text(prop, "Keyframes", "User-editable keyframes");
rna_def_fcurve_keyframe_points(brna, prop);
- prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "FModifier");
RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting the shape of the F-Curve");
rna_def_fcurve_modifiers(brna, prop);
/* Functions */
- func= RNA_def_function(srna, "evaluate", "evaluate_fcurve"); /* calls the C/API direct */
+ func = RNA_def_function(srna, "evaluate", "evaluate_fcurve"); /* calls the C/API direct */
RNA_def_function_ui_description(func, "Evaluate F-Curve");
- parm= RNA_def_float(func, "frame", 1.0f, -FLT_MAX, FLT_MAX, "Frame", "Evaluate F-Curve at given frame", -FLT_MAX, FLT_MAX);
+ parm = RNA_def_float(func, "frame", 1.0f, -FLT_MAX, FLT_MAX, "Frame", "Evaluate F-Curve at given frame", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return value */
- parm= RNA_def_float(func, "position", 0, -FLT_MAX, FLT_MAX, "Position", "F-Curve position", -FLT_MAX, FLT_MAX);
+ parm = RNA_def_float(func, "position", 0, -FLT_MAX, FLT_MAX, "Position", "F-Curve position", -FLT_MAX, FLT_MAX);
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "range", "rna_fcurve_range");
+ func = RNA_def_function(srna, "range", "rna_fcurve_range");
RNA_def_function_ui_description(func, "Get the time extents for F-Curve");
/* return value */
- parm= RNA_def_float_vector(func, "range", 2, NULL, -FLT_MAX, FLT_MAX, "Range", "Min/Max values", -FLT_MAX, FLT_MAX);
+ parm = RNA_def_float_vector(func, "range", 2, NULL, -FLT_MAX, FLT_MAX, "Range", "Min/Max values", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm);
}
diff --git a/source/blender/makesrna/intern/rna_fcurve_api.c b/source/blender/makesrna/intern/rna_fcurve_api.c
index 50698757ecb..4f596dd2b7d 100644
--- a/source/blender/makesrna/intern/rna_fcurve_api.c
+++ b/source/blender/makesrna/intern/rna_fcurve_api.c
@@ -49,8 +49,8 @@
void RNA_api_drivers(StructRNA *srna)
{
-// FunctionRNA *func;
-// PropertyRNA *parm;
+/* FunctionRNA *func; */
+/* PropertyRNA *parm; */
}
#endif
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index c17f23bb3a0..5a68fdf1c68 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -53,9 +53,9 @@
static StructRNA* rna_FluidSettings_refine(struct PointerRNA *ptr)
{
- FluidsimSettings *fss= (FluidsimSettings*)ptr->data;
+ FluidsimSettings *fss = (FluidsimSettings*)ptr->data;
- switch(fss->type) {
+ switch (fss->type) {
case OB_FLUIDSIM_DOMAIN:
return &RNA_DomainFluidSettings;
case OB_FLUIDSIM_FLUID:
@@ -77,7 +77,7 @@ static StructRNA* rna_FluidSettings_refine(struct PointerRNA *ptr)
static void rna_fluid_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Object *ob= ptr->id.data;
+ Object *ob = ptr->id.data;
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
@@ -95,17 +95,17 @@ static int fluidsim_find_lastframe(Object *ob, FluidsimSettings *fss)
do {
BLI_strncpy(targetFileTest, targetFile, sizeof(targetFileTest));
BLI_path_frame(targetFileTest, curFrame++, 0);
- } while(BLI_exists(targetFileTest));
+ } while (BLI_exists(targetFileTest));
return curFrame - 1;
}
static void rna_fluid_find_enframe(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Object *ob= ptr->id.data;
- FluidsimModifierData *fluidmd= (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim);
+ Object *ob = ptr->id.data;
+ FluidsimModifierData *fluidmd = (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim);
- if(fluidmd->fss->flag & OB_FLUIDSIM_REVERSE) {
+ if (fluidmd->fss->flag & OB_FLUIDSIM_REVERSE) {
fluidmd->fss->lastgoodframe = fluidsim_find_lastframe(ob, fluidmd->fss);
}
else {
@@ -116,46 +116,46 @@ static void rna_fluid_find_enframe(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
FluidsimModifierData *fluidmd;
ParticleSystemModifierData *psmd;
ParticleSystem *psys;
ParticleSettings *part;
- fluidmd= (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim);
- fluidmd->fss->flag &= ~OB_FLUIDSIM_REVERSE; // clear flag
+ fluidmd = (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim);
+ fluidmd->fss->flag &= ~OB_FLUIDSIM_REVERSE; /* clear flag */
/* remove fluidsim particle system */
- if(fluidmd->fss->type & OB_FLUIDSIM_PARTICLE) {
- for(psys=ob->particlesystem.first; psys; psys=psys->next)
- if(psys->part->type == PART_FLUID)
+ if (fluidmd->fss->type & OB_FLUIDSIM_PARTICLE) {
+ for (psys = ob->particlesystem.first; psys; psys = psys->next)
+ if (psys->part->type == PART_FLUID)
break;
- if(ob->type == OB_MESH && !psys) {
+ if (ob->type == OB_MESH && !psys) {
/* add particle system */
- part= psys_new_settings("ParticleSettings", bmain);
- psys= MEM_callocN(sizeof(ParticleSystem), "particle_system");
+ part = psys_new_settings("ParticleSettings", bmain);
+ psys = MEM_callocN(sizeof(ParticleSystem), "particle_system");
- part->type= PART_FLUID;
- psys->part= part;
- psys->pointcache= BKE_ptcache_add(&psys->ptcaches);
+ part->type = PART_FLUID;
+ psys->part = part;
+ psys->pointcache = BKE_ptcache_add(&psys->ptcaches);
psys->flag |= PSYS_ENABLED;
BLI_strncpy(psys->name, "FluidParticles", sizeof(psys->name));
BLI_addtail(&ob->particlesystem,psys);
/* add modifier */
- psmd= (ParticleSystemModifierData*)modifier_new(eModifierType_ParticleSystem);
+ psmd = (ParticleSystemModifierData*)modifier_new(eModifierType_ParticleSystem);
BLI_strncpy(psmd->modifier.name, "FluidParticleSystem", sizeof(psmd->modifier.name));
- psmd->psys= psys;
+ psmd->psys = psys;
BLI_addtail(&ob->modifiers, psmd);
modifier_unique_name(&ob->modifiers, (ModifierData *)psmd);
}
}
else {
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- if(psys->part->type == PART_FLUID) {
+ for (psys = ob->particlesystem.first; psys; psys = psys->next) {
+ if (psys->part->type == PART_FLUID) {
/* clear modifier */
- psmd= psys_get_modifier(ob, psys);
+ psmd = psys_get_modifier(ob, psys);
BLI_remlink(&ob->modifiers, psmd);
modifier_free((ModifierData *)psmd);
@@ -173,10 +173,10 @@ static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *v
{
#ifndef WITH_MOD_FLUID
(void)ptr;
- value[0]= '\0';
+ value[0] = '\0';
#else
- Object *ob= (Object*)ptr->id.data;
- FluidsimSettings *fss= (FluidsimSettings*)ptr->data;
+ Object *ob = (Object*)ptr->id.data;
+ FluidsimSettings *fss = (FluidsimSettings*)ptr->data;
fluid_estimate_memory(ob, fss, value);
#endif
@@ -194,7 +194,7 @@ static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *UNUSED(ptr
static char *rna_FluidSettings_path(PointerRNA *ptr)
{
FluidsimSettings *fss = (FluidsimSettings*)ptr->data;
- ModifierData *md= (ModifierData *)fss->fmd;
+ ModifierData *md = (ModifierData *)fss->fmd;
return BLI_sprintfN("modifiers[\"%s\"].settings", md->name);
}
@@ -223,13 +223,13 @@ static void rna_def_fluidsim_slip(StructRNA *srna)
{OB_FSBND_FREESLIP, "FREESLIP", 0, "Free Slip", "Obstacle only causes zero normal velocity (=not sticky, non moving objects only!)"},
{0, NULL, 0, NULL, NULL}};
- prop= RNA_def_property(srna, "slip_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "slip_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "typeFlags");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, slip_items);
RNA_def_property_ui_text(prop, "Slip Type", "");
- prop= RNA_def_property(srna, "partial_slip_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "partial_slip_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "partSlipValue");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Partial Slip Amount", "Amount of mixing between no- and free-slip, 0 is no slip and 1 is free slip");
@@ -240,12 +240,12 @@ static void rna_def_fluid_mesh_vertices(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "FluidMeshVertex", NULL);
+ srna = RNA_def_struct(brna, "FluidMeshVertex", NULL);
RNA_def_struct_sdna(srna, "FluidVertexVelocity");
RNA_def_struct_ui_text(srna, "Fluid Mesh Vertex", "Vertex of a simulated fluid mesh");
RNA_def_struct_ui_icon(srna, ICON_VERTEXSEL);
- prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
+ prop = RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_array(prop, 3);
RNA_def_property_float_sdna(prop, NULL, "vel");
RNA_def_property_ui_text(prop, "Velocity", "");
@@ -271,107 +271,107 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
{4, "HONEY", 0, "Honey", "Viscosity of 2.0 * 10^-3"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "DomainFluidSettings", "FluidSettings");
+ srna = RNA_def_struct(brna, "DomainFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Domain Fluid Simulation Settings", "Fluid simulation settings for the domain of a fluid simulation");
/* standard settings */
- prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolutionxyz");
RNA_def_property_range(prop, 1, 1024);
RNA_def_property_ui_text(prop, "Resolution", "Domain resolution in X,Y and Z direction");
- prop= RNA_def_property(srna, "preview_resolution", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "preview_resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "previewresxyz");
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Preview Resolution", "Preview resolution in X,Y and Z direction");
- prop= RNA_def_property(srna, "viewport_display_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "viewport_display_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "guiDisplayMode");
RNA_def_property_enum_items(prop, quality_items);
RNA_def_property_ui_text(prop, "Viewport Display Mode", "How to display the mesh in the viewport");
RNA_def_property_update(prop, 0, "rna_fluid_update");
- prop= RNA_def_property(srna, "render_display_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "render_display_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "renderDisplayMode");
RNA_def_property_enum_items(prop, quality_items);
RNA_def_property_ui_text(prop, "Render Display Mode", "How to display the mesh for rendering");
- prop= RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_REVERSE);
RNA_def_property_ui_text(prop, "Reverse Frames", "Reverse fluid frames");
RNA_def_property_update(prop, 0, "rna_fluid_find_enframe");
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_maxlength(prop, FILE_MAX);
RNA_def_property_string_sdna(prop, NULL, "surfdataPath");
RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store baked fluid simulation files in");
RNA_def_property_update(prop, 0, "rna_fluid_update");
- prop= RNA_def_property(srna, "memory_estimate", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "memory_estimate", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_DomainFluidSettings_memory_estimate_get", "rna_DomainFluidSettings_memory_estimate_length", NULL);
RNA_def_property_ui_text(prop, "Memory Estimate", "Estimated amount of memory needed for baking the domain");
/* advanced settings */
- prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
+ prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_float_sdna(prop, NULL, "grav");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1000.1, 1000.1);
RNA_def_property_ui_text(prop, "Gravity", "Gravity in X, Y and Z direction");
- prop= RNA_def_property(srna, "use_time_override", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_time_override", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_OVERRIDE_TIME);
RNA_def_property_ui_text(prop, "Override Time", "Use a custom start and end time (in seconds) instead of the scene's timeline");
- prop= RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "animStart");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Start Time", "Simulation time of the first blender frame (in seconds)");
- prop= RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "animEnd");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "End Time", "Simulation time of the last blender frame (in seconds)");
- prop= RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "frameOffset");
RNA_def_property_ui_text(prop, "Cache Offset", "Offset when reading baked cache");
RNA_def_property_update(prop, NC_OBJECT, "rna_fluid_update");
- prop= RNA_def_property(srna, "simulation_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "simulation_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "realsize");
RNA_def_property_range(prop, 0.001, 10);
RNA_def_property_ui_text(prop, "Real World Size", "Size of the simulation domain in metres");
- prop= RNA_def_property(srna, "simulation_rate", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "simulation_rate", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "animRate");
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Simulation Speed", "Fluid motion rate (0 = stationary, 1 = normal speed)");
- prop= RNA_def_property(srna, "viscosity_preset", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "viscosity_preset", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "viscosityMode");
RNA_def_property_enum_items(prop, viscosity_items);
RNA_def_property_ui_text(prop, "Viscosity Preset", "Set viscosity of the fluid to a preset value, or use manual input");
- prop= RNA_def_property(srna, "viscosity_base", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "viscosity_base", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "viscosityValue");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Viscosity Base", "Viscosity setting: value that is multiplied by 10 to the power of (exponent*-1)");
- prop= RNA_def_property(srna, "viscosity_exponent", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "viscosity_exponent", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "viscosityExponent");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Viscosity Exponent", "Negative exponent for the viscosity value (to simplify entering small values e.g. 5*10^-6)");
- prop= RNA_def_property(srna, "grid_levels", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "grid_levels", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxRefine");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, -1, 4);
RNA_def_property_ui_text(prop, "Grid Levels", "Number of coarsened grids to use (-1 for automatic)");
- prop= RNA_def_property(srna, "compressibility", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "compressibility", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "gstar");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.001, 0.1);
@@ -381,45 +381,45 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
rna_def_fluidsim_slip(srna);
- prop= RNA_def_property(srna, "surface_smooth", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "surface_smooth", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "surfaceSmoothing");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0, 5.0);
RNA_def_property_ui_text(prop, "Surface Smoothing", "Amount of surface smoothing (a value of 0 is off, 1 is normal smoothing and more than 1 is extra smoothing)");
- prop= RNA_def_property(srna, "surface_subdivisions", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "surface_subdivisions", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "surfaceSubdivs");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0, 5);
RNA_def_property_ui_text(prop, "Surface Subdivisions", "Number of isosurface subdivisions (this is necessary for the inclusion of particles into the surface generation - WARNING: can lead to longer computation times !)");
- prop= RNA_def_property(srna, "use_speed_vectors", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_speed_vectors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "domainNovecgen", 0);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Generate Speed Vectors", "Generate speed vectors for vector blur");
/* no collision object surface */
- prop= RNA_def_property(srna, "surface_noobs", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "surface_noobs", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSSG_NOOBS);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Hide fluid surface", "");
/* particles */
- prop= RNA_def_property(srna, "tracer_particles", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "tracer_particles", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "generateTracers");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "Tracer Particles", "Number of tracer particles to generate");
- prop= RNA_def_property(srna, "generate_particles", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "generate_particles", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "generateParticles");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Generate Particles", "Amount of particles to generate (0=off, 1=normal, >1=more)");
/* simulated fluid mesh data */
- prop= RNA_def_property(srna, "fluid_mesh_vertices", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "fluid_mesh_vertices", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "FluidMeshVertex");
RNA_def_property_ui_text(prop, "Fluid Mesh Vertices", "Vertices of the fluid mesh generated by simulation");
RNA_def_property_collection_funcs(prop, "rna_FluidMeshVertex_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_FluidMeshVertex_data_length", NULL, NULL, NULL);
@@ -436,13 +436,13 @@ static void rna_def_fluidsim_volume(StructRNA *srna)
{3, "BOTH", 0, "Both", "Use both the inner volume and the outer shell of the mesh"},
{0, NULL, 0, NULL, NULL}};
- prop= RNA_def_property(srna, "volume_initialization", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "volume_initialization", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "volumeInitType");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, volume_type_items);
RNA_def_property_ui_text(prop, "Volume Initialization", "Volume initialization type");
- prop= RNA_def_property(srna, "use_animated_mesh", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_animated_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "domainNovecgen", 0);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Export Animated Mesh", "Export this mesh as an animated one (slower, only use if really necessary [e.g. armatures or parented objects], animated pos/rot/scale F-Curves do not require it)");
@@ -452,7 +452,7 @@ static void rna_def_fluidsim_active(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_ACTIVE);
RNA_def_property_ui_text(prop, "Enabled", "Object contributes to the fluid simulation");
}
@@ -462,14 +462,14 @@ static void rna_def_fluidsim_fluid(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "FluidFluidSettings", "FluidSettings");
+ srna = RNA_def_struct(brna, "FluidFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Fluid Fluid Simulation Settings", "Fluid simulation settings for the fluid in the simulation");
rna_def_fluidsim_active(srna);
rna_def_fluidsim_volume(srna);
- prop= RNA_def_property(srna, "initial_velocity", PROP_FLOAT, PROP_VELOCITY);
+ prop = RNA_def_property(srna, "initial_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "iniVelx");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1000.1, 1000.1);
@@ -481,7 +481,7 @@ static void rna_def_fluidsim_obstacle(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ObstacleFluidSettings", "FluidSettings");
+ srna = RNA_def_struct(brna, "ObstacleFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Obstacle Fluid Simulation Settings", "Fluid simulation settings for obstacles in the simulation");
@@ -489,7 +489,7 @@ static void rna_def_fluidsim_obstacle(BlenderRNA *brna)
rna_def_fluidsim_volume(srna);
rna_def_fluidsim_slip(srna);
- prop= RNA_def_property(srna, "impact_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "impact_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "surfaceSmoothing");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, -2.0, 10.0);
@@ -501,20 +501,20 @@ static void rna_def_fluidsim_inflow(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "InflowFluidSettings", "FluidSettings");
+ srna = RNA_def_struct(brna, "InflowFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Inflow Fluid Simulation Settings", "Fluid simulation settings for objects adding fluids in the simulation");
rna_def_fluidsim_active(srna);
rna_def_fluidsim_volume(srna);
- prop= RNA_def_property(srna, "inflow_velocity", PROP_FLOAT, PROP_VELOCITY);
+ prop = RNA_def_property(srna, "inflow_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "iniVelx");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1000.1, 1000.1);
RNA_def_property_ui_text(prop, "Inflow Velocity", "Initial velocity of fluid");
- prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSINFLOW_LOCALCOORD);
RNA_def_property_ui_text(prop, "Local Coordinates", "Use local coordinates for inflow (e.g. for rotating objects)");
@@ -524,7 +524,7 @@ static void rna_def_fluidsim_outflow(BlenderRNA *brna)
{
StructRNA *srna;
- srna= RNA_def_struct(brna, "OutflowFluidSettings", "FluidSettings");
+ srna = RNA_def_struct(brna, "OutflowFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Outflow Fluid Simulation Settings", "Fluid simulation settings for objects removing fluids from the simulation");
@@ -537,33 +537,33 @@ static void rna_def_fluidsim_particle(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ParticleFluidSettings", "FluidSettings");
+ srna = RNA_def_struct(brna, "ParticleFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Particle Fluid Simulation Settings", "Fluid simulation settings for objects storing fluid particles generated by the simulation");
- prop= RNA_def_property(srna, "use_drops", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_drops", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSPART_DROP);
RNA_def_property_ui_text(prop, "Drops", "Show drop particles");
- prop= RNA_def_property(srna, "use_floats", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_floats", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSPART_FLOAT);
RNA_def_property_ui_text(prop, "Floats", "Show floating foam particles");
- prop= RNA_def_property(srna, "show_tracer", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_tracer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSPART_TRACER);
RNA_def_property_ui_text(prop, "Tracer", "Show tracer particles");
- prop= RNA_def_property(srna, "particle_influence", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "particle_influence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "particleInfSize");
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Particle Influence", "Amount of particle size scaling: 0=off (all same size), 1=full (range 0.2-2.0), >1=stronger");
- prop= RNA_def_property(srna, "alpha_influence", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "alpha_influence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "particleInfAlpha");
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Alpha Influence", "Amount of particle alpha change, inverse of size influence: 0=off (all same alpha), 1=full (large particles get lower alphas, smaller ones higher values)");
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_maxlength(prop, FILE_MAX);
RNA_def_property_string_sdna(prop, NULL, "surfdataPath");
RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store and load particles from");
@@ -575,49 +575,49 @@ static void rna_def_fluidsim_control(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ControlFluidSettings", "FluidSettings");
+ srna = RNA_def_struct(brna, "ControlFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Control Fluid Simulation Settings", "Fluid simulation settings for objects controlling the motion of fluid in the simulation");
rna_def_fluidsim_active(srna);
- prop= RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "cpsTimeStart");
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Start Time", "Time when the control particles are activated");
- prop= RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "cpsTimeEnd");
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "End Time", "Time when the control particles are deactivated");
- prop= RNA_def_property(srna, "attraction_strength", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "attraction_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "attractforceStrength");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_text(prop, "Attraction Strength", "Force strength for directional attraction towards the control object");
- prop= RNA_def_property(srna, "attraction_radius", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "attraction_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "attractforceRadius");
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Attraction Radius", "Force field radius around the control object");
- prop= RNA_def_property(srna, "velocity_strength", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "velocity_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "velocityforceStrength");
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Velocity Strength", "Force strength of how much of the control object's velocity is influencing the fluid velocity");
- prop= RNA_def_property(srna, "velocity_radius", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "velocity_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "velocityforceRadius");
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Velocity Radius", "Force field radius around the control object");
- prop= RNA_def_property(srna, "quality", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "quality", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cpsQuality");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 5.0, 100.0);
RNA_def_property_ui_text(prop, "Quality", "Quality which is used for object sampling (higher = better but slower)");
- prop= RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_REVERSE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Reverse Frames", "Reverse control object movement");
@@ -641,21 +641,21 @@ void RNA_def_fluidsim(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "FluidSettings", NULL);
+ srna = RNA_def_struct(brna, "FluidSettings", NULL);
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_refine_func(srna, "rna_FluidSettings_refine");
RNA_def_struct_path_func(srna, "rna_FluidSettings_path");
RNA_def_struct_ui_text(srna, "Fluid Simulation Settings", "Fluid simulation settings for an object taking part in the simulation");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_fluid_type_items);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Type", "Type of participation in the fluid simulation");
RNA_def_property_update(prop, 0, "rna_FluidSettings_update_type");
- //prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
- //RNA_def_property_ui_text(prop, "IPO Curves", "IPO curves used by fluid simulation settings");
+ /*prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE); */
+ /*RNA_def_property_ui_text(prop, "IPO Curves", "IPO curves used by fluid simulation settings"); */
/* types */
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index eacd814c926..fa8f9bf9d35 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -42,7 +42,7 @@
static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr)
{
- bGPDlayer *gpl= (bGPDlayer *)ptr->data;
+ bGPDlayer *gpl = (bGPDlayer *)ptr->data;
/* surely there must be other criteria too... */
if (gpl->flag & GP_LAYER_LOCKED)
@@ -53,18 +53,18 @@ static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr)
static PointerRNA rna_GPencil_active_layer_get(PointerRNA *ptr)
{
- bGPdata *gpd= ptr->id.data;
+ bGPdata *gpd = ptr->id.data;
if (GS(gpd->id.name) == ID_GD) { /* why would this ever be not GD */
bGPDlayer *gl;
- for (gl= gpd->layers.first; gl; gl= gl->next) {
- if(gl->flag & GP_LAYER_ACTIVE) {
+ for (gl = gpd->layers.first; gl; gl = gl->next) {
+ if (gl->flag & GP_LAYER_ACTIVE) {
break;
}
}
- if(gl) {
+ if (gl) {
return rna_pointer_inherit_refine(ptr, &RNA_GPencilLayer, gl);
}
}
@@ -74,13 +74,13 @@ static PointerRNA rna_GPencil_active_layer_get(PointerRNA *ptr)
static void rna_GPencil_active_layer_set(PointerRNA *ptr, PointerRNA value)
{
- bGPdata *gpd= ptr->id.data;
+ bGPdata *gpd = ptr->id.data;
if (GS(gpd->id.name) == ID_GD) { /* why would this ever be not GD */
bGPDlayer *gl;
- for (gl= gpd->layers.first; gl; gl= gl->next) {
- if(gl == value.data) {
+ for (gl = gpd->layers.first; gl; gl = gl->next) {
+ if (gl == value.data) {
gl->flag |= GP_LAYER_ACTIVE;
}
else {
@@ -92,8 +92,8 @@ static void rna_GPencil_active_layer_set(PointerRNA *ptr, PointerRNA value)
void rna_GPencilLayer_info_set(PointerRNA *ptr, const char *value)
{
- bGPdata *gpd= ptr->id.data;
- bGPDlayer *gpl= ptr->data;
+ bGPdata *gpd = ptr->id.data;
+ bGPDlayer *gpl = ptr->data;
/* copy the new name into the name slot */
BLI_strncpy_utf8(gpl->info, value, sizeof(gpl->info));
@@ -108,17 +108,17 @@ static void rna_def_gpencil_stroke_point(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "GPencilStrokePoint", NULL);
+ srna = RNA_def_struct(brna, "GPencilStrokePoint", NULL);
RNA_def_struct_sdna(srna, "bGPDspoint");
RNA_def_struct_ui_text(srna, "Grease Pencil Stroke Point", "Data point for freehand stroke curve");
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Coordinates", "");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
- prop= RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pressure");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Pressure", "Pressure of tablet at point when drawing it");
@@ -130,18 +130,18 @@ static void rna_def_gpencil_stroke(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "GPencilStroke", NULL);
+ srna = RNA_def_struct(brna, "GPencilStroke", NULL);
RNA_def_struct_sdna(srna, "bGPDstroke");
RNA_def_struct_ui_text(srna, "Grease Pencil Stroke", "Freehand curve defining part of a sketch");
/* Points */
- prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "points", "totpoints");
RNA_def_property_struct_type(prop, "GPencilStrokePoint");
RNA_def_property_ui_text(prop, "Stroke Points", "Stroke data points");
/* Flags - Readonly type-info really... */
- // TODO...
+ /* TODO... */
}
static void rna_def_gpencil_frame(BlenderRNA *brna)
@@ -149,28 +149,28 @@ static void rna_def_gpencil_frame(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "GPencilFrame", NULL);
+ srna = RNA_def_struct(brna, "GPencilFrame", NULL);
RNA_def_struct_sdna(srna, "bGPDframe");
RNA_def_struct_ui_text(srna, "Grease Pencil Frame", "Collection of related sketches on a particular frame");
/* Strokes */
- prop= RNA_def_property(srna, "strokes", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "strokes", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "strokes", NULL);
RNA_def_property_struct_type(prop, "GPencilStroke");
RNA_def_property_ui_text(prop, "Strokes", "Freehand curves defining the sketch on this frame");
/* Frame Number */
- prop= RNA_def_property(srna, "frame_number", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "framenum");
- RNA_def_property_range(prop, MINFRAME, MAXFRAME); // XXX note: this cannot occur on the same frame as another sketch
+ RNA_def_property_range(prop, MINFRAME, MAXFRAME); /* XXX note: this cannot occur on the same frame as another sketch */
RNA_def_property_ui_text(prop, "Frame Number", "The frame on which this sketch appears");
/* Flags */
- prop= RNA_def_property(srna, "is_edited", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_PAINT); // XXX should it be editable?
+ prop = RNA_def_property(srna, "is_edited", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_PAINT); /* XXX should it be editable? */
RNA_def_property_ui_text(prop, "Paint Lock", "Frame is being edited (painted on)");
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_SELECT);
RNA_def_property_ui_text(prop, "Select", "Frame is selected for editing in the DopeSheet");
}
@@ -180,100 +180,102 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "GPencilLayer", NULL);
+ srna = RNA_def_struct(brna, "GPencilLayer", NULL);
RNA_def_struct_sdna(srna, "bGPDlayer");
RNA_def_struct_ui_text(srna, "Grease Pencil Layer", "Collection of related sketches");
/* Name */
- prop= RNA_def_property(srna, "info", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "info", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Info", "Layer name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GPencilLayer_info_set");
RNA_def_struct_name_property(srna, prop);
/* Frames */
- prop= RNA_def_property(srna, "frames", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "frames", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "frames", NULL);
RNA_def_property_struct_type(prop, "GPencilFrame");
RNA_def_property_ui_text(prop, "Frames", "Sketches for this layer on different frames");
/* Active Frame */
- prop= RNA_def_property(srna, "active_frame", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active_frame", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "actframe");
RNA_def_property_ui_text(prop, "Active Frame", "Frame currently being displayed for this layer");
RNA_def_property_editable_func(prop, "rna_GPencilLayer_active_frame_editable");
/* Drawing Color */
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Color", "Color for all strokes in this layer");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
- prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "color[3]");
RNA_def_property_range(prop, 0.3, 1.0f);
RNA_def_property_ui_text(prop, "Opacity", "Layer Opacity");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
/* Line Thickness */
- prop= RNA_def_property(srna, "line_width", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "line_width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "thickness");
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels)");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
/* Onion-Skinning */
- prop= RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ONIONSKIN);
- RNA_def_property_ui_text(prop, "Use Onion Skinning", "Ghost frames on either side of frame");
+ RNA_def_property_ui_text(prop, "Onion Skinning", "Ghost frames on either side of frame");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
- prop= RNA_def_property(srna, "ghost_range_max", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "ghost_range_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gstep");
RNA_def_property_range(prop, 0, 120);
- RNA_def_property_ui_text(prop, "Max Ghost Range", "Maximum number of frames on either side of the active frame to show (0 = show the 'first' available sketch on either side)");
+ RNA_def_property_ui_text(prop, "Max Ghost Range",
+ "Maximum number of frames on either side of the active frame to show "
+ "(0 = show the 'first' available sketch on either side)");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
/* Flags */
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE);
RNA_def_property_ui_text(prop, "Hide", "Set layer Visibility");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
- prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_LOCKED);
RNA_def_property_ui_text(prop, "Locked", "Protect layer from further editing and/or frame changes");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
- prop= RNA_def_property(srna, "lock_frame", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_frame", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_FRAMELOCK);
RNA_def_property_ui_text(prop, "Frame Locked", "Lock current frame displayed by layer");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
/* expose as layers.active */
- /*
+#if 0
prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ACTIVE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencilLayer_active_set");
RNA_def_property_ui_text(prop, "Active", "Set active layer for editing");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
- */
+#endif
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT);
RNA_def_property_ui_text(prop, "Select", "Layer is selected for editing in the DopeSheet");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
- // XXX keep this option?
- prop= RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE);
+ /* XXX keep this option? */
+ prop = RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_DRAWDEBUG);
RNA_def_property_ui_text(prop, "Show Points", "Draw the points which make up the strokes (for debugging purposes)");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
/* X-Ray */
- prop= RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_LAYER_NO_XRAY);
- RNA_def_property_ui_text(prop, "X Ray", "");
+ RNA_def_property_ui_text(prop, "X Ray", "Make the layer draw in front of objects");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
}
@@ -282,30 +284,30 @@ static void rna_def_gpencil_layers(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna;
PropertyRNA *prop;
-// FunctionRNA *func;
-// PropertyRNA *parm;
+/* FunctionRNA *func; */
+/* PropertyRNA *parm; */
RNA_def_property_srna(cprop, "GreasePencilLayers");
- srna= RNA_def_struct(brna, "GreasePencilLayers", NULL);
+ srna = RNA_def_struct(brna, "GreasePencilLayers", NULL);
RNA_def_struct_sdna(srna, "bGPdata");
RNA_def_struct_ui_text(srna, "Grease Pencil Layers", "Collection of grease pencil layers");
#if 0
- func= RNA_def_function(srna, "new", "rna_GPencil_layer_new");
+ func = RNA_def_function(srna, "new", "rna_GPencil_layer_new");
RNA_def_function_ui_description(func, "Add a new spline to the curve");
- parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline");
+ parm = RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline");
+ parm = RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_GPencil_layer_remove");
+ func = RNA_def_function(srna, "remove", "rna_GPencil_layer_remove");
RNA_def_function_ui_description(func, "Remove a spline from a curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
+ parm = RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
#endif
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "GreasePencil");
RNA_def_property_pointer_funcs(prop, "rna_GPencil_active_layer_get", "rna_GPencil_active_layer_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -324,25 +326,25 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
{GP_DATA_VIEWALIGN|GP_DATA_DEPTH_STROKE, "STROKE", 0, "Stroke", "Stick stroke to other strokes"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "GreasePencil", "ID");
+ srna = RNA_def_struct(brna, "GreasePencil", "ID");
RNA_def_struct_sdna(srna, "bGPdata");
RNA_def_struct_ui_text(srna, "Grease Pencil", "Freehand annotation sketchbook");
RNA_def_struct_ui_icon(srna, ICON_GREASEPENCIL);
/* Layers */
- prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
RNA_def_property_struct_type(prop, "GPencilLayer");
RNA_def_property_ui_text(prop, "Layers", "");
rna_def_gpencil_layers(brna, prop);
/* Flags */
- prop= RNA_def_property(srna, "draw_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "draw_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, draw_mode_items);
RNA_def_property_ui_text(prop, "Draw Mode", "");
- prop= RNA_def_property(srna, "use_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_DEPTH_STROKE_ENDPOINTS);
RNA_def_property_ui_text(prop, "Only Endpoints", "Only use the first and last parts of the stroke for snapping");
diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c
index 8fa92e712d9..7c66110cb85 100644
--- a/source/blender/makesrna/intern/rna_group.c
+++ b/source/blender/makesrna/intern/rna_group.c
@@ -45,7 +45,7 @@
static PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter)
{
- ListBaseIterator *internal= iter->internal;
+ ListBaseIterator *internal = iter->internal;
/* we are actually iterating a GroupObject list, so override get */
return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((GroupObject*)internal->link)->ob);
@@ -53,7 +53,7 @@ static PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter)
static void rna_Group_objects_link(Group *group, bContext *C, ReportList *reports, Object *object)
{
- if(!add_to_group(group, object, CTX_data_scene(C), NULL)) {
+ if (!add_to_group(group, object, CTX_data_scene(C), NULL)) {
BKE_reportf(reports, RPT_ERROR, "Object \"%s\" already in group \"%s\"", object->id.name+2, group->id.name+2);
return;
}
@@ -63,7 +63,7 @@ static void rna_Group_objects_link(Group *group, bContext *C, ReportList *report
static void rna_Group_objects_unlink(Group *group, bContext *C, ReportList *reports, Object *object)
{
- if(!rem_from_group(group, object, CTX_data_scene(C), NULL)) {
+ if (!rem_from_group(group, object, CTX_data_scene(C), NULL)) {
BKE_reportf(reports, RPT_ERROR, "Object \"%s\" not in group \"%s\"", object->id.name+2, group->id.name+2);
return;
}
@@ -77,30 +77,30 @@ static void rna_Group_objects_unlink(Group *group, bContext *C, ReportList *repo
static void rna_def_group_objects(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
-// PropertyRNA *prop;
+/* PropertyRNA *prop; */
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "GroupObjects");
- srna= RNA_def_struct(brna, "GroupObjects", NULL);
+ srna = RNA_def_struct(brna, "GroupObjects", NULL);
RNA_def_struct_sdna(srna, "Group");
RNA_def_struct_ui_text(srna, "Group Objects", "Collection of group objects");
/* add object */
- func= RNA_def_function(srna, "link", "rna_Group_objects_link");
+ func = RNA_def_function(srna, "link", "rna_Group_objects_link");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add this object to a group");
/* object to add */
- parm= RNA_def_pointer(func, "object", "Object", "", "Object to add");
+ parm = RNA_def_pointer(func, "object", "Object", "", "Object to add");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* remove object */
- func= RNA_def_function(srna, "unlink", "rna_Group_objects_unlink");
+ func = RNA_def_function(srna, "unlink", "rna_Group_objects_unlink");
RNA_def_function_ui_description(func, "Remove this object to a group");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
/* object to remove */
- parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove");
+ parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -110,23 +110,23 @@ void RNA_def_group(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Group", "ID");
+ srna = RNA_def_struct(brna, "Group", "ID");
RNA_def_struct_ui_text(srna, "Group", "Group of Object datablocks");
RNA_def_struct_ui_icon(srna, ICON_GROUP);
RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); /* this is done on save/load in readfile.c, removed if no objects are in the group */
- prop= RNA_def_property(srna, "dupli_offset", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "dupli_offset", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "dupli_ofs");
RNA_def_property_ui_text(prop, "Dupli Offset", "Offset from the origin to use when instancing as DupliGroup");
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
- prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER);
+ prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER);
RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_ui_text(prop, "Dupli Layers", "Layers visible when this group is instanced as a dupli");
- prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "gobject", NULL);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Objects", "A collection of this groups objects");
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index 7e3922a8f81..ebd77219dc0 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -42,7 +42,7 @@
#include "WM_types.h"
#include "WM_api.h"
-static EnumPropertyItem image_source_items[]= {
+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", "Movie file"},
@@ -56,24 +56,24 @@ static EnumPropertyItem image_source_items[]= {
static void rna_Image_animated_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Image *ima= (Image*)ptr->data;
+ Image *ima = (Image*)ptr->data;
int nr;
- if(ima->flag & IMA_TWINANIM) {
- nr= ima->xrep*ima->yrep;
- if(ima->twsta>=nr) ima->twsta= 1;
- if(ima->twend>=nr) ima->twend= nr-1;
- if(ima->twsta>ima->twend) ima->twsta= 1;
+ if (ima->flag & IMA_TWINANIM) {
+ nr = ima->xrep*ima->yrep;
+ if (ima->twsta >= nr) ima->twsta = 1;
+ if (ima->twend >= nr) ima->twend = nr-1;
+ if (ima->twsta>ima->twend) ima->twsta = 1;
}
}
static int rna_Image_dirty_get(PointerRNA *ptr)
{
- Image *ima= (Image*)ptr->data;
+ Image *ima = (Image*)ptr->data;
ImBuf *ibuf;
- for(ibuf=ima->ibufs.first; ibuf; ibuf=ibuf->next)
- if(ibuf->userflags & IB_BITMAPDIRTY)
+ for (ibuf = ima->ibufs.first; ibuf; ibuf = ibuf->next)
+ if (ibuf->userflags & IB_BITMAPDIRTY)
return 1;
return 0;
@@ -81,26 +81,26 @@ static int rna_Image_dirty_get(PointerRNA *ptr)
static void rna_Image_source_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Image *ima= ptr->id.data;
+ Image *ima = ptr->id.data;
BKE_image_signal(ima, NULL, IMA_SIGNAL_SRC_CHANGE);
DAG_id_tag_update(&ima->id, 0);
}
static void rna_Image_fields_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Image *ima= ptr->id.data;
+ Image *ima = ptr->id.data;
ImBuf *ibuf;
void *lock;
- ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
+ ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
- if(ibuf) {
- short nr= 0;
+ if (ibuf) {
+ short nr = 0;
- if(!(ima->flag & IMA_FIELDS) && (ibuf->flags & IB_fields)) nr= 1;
- if((ima->flag & IMA_FIELDS) && !(ibuf->flags & IB_fields)) nr= 1;
+ if (!(ima->flag & IMA_FIELDS) && (ibuf->flags & IB_fields)) nr = 1;
+ if ((ima->flag & IMA_FIELDS) && !(ibuf->flags & IB_fields)) nr = 1;
- if(nr)
+ if (nr)
BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
}
@@ -109,7 +109,7 @@ static void rna_Image_fields_update(Main *UNUSED(bmain), Scene *UNUSED(scene), P
static void rna_Image_free_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Image *ima= ptr->id.data;
+ Image *ima = ptr->id.data;
BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
WM_main_add_notifier(NC_IMAGE|NA_EDITED, &ima->id);
DAG_id_tag_update(&ima->id, 0);
@@ -118,7 +118,7 @@ static void rna_Image_free_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi
static void rna_Image_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Image *ima= ptr->id.data;
+ Image *ima = ptr->id.data;
BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
WM_main_add_notifier(NC_IMAGE|NA_EDITED, &ima->id);
DAG_id_tag_update(&ima->id, 0);
@@ -126,13 +126,13 @@ static void rna_Image_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), P
static void rna_Image_generated_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Image *ima= ptr->id.data;
+ Image *ima = ptr->id.data;
BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
}
static void rna_ImageUser_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
- ImageUser *iuser= ptr->data;
+ ImageUser *iuser = ptr->data;
BKE_image_user_calc_frame(iuser, scene->r.cfra, 0);
}
@@ -141,9 +141,9 @@ static void rna_ImageUser_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *
char *rna_ImageUser_path(PointerRNA *ptr)
{
if (ptr->id.data) {
- // ImageUser *iuser= ptr->data;
+ /* ImageUser *iuser= ptr->data; */
- switch(GS(((ID *)ptr->id.data)->name)) {
+ switch (GS(((ID *)ptr->id.data)->name)) {
case ID_TE:
return BLI_strdup("image_user");
}
@@ -154,11 +154,11 @@ char *rna_ImageUser_path(PointerRNA *ptr)
static EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{
- Image *ima= (Image*)ptr->data;
- EnumPropertyItem *item= NULL;
- int totitem= 0;
+ Image *ima = (Image*)ptr->data;
+ EnumPropertyItem *item = NULL;
+ int totitem = 0;
- if(ima->source == IMA_SRC_VIEWER) {
+ if (ima->source == IMA_SRC_VIEWER) {
RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_VIEWER);
}
else {
@@ -169,24 +169,24 @@ static EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C), PointerRNA
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
static int rna_Image_file_format_get(PointerRNA *ptr)
{
- Image *image= (Image*)ptr->data;
- ImBuf *ibuf= BKE_image_get_ibuf(image, NULL);
+ Image *image = (Image*)ptr->data;
+ ImBuf *ibuf = BKE_image_get_ibuf(image, NULL);
return BKE_ftype_to_imtype(ibuf ? ibuf->ftype : 0);
}
static void rna_Image_file_format_set(PointerRNA *ptr, int value)
{
- Image *image= (Image*)ptr->data;
- if(BKE_imtype_is_movie(value) == 0) { /* should be able to throw an error here */
+ Image *image = (Image*)ptr->data;
+ if (BKE_imtype_is_movie(value) == 0) { /* should be able to throw an error here */
ImBuf *ibuf;
- int ftype= BKE_imtype_to_ftype(value);
+ int ftype = BKE_imtype_to_ftype(value);
/*
ibuf= BKE_image_get_ibuf(image, NULL);
@@ -195,15 +195,15 @@ static void rna_Image_file_format_set(PointerRNA *ptr, int value)
*/
/* to be safe change all buffer file types */
- for(ibuf= image->ibufs.first; ibuf; ibuf= ibuf->next) {
- ibuf->ftype= ftype;
+ for (ibuf = image->ibufs.first; ibuf; ibuf = ibuf->next) {
+ ibuf->ftype = ftype;
}
}
}
static int rna_Image_has_data_get(PointerRNA *ptr)
{
- Image *im= (Image*)ptr->data;
+ Image *im = (Image*)ptr->data;
if (im->ibufs.first)
return 1;
@@ -213,18 +213,18 @@ static int rna_Image_has_data_get(PointerRNA *ptr)
static void rna_Image_size_get(PointerRNA *ptr,int *values)
{
- Image *im= (Image*)ptr->data;
+ Image *im = (Image*)ptr->data;
ImBuf *ibuf;
void *lock;
ibuf = BKE_image_acquire_ibuf(im, NULL , &lock);
if (ibuf) {
- values[0]= ibuf->x;
- values[1]= ibuf->y;
+ values[0] = ibuf->x;
+ values[1] = ibuf->y;
}
else {
- values[0]= 0;
- values[1]= 0;
+ values[0] = 0;
+ values[1] = 0;
}
BKE_image_release_ibuf(im, lock);
@@ -232,18 +232,18 @@ static void rna_Image_size_get(PointerRNA *ptr,int *values)
static void rna_Image_resolution_get(PointerRNA *ptr, float *values)
{
- Image *im= (Image*)ptr->data;
+ Image *im = (Image*)ptr->data;
ImBuf *ibuf;
void *lock;
ibuf = BKE_image_acquire_ibuf(im, NULL , &lock);
if (ibuf) {
- values[0]= ibuf->ppm[0];
- values[1]= ibuf->ppm[1];
+ values[0] = ibuf->ppm[0];
+ values[1] = ibuf->ppm[1];
}
else {
- values[0]= 0;
- values[1]= 0;
+ values[0] = 0;
+ values[1] = 0;
}
BKE_image_release_ibuf(im, lock);
@@ -251,14 +251,14 @@ static void rna_Image_resolution_get(PointerRNA *ptr, float *values)
static void rna_Image_resolution_set(PointerRNA *ptr, const float *values)
{
- Image *im= (Image*)ptr->data;
+ Image *im = (Image*)ptr->data;
ImBuf *ibuf;
void *lock;
ibuf = BKE_image_acquire_ibuf(im, NULL , &lock);
if (ibuf) {
- ibuf->ppm[0]= values[0];
- ibuf->ppm[1]= values[1];
+ ibuf->ppm[0] = values[0];
+ ibuf->ppm[1] = values[1];
}
BKE_image_release_ibuf(im, lock);
@@ -266,19 +266,19 @@ static void rna_Image_resolution_set(PointerRNA *ptr, const float *values)
static int rna_Image_depth_get(PointerRNA *ptr)
{
- Image *im= (Image*)ptr->data;
+ Image *im = (Image*)ptr->data;
ImBuf *ibuf;
void *lock;
int planes;
- ibuf= BKE_image_acquire_ibuf(im, NULL, &lock);
+ ibuf = BKE_image_acquire_ibuf(im, NULL, &lock);
- if(!ibuf)
- planes= 0;
- else if(ibuf->rect_float)
- planes= ibuf->planes * 4;
+ if (!ibuf)
+ planes = 0;
+ else if (ibuf->rect_float)
+ planes = ibuf->planes * 4;
else
- planes= ibuf->planes;
+ planes = ibuf->planes;
BKE_image_release_ibuf(im, lock);
@@ -287,16 +287,16 @@ static int rna_Image_depth_get(PointerRNA *ptr)
static int rna_Image_pixels_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
- Image *ima= ptr->id.data;
+ Image *ima = ptr->id.data;
ImBuf *ibuf;
void *lock;
- ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
+ ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
- if(ibuf)
- length[0]= ibuf->x*ibuf->y*ibuf->channels;
+ if (ibuf)
+ length[0] = ibuf->x*ibuf->y*ibuf->channels;
else
- length[0]= 0;
+ length[0] = 0;
BKE_image_release_ibuf(ima, lock);
@@ -305,21 +305,21 @@ static int rna_Image_pixels_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY
static void rna_Image_pixels_get(PointerRNA *ptr, float *values)
{
- Image *ima= ptr->id.data;
+ Image *ima = ptr->id.data;
ImBuf *ibuf;
void *lock;
int i, size;
- ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
+ ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
- if(ibuf) {
- size= ibuf->x*ibuf->y*ibuf->channels;
+ if (ibuf) {
+ size = ibuf->x*ibuf->y*ibuf->channels;
- if(ibuf->rect_float) {
+ if (ibuf->rect_float) {
memcpy(values, ibuf->rect_float, sizeof(float)*size);
}
else {
- for(i = 0; i < size; i++)
+ for (i = 0; i < size; i++)
values[i] = ((unsigned char*)ibuf->rect)[i]*(1.0f/255.0f);
}
}
@@ -329,21 +329,21 @@ static void rna_Image_pixels_get(PointerRNA *ptr, float *values)
static void rna_Image_pixels_set(PointerRNA *ptr, const float *values)
{
- Image *ima= ptr->id.data;
+ Image *ima = ptr->id.data;
ImBuf *ibuf;
void *lock;
int i, size;
- ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
+ ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
- if(ibuf) {
- size= ibuf->x*ibuf->y*ibuf->channels;
+ if (ibuf) {
+ size = ibuf->x*ibuf->y*ibuf->channels;
- if(ibuf->rect_float) {
+ if (ibuf->rect_float) {
memcpy(ibuf->rect_float, values, sizeof(float)*size);
}
else {
- for(i = 0; i < size; i++)
+ for (i = 0; i < size; i++)
((unsigned char*)ibuf->rect)[i] = FTOCHAR(values[i]);
}
@@ -360,51 +360,51 @@ static void rna_def_imageuser(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ImageUser", NULL);
+ srna = RNA_def_struct(brna, "ImageUser", NULL);
RNA_def_struct_ui_text(srna, "Image User", "Parameters defining how an Image datablock is used by another datablock");
RNA_def_struct_path_func(srna, "rna_ImageUser_path");
- prop= RNA_def_property(srna, "use_auto_refresh", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_refresh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANIM_ALWAYS);
RNA_def_property_ui_text(prop, "Auto Refresh", "Always refresh image on frame changes");
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
/* animation */
- prop= RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cycl", 0);
RNA_def_property_ui_text(prop, "Cyclic", "Cycle the images in the movie");
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
- prop= RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "frames");
RNA_def_property_range(prop, 0, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Frames", "Number of images of a movie to use");
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
- prop= RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "offset");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Offset", "Offset the number of the frame to use in the animation");
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
- prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "sfra");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start Frame", "Global starting frame of the movie/sequence, assuming first picture has a #1");
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
- prop= RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "fie_ima");
RNA_def_property_range(prop, 1, 200);
RNA_def_property_ui_text(prop, "Fields per Frame", "Number of fields per rendered frame (2 fields is 1 image)");
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
- prop= RNA_def_property(srna, "multilayer_layer", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "multilayer_layer", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "layer");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */
RNA_def_property_ui_text(prop, "Layer", "Layer in multilayer image");
- prop= RNA_def_property(srna, "multilayer_pass", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "multilayer_pass", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "pass");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */
RNA_def_property_ui_text(prop, "Pass", "Pass in multilayer image");
@@ -414,178 +414,178 @@ static void rna_def_image(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- static const EnumPropertyItem prop_type_items[]= {
+ static const EnumPropertyItem prop_type_items[] = {
{IMA_TYPE_IMAGE, "IMAGE", 0, "Image", ""},
{IMA_TYPE_MULTILAYER, "MULTILAYER", 0, "Multilayer", ""},
{IMA_TYPE_UV_TEST, "UV_TEST", 0, "UV Test", ""},
{IMA_TYPE_R_RESULT, "RENDER_RESULT", 0, "Render Result", ""},
{IMA_TYPE_COMPOSITE, "COMPOSITING", 0, "Compositing", ""},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem prop_generated_type_items[]= {
+ static const EnumPropertyItem prop_generated_type_items[] = {
{0, "BLANK", 0, "Blank", "Generate a blank image"},
{1, "UV_GRID", 0, "UV Grid", "Generated grid to test UV mappings"},
{2, "COLOR_GRID", 0, "Color Grid", "Generated improved UV grid to test UV mappings"},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem prop_mapping_items[]= {
+ static const EnumPropertyItem prop_mapping_items[] = {
{0, "UV", 0, "UV Coordinates", "Use UV coordinates for mapping the image"},
{IMA_REFLECT, "REFLECTION", 0, "Reflection", "Use reflection mapping for mapping the image"},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem prop_field_order_items[]= {
+ static const EnumPropertyItem prop_field_order_items[] = {
{0, "EVEN", 0, "Upper First", "Upper field first"},
{IMA_STD_FIELD, "ODD", 0, "Lower First", "Lower field first"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Image", "ID");
+ srna = RNA_def_struct(brna, "Image", "ID");
RNA_def_struct_ui_text(srna, "Image", "Image datablock referencing an external or packed image");
RNA_def_struct_ui_icon(srna, ICON_IMAGE_DATA);
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ 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 Name", "Image/Movie file name");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update");
/* eek. this is horrible but needed so we can save to a new name without blanking the data :( */
- prop= RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name (without data refreshing)");
- prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, image_type_items);
RNA_def_property_enum_funcs(prop, "rna_Image_file_format_get", "rna_Image_file_format_set", NULL);
RNA_def_property_ui_text(prop, "File Format", "Format used for re-saving this file");
- prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, image_source_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Image_source_itemf");
RNA_def_property_ui_text(prop, "Source", "Where the image comes from");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_source_update");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Type", "How to generate the image");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
- prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
RNA_def_property_ui_text(prop, "Packed File", "");
- prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_field_order_items);
RNA_def_property_ui_text(prop, "Field Order", "Order of video fields (select which lines are displayed first)");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
/* booleans */
- prop= RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_FIELDS);
RNA_def_property_ui_text(prop, "Fields", "Use fields of the image");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_fields_update");
- prop= RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_DO_PREMUL);
RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_free_update");
- prop= RNA_def_property(srna, "use_color_unpremultiply", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_color_unpremultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_CM_PREDIVIDE);
RNA_def_property_ui_text(prop, "Color Unpremultiply", "For premultiplied alpha images, do color space conversion on colors without alpha, to avoid fringing for images with light backgrounds");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_free_update");
- prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Dirty", "Image has changed and is not saved");
/* generated image (image_generated_change_cb) */
- prop= RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "gen_type");
RNA_def_property_enum_items(prop, prop_generated_type_items);
RNA_def_property_ui_text(prop, "Generated Type", "Generated image type");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
- prop= RNA_def_property(srna, "generated_width", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "generated_width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gen_x");
RNA_def_property_range(prop, 1, 16384);
RNA_def_property_ui_text(prop, "Generated Width", "Generated image width");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
- prop= RNA_def_property(srna, "generated_height", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "generated_height", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gen_y");
RNA_def_property_range(prop, 1, 16384);
RNA_def_property_ui_text(prop, "Generated Height", "Generated image height");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
- prop= RNA_def_property(srna, "use_generated_float", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_generated_float", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gen_flag", IMA_GEN_FLOAT);
RNA_def_property_ui_text(prop, "Float Buffer", "Generate floating point buffer");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
/* realtime properties */
- prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_mapping_items);
RNA_def_property_ui_text(prop, "Mapping", "Mapping type to use for this image in the game engine");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
- prop= RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "aspx");
RNA_def_property_array(prop, 2);
RNA_def_property_range(prop, 0.1f, 5000.0f);
RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this image, does not affect rendering");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
- prop= RNA_def_property(srna, "use_animation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_animation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TWINANIM);
RNA_def_property_ui_text(prop, "Animated", "Use as animated texture in the game engine");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
- prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "twsta");
RNA_def_property_range(prop, 0, 128);
RNA_def_property_ui_text(prop, "Animation Start", "Start frame of an animated texture");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
- prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "twend");
RNA_def_property_range(prop, 0, 128);
RNA_def_property_ui_text(prop, "Animation End", "End frame of an animated texture");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
- prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "animspeed");
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Animation Speed", "Speed of the animation in frames per second");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
- prop= RNA_def_property(srna, "use_tiles", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_tiles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TILES);
RNA_def_property_ui_text(prop, "Tiles", "Use of tilemode for faces (default shift-LMB to pick the tile for selected faces)");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
- prop= RNA_def_property(srna, "tiles_x", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "tiles_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xrep");
RNA_def_property_range(prop, 1, 16);
RNA_def_property_ui_text(prop, "Tiles X", "Degree of repetition in the X direction");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
- prop= RNA_def_property(srna, "tiles_y", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "tiles_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "yrep");
RNA_def_property_range(prop, 1, 16);
RNA_def_property_ui_text(prop, "Tiles Y", "Degree of repetition in the Y direction");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
- prop= RNA_def_property(srna, "use_clamp_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_clamp_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_U);
RNA_def_property_ui_text(prop, "Clamp X", "Disable texture repeating horizontally");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
- prop= RNA_def_property(srna, "use_clamp_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_clamp_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_V);
RNA_def_property_ui_text(prop, "Clamp Y", "Disable texture repeating vertically");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
- prop= RNA_def_property(srna, "bindcode", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "bindcode", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "bindcode");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bindcode", "OpenGL bindcode");
@@ -595,24 +595,24 @@ static void rna_def_image(BlenderRNA *brna)
Image.has_data and Image.depth are temporary,
Update import_obj.py when they are replaced (Arystan)
*/
- prop= RNA_def_property(srna, "has_data", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "has_data", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_Image_has_data_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Has data", "True if this image has data");
- prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_Image_depth_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Depth", "Image bit depth");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size" , "Width and height in pixels, zero when image data cant be loaded" , 0 , 0);
+ prop = RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size" , "Width and height in pixels, zero when image data cant be loaded" , 0 , 0);
RNA_def_property_int_funcs(prop, "rna_Image_size_get" , NULL, NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_float_vector(srna, "resolution" , 2 , NULL , 0, 0, "Resolution" , "X/Y pixels per meter" , 0 , 0);
+ prop = RNA_def_float_vector(srna, "resolution" , 2 , NULL , 0, 0, "Resolution" , "X/Y pixels per meter" , 0 , 0);
RNA_def_property_float_funcs(prop, "rna_Image_resolution_get" , "rna_Image_resolution_set", NULL);
- prop= RNA_def_property(srna, "pixels", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "pixels", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_multi_array(prop, 1, NULL);
RNA_def_property_ui_text(prop, "Pixels", "Image pixels in floating point values");
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c
index b28adeafbc8..39561536a67 100644
--- a/source/blender/makesrna/intern/rna_image_api.c
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -82,15 +82,15 @@ static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports
}
else {
/* temp swap out the color */
- const unsigned char imb_planes_back= ibuf->planes;
- const float dither_back= ibuf->dither;
- ibuf->planes= scene->r.im_format.planes;
- ibuf->dither= scene->r.dither_intensity;
+ const unsigned char imb_planes_back = ibuf->planes;
+ const float dither_back = ibuf->dither;
+ ibuf->planes = scene->r.im_format.planes;
+ ibuf->dither = scene->r.dither_intensity;
if (!BKE_write_ibuf(ibuf, path, &scene->r.im_format)) {
BKE_reportf(reports, RPT_ERROR, "Couldn't write image: %s", path);
}
- ibuf->planes= imb_planes_back;
- ibuf->dither= dither_back;
+ ibuf->planes = imb_planes_back;
+ ibuf->dither = dither_back;
}
BKE_image_release_ibuf(image, lock);
@@ -101,22 +101,22 @@ static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports
static void rna_Image_save(Image *image, ReportList *reports)
{
- ImBuf *ibuf= BKE_image_get_ibuf(image, NULL);
- if(ibuf) {
+ ImBuf *ibuf = BKE_image_get_ibuf(image, NULL);
+ if (ibuf) {
char filename[FILE_MAX];
BLI_strncpy(filename, image->name, sizeof(filename));
BLI_path_abs(filename, G.main->name);
- if(image->packedfile) {
+ if (image->packedfile) {
if (writePackedFile(reports, image->name, image->packedfile, 0) != RET_OK) {
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" could saved packed file to \"%s\"", image->id.name+2, image->name);
}
}
else if (IMB_saveiff(ibuf, filename, ibuf->flags)) {
- image->type= IMA_TYPE_IMAGE;
+ image->type = IMA_TYPE_IMAGE;
- if(image->source==IMA_SRC_GENERATED)
- image->source= IMA_SRC_FILE;
+ if (image->source == IMA_SRC_GENERATED)
+ image->source = IMA_SRC_FILE;
ibuf->userflags &= ~IB_BITMAPDIRTY;
}
@@ -137,11 +137,11 @@ static void rna_Image_pack(Image *image, ReportList *reports, int as_png)
BKE_reportf(reports, RPT_ERROR, "Can't pack edited image from disk, only as internal PNG");
}
else {
- if(as_png) {
+ if (as_png) {
BKE_image_memorypack(image);
}
else {
- image->packedfile= newPackedFile(reports, image->name, ID_BLEND_PATH(G.main, &image->id));
+ image->packedfile = newPackedFile(reports, image->name, ID_BLEND_PATH(G.main, &image->id));
}
}
}
@@ -151,7 +151,7 @@ static void rna_Image_unpack(Image *image, ReportList *reports, int method)
if (!image->packedfile) {
BKE_report(reports, RPT_ERROR, "Image not packed");
}
- else if (image->source==IMA_SRC_SEQUENCE || image->source==IMA_SRC_MOVIE) {
+ else if (image->source == IMA_SRC_SEQUENCE || image->source == IMA_SRC_MOVIE) {
BKE_report(reports, RPT_ERROR, "Unpacking movies or image sequences not supported");
return;
}
@@ -168,9 +168,9 @@ static void rna_Image_reload(Image *image)
static void rna_Image_update(Image *image, ReportList *reports)
{
- ImBuf *ibuf= BKE_image_get_ibuf(image, NULL);
+ ImBuf *ibuf = BKE_image_get_ibuf(image, NULL);
- if(ibuf == NULL) {
+ if (ibuf == NULL) {
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name+2);
return;
}
@@ -184,12 +184,12 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int filter, int
unsigned int *bind = &image->bindcode;
int error = GL_NO_ERROR;
- if(*bind)
+ if (*bind)
return error;
- ibuf= BKE_image_get_ibuf(image, NULL);
+ ibuf = BKE_image_get_ibuf(image, NULL);
- if(ibuf == NULL || ibuf->rect == NULL ) {
+ if (ibuf == NULL || ibuf->rect == NULL ) {
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name+2);
return (int)GL_INVALID_OPERATION;
}
@@ -234,35 +234,35 @@ void RNA_api_image(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "save_render", "rna_Image_save_render");
+ func = RNA_def_function(srna, "save_render", "rna_Image_save_render");
RNA_def_function_ui_description(func, "Save image to a specific path using a scenes render settings");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_string_file_path(func, "filepath", "", 0, "", "Save path");
+ parm = RNA_def_string_file_path(func, "filepath", "", 0, "", "Save path");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "scene", "Scene", "", "Scene to take image parameters from");
- func= RNA_def_function(srna, "save", "rna_Image_save");
+ func = RNA_def_function(srna, "save", "rna_Image_save");
RNA_def_function_ui_description(func, "Save image to its source path");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- func= RNA_def_function(srna, "pack", "rna_Image_pack");
+ func = RNA_def_function(srna, "pack", "rna_Image_pack");
RNA_def_function_ui_description(func, "Pack an image as embedded data into the .blend file");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_boolean(func, "as_png", 0, "as_png", "Pack the image as PNG (needed for generated/dirty images)");
- func= RNA_def_function(srna, "unpack", "rna_Image_unpack");
+ func = RNA_def_function(srna, "unpack", "rna_Image_unpack");
RNA_def_function_ui_description(func, "Save an image packed in the .blend file to disk");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_enum(func, "method", unpack_method_items, PF_USE_LOCAL, "method", "How to unpack");
- func= RNA_def_function(srna, "reload", "rna_Image_reload");
+ func = RNA_def_function(srna, "reload", "rna_Image_reload");
RNA_def_function_ui_description(func, "Reload the image from its source path");
- func= RNA_def_function(srna, "update", "rna_Image_update");
+ func = RNA_def_function(srna, "update", "rna_Image_update");
RNA_def_function_ui_description(func, "Update the display image from the floating point buffer");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- func= RNA_def_function(srna, "gl_load", "rna_Image_gl_load");
+ func = RNA_def_function(srna, "gl_load", "rna_Image_gl_load");
RNA_def_function_ui_description(func, "Load the image into OpenGL graphics memory");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_int(func, "filter", GL_LINEAR_MIPMAP_NEAREST, -INT_MAX, INT_MAX, "Filter",
@@ -270,10 +270,10 @@ void RNA_api_image(StructRNA *srna)
RNA_def_int(func, "mag", GL_LINEAR, -INT_MAX, INT_MAX, "Magnification",
"The texture magnification function", -INT_MAX, INT_MAX);
/* return value */
- parm= RNA_def_int(func, "error", 0, -INT_MAX, INT_MAX, "Error", "OpenGL error value", -INT_MAX, INT_MAX);
+ parm = RNA_def_int(func, "error", 0, -INT_MAX, INT_MAX, "Error", "OpenGL error value", -INT_MAX, INT_MAX);
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "gl_free", "rna_Image_gl_free");
+ func = RNA_def_function(srna, "gl_free", "rna_Image_gl_free");
RNA_def_function_ui_description(func, "Free the image from OpenGL graphics memory");
/* TODO, pack/unpack, maybe should be generic functions? */
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index b60a6687290..3bc47f6743d 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -340,7 +340,7 @@ PointerRNA rna_listbase_lookup_int(PointerRNA *ptr, StructRNA *type, struct List
typedef struct ArrayIterator {
char *ptr;
char *endptr; /* past the last valid pointer, only for comparisons, ignores skipped values */
- void *free_ptr; /* will be free'd if set */
+ void *free_ptr; /* will be freed if set */
int itemsize;
/* array length with no skip functins applied, take care not to compare against index from animsys or python indices */
@@ -379,7 +379,7 @@ PointerRNA rna_pointer_inherit_refine(struct PointerRNA *ptr, struct StructRNA *
int rna_parameter_size(struct PropertyRNA *parm);
int rna_parameter_size_alloc(struct PropertyRNA *parm);
-// XXX, these should not need to be defined here~!
+/* XXX, these should not need to be defined here~! */
struct MTex *rna_mtex_texture_slots_add(struct ID *self, struct bContext *C, struct ReportList *reports);
struct MTex *rna_mtex_texture_slots_create(struct ID *self, struct bContext *C, struct ReportList *reports, int index);
void rna_mtex_texture_slots_clear(struct ID *self, struct bContext *C, struct ReportList *reports, int index);
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index 08836cc1865..9e7ea1379d9 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -55,7 +55,7 @@
static Key *rna_ShapeKey_find_key(ID *id)
{
- switch(GS(id->name)) {
+ switch (GS(id->name)) {
case ID_CU: return ((Curve*)id)->key;
case ID_KE: return (Key*)id;
case ID_LT: return ((Lattice*)id)->key;
@@ -67,7 +67,7 @@ static Key *rna_ShapeKey_find_key(ID *id)
void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value)
{
- KeyBlock *kb= ptr->data;
+ KeyBlock *kb = ptr->data;
char oldname[sizeof(kb->name)];
/* make a copy of the old name first */
@@ -78,7 +78,7 @@ void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value)
/* make sure the name is truly unique */
if (ptr->id.data) {
- Key *key= rna_ShapeKey_find_key(ptr->id.data);
+ Key *key = rna_ShapeKey_find_key(ptr->id.data);
BLI_uniquename(&key->block, kb, "Key", '.', offsetof(KeyBlock, name), sizeof(kb->name));
}
@@ -88,17 +88,17 @@ void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value)
static void rna_ShapeKey_value_set(PointerRNA *ptr, float value)
{
- KeyBlock *data= (KeyBlock*)ptr->data;
+ KeyBlock *data = (KeyBlock*)ptr->data;
CLAMP(value, data->slidermin, data->slidermax);
- data->curval= value;
+ data->curval = value;
}
static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max)
{
- KeyBlock *data= (KeyBlock*)ptr->data;
+ KeyBlock *data = (KeyBlock*)ptr->data;
- *min= data->slidermin;
- *max= data->slidermax;
+ *min = data->slidermin;
+ *max = data->slidermax;
}
/* epsilon for how close one end of shapekey range can get to the other */
@@ -106,15 +106,15 @@ static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max)
static void rna_ShapeKey_slider_min_range(PointerRNA *ptr, float *min, float *max)
{
- KeyBlock *data= (KeyBlock*)ptr->data;
+ KeyBlock *data = (KeyBlock*)ptr->data;
- *min= -10.0f;
- *max= data->slidermax - SHAPEKEY_SLIDER_TOL;
+ *min = -10.0f;
+ *max = data->slidermax - SHAPEKEY_SLIDER_TOL;
}
static void rna_ShapeKey_slider_min_set(PointerRNA *ptr, float value)
{
- KeyBlock *data= (KeyBlock*)ptr->data;
+ KeyBlock *data = (KeyBlock*)ptr->data;
float min, max;
rna_ShapeKey_slider_min_range(ptr, &min, &max);
@@ -124,15 +124,15 @@ static void rna_ShapeKey_slider_min_set(PointerRNA *ptr, float value)
static void rna_ShapeKey_slider_max_range(PointerRNA *ptr, float *min, float *max)
{
- KeyBlock *data= (KeyBlock*)ptr->data;
+ KeyBlock *data = (KeyBlock*)ptr->data;
- *min= data->slidermin + SHAPEKEY_SLIDER_TOL;
- *max= 10.0f;
+ *min = data->slidermin + SHAPEKEY_SLIDER_TOL;
+ *max = 10.0f;
}
static void rna_ShapeKey_slider_max_set(PointerRNA *ptr, float value)
{
- KeyBlock *data= (KeyBlock*)ptr->data;
+ KeyBlock *data = (KeyBlock*)ptr->data;
float min, max;
rna_ShapeKey_slider_max_range(ptr, &min, &max);
@@ -144,8 +144,8 @@ static void rna_ShapeKey_slider_max_set(PointerRNA *ptr, float value)
PointerRNA rna_object_shapekey_index_get(ID *id, int value)
{
- Key *key= rna_ShapeKey_find_key(id);
- KeyBlock *kb= NULL;
+ Key *key = rna_ShapeKey_find_key(id);
+ KeyBlock *kb = NULL;
PointerRNA ptr;
if (key && value < key->totkey)
@@ -158,7 +158,7 @@ PointerRNA rna_object_shapekey_index_get(ID *id, int value)
int rna_object_shapekey_index_set(ID *id, PointerRNA value, int current)
{
- Key *key= rna_ShapeKey_find_key(id);
+ Key *key = rna_ShapeKey_find_key(id);
if (key) {
int a = BLI_findindex(&key->block, value.data);
@@ -170,100 +170,100 @@ int rna_object_shapekey_index_set(ID *id, PointerRNA value, int current)
static PointerRNA rna_ShapeKey_relative_key_get(PointerRNA *ptr)
{
- KeyBlock *kb= (KeyBlock*)ptr->data;
+ KeyBlock *kb = (KeyBlock*)ptr->data;
return rna_object_shapekey_index_get(ptr->id.data, kb->relative);
}
static void rna_ShapeKey_relative_key_set(PointerRNA *ptr, PointerRNA value)
{
- KeyBlock *kb= (KeyBlock*)ptr->data;
+ KeyBlock *kb = (KeyBlock*)ptr->data;
- kb->relative= rna_object_shapekey_index_set(ptr->id.data, value, kb->relative);
+ kb->relative = rna_object_shapekey_index_set(ptr->id.data, value, kb->relative);
}
static void rna_ShapeKeyPoint_co_get(PointerRNA *ptr, float *values)
{
- float *vec= (float*)ptr->data;
+ float *vec = (float*)ptr->data;
- values[0]= vec[0];
- values[1]= vec[1];
- values[2]= vec[2];
+ values[0] = vec[0];
+ values[1] = vec[1];
+ values[2] = vec[2];
}
static void rna_ShapeKeyPoint_co_set(PointerRNA *ptr, const float *values)
{
- float *vec= (float*)ptr->data;
+ float *vec = (float*)ptr->data;
- vec[0]= values[0];
- vec[1]= values[1];
- vec[2]= values[2];
+ vec[0] = values[0];
+ vec[1] = values[1];
+ vec[2] = values[2];
}
static float rna_ShapeKeyCurvePoint_tilt_get(PointerRNA *ptr)
{
- float *vec= (float*)ptr->data;
+ float *vec = (float*)ptr->data;
return vec[3];
}
static void rna_ShapeKeyCurvePoint_tilt_set(PointerRNA *ptr, float value)
{
- float *vec= (float*)ptr->data;
- vec[3]= value;
+ float *vec = (float*)ptr->data;
+ vec[3] = value;
}
static void rna_ShapeKeyBezierPoint_co_get(PointerRNA *ptr, float *values)
{
- float *vec= (float*)ptr->data;
+ float *vec = (float*)ptr->data;
- values[0]= vec[0+3];
- values[1]= vec[1+3];
- values[2]= vec[2+3];
+ values[0] = vec[0+3];
+ values[1] = vec[1+3];
+ values[2] = vec[2+3];
}
static void rna_ShapeKeyBezierPoint_co_set(PointerRNA *ptr, const float *values)
{
- float *vec= (float*)ptr->data;
+ float *vec = (float*)ptr->data;
- vec[0+3]= values[0];
- vec[1+3]= values[1];
- vec[2+3]= values[2];
+ vec[0+3] = values[0];
+ vec[1+3] = values[1];
+ vec[2+3] = values[2];
}
static void rna_ShapeKeyBezierPoint_handle_1_co_get(PointerRNA *ptr, float *values)
{
- float *vec= (float*)ptr->data;
+ float *vec = (float*)ptr->data;
- values[0]= vec[0];
- values[1]= vec[1];
- values[2]= vec[2];
+ values[0] = vec[0];
+ values[1] = vec[1];
+ values[2] = vec[2];
}
static void rna_ShapeKeyBezierPoint_handle_1_co_set(PointerRNA *ptr, const float *values)
{
- float *vec= (float*)ptr->data;
+ float *vec = (float*)ptr->data;
- vec[0]= values[0];
- vec[1]= values[1];
- vec[2]= values[2];
+ vec[0] = values[0];
+ vec[1] = values[1];
+ vec[2] = values[2];
}
static void rna_ShapeKeyBezierPoint_handle_2_co_get(PointerRNA *ptr, float *values)
{
- float *vec= (float*)ptr->data;
+ float *vec = (float*)ptr->data;
- values[0]= vec[6+0];
- values[1]= vec[6+1];
- values[2]= vec[6+2];
+ values[0] = vec[6+0];
+ values[1] = vec[6+1];
+ values[2] = vec[6+2];
}
static void rna_ShapeKeyBezierPoint_handle_2_co_set(PointerRNA *ptr, const float *values)
{
- float *vec= (float*)ptr->data;
+ float *vec = (float*)ptr->data;
- vec[6+0]= values[0];
- vec[6+1]= values[1];
- vec[6+2]= values[2];
+ vec[6+0] = values[0];
+ vec[6+1] = values[1];
+ vec[6+2] = values[2];
}
/*static float rna_ShapeKeyBezierPoint_tilt_get(PointerRNA *ptr)
@@ -280,17 +280,17 @@ static void rna_ShapeKeyBezierPoint_tilt_set(PointerRNA *ptr, float value)
static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Key *key= rna_ShapeKey_find_key(ptr->id.data);
- KeyBlock *kb= (KeyBlock*)ptr->data;
+ Key *key = rna_ShapeKey_find_key(ptr->id.data);
+ KeyBlock *kb = (KeyBlock*)ptr->data;
Curve *cu;
Nurb *nu;
- int tot= kb->totelem, size= key->elemsize;
+ int tot = kb->totelem, size = key->elemsize;
- if(GS(key->from->name) == ID_CU) {
- cu= (Curve*)key->from;
- nu= cu->nurb.first;
+ if (GS(key->from->name) == ID_CU) {
+ cu = (Curve*)key->from;
+ nu = cu->nurb.first;
- if(nu->bezt) {
+ if (nu->bezt) {
tot /= 3;
size *= 3;
}
@@ -301,17 +301,17 @@ static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA
static int rna_ShapeKey_data_length(PointerRNA *ptr)
{
- Key *key= rna_ShapeKey_find_key(ptr->id.data);
- KeyBlock *kb= (KeyBlock*)ptr->data;
+ Key *key = rna_ShapeKey_find_key(ptr->id.data);
+ KeyBlock *kb = (KeyBlock*)ptr->data;
Curve *cu;
Nurb *nu;
- int tot= kb->totelem;
+ int tot = kb->totelem;
- if(GS(key->from->name) == ID_CU) {
- cu= (Curve*)key->from;
- nu= cu->nurb.first;
+ if (GS(key->from->name) == ID_CU) {
+ cu = (Curve*)key->from;
+ nu = cu->nurb.first;
- if(nu->bezt)
+ if (nu->bezt)
tot /= 3;
}
@@ -320,30 +320,30 @@ static int rna_ShapeKey_data_length(PointerRNA *ptr)
static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter)
{
- Key *key= rna_ShapeKey_find_key(iter->parent.id.data);
+ Key *key = rna_ShapeKey_find_key(iter->parent.id.data);
StructRNA *type;
Curve *cu;
Nurb *nu;
- if(GS(key->from->name) == ID_CU) {
- cu= (Curve*)key->from;
- nu= cu->nurb.first;
+ if (GS(key->from->name) == ID_CU) {
+ cu = (Curve*)key->from;
+ nu = cu->nurb.first;
- if(nu->bezt)
- type= &RNA_ShapeKeyBezierPoint;
+ if (nu->bezt)
+ type = &RNA_ShapeKeyBezierPoint;
else
- type= &RNA_ShapeKeyCurvePoint;
+ type = &RNA_ShapeKeyCurvePoint;
}
else
- type= &RNA_ShapeKeyPoint;
+ type = &RNA_ShapeKeyPoint;
return rna_pointer_inherit_refine(&iter->parent, type, rna_iterator_array_get(iter));
}
static char *rna_ShapeKey_path(PointerRNA *ptr)
{
- KeyBlock *kb= (KeyBlock *)ptr->data;
- ID *id= ptr->id.data;
+ KeyBlock *kb = (KeyBlock *)ptr->data;
+ ID *id = ptr->id.data;
if ((id) && (GS(id->name) != ID_KE))
return BLI_sprintfN("shape_keys.key_blocks[\"%s\"]", kb->name);
@@ -353,11 +353,11 @@ static char *rna_ShapeKey_path(PointerRNA *ptr)
static void rna_Key_update_data(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
- Key *key= ptr->id.data;
+ Key *key = ptr->id.data;
Object *ob;
- for(ob=bmain->object.first; ob; ob= ob->id.next) {
- if(ob_get_key(ob) == key) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
+ if (ob_get_key(ob) == key) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
}
@@ -437,7 +437,7 @@ static char *rna_ShapeKeyPoint_path(PointerRNA *ptr)
return BLI_sprintfN("shape_keys.key_blocks[\"%s\"].data[%d]", kb->name, index);
}
else
- return NULL; // XXX: there's really no way to resolve this...
+ return NULL; /* XXX: there's really no way to resolve this... */
}
#else
@@ -447,58 +447,60 @@ static void rna_def_keydata(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ShapeKeyPoint", NULL);
+ srna = RNA_def_struct(brna, "ShapeKeyPoint", NULL);
RNA_def_struct_ui_text(srna, "Shape Key Point", "Point in a shape key");
RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path");
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL);
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- srna= RNA_def_struct(brna, "ShapeKeyCurvePoint", NULL);
+ srna = RNA_def_struct(brna, "ShapeKeyCurvePoint", NULL);
RNA_def_struct_ui_text(srna, "Shape Key Curve Point", "Point in a shape key for curves");
RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path"); /* there's nothing type specific here, so this is fine for now */
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL);
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyCurvePoint_tilt_get", "rna_ShapeKeyCurvePoint_tilt_set", NULL);
RNA_def_property_ui_text(prop, "Tilt", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- srna= RNA_def_struct(brna, "ShapeKeyBezierPoint", NULL);
+ srna = RNA_def_struct(brna, "ShapeKeyBezierPoint", NULL);
RNA_def_struct_ui_text(srna, "Shape Key Bezier Point", "Point in a shape key for Bezier curves");
RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path"); /* there's nothing type specific here, so this is fine for now */
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_co_get", "rna_ShapeKeyBezierPoint_co_set", NULL);
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- prop= RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_1_co_get", "rna_ShapeKeyBezierPoint_handle_1_co_set", NULL);
RNA_def_property_ui_text(prop, "Handle 1 Location", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- prop= RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_2_co_get", "rna_ShapeKeyBezierPoint_handle_2_co_set", NULL);
RNA_def_property_ui_text(prop, "Handle 2 Location", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- /* appears to be unused currently
+ /* appears to be unused currently */
+#if 0
prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_tilt_get", "rna_ShapeKeyBezierPoint_tilt_set", NULL);
RNA_def_property_ui_text(prop, "Tilt", "");
- RNA_def_property_update(prop, 0, "rna_Key_update_data"); */
+ RNA_def_property_update(prop, 0, "rna_Key_update_data");
+#endif
}
static void rna_def_keyblock(BlenderRNA *brna)
@@ -512,70 +514,70 @@ static void rna_def_keyblock(BlenderRNA *brna)
{KEY_BSPLINE, "KEY_BSPLINE", 0, "BSpline", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ShapeKey", NULL);
+ srna = RNA_def_struct(brna, "ShapeKey", NULL);
RNA_def_struct_ui_text(srna, "Shape Key", "Shape key in a shape keys datablock");
RNA_def_struct_sdna(srna, "KeyBlock");
RNA_def_struct_path_func(srna, "rna_ShapeKey_path");
RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA);
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Name of Shape Key");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ShapeKey_name_set");
RNA_def_struct_name_property(srna, prop);
/* keys need to be sorted to edit this */
- prop= RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_sdna(prop, NULL, "pos");
RNA_def_property_ui_text(prop, "Frame", "Frame for absolute keys");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
/* for now, this is editable directly, as users can set this even if they're not animating them (to test results) */
- prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "curval");
RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_value_set", "rna_ShapeKey_value_range");
RNA_def_property_ui_range(prop, -10.0f, 10.0f, 10, 3);
RNA_def_property_ui_text(prop, "Value", "Value of shape key at the current frame");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_keyblock_type_items);
RNA_def_property_ui_text(prop, "Interpolation", "Interpolation type");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "vgroup");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex weight group, to blend with basis shape");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- prop= RNA_def_property(srna, "relative_key", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "relative_key", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ShapeKey");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get", "rna_ShapeKey_relative_key_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Relative Key", "Shape used as a relative key");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYBLOCK_MUTE);
RNA_def_property_ui_text(prop, "Mute", "Mute this shape key");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1);
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- prop= RNA_def_property(srna, "slider_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "slider_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "slidermin");
RNA_def_property_range(prop, -10.0f, 10.0f);
RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_slider_min_set", "rna_ShapeKey_slider_min_range");
RNA_def_property_ui_text(prop, "Slider Min", "Minimum for slider");
- prop= RNA_def_property(srna, "slider_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "slider_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "slidermax");
RNA_def_property_range(prop, -10.0f, 10.0f);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_slider_max_set", "rna_ShapeKey_slider_max_range");
RNA_def_property_ui_text(prop, "Slider Max", "Maximum for slider");
- prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "data", "totelem");
RNA_def_property_struct_type(prop, "UnknownType");
RNA_def_property_ui_text(prop, "Data", "");
@@ -587,34 +589,34 @@ static void rna_def_key(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Key", "ID");
+ srna = RNA_def_struct(brna, "Key", "ID");
RNA_def_struct_ui_text(srna, "Key", "Shape keys datablock containing different shapes of geometric datablocks");
RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA);
- prop= RNA_def_property(srna, "reference_key", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "reference_key", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "refkey");
RNA_def_property_ui_text(prop, "Reference Key", "");
- prop= RNA_def_property(srna, "key_blocks", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "key_blocks", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "block", NULL);
RNA_def_property_struct_type(prop, "ShapeKey");
RNA_def_property_ui_text(prop, "Key Blocks", "Shape keys");
rna_def_animdata_common(srna);
- prop= RNA_def_property(srna, "user", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "user", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "from");
RNA_def_property_ui_text(prop, "User", "Datablock using these shape keys");
- prop= RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type", KEY_RELATIVE);
RNA_def_property_ui_text(prop, "Relative", "Make shape keys relative");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- prop= RNA_def_property(srna, "slurph", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "slurph", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "slurph");
RNA_def_property_range(prop, -500, 500);
RNA_def_property_ui_text(prop, "Slurph", "Create a delay (in frames) in applying keypositions, first vertex goes first");
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
index 7de2d550875..f5ba7fbe816 100644
--- a/source/blender/makesrna/intern/rna_lamp.c
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -52,10 +52,10 @@
static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value)
{
- Lamp *la= (Lamp*)ptr->data;
+ Lamp *la = (Lamp*)ptr->data;
CLAMP(value, 512, 10240);
- la->bufsize= value;
+ la->bufsize = value;
la->bufsize &= (~15); /* round to multiple of 16 */
}
@@ -66,31 +66,31 @@ static PointerRNA rna_Lamp_sky_settings_get(PointerRNA *ptr)
static void rna_Lamp_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Lamp *la= (Lamp*)ptr->data;
+ Lamp *la = (Lamp*)ptr->data;
rna_iterator_array_begin(iter, (void*)la->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL);
}
static PointerRNA rna_Lamp_active_texture_get(PointerRNA *ptr)
{
- Lamp *la= (Lamp*)ptr->data;
+ Lamp *la = (Lamp*)ptr->data;
Tex *tex;
- tex= give_current_lamp_texture(la);
+ tex = give_current_lamp_texture(la);
return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
}
static void rna_Lamp_active_texture_set(PointerRNA *ptr, PointerRNA value)
{
- Lamp *la= (Lamp*)ptr->data;
+ Lamp *la = (Lamp*)ptr->data;
set_current_lamp_texture(la, value.data);
}
static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr)
{
- Lamp *la= (Lamp*)ptr->data;
+ Lamp *la = (Lamp*)ptr->data;
- switch(la->type) {
+ switch (la->type) {
case LA_LOCAL:
return &RNA_PointLamp;
case LA_SUN:
@@ -108,10 +108,10 @@ static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr)
static void rna_Lamp_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
- Lamp *la= ptr->id.data;
+ Lamp *la = ptr->id.data;
DAG_id_tag_update(&la->id, 0);
- if(scene->gm.matmode == GAME_MAT_GLSL)
+ if (scene->gm.matmode == GAME_MAT_GLSL)
WM_main_add_notifier(NC_LAMP|ND_LIGHTING_DRAW, la);
else
WM_main_add_notifier(NC_LAMP|ND_LIGHTING, la);
@@ -119,7 +119,7 @@ static void rna_Lamp_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Lamp *la= ptr->id.data;
+ Lamp *la = ptr->id.data;
DAG_id_tag_update(&la->id, 0);
WM_main_add_notifier(NC_LAMP|ND_LIGHTING_DRAW, la);
@@ -127,7 +127,7 @@ static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poin
static void rna_Lamp_sky_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Lamp *la= ptr->id.data;
+ Lamp *la = ptr->id.data;
DAG_id_tag_update(&la->id, 0);
WM_main_add_notifier(NC_LAMP|ND_SKY, la);
@@ -136,21 +136,21 @@ static void rna_Lamp_sky_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Point
/* only for rad/deg conversion! can remove later */
static float rna_Lamp_spot_size_get(PointerRNA *ptr)
{
- Lamp *la= ptr->id.data;
+ Lamp *la = ptr->id.data;
return DEG2RADF(la->spotsize);
}
static void rna_Lamp_spot_size_set(PointerRNA *ptr, float value)
{
- Lamp *la= ptr->id.data;
- la->spotsize= RAD2DEGF(value);
+ Lamp *la = ptr->id.data;
+ la->spotsize = RAD2DEGF(value);
}
static void rna_Lamp_use_nodes_update(Main *blain, Scene *scene, PointerRNA *ptr)
{
- Lamp *la= (Lamp*)ptr->data;
+ Lamp *la = (Lamp*)ptr->data;
- if(la->use_nodes && la->nodetree==NULL)
+ if (la->use_nodes && la->nodetree == NULL)
ED_node_shader_default(scene, &la->id);
rna_Lamp_update(blain, scene, ptr);
@@ -177,38 +177,38 @@ static void rna_def_lamp_mtex(BlenderRNA *brna)
{TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "LampTextureSlot", "TextureSlot");
+ srna = RNA_def_struct(brna, "LampTextureSlot", "TextureSlot");
RNA_def_struct_sdna(srna, "MTex");
RNA_def_struct_ui_text(srna, "Lamp Texture Slot", "Texture slot for textures in a Lamp datablock");
- prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texco");
RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", "");
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates");
- prop= RNA_def_property(srna, "use_map_color", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_COL);
RNA_def_property_ui_text(prop, "Color", "Let the texture affect the basic color of the lamp");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "use_map_shadow", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_SHAD);
RNA_def_property_ui_text(prop, "Shadow", "Let the texture affect the shadow color of the lamp");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Color Factor", "Amount texture affects color values");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "shadow_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shadowfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Shadow Factor", "Amount texture affects shadow");
@@ -226,18 +226,18 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna)
{2, "CIE", 0, "CIE", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "LampSkySettings", NULL);
+ srna = RNA_def_struct(brna, "LampSkySettings", NULL);
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_nested(brna, srna, "SunLamp");
RNA_def_struct_ui_text(srna, "Lamp Sky Settings", "Sky related settings for a sun lamp");
- prop= RNA_def_property(srna, "sky_color_space", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "sky_color_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "sky_colorspace");
RNA_def_property_enum_items(prop, prop_skycolorspace_items);
RNA_def_property_ui_text(prop, "Sky Color Space", "Color space to use for internal XYZ->RGB color conversion");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
- prop= RNA_def_property(srna, "sky_blend_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "sky_blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "skyblendtype");
RNA_def_property_enum_items(prop, ramp_blend_items);
RNA_def_property_ui_text(prop, "Sky Blend Mode", "Blend mode for combining sun sky with world sky");
@@ -245,80 +245,80 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna)
/* Number values */
- prop= RNA_def_property(srna, "horizon_brightness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "horizon_brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Horizon Brightness", "Horizon brightness");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
- prop= RNA_def_property(srna, "spread", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "spread", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Horizon Spread", "Horizon Spread");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
- prop= RNA_def_property(srna, "sun_brightness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "sun_brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Brightness", "Sun brightness");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
- prop= RNA_def_property(srna, "sun_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "sun_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Size", "Sun size");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
- prop= RNA_def_property(srna, "backscattered_light", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "backscattered_light", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Backscattered Light", "Backscattered light");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
- prop= RNA_def_property(srna, "sun_intensity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "sun_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Intensity", "Sun intensity");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
- prop= RNA_def_property(srna, "atmosphere_turbidity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "atmosphere_turbidity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_turbidity");
RNA_def_property_range(prop, 1.0f, 30.0f);
RNA_def_property_ui_range(prop, 2.0f, 10.0f, 1, 2);
RNA_def_property_ui_text(prop, "Atmosphere Turbidity", "Sky turbidity");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
- prop= RNA_def_property(srna, "atmosphere_inscattering", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "atmosphere_inscattering", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_inscattering_factor");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Atmosphere Inscatter", "Scatter contribution factor");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
- prop= RNA_def_property(srna, "atmosphere_extinction", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "atmosphere_extinction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_extinction_factor");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Atmosphere Extinction", "Extinction scattering contribution factor");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
- prop= RNA_def_property(srna, "atmosphere_distance_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "atmosphere_distance_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_distance_factor");
RNA_def_property_range(prop, 0.0f, 500.0f);
RNA_def_property_ui_text(prop, "Atmosphere Distance Factor", "Multiplier to convert blender units to physical distance");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
- prop= RNA_def_property(srna, "sky_blend", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "sky_blend", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "skyblendfac");
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Sky Blend", "Blend factor with sky");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
- prop= RNA_def_property(srna, "sky_exposure", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "sky_exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Sky Exposure", "Strength of sky shading exponential exposure correction");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
/* boolean */
- prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_SKY);
RNA_def_property_ui_text(prop, "Sky", "Apply sun effect on sky");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
- prop= RNA_def_property(srna, "use_atmosphere", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_atmosphere", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_AP);
RNA_def_property_ui_text(prop, "Atmosphere", "Apply sun effect on atmosphere");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
@@ -329,60 +329,60 @@ static void rna_def_lamp(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Lamp", "ID");
+ srna = RNA_def_struct(brna, "Lamp", "ID");
RNA_def_struct_refine_func(srna, "rna_Lamp_refine");
RNA_def_struct_ui_text(srna, "Lamp", "Lamp datablock for lighting a scene");
RNA_def_struct_ui_icon(srna, ICON_LAMP_DATA);
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, lamp_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of Lamp");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 1000, 1, 3);
RNA_def_property_ui_text(prop, "Distance", "Falloff distance - the light is at half the original intensity at this point");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 10, 1, 3);
RNA_def_property_ui_text(prop, "Energy", "Amount of light that the lamp emits");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "Light color");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "use_own_layer", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_own_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER);
RNA_def_property_ui_text(prop, "Layer", "Illuminate objects only on the same layers the lamp is on");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "use_negative", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_negative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NEG);
RNA_def_property_ui_text(prop, "Negative", "Cast negative light");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "use_specular", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_SPEC);
RNA_def_property_ui_text(prop, "Specular", "Create specular highlights");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "use_diffuse", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_DIFF);
RNA_def_property_ui_text(prop, "Diffuse", "Do diffuse shading");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
/* nodes */
- prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based lamps");
- prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the lamp");
@@ -408,28 +408,28 @@ static void rna_def_lamp_falloff(StructRNA *srna)
{LA_FALLOFF_SLIDERS, "LINEAR_QUADRATIC_WEIGHTED", 0, "Lin/Quad Weighted", ""},
{0, NULL, 0, NULL, NULL}};
- prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_fallofftype_items);
RNA_def_property_ui_text(prop, "Falloff Type", "Intensity Decay with distance");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curfalloff");
RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "use_sphere", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_sphere", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SPHERE);
RNA_def_property_ui_text(prop, "Sphere", "Set light intensity to zero beyond lamp distance");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "att1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Linear Attenuation", "Linear distance attenuation");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "quadratic_attenuation", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "quadratic_attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "att2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Quadratic Attenuation", "Quadratic distance attenuation");
@@ -462,56 +462,56 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
{LA_SAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", ""},
{0, NULL, 0, NULL, NULL}};
- prop= RNA_def_property(srna, "shadow_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, (spot)? prop_spot_shadow_items: prop_shadow_items);
RNA_def_property_ui_text(prop, "Shadow Method", "Method to compute lamp shadow with");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "shdwr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows cast by the lamp");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "use_only_shadow", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_only_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_ONLYSHADOW);
RNA_def_property_ui_text(prop, "Only Shadow", "Cast shadows only, without illuminating objects");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "shadow_ray_sample_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_ray_sample_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ray_samp_method");
RNA_def_property_enum_items(prop, (area)? prop_spot_ray_sampling_method_items: prop_ray_sampling_method_items);
RNA_def_property_ui_text(prop, "Shadow Ray Sampling Method", "Method for generating shadow samples: Adaptive QMC is fastest, Constant QMC is less noisy but slower");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, (area)? "shadow_ray_samples_x": "shadow_ray_samples", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, (area)? "shadow_ray_samples_x": "shadow_ray_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_samp");
RNA_def_property_range(prop, 1, 64);
RNA_def_property_ui_text(prop, (area)? "Shadow Ray Samples": "Shadow Ray Samples X","Number of samples taken extra (samples x samples)");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- if(area) {
- prop= RNA_def_property(srna, "shadow_ray_samples_y", PROP_INT, PROP_NONE);
+ if (area) {
+ prop = RNA_def_property(srna, "shadow_ray_samples_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_sampy");
RNA_def_property_range(prop, 1, 64);
RNA_def_property_ui_text(prop, "Shadow Ray Samples Y", "Number of samples taken extra (samples x samples)");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
- prop= RNA_def_property(srna, "shadow_adaptive_threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_adaptive_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Shadow Adaptive Threshold", "Threshold for Adaptive Sampling (Raytraced shadows)");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "shadow_soft_size", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "shadow_soft_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "area_size");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Shadow Soft Size", "Light size for ray shadow sampling (Raytraced shadows)");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "use_shadow_layer", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_shadow_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER_SHADOW);
RNA_def_property_ui_text(prop, "Shadow Layer", "Objects on the same layers only cast shadows");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
@@ -521,7 +521,7 @@ static void rna_def_point_lamp(BlenderRNA *brna)
{
StructRNA *srna;
- srna= RNA_def_struct(brna, "PointLamp", "Lamp");
+ srna = RNA_def_struct(brna, "PointLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Point Lamp", "Omnidirectional point lamp");
RNA_def_struct_ui_icon(srna, ICON_LAMP_POINT);
@@ -540,47 +540,47 @@ static void rna_def_area_lamp(BlenderRNA *brna)
{LA_AREA_RECT, "RECTANGLE", 0, "Rectangle", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "AreaLamp", "Lamp");
+ srna = RNA_def_struct(brna, "AreaLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Area Lamp", "Directional area lamp");
RNA_def_struct_ui_icon(srna, ICON_LAMP_AREA);
rna_def_lamp_shadow(srna, 0, 1);
- prop= RNA_def_property(srna, "use_umbra", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_umbra", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_UMBRA);
RNA_def_property_ui_text(prop, "Umbra", "Emphasize parts that are fully shadowed (Constant Jittered sampling)");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "use_dither", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_dither", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_DITHER);
RNA_def_property_ui_text(prop, "Dither", "Use 2x2 dithering for sampling (Constant Jittered sampling)");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "use_jitter", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_jitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_JITTER);
RNA_def_property_ui_text(prop, "Jitter", "Use noise for sampling (Constant Jittered sampling)");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "area_shape");
RNA_def_property_enum_items(prop, prop_areashape_items);
RNA_def_property_ui_text(prop, "Shape", "Shape of the area lamp");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "area_size");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Size", "Size of the area of the area Lamp, X direction size for Rectangle shapes");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "area_sizey");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Size Y", "Size of the area of the area Lamp in the Y direction for Rectangle shapes");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "k");
RNA_def_property_ui_range(prop, 0.001, 2.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Gamma", "Light gamma correction value");
@@ -611,7 +611,7 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
{9, "BUFFERS_9", 0, "9", "Render 9 buffers for better AA, this uses nine times more memory"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SpotLamp", "Lamp");
+ srna = RNA_def_struct(brna, "SpotLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Spot Lamp", "Directional cone lamp");
RNA_def_struct_ui_icon(srna, ICON_LAMP_SPOT);
@@ -619,112 +619,112 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
rna_def_lamp_falloff(srna);
rna_def_lamp_shadow(srna, 1, 0);
- prop= RNA_def_property(srna, "use_square", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_square", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SQUARE);
RNA_def_property_ui_text(prop, "Square", "Cast a square spot light shape");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_HALO);
RNA_def_property_ui_text(prop, "Halo", "Render spotlight with a volumetric halo");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "haint");
RNA_def_property_ui_range(prop, 0, 5.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Halo Intensity", "Brightness of the spotlight's halo cone");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "halo_step", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "halo_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "shadhalostep");
RNA_def_property_range(prop, 0, 12);
RNA_def_property_ui_text(prop, "Halo Step", "Volumetric halo sampling frequency");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "shadow_buffer_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_buffer_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "bufsize");
RNA_def_property_range(prop, 512, 10240);
RNA_def_property_ui_text(prop, "Shadow Buffer Size", "Resolution of the shadow buffer, higher values give crisper shadows but use more memory");
RNA_def_property_int_funcs(prop, NULL, "rna_Lamp_buffer_size_set", NULL);
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "shadow_filter_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "filtertype");
RNA_def_property_enum_items(prop, prop_shadbuffiltertype_items);
RNA_def_property_ui_text(prop, "Shadow Filter Type", "Type of shadow filter (Buffer Shadows)");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "shadow_sample_buffers", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_sample_buffers", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "buffers");
RNA_def_property_enum_items(prop, prop_numbuffer_items);
RNA_def_property_ui_text(prop, "Shadow Sample Buffers", "Number of shadow buffers to render for better AA, this increases memory usage");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spotblend");
RNA_def_property_range(prop, 0.0f ,1.0f);
RNA_def_property_ui_text(prop, "Spot Blend", "The softness of the spotlight edge");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_ANGLE);
- // RNA_def_property_float_sdna(prop, NULL, "spotsize");
+ prop = RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_ANGLE);
+ /* RNA_def_property_float_sdna(prop, NULL, "spotsize"); */
RNA_def_property_range(prop, M_PI/180.0, M_PI);
RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam");
RNA_def_property_float_funcs(prop, "rna_Lamp_spot_size_get", "rna_Lamp_spot_size_set", NULL); /* only for deg/rad conversion */
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "show_cone", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_cone", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SHOW_CONE);
RNA_def_property_ui_text(prop, "Show Cone", "Draw transparent cone in 3D view to visualize which objects are contained in it");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "shadow_buffer_clip_start", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "shadow_buffer_clip_start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Clip Start", "Shadow map clip start, below which objects will not generate shadows");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Clip End", "Shadow map clip end, beyond which objects will not generate shadows");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bias");
RNA_def_property_range(prop, 0.001f, 5.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Shadow buffer sampling bias");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "shadow_buffer_soft", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_buffer_soft", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "soft");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Soft", "Size of shadow buffer sampling area");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "shadow_buffer_samples", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_buffer_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samp");
RNA_def_property_range(prop, 1, 16);
RNA_def_property_ui_text(prop, "Samples", "Number of shadow buffer samples");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "shadow_buffer_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_buffer_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "buftype");
RNA_def_property_enum_items(prop, prop_shadbuftype_items);
RNA_def_property_ui_text(prop, "Shadow Buffer Type", "Type of shadow buffer");
RNA_def_property_update(prop, 0, "rna_Lamp_update");
- prop= RNA_def_property(srna, "use_auto_clip_start", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_clip_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_START);
RNA_def_property_ui_text(prop, "Autoclip Start", "Automatic calculation of clipping-start, based on visible vertices");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "use_auto_clip_end", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_clip_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_END);
RNA_def_property_ui_text(prop, "Autoclip End", "Automatic calculation of clipping-end, based on visible vertices");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
- prop= RNA_def_property(srna, "compression_threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "compression_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "compressthresh");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Compress", "Deep shadow map compression threshold");
@@ -736,7 +736,7 @@ static void rna_def_sun_lamp(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SunLamp", "Lamp");
+ srna = RNA_def_struct(brna, "SunLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Sun Lamp", "Constant direction parallel ray lamp");
RNA_def_struct_ui_icon(srna, ICON_LAMP_SUN);
@@ -744,7 +744,7 @@ static void rna_def_sun_lamp(BlenderRNA *brna)
rna_def_lamp_shadow(srna, 0, 0);
/* sky */
- prop= RNA_def_property(srna, "sky", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "sky", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "LampSkySettings");
RNA_def_property_pointer_funcs(prop, "rna_Lamp_sky_settings_get", NULL, NULL, NULL);
@@ -757,7 +757,7 @@ static void rna_def_hemi_lamp(BlenderRNA *brna)
{
StructRNA *srna;
- srna= RNA_def_struct(brna, "HemiLamp", "Lamp");
+ srna = RNA_def_struct(brna, "HemiLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Hemi Lamp", "180 degree constant lamp");
RNA_def_struct_ui_icon(srna, ICON_LAMP_HEMI);
diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c
index 9fe6b236961..24445e652cc 100644
--- a/source/blender/makesrna/intern/rna_lattice.c
+++ b/source/blender/makesrna/intern/rna_lattice.c
@@ -51,25 +51,25 @@
static void rna_LatticePoint_co_get(PointerRNA *ptr, float *values)
{
- Lattice *lt= (Lattice*)ptr->id.data;
- BPoint *bp= (BPoint*)ptr->data;
- int a= bp - lt->def;
- int x= a % lt->pntsu;
- int y= (a/lt->pntsu) % lt->pntsv;
- int z= (a/(lt->pntsu*lt->pntsv));
-
- values[0]= lt->fu + x*lt->du;
- values[1]= lt->fv + y*lt->dv;
- values[2]= lt->fw + z*lt->dw;
+ Lattice *lt = (Lattice*)ptr->id.data;
+ BPoint *bp = (BPoint*)ptr->data;
+ int a = bp - lt->def;
+ int x = a % lt->pntsu;
+ int y = (a/lt->pntsu) % lt->pntsv;
+ int z = (a/(lt->pntsu*lt->pntsv));
+
+ values[0] = lt->fu + x*lt->du;
+ values[1] = lt->fv + y*lt->dv;
+ values[2] = lt->fw + z*lt->dw;
}
static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Lattice *lt= (Lattice*)ptr->id.data;
+ Lattice *lt = (Lattice*)ptr->id.data;
- if(lt->dvert) {
- BPoint *bp= (BPoint*)ptr->data;
- MDeformVert *dvert= lt->dvert + (bp-lt->def);
+ if (lt->dvert) {
+ BPoint *bp = (BPoint*)ptr->data;
+ MDeformVert *dvert = lt->dvert + (bp-lt->def);
rna_iterator_array_begin(iter, (void*)dvert->dw, sizeof(MDeformWeight), dvert->totweight, 0, NULL);
}
@@ -79,12 +79,12 @@ static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, Poin
static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Lattice *lt= (Lattice*)ptr->data;
- int tot= lt->pntsu*lt->pntsv*lt->pntsw;
+ Lattice *lt = (Lattice*)ptr->data;
+ int tot = lt->pntsu*lt->pntsv*lt->pntsw;
- if(lt->editlatt && lt->editlatt->latt->def)
+ if (lt->editlatt && lt->editlatt->latt->def)
rna_iterator_array_begin(iter, (void*)lt->editlatt->latt->def, sizeof(BPoint), tot, 0, NULL);
- else if(lt->def)
+ else if (lt->def)
rna_iterator_array_begin(iter, (void*)lt->def, sizeof(BPoint), tot, 0, NULL);
else
rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL);
@@ -92,7 +92,7 @@ static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRN
static void rna_Lattice_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
DAG_id_tag_update(id, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
@@ -100,29 +100,29 @@ static void rna_Lattice_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), P
static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Lattice *lt= ptr->id.data;
+ Lattice *lt = ptr->id.data;
Object *ob;
int newu, newv, neww;
/* we don't modify the actual pnts, but go through opnts instead */
- newu= (lt->opntsu > 0)? lt->opntsu: lt->pntsu;
- newv= (lt->opntsv > 0)? lt->opntsv: lt->pntsv;
- neww= (lt->opntsw > 0)? lt->opntsw: lt->pntsw;
+ newu = (lt->opntsu > 0)? lt->opntsu: lt->pntsu;
+ newv = (lt->opntsv > 0)? lt->opntsv: lt->pntsv;
+ neww = (lt->opntsw > 0)? lt->opntsw: lt->pntsw;
/* resizelattice needs an object, any object will have the same result */
- for(ob=bmain->object.first; ob; ob= ob->id.next) {
- if(ob->data == lt) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
+ if (ob->data == lt) {
resizelattice(lt, newu, newv, neww, ob);
- if(lt->editlatt)
+ if (lt->editlatt)
resizelattice(lt->editlatt->latt, newu, newv, neww, ob);
break;
}
}
/* otherwise without, means old points are not repositioned */
- if(!ob) {
+ if (!ob) {
resizelattice(lt, newu, newv, neww, NULL);
- if(lt->editlatt)
+ if (lt->editlatt)
resizelattice(lt->editlatt->latt, newu, newv, neww, NULL);
}
@@ -131,15 +131,15 @@ static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Lattice_use_outside_set(PointerRNA *ptr, int value)
{
- Lattice *lt= ptr->data;
+ Lattice *lt = ptr->data;
- if(value) lt->flag |= LT_OUTSIDE;
+ if (value) lt->flag |= LT_OUTSIDE;
else lt->flag &= ~LT_OUTSIDE;
outside_lattice(lt);
- if(lt->editlatt) {
- if(value) lt->editlatt->latt->flag |= LT_OUTSIDE;
+ if (lt->editlatt) {
+ if (value) lt->editlatt->latt->flag |= LT_OUTSIDE;
else lt->editlatt->latt->flag &= ~LT_OUTSIDE;
outside_lattice(lt->editlatt->latt);
@@ -148,38 +148,38 @@ static void rna_Lattice_use_outside_set(PointerRNA *ptr, int value)
static int rna_Lattice_size_editable(PointerRNA *ptr)
{
- Lattice *lt= (Lattice*)ptr->data;
+ Lattice *lt = (Lattice*)ptr->data;
return lt->key == NULL;
}
static void rna_Lattice_points_u_set(PointerRNA *ptr, int value)
{
- Lattice *lt= (Lattice*)ptr->data;
+ Lattice *lt = (Lattice*)ptr->data;
- lt->opntsu= CLAMPIS(value, 1, 64);
+ lt->opntsu = CLAMPIS(value, 1, 64);
}
static void rna_Lattice_points_v_set(PointerRNA *ptr, int value)
{
- Lattice *lt= (Lattice*)ptr->data;
+ Lattice *lt = (Lattice*)ptr->data;
- lt->opntsv= CLAMPIS(value, 1, 64);
+ lt->opntsv = CLAMPIS(value, 1, 64);
}
static void rna_Lattice_points_w_set(PointerRNA *ptr, int value)
{
- Lattice *lt= (Lattice*)ptr->data;
+ Lattice *lt = (Lattice*)ptr->data;
- lt->opntsw= CLAMPIS(value, 1, 64);
+ lt->opntsw = CLAMPIS(value, 1, 64);
}
static void rna_Lattice_vg_name_set(PointerRNA *ptr, const char *value)
{
- Lattice *lt= ptr->data;
+ Lattice *lt = ptr->data;
BLI_strncpy(lt->vgroup, value, sizeof(lt->vgroup));
- if(lt->editlatt) {
+ if (lt->editlatt) {
BLI_strncpy(lt->editlatt->latt->vgroup, value, sizeof(lt->editlatt->latt->vgroup));
}
}
@@ -187,8 +187,8 @@ static void rna_Lattice_vg_name_set(PointerRNA *ptr, const char *value)
/* annoying, but is a consequence of RNA structures... */
static char *rna_LatticePoint_path(PointerRNA *ptr)
{
- Lattice *lt= (Lattice*)ptr->id.data;
- void *point= ptr->data;
+ Lattice *lt = (Lattice*)ptr->id.data;
+ void *point = ptr->data;
BPoint *points = NULL;
if (lt->editlatt && lt->editlatt->latt->def)
@@ -197,7 +197,7 @@ static char *rna_LatticePoint_path(PointerRNA *ptr)
points = lt->def;
if (points && point) {
- int tot= lt->pntsu*lt->pntsv*lt->pntsw;
+ int tot = lt->pntsu*lt->pntsv*lt->pntsw;
/* only return index if in range */
if ((point >= (void *)points) && (point < (void *)(points + tot))) {
@@ -218,24 +218,24 @@ static void rna_def_latticepoint(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "LatticePoint", NULL);
+ srna = RNA_def_struct(brna, "LatticePoint", NULL);
RNA_def_struct_sdna(srna, "BPoint");
RNA_def_struct_ui_text(srna, "LatticePoint", "Point in the lattice grid");
RNA_def_struct_path_func(srna, "rna_LatticePoint_path");
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_LatticePoint_co_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Location", "");
- prop= RNA_def_property(srna, "co_deform", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "co_deform", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Deformed Location", "");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
- prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "VertexGroupElement");
RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this point is member of");
@@ -252,11 +252,11 @@ static void rna_def_lattice(BlenderRNA *brna)
{KEY_BSPLINE, "KEY_BSPLINE", 0, "BSpline", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Lattice", "ID");
+ srna = RNA_def_struct(brna, "Lattice", "ID");
RNA_def_struct_ui_text(srna, "Lattice", "Lattice datablock defining a grid for deforming other objects");
RNA_def_struct_ui_icon(srna, ICON_LATTICE_DATA);
- prop= RNA_def_property(srna, "points_u", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "points_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "pntsu");
RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_u_set", NULL);
RNA_def_property_range(prop, 1, 64);
@@ -264,7 +264,7 @@ static void rna_def_lattice(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");
- prop= RNA_def_property(srna, "points_v", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "points_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "pntsv");
RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_v_set", NULL);
RNA_def_property_range(prop, 1, 64);
@@ -272,7 +272,7 @@ static void rna_def_lattice(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");
- prop= RNA_def_property(srna, "points_w", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "points_w", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "pntsw");
RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_w_set", NULL);
RNA_def_property_range(prop, 1, 64);
@@ -280,41 +280,41 @@ static void rna_def_lattice(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");
- prop= RNA_def_property(srna, "interpolation_type_u", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "interpolation_type_u", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "typeu");
RNA_def_property_enum_items(prop, prop_keyblock_type_items);
RNA_def_property_ui_text(prop, "Interpolation Type U", "");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
- prop= RNA_def_property(srna, "interpolation_type_v", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "interpolation_type_v", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "typev");
RNA_def_property_enum_items(prop, prop_keyblock_type_items);
RNA_def_property_ui_text(prop, "Interpolation Type V", "");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
- prop= RNA_def_property(srna, "interpolation_type_w", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "interpolation_type_w", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "typew");
RNA_def_property_enum_items(prop, prop_keyblock_type_items);
RNA_def_property_ui_text(prop, "Interpolation Type W", "");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
- prop= RNA_def_property(srna, "use_outside", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_outside", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LT_OUTSIDE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Lattice_use_outside_set");
RNA_def_property_ui_text(prop, "Outside", "Only draw, and take into account, the outer vertices");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "vgroup");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group to apply the influence of the lattice");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Lattice_vg_name_set");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
- prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "key");
RNA_def_property_ui_text(prop, "Shape Keys", "");
- prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "LatticePoint");
RNA_def_property_collection_funcs(prop, "rna_Lattice_points_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Points", "Points of the lattice");
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index d5f39dbd28a..0a54fbf6728 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -50,9 +50,9 @@ static int rna_Main_is_saved_get(PointerRNA *UNUSED(ptr))
static int rna_Main_is_dirty_get(PointerRNA *ptr)
{
/* XXX, not totally nice to do it this way, should store in main ? */
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
wmWindowManager *wm;
- for(wm= bmain->wm.first; wm; wm= wm->id.next) {
+ for (wm = bmain->wm.first; wm; wm = wm->id.next) {
return !wm->file_saved;
}
@@ -61,195 +61,195 @@ static int rna_Main_is_dirty_get(PointerRNA *ptr)
static void rna_Main_filepath_get(PointerRNA *ptr, char *value)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
BLI_strncpy(value, bmain->name, sizeof(bmain->name));
}
static int rna_Main_filepath_length(PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
return strlen(bmain->name);
}
#if 0
static void rna_Main_filepath_set(PointerRNA *ptr, const char *value)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
BLI_strncpy(bmain->name, value, sizeof(bmain->name));
}
#endif
static void rna_Main_scene_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->scene, NULL);
}
static void rna_Main_object_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->object, NULL);
}
static void rna_Main_lamp_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->lamp, NULL);
}
static void rna_Main_library_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->library, NULL);
}
static void rna_Main_mesh_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->mesh, NULL);
}
static void rna_Main_curve_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->curve, NULL);
}
static void rna_Main_mball_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->mball, NULL);
}
static void rna_Main_mat_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->mat, NULL);
}
static void rna_Main_tex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->tex, NULL);
}
static void rna_Main_image_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->image, NULL);
}
static void rna_Main_latt_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->latt, NULL);
}
static void rna_Main_camera_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->camera, NULL);
}
static void rna_Main_key_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->key, NULL);
}
static void rna_Main_world_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->world, NULL);
}
static void rna_Main_screen_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->screen, NULL);
}
static void rna_Main_script_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->script, NULL);
}
static void rna_Main_font_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->vfont, NULL);
}
static void rna_Main_text_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->text, NULL);
}
static void rna_Main_speaker_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->speaker, NULL);
}
static void rna_Main_sound_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->sound, NULL);
}
static void rna_Main_group_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->group, NULL);
}
static void rna_Main_armature_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->armature, NULL);
}
static void rna_Main_action_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->action, NULL);
}
static void rna_Main_nodetree_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->nodetree, NULL);
}
static void rna_Main_brush_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->brush, NULL);
}
static void rna_Main_particle_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->particle, NULL);
}
static void rna_Main_gpencil_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->gpencil, NULL);
}
static void rna_Main_wm_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->wm, NULL);
}
static void rna_Main_movieclips_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Main *bmain= (Main*)ptr->data;
+ Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->movieclip, NULL);
}
@@ -263,8 +263,8 @@ static void rna_Main_linestyle_begin(CollectionPropertyIterator *iter, PointerRN
static PointerRNA rna_Test_test_get(PointerRNA *ptr)
{
- PointerRNA ret= *ptr;
- ret.type= &RNA_Test;
+ PointerRNA ret = *ptr;
+ ret.type = &RNA_Test;
return ret;
}
@@ -292,7 +292,7 @@ void RNA_def_main(BlenderRNA *brna)
CollectionDefFunc *func;
/* plural must match idtypes in readblenentry.c */
- MainCollectionDef lists[]= {
+ MainCollectionDef lists[] = {
{"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks", RNA_def_main_cameras},
{"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks", RNA_def_main_scenes},
{"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks", RNA_def_main_objects},
@@ -327,36 +327,36 @@ void RNA_def_main(BlenderRNA *brna)
int i;
- srna= RNA_def_struct(brna, "BlendData", NULL);
+ srna = RNA_def_struct(brna, "BlendData", NULL);
RNA_def_struct_ui_text(srna, "Blendfile Data", "Main data structure representing a .blend file and all its datablocks");
RNA_def_struct_ui_icon(srna, ICON_BLENDER);
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_maxlength(prop, FILE_MAX);
RNA_def_property_string_funcs(prop, "rna_Main_filepath_get", "rna_Main_filepath_length", "rna_Main_filepath_set");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file");
- prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_is_dirty_get", NULL);
RNA_def_property_ui_text(prop, "File Has Unsaved Changes", "Have recent edits been saved to disk");
- prop= RNA_def_property(srna, "is_saved", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_saved", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_is_saved_get", NULL);
RNA_def_property_ui_text(prop, "File is Saved", "Has the current session been saved to disk as a .blend file");
- for(i=0; lists[i].name; i++)
+ for (i = 0; lists[i].name; i++)
{
- prop= RNA_def_property(srna, lists[i].identifier, PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, lists[i].identifier, PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, lists[i].type);
RNA_def_property_collection_funcs(prop, lists[i].iter_begin, "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, lists[i].name, lists[i].description);
/* collection functions */
- func= lists[i].func;
- if(func)
+ func = lists[i].func;
+ if (func)
func(brna, prop);
}
@@ -366,7 +366,7 @@ void RNA_def_main(BlenderRNA *brna)
RNA_define_verify_sdna(0);
- prop= RNA_def_property(srna, "test", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "test", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Test");
RNA_def_property_pointer_funcs(prop, "rna_Test_test_get", NULL, NULL, NULL);
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index ac03370debf..cd7b0e814c7 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -98,13 +98,13 @@ Tex *rna_Main_add_texture(Main *UNUSED(bmain), const char *name)
Camera *rna_Main_cameras_new(Main *UNUSED(bmain), const char *name)
{
- ID *id= add_camera(name);
+ ID *id = add_camera(name);
id_us_min(id);
return (Camera *)id;
}
void rna_Main_cameras_remove(Main *bmain, ReportList *reports, struct Camera *camera)
{
- if(ID_REAL_USERS(camera) <= 0)
+ if (ID_REAL_USERS(camera) <= 0)
free_libblock(&bmain->camera, camera);
else
BKE_reportf(reports, RPT_ERROR, "Camera \"%s\" must have zero users to be removed, found %d",
@@ -122,17 +122,17 @@ void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports, struc
/* dont call free_libblock(...) directly */
Scene *newscene;
- if(scene->id.prev)
- newscene= scene->id.prev;
- else if(scene->id.next)
- newscene= scene->id.next;
+ if (scene->id.prev)
+ newscene = scene->id.prev;
+ else if (scene->id.next)
+ newscene = scene->id.next;
else {
BKE_reportf(reports, RPT_ERROR, "Scene \"%s\" is the last, cant ve removed", scene->id.name+2);
return;
}
- if(CTX_wm_screen(C)->scene == scene)
- ED_screen_set_scene(C, newscene);
+ if (CTX_wm_screen(C)->scene == scene)
+ ED_screen_set_scene(C, CTX_wm_screen(C), newscene);
unlink_scene(bmain, scene, newscene);
}
@@ -140,38 +140,38 @@ void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports, struc
Object *rna_Main_objects_new(Main *UNUSED(bmain), ReportList *reports, const char *name, ID *data)
{
Object *ob;
- int type= OB_EMPTY;
- if(data) {
- switch(GS(data->name)) {
+ int type = OB_EMPTY;
+ if (data) {
+ switch (GS(data->name)) {
case ID_ME:
- type= OB_MESH;
+ type = OB_MESH;
break;
case ID_CU:
- type= curve_type((struct Curve *)data);
+ type = curve_type((struct Curve *)data);
break;
case ID_MB:
- type= OB_MBALL;
+ type = OB_MBALL;
break;
case ID_LA:
- type= OB_LAMP;
+ type = OB_LAMP;
break;
case ID_SPK:
- type= OB_SPEAKER;
+ type = OB_SPEAKER;
break;
case ID_CA:
- type= OB_CAMERA;
+ type = OB_CAMERA;
break;
case ID_LT:
- type= OB_LATTICE;
+ type = OB_LATTICE;
break;
case ID_AR:
- type= OB_ARMATURE;
+ type = OB_ARMATURE;
break;
default:
{
const char *idname;
- if(RNA_enum_id_from_value(id_type_items, GS(data->name), &idname) == 0)
- idname= "UNKNOWN";
+ if (RNA_enum_id_from_value(id_type_items, GS(data->name), &idname) == 0)
+ idname = "UNKNOWN";
BKE_reportf(reports, RPT_ERROR, "ID type '%s' is not valid for a object", idname);
return NULL;
@@ -181,10 +181,10 @@ Object *rna_Main_objects_new(Main *UNUSED(bmain), ReportList *reports, const cha
id_us_plus(data);
}
- ob= add_only_object(type, name);
+ ob = add_only_object(type, name);
id_us_min(&ob->id);
- ob->data= data;
+ ob->data = data;
test_object_materials(ob->data);
return ob;
@@ -192,7 +192,7 @@ Object *rna_Main_objects_new(Main *UNUSED(bmain), ReportList *reports, const cha
void rna_Main_objects_remove(Main *bmain, ReportList *reports, struct Object *object)
{
- if(ID_REAL_USERS(object) <= 0) {
+ if (ID_REAL_USERS(object) <= 0) {
unlink_object(object); /* needed or ID pointers to this are not cleared */
free_libblock(&bmain->object, object);
}
@@ -204,13 +204,13 @@ void rna_Main_objects_remove(Main *bmain, ReportList *reports, struct Object *ob
struct Material *rna_Main_materials_new(Main *UNUSED(bmain), const char *name)
{
- ID *id= (ID *)add_material(name);
+ ID *id = (ID *)add_material(name);
id_us_min(id);
return (Material *)id;
}
void rna_Main_materials_remove(Main *bmain, ReportList *reports, struct Material *material)
{
- if(ID_REAL_USERS(material) <= 0)
+ if (ID_REAL_USERS(material) <= 0)
free_libblock(&bmain->mat, material);
else
BKE_reportf(reports, RPT_ERROR, "Material \"%s\" must have zero users to be removed, found %d",
@@ -228,7 +228,7 @@ struct bNodeTree *rna_Main_nodetree_new(Main *UNUSED(bmain), const char *name, i
}
void rna_Main_nodetree_remove(Main *bmain, ReportList *reports, struct bNodeTree *tree)
{
- if(ID_REAL_USERS(tree) <= 0)
+ if (ID_REAL_USERS(tree) <= 0)
free_libblock(&bmain->nodetree, tree);
else
BKE_reportf(reports, RPT_ERROR, "Node Tree \"%s\" must have zero users to be removed, found %d",
@@ -239,13 +239,13 @@ void rna_Main_nodetree_remove(Main *bmain, ReportList *reports, struct bNodeTree
Mesh *rna_Main_meshes_new(Main *UNUSED(bmain), const char *name)
{
- Mesh *me= add_mesh(name);
+ Mesh *me = add_mesh(name);
id_us_min(&me->id);
return me;
}
void rna_Main_meshes_remove(Main *bmain, ReportList *reports, Mesh *mesh)
{
- if(ID_REAL_USERS(mesh) <= 0)
+ if (ID_REAL_USERS(mesh) <= 0)
free_libblock(&bmain->mesh, mesh);
else
BKE_reportf(reports, RPT_ERROR, "Mesh \"%s\" must have zero users to be removed, found %d",
@@ -256,14 +256,14 @@ void rna_Main_meshes_remove(Main *bmain, ReportList *reports, Mesh *mesh)
Lamp *rna_Main_lamps_new(Main *UNUSED(bmain), const char *name, int type)
{
- Lamp *lamp= add_lamp(name);
- lamp->type= type;
+ Lamp *lamp = add_lamp(name);
+ lamp->type = type;
id_us_min(&lamp->id);
return lamp;
}
void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp)
{
- if(ID_REAL_USERS(lamp) <= 0)
+ if (ID_REAL_USERS(lamp) <= 0)
free_libblock(&bmain->lamp, lamp);
else
BKE_reportf(reports, RPT_ERROR, "Lamp \"%s\" must have zero users to be removed, found %d",
@@ -274,8 +274,8 @@ void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp)
Image *rna_Main_images_new(Main *UNUSED(bmain), const char *name, int width, int height, int alpha, int float_buffer)
{
- float color[4]= {0.0, 0.0, 0.0, 1.0};
- Image *image= BKE_add_image_size(width, height, name, alpha ? 32:24, float_buffer, 0, color);
+ float color[4] = {0.0, 0.0, 0.0, 1.0};
+ Image *image = BKE_add_image_size(width, height, name, alpha ? 32:24, float_buffer, 0, color);
id_us_min(&image->id);
return image;
}
@@ -283,10 +283,10 @@ Image *rna_Main_images_load(Main *UNUSED(bmain), ReportList *reports, const char
{
Image *ima;
- errno= 0;
- ima= BKE_add_image_file(filepath);
+ errno = 0;
+ ima = BKE_add_image_file(filepath);
- if(!ima)
+ if (!ima)
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
errno ? strerror(errno) : "Unsupported image format");
@@ -294,7 +294,7 @@ Image *rna_Main_images_load(Main *UNUSED(bmain), ReportList *reports, const char
}
void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image)
{
- if(ID_REAL_USERS(image) <= 0)
+ if (ID_REAL_USERS(image) <= 0)
free_libblock(&bmain->image, image);
else
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" must have zero users to be removed, found %d",
@@ -305,13 +305,13 @@ void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image)
Lattice *rna_Main_lattices_new(Main *UNUSED(bmain), const char *name)
{
- Lattice *lt= add_lattice(name);
+ Lattice *lt = add_lattice(name);
id_us_min(&lt->id);
return lt;
}
void rna_Main_lattices_remove(Main *bmain, ReportList *reports, struct Lattice *lt)
{
- if(ID_REAL_USERS(lt) <= 0)
+ if (ID_REAL_USERS(lt) <= 0)
free_libblock(&bmain->latt, lt);
else
BKE_reportf(reports, RPT_ERROR, "Lattice \"%s\" must have zero users to be removed, found %d",
@@ -320,13 +320,13 @@ void rna_Main_lattices_remove(Main *bmain, ReportList *reports, struct Lattice *
Curve *rna_Main_curves_new(Main *UNUSED(bmain), const char *name, int type)
{
- Curve *cu= add_curve(name, type);
+ Curve *cu = add_curve(name, type);
id_us_min(&cu->id);
return cu;
}
void rna_Main_curves_remove(Main *bmain, ReportList *reports, struct Curve *cu)
{
- if(ID_REAL_USERS(cu) <= 0)
+ if (ID_REAL_USERS(cu) <= 0)
free_libblock(&bmain->curve, cu);
else
BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" must have zero users to be removed, found %d",
@@ -335,13 +335,13 @@ void rna_Main_curves_remove(Main *bmain, ReportList *reports, struct Curve *cu)
MetaBall *rna_Main_metaballs_new(Main *UNUSED(bmain), const char *name)
{
- MetaBall *mb= add_mball(name);
+ MetaBall *mb = add_mball(name);
id_us_min(&mb->id);
return mb;
}
void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall *mb)
{
- if(ID_REAL_USERS(mb) <= 0)
+ 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",
@@ -352,10 +352,10 @@ VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *filepat
{
VFont *font;
- errno= 0;
- font= load_vfont(bmain, filepath);
+ errno = 0;
+ font = load_vfont(bmain, filepath);
- if(!font)
+ if (!font)
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
errno ? strerror(errno) : "Unsupported font format");
@@ -364,7 +364,7 @@ VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *filepat
}
void rna_Main_fonts_remove(Main *bmain, ReportList *reports, VFont *vfont)
{
- if(ID_REAL_USERS(vfont) <= 0)
+ if (ID_REAL_USERS(vfont) <= 0)
free_libblock(&bmain->vfont, vfont);
else
BKE_reportf(reports, RPT_ERROR, "Font \"%s\" must have zero users to be removed, found %d",
@@ -375,14 +375,14 @@ void rna_Main_fonts_remove(Main *bmain, ReportList *reports, VFont *vfont)
Tex *rna_Main_textures_new(Main *UNUSED(bmain), const char *name, int type)
{
- Tex *tex= add_texture(name);
+ Tex *tex = add_texture(name);
tex_set_type(tex, type);
id_us_min(&tex->id);
return tex;
}
void rna_Main_textures_remove(Main *bmain, ReportList *reports, struct Tex *tex)
{
- if(ID_REAL_USERS(tex) <= 0)
+ if (ID_REAL_USERS(tex) <= 0)
free_libblock(&bmain->tex, tex);
else
BKE_reportf(reports, RPT_ERROR, "Texture \"%s\" must have zero users to be removed, found %d",
@@ -397,7 +397,7 @@ Brush *rna_Main_brushes_new(Main *UNUSED(bmain), const char *name)
}
void rna_Main_brushes_remove(Main *bmain, ReportList *reports, struct Brush *brush)
{
- if(ID_REAL_USERS(brush) <= 0)
+ if (ID_REAL_USERS(brush) <= 0)
free_libblock(&bmain->brush, brush);
else
BKE_reportf(reports, RPT_ERROR, "Brush \"%s\" must have zero users to be removed, found %d",
@@ -412,7 +412,7 @@ World *rna_Main_worlds_new(Main *UNUSED(bmain), const char *name)
}
void rna_Main_worlds_remove(Main *bmain, ReportList *reports, struct World *world)
{
- if(ID_REAL_USERS(world) <= 0)
+ if (ID_REAL_USERS(world) <= 0)
free_libblock(&bmain->world, world);
else
BKE_reportf(reports, RPT_ERROR, "World \"%s\" must have zero users to be removed, found %d",
@@ -432,13 +432,13 @@ void rna_Main_groups_remove(Main *bmain, Group *group)
Speaker *rna_Main_speakers_new(Main *UNUSED(bmain), const char *name)
{
- Speaker *speaker= add_speaker(name);
+ Speaker *speaker = add_speaker(name);
id_us_min(&speaker->id);
return speaker;
}
void rna_Main_speakers_remove(Main *bmain, ReportList *reports, Speaker *speaker)
{
- if(ID_REAL_USERS(speaker) <= 0)
+ if (ID_REAL_USERS(speaker) <= 0)
free_libblock(&bmain->speaker, speaker);
else
BKE_reportf(reports, RPT_ERROR, "Speaker \"%s\" must have zero users to be removed, found %d",
@@ -462,10 +462,10 @@ Text *rna_Main_texts_load(Main *bmain, ReportList *reports, const char *filepath
{
Text *txt;
- errno= 0;
- txt= add_text(filepath, bmain->name);
+ errno = 0;
+ txt = add_text(filepath, bmain->name);
- if(!txt)
+ if (!txt)
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
errno ? strerror(errno) : "Unable to load text");
@@ -474,13 +474,13 @@ Text *rna_Main_texts_load(Main *bmain, ReportList *reports, const char *filepath
bArmature *rna_Main_armatures_new(Main *UNUSED(bmain), const char *name)
{
- bArmature *arm= add_armature(name);
+ bArmature *arm = add_armature(name);
id_us_min(&arm->id);
return arm;
}
void rna_Main_armatures_remove(Main *bmain, ReportList *reports, bArmature *arm)
{
- if(ID_REAL_USERS(arm) <= 0)
+ if (ID_REAL_USERS(arm) <= 0)
free_libblock(&bmain->armature, arm);
else
BKE_reportf(reports, RPT_ERROR, "Armature \"%s\" must have zero users to be removed, found %d",
@@ -491,14 +491,14 @@ void rna_Main_armatures_remove(Main *bmain, ReportList *reports, bArmature *arm)
bAction *rna_Main_actions_new(Main *UNUSED(bmain), const char *name)
{
- bAction *act= add_empty_action(name);
+ bAction *act = add_empty_action(name);
id_us_min(&act->id);
act->id.flag &= ~LIB_FAKEUSER;
return act;
}
void rna_Main_actions_remove(Main *bmain, ReportList *reports, bAction *act)
{
- if(ID_REAL_USERS(act) <= 0)
+ if (ID_REAL_USERS(act) <= 0)
free_libblock(&bmain->action, act);
else
BKE_reportf(reports, RPT_ERROR, "Action \"%s\" must have zero users to be removed, found %d",
@@ -515,7 +515,7 @@ ParticleSettings *rna_Main_particles_new(Main *bmain, const char *name)
}
void rna_Main_particles_remove(Main *bmain, ReportList *reports, ParticleSettings *part)
{
- if(ID_REAL_USERS(part) <= 0)
+ if (ID_REAL_USERS(part) <= 0)
free_libblock(&bmain->particle, part);
else
BKE_reportf(reports, RPT_ERROR, "Particle Settings \"%s\" must have zero users to be removed, found %d",
@@ -528,10 +528,10 @@ MovieClip *rna_Main_movieclip_load(Main *UNUSED(bmain), ReportList *reports, con
{
MovieClip *clip;
- errno= 0;
- clip= BKE_add_movieclip_file(filepath);
+ errno = 0;
+ clip = BKE_add_movieclip_file(filepath);
- if(!clip)
+ if (!clip)
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unable to load movie clip");
return clip;
@@ -649,29 +649,29 @@ void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataCameras");
- srna= RNA_def_struct(brna, "BlendDataCameras", NULL);
+ srna = RNA_def_struct(brna, "BlendDataCameras", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Cameras", "Collection of cameras");
- func= RNA_def_function(srna, "new", "rna_Main_cameras_new");
+ func = RNA_def_function(srna, "new", "rna_Main_cameras_new");
RNA_def_function_ui_description(func, "Add a new camera to the main database");
- parm= RNA_def_string(func, "name", "Camera", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Camera", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "camera", "Camera", "", "New camera datablock");
+ parm = RNA_def_pointer(func, "camera", "Camera", "", "New camera datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_cameras_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_cameras_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a camera from the current blendfile");
- parm= RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove");
+ parm = RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_cameras_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_cameras_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_cameras_is_updated_get", NULL);
}
@@ -684,25 +684,25 @@ void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataScenes");
- srna= RNA_def_struct(brna, "BlendDataScenes", NULL);
+ srna = RNA_def_struct(brna, "BlendDataScenes", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Scenes", "Collection of scenes");
- func= RNA_def_function(srna, "new", "rna_Main_scenes_new");
+ func = RNA_def_function(srna, "new", "rna_Main_scenes_new");
RNA_def_function_ui_description(func, "Add a new scene to the main database");
- parm= RNA_def_string(func, "name", "Scene", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Scene", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "scene", "Scene", "", "New scene datablock");
+ parm = RNA_def_pointer(func, "scene", "Scene", "", "New scene datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_scenes_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_scenes_remove");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a scene from the current blendfile");
- parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove");
+ parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_scenes_is_updated_get", NULL);
}
@@ -715,33 +715,33 @@ void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataObjects");
- srna= RNA_def_struct(brna, "BlendDataObjects", NULL);
+ srna = RNA_def_struct(brna, "BlendDataObjects", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Objects", "Collection of objects");
- func= RNA_def_function(srna, "new", "rna_Main_objects_new");
+ func = RNA_def_function(srna, "new", "rna_Main_objects_new");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new object to the main database");
- parm= RNA_def_string(func, "name", "Object", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Object", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object");
+ parm = RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "object", "Object", "", "New object datablock");
+ parm = RNA_def_pointer(func, "object", "Object", "", "New object datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_objects_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_objects_remove");
RNA_def_function_ui_description(func, "Remove a object from the current blendfile");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove");
+ parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_objects_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_objects_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_objects_is_updated_get", NULL);
}
@@ -754,29 +754,29 @@ void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataMaterials");
- srna= RNA_def_struct(brna, "BlendDataMaterials", NULL);
+ srna = RNA_def_struct(brna, "BlendDataMaterials", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Materials", "Collection of materials");
- func= RNA_def_function(srna, "new", "rna_Main_materials_new");
+ func = RNA_def_function(srna, "new", "rna_Main_materials_new");
RNA_def_function_ui_description(func, "Add a new material to the main database");
- parm= RNA_def_string(func, "name", "Material", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Material", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "material", "Material", "", "New material datablock");
+ parm = RNA_def_pointer(func, "material", "Material", "", "New material datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_materials_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_materials_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a material from the current blendfile");
- parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove");
+ parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_materials_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_materials_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_materials_is_updated_get", NULL);
}
@@ -794,31 +794,31 @@ void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
{0, NULL, 0, NULL, NULL}};
RNA_def_property_srna(cprop, "BlendDataNodeTrees");
- srna= RNA_def_struct(brna, "BlendDataNodeTrees", NULL);
+ srna = RNA_def_struct(brna, "BlendDataNodeTrees", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Node Trees", "Collection of node trees");
- func= RNA_def_function(srna, "new", "rna_Main_nodetree_new");
+ func = RNA_def_function(srna, "new", "rna_Main_nodetree_new");
RNA_def_function_ui_description(func, "Add a new node tree to the main database");
- parm= RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_enum(func, "type", node_nodetree_items, 0, "Type", "The type of node_group to add");
+ parm = RNA_def_enum(func, "type", node_nodetree_items, 0, "Type", "The type of node_group to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree datablock");
+ parm = RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_nodetree_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_nodetree_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile");
- parm= RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove");
+ parm = RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_node_groups_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_node_groups_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_node_groups_is_updated_get", NULL);
}
@@ -830,29 +830,29 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataMeshes");
- srna= RNA_def_struct(brna, "BlendDataMeshes", NULL);
+ srna = RNA_def_struct(brna, "BlendDataMeshes", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Meshes", "Collection of meshes");
- func= RNA_def_function(srna, "new", "rna_Main_meshes_new");
+ func = RNA_def_function(srna, "new", "rna_Main_meshes_new");
RNA_def_function_ui_description(func, "Add a new mesh to the main database");
- parm= RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh datablock");
+ parm = RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_meshes_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_meshes_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile");
- parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove");
+ parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_meshes_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_meshes_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_meshes_is_updated_get", NULL);
}
@@ -864,31 +864,31 @@ void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataLamps");
- srna= RNA_def_struct(brna, "BlendDataLamps", NULL);
+ srna = RNA_def_struct(brna, "BlendDataLamps", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Lamps", "Collection of lamps");
- func= RNA_def_function(srna, "new", "rna_Main_lamps_new");
+ func = RNA_def_function(srna, "new", "rna_Main_lamps_new");
RNA_def_function_ui_description(func, "Add a new lamp to the main database");
- parm= RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_enum(func, "type", lamp_type_items, 0, "Type", "The type of texture to add");
+ parm = RNA_def_enum(func, "type", lamp_type_items, 0, "Type", "The type of texture to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "lamp", "Lamp", "", "New lamp datablock");
+ parm = RNA_def_pointer(func, "lamp", "Lamp", "", "New lamp datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_lamps_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_lamps_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile");
- parm= RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove");
+ parm = RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_lamps_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_lamps_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_lamps_is_updated_get", NULL);
}
@@ -901,15 +901,15 @@ void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataLibraries");
- srna= RNA_def_struct(brna, "BlendDataLibraries", NULL);
+ srna = RNA_def_struct(brna, "BlendDataLibraries", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Libraries", "Collection of libraries");
- func= RNA_def_function(srna, "tag", "rna_Main_libraries_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_libraries_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_libraries_is_updated_get", NULL);
}
@@ -922,15 +922,15 @@ void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataScreens");
- srna= RNA_def_struct(brna, "BlendDataScreens", NULL);
+ srna = RNA_def_struct(brna, "BlendDataScreens", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Screens", "Collection of screens");
- func= RNA_def_function(srna, "tag", "rna_Main_screens_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_screens_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_screens_is_updated_get", NULL);
}
@@ -943,15 +943,15 @@ void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataWindowManagers");
- srna= RNA_def_struct(brna, "BlendDataWindowManagers", NULL);
+ srna = RNA_def_struct(brna, "BlendDataWindowManagers", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers");
- func= RNA_def_function(srna, "tag", "rna_Main_window_managers_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_window_managers_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_window_managers_is_updated_get", NULL);
}
@@ -963,44 +963,44 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataImages");
- srna= RNA_def_struct(brna, "BlendDataImages", NULL);
+ srna = RNA_def_struct(brna, "BlendDataImages", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Images", "Collection of images");
- func= RNA_def_function(srna, "new", "rna_Main_images_new");
+ func = RNA_def_function(srna, "new", "rna_Main_images_new");
RNA_def_function_ui_description(func, "Add a new image to the main database");
- parm= RNA_def_string(func, "name", "Image", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Image", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image", 0, INT_MAX);
+ parm = RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image", 0, INT_MAX);
+ parm = RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_boolean(func, "alpha", 0, "Alpha", "Use alpha channel");
RNA_def_boolean(func, "float_buffer", 0, "Float Buffer", "Create an image with floating point color");
/* return type */
- parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock");
+ parm = RNA_def_pointer(func, "image", "Image", "", "New image datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "load", "rna_Main_images_load");
+ func = RNA_def_function(srna, "load", "rna_Main_images_load");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Load a new image into the main database");
- parm= RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the file to load");
+ parm = RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the file to load");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock");
+ parm = RNA_def_pointer(func, "image", "Image", "", "New image datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_images_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_images_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove an image from the current blendfile");
- parm= RNA_def_pointer(func, "image", "Image", "", "Image to remove");
+ parm = RNA_def_pointer(func, "image", "Image", "", "Image to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_images_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_images_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_images_is_updated_get", NULL);
}
@@ -1013,29 +1013,29 @@ void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataLattices");
- srna= RNA_def_struct(brna, "BlendDataLattices", NULL);
+ srna = RNA_def_struct(brna, "BlendDataLattices", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices");
- func= RNA_def_function(srna, "new", "rna_Main_lattices_new");
+ func = RNA_def_function(srna, "new", "rna_Main_lattices_new");
RNA_def_function_ui_description(func, "Add a new lattice to the main database");
- parm= RNA_def_string(func, "name", "Lattice", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Lattice", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "lattice", "Lattice", "", "New lattices datablock");
+ parm = RNA_def_pointer(func, "lattice", "Lattice", "", "New lattices datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_lattices_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_lattices_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile");
- parm= RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove");
+ parm = RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_lattices_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_lattices_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_lattices_is_updated_get", NULL);
}
@@ -1047,31 +1047,31 @@ void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataCurves");
- srna= RNA_def_struct(brna, "BlendDataCurves", NULL);
+ srna = RNA_def_struct(brna, "BlendDataCurves", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Curves", "Collection of curves");
- func= RNA_def_function(srna, "new", "rna_Main_curves_new");
+ func = RNA_def_function(srna, "new", "rna_Main_curves_new");
RNA_def_function_ui_description(func, "Add a new curve to the main database");
- parm= RNA_def_string(func, "name", "Curve", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Curve", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_enum(func, "type", object_type_curve_items, 0, "Type", "The type of curve to add");
+ parm = RNA_def_enum(func, "type", object_type_curve_items, 0, "Type", "The type of curve to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "curve", "Curve", "", "New curve datablock");
+ parm = RNA_def_pointer(func, "curve", "Curve", "", "New curve datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_curves_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_curves_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a curve from the current blendfile");
- parm= RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove");
+ parm = RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_curves_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_curves_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_curves_is_updated_get", NULL);
}
@@ -1083,29 +1083,29 @@ void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataMetaBalls");
- srna= RNA_def_struct(brna, "BlendDataMetaBalls", NULL);
+ srna = RNA_def_struct(brna, "BlendDataMetaBalls", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Metaballs", "Collection of metaballs");
- func= RNA_def_function(srna, "new", "rna_Main_metaballs_new");
+ func = RNA_def_function(srna, "new", "rna_Main_metaballs_new");
RNA_def_function_ui_description(func, "Add a new metaball to the main database");
- parm= RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball datablock");
+ parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_metaballs_remove");
+ 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");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_metaballs_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_metaballs_is_updated_get", NULL);
}
@@ -1117,30 +1117,30 @@ void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataFonts");
- srna= RNA_def_struct(brna, "BlendDataFonts", NULL);
+ srna = RNA_def_struct(brna, "BlendDataFonts", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts");
- func= RNA_def_function(srna, "load", "rna_Main_fonts_load");
+ func = RNA_def_function(srna, "load", "rna_Main_fonts_load");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Load a new font into the main database");
- parm= RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the font to load");
+ parm = RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the font to load");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "New font datablock");
+ parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "New font datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_fonts_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_fonts_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a font from the current blendfile");
- parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove");
+ parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_fonts_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_fonts_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_fonts_is_updated_get", NULL);
}
@@ -1152,31 +1152,31 @@ void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataTextures");
- srna= RNA_def_struct(brna, "BlendDataTextures", NULL);
+ srna = RNA_def_struct(brna, "BlendDataTextures", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Textures", "Collection of groups");
- func= RNA_def_function(srna, "new", "rna_Main_textures_new");
+ func = RNA_def_function(srna, "new", "rna_Main_textures_new");
RNA_def_function_ui_description(func, "Add a new texture to the main database");
- parm= RNA_def_string(func, "name", "Texture", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Texture", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_enum(func, "type", texture_type_items, 0, "Type", "The type of texture to add");
+ parm = RNA_def_enum(func, "type", texture_type_items, 0, "Type", "The type of texture to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "texture", "Texture", "", "New texture datablock");
+ parm = RNA_def_pointer(func, "texture", "Texture", "", "New texture datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_textures_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_textures_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a texture from the current blendfile");
- parm= RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove");
+ parm = RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_textures_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_textures_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_textures_is_updated_get", NULL);
}
@@ -1188,29 +1188,29 @@ void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataBrushes");
- srna= RNA_def_struct(brna, "BlendDataBrushes", NULL);
+ srna = RNA_def_struct(brna, "BlendDataBrushes", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes");
- func= RNA_def_function(srna, "new", "rna_Main_brushes_new");
+ func = RNA_def_function(srna, "new", "rna_Main_brushes_new");
RNA_def_function_ui_description(func, "Add a new brush to the main database");
- parm= RNA_def_string(func, "name", "Brush", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Brush", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "brush", "Brush", "", "New brush datablock");
+ parm = RNA_def_pointer(func, "brush", "Brush", "", "New brush datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_brushes_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_brushes_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a brush from the current blendfile");
- parm= RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove");
+ parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_brushes_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_brushes_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_brushes_is_updated_get", NULL);
}
@@ -1223,29 +1223,29 @@ void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataWorlds");
- srna= RNA_def_struct(brna, "BlendDataWorlds", NULL);
+ srna = RNA_def_struct(brna, "BlendDataWorlds", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Worlds", "Collection of worlds");
- func= RNA_def_function(srna, "new", "rna_Main_worlds_new");
+ func = RNA_def_function(srna, "new", "rna_Main_worlds_new");
RNA_def_function_ui_description(func, "Add a new world to the main database");
- parm= RNA_def_string(func, "name", "World", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "World", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "world", "World", "", "New world datablock");
+ parm = RNA_def_pointer(func, "world", "World", "", "New world datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_worlds_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_worlds_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a world from the current blendfile");
- parm= RNA_def_pointer(func, "world", "World", "", "World to remove");
+ parm = RNA_def_pointer(func, "world", "World", "", "World to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_worlds_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_worlds_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_worlds_is_updated_get", NULL);
}
@@ -1258,28 +1258,28 @@ void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataGroups");
- srna= RNA_def_struct(brna, "BlendDataGroups", NULL);
+ srna = RNA_def_struct(brna, "BlendDataGroups", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Groups", "Collection of groups");
- func= RNA_def_function(srna, "new", "rna_Main_groups_new");
+ func = RNA_def_function(srna, "new", "rna_Main_groups_new");
RNA_def_function_ui_description(func, "Add a new group to the main database");
- parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Group", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "group", "Group", "", "New group datablock");
+ parm = RNA_def_pointer(func, "group", "Group", "", "New group datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_groups_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_groups_remove");
RNA_def_function_ui_description(func, "Remove a group from the current blendfile");
- parm= RNA_def_pointer(func, "group", "Group", "", "Group to remove");
+ parm = RNA_def_pointer(func, "group", "Group", "", "Group to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_groups_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_groups_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_groups_is_updated_get", NULL);
}
@@ -1292,29 +1292,29 @@ void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataSpeakers");
- srna= RNA_def_struct(brna, "BlendDataSpeakers", NULL);
+ srna = RNA_def_struct(brna, "BlendDataSpeakers", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Speakers", "Collection of speakers");
- func= RNA_def_function(srna, "new", "rna_Main_speakers_new");
+ func = RNA_def_function(srna, "new", "rna_Main_speakers_new");
RNA_def_function_ui_description(func, "Add a new speaker to the main database");
- parm= RNA_def_string(func, "name", "Speaker", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Speaker", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker datablock");
+ parm = RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_speakers_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_speakers_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile");
- parm= RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove");
+ parm = RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_speakers_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_speakers_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_speakers_is_updated_get", NULL);
}
@@ -1327,38 +1327,38 @@ void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataTexts");
- srna= RNA_def_struct(brna, "BlendDataTexts", NULL);
+ srna = RNA_def_struct(brna, "BlendDataTexts", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Texts", "Collection of texts");
- func= RNA_def_function(srna, "new", "rna_Main_texts_new");
+ func = RNA_def_function(srna, "new", "rna_Main_texts_new");
RNA_def_function_ui_description(func, "Add a new text to the main database");
- parm= RNA_def_string(func, "name", "Text", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Text", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock");
+ parm = RNA_def_pointer(func, "text", "Text", "", "New text datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_texts_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_texts_remove");
RNA_def_function_ui_description(func, "Remove a text from the current blendfile");
- parm= RNA_def_pointer(func, "text", "Text", "", "Text to remove");
+ parm = RNA_def_pointer(func, "text", "Text", "", "Text to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* load func */
- func= RNA_def_function(srna, "load", "rna_Main_texts_load");
+ func = RNA_def_function(srna, "load", "rna_Main_texts_load");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
- parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAX, "", "path for the datablock");
+ parm = RNA_def_string_file_path(func, "filepath", "Path", FILE_MAX, "", "path for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock");
+ parm = RNA_def_pointer(func, "text", "Text", "", "New text datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "tag", "rna_Main_texts_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_texts_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_texts_is_updated_get", NULL);
}
@@ -1371,17 +1371,17 @@ void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataSounds");
- srna= RNA_def_struct(brna, "BlendDataSounds", NULL);
+ srna = RNA_def_struct(brna, "BlendDataSounds", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds");
/* TODO, 'load' */
- func= RNA_def_function(srna, "tag", "rna_Main_sounds_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_sounds_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_sounds_is_updated_get", NULL);
}
@@ -1394,29 +1394,29 @@ void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataArmatures");
- srna= RNA_def_struct(brna, "BlendDataArmatures", NULL);
+ srna = RNA_def_struct(brna, "BlendDataArmatures", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Armatures", "Collection of armatures");
- func= RNA_def_function(srna, "new", "rna_Main_armatures_new");
+ func = RNA_def_function(srna, "new", "rna_Main_armatures_new");
RNA_def_function_ui_description(func, "Add a new armature to the main database");
- parm= RNA_def_string(func, "name", "Armature", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Armature", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "armature", "Armature", "", "New armature datablock");
+ parm = RNA_def_pointer(func, "armature", "Armature", "", "New armature datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_armatures_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_armatures_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a armature from the current blendfile");
- parm= RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove");
+ parm = RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_armatures_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_armatures_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_armatures_is_updated_get", NULL);
}
@@ -1428,29 +1428,29 @@ void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataActions");
- srna= RNA_def_struct(brna, "BlendDataActions", NULL);
+ srna = RNA_def_struct(brna, "BlendDataActions", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Actions", "Collection of actions");
- func= RNA_def_function(srna, "new", "rna_Main_actions_new");
+ func = RNA_def_function(srna, "new", "rna_Main_actions_new");
RNA_def_function_ui_description(func, "Add a new action to the main database");
- parm= RNA_def_string(func, "name", "Action", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "Action", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "action", "Action", "", "New action datablock");
+ parm = RNA_def_pointer(func, "action", "Action", "", "New action datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_actions_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_actions_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a action from the current blendfile");
- parm= RNA_def_pointer(func, "action", "Action", "", "Action to remove");
+ parm = RNA_def_pointer(func, "action", "Action", "", "Action to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_actions_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_actions_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_actions_is_updated_get", NULL);
}
@@ -1462,29 +1462,29 @@ void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataParticles");
- srna= RNA_def_struct(brna, "BlendDataParticles", NULL);
+ srna = RNA_def_struct(brna, "BlendDataParticles", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings");
- func= RNA_def_function(srna, "new", "rna_Main_particles_new");
+ func = RNA_def_function(srna, "new", "rna_Main_particles_new");
RNA_def_function_ui_description(func, "Add a new particle settings instance to the main database");
- parm= RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the datablock");
+ parm = RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "New particle settings datablock");
+ parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "New particle settings datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Main_particles_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_particles_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a particle settings instance from the current blendfile");
- parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove");
+ parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "tag", "rna_Main_particles_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_particles_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_particles_is_updated_get", NULL);
}
@@ -1497,15 +1497,15 @@ void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "BlendDataGreasePencils");
- srna= RNA_def_struct(brna, "BlendDataGreasePencils", NULL);
+ srna = RNA_def_struct(brna, "BlendDataGreasePencils", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of grease pencils");
- func= RNA_def_function(srna, "tag", "rna_Main_gpencil_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_gpencil_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_gpencil_is_updated_get", NULL);
}
@@ -1517,27 +1517,27 @@ void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "BlendDataMovieClips");
- srna= RNA_def_struct(brna, "BlendDataMovieClips", NULL);
+ srna = RNA_def_struct(brna, "BlendDataMovieClips", NULL);
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Movie Clips", "Collection of movie clips");
- func= RNA_def_function(srna, "tag", "rna_Main_movieclips_tag");
- parm= RNA_def_boolean(func, "value", 0, "Value", "");
+ func = RNA_def_function(srna, "tag", "rna_Main_movieclips_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "remove", "rna_Main_movieclips_remove");
+ func = RNA_def_function(srna, "remove", "rna_Main_movieclips_remove");
RNA_def_function_ui_description(func, "Remove a movie clip from the current blendfile.");
- parm= RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove");
+ parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* load func */
- func= RNA_def_function(srna, "load", "rna_Main_movieclip_load");
+ func = RNA_def_function(srna, "load", "rna_Main_movieclip_load");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new movie clip to the main database from a file");
- parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAX, "", "path for the datablock");
+ parm = RNA_def_string_file_path(func, "filepath", "Path", FILE_MAX, "", "path for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip datablock");
+ parm = RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip datablock");
RNA_def_function_return(func, parm);
}
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 21b9c830435..e62f85a1f08 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -90,7 +90,7 @@ EnumPropertyItem ramp_blend_items[] = {
static void rna_Material_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
- Material *ma= ptr->id.data;
+ Material *ma = ptr->id.data;
DAG_id_tag_update(&ma->id, 0);
if (scene) { /* can be NULL, see [#30025] */
@@ -105,7 +105,7 @@ static void rna_Material_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *p
static void rna_Material_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Material *ma= ptr->id.data;
+ Material *ma = ptr->id.data;
DAG_id_tag_update(&ma->id, 0);
WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ma);
@@ -143,93 +143,93 @@ static PointerRNA rna_Material_physics_get(PointerRNA *ptr)
static void rna_Material_type_set(PointerRNA *ptr, int value)
{
- Material *ma= (Material*)ptr->data;
+ Material *ma = (Material*)ptr->data;
- if(ma->material_type == MA_TYPE_HALO && value != MA_TYPE_HALO)
+ if (ma->material_type == MA_TYPE_HALO && value != MA_TYPE_HALO)
ma->mode &= ~(MA_STAR|MA_HALO_XALPHA|MA_ZINV|MA_ENV);
- ma->material_type= value;
+ ma->material_type = value;
}
static void rna_Material_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Material *ma= (Material*)ptr->data;
+ Material *ma = (Material*)ptr->data;
rna_iterator_array_begin(iter, (void*)ma->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL);
}
static PointerRNA rna_Material_active_texture_get(PointerRNA *ptr)
{
- Material *ma= (Material*)ptr->data;
+ Material *ma = (Material*)ptr->data;
Tex *tex;
- tex= give_current_material_texture(ma);
+ tex = give_current_material_texture(ma);
return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
}
static void rna_Material_active_texture_set(PointerRNA *ptr, PointerRNA value)
{
- Material *ma= (Material*)ptr->data;
+ Material *ma = (Material*)ptr->data;
set_current_material_texture(ma, value.data);
}
static int rna_Material_active_texture_editable(PointerRNA *ptr)
{
- Material *ma= (Material*)ptr->id.data;
+ Material *ma = (Material*)ptr->id.data;
return has_current_material_texture(ma);
}
static PointerRNA rna_Material_active_node_material_get(PointerRNA *ptr)
{
- Material *ma= give_node_material((Material*)ptr->data);
+ Material *ma = give_node_material((Material*)ptr->data);
return rna_pointer_inherit_refine(ptr, &RNA_Material, ma);
}
static void rna_Material_active_node_material_set(PointerRNA *ptr, PointerRNA value)
{
- Material *ma= (Material*)ptr->data;
- Material *ma_act= value.data;
+ Material *ma = (Material*)ptr->data;
+ Material *ma_act = value.data;
nodeSetActiveID(ma->nodetree, ID_MA, &ma_act->id);
}
static void rna_MaterialStrand_start_size_range(PointerRNA *ptr, float *min, float *max)
{
- Material *ma= (Material*)ptr->id.data;
+ Material *ma = (Material*)ptr->id.data;
- if(ma->mode & MA_STR_B_UNITS) {
- *min= 0.0001f;
- *max= 2.0f;
+ if (ma->mode & MA_STR_B_UNITS) {
+ *min = 0.0001f;
+ *max = 2.0f;
}
else {
- *min= 0.25f;
- *max= 20.0f;
+ *min = 0.25f;
+ *max = 20.0f;
}
}
static void rna_MaterialStrand_end_size_range(PointerRNA *ptr, float *min, float *max)
{
- Material *ma= (Material*)ptr->id.data;
+ Material *ma = (Material*)ptr->id.data;
- if(ma->mode & MA_STR_B_UNITS) {
- *min= 0.0001f;
- *max= 1.0f;
+ if (ma->mode & MA_STR_B_UNITS) {
+ *min = 0.0001f;
+ *max = 1.0f;
}
else {
- *min= 0.25f;
- *max= 10.0f;
+ *min = 0.25f;
+ *max = 10.0f;
}
}
static int rna_MaterialTextureSlot_use_get(PointerRNA *ptr)
{
- Material *ma= (Material*)ptr->id.data;
- MTex *mtex= (MTex*)ptr->data;
+ Material *ma = (Material*)ptr->id.data;
+ MTex *mtex = (MTex*)ptr->data;
int a;
- for(a=0; a<MAX_MTEX; a++)
- if(ma->mtex[a] == mtex)
+ for (a = 0; a<MAX_MTEX; a++)
+ if (ma->mtex[a] == mtex)
return (ma->septex & (1<<a)) == 0;
return 0;
@@ -237,13 +237,13 @@ static int rna_MaterialTextureSlot_use_get(PointerRNA *ptr)
static void rna_MaterialTextureSlot_use_set(PointerRNA *ptr, int value)
{
- Material *ma= (Material*)ptr->id.data;
- MTex *mtex= (MTex*)ptr->data;
+ Material *ma = (Material*)ptr->id.data;
+ MTex *mtex = (MTex*)ptr->data;
int a;
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a] == mtex) {
- if(value)
+ for (a = 0; a<MAX_MTEX; a++) {
+ if (ma->mtex[a] == mtex) {
+ if (value)
ma->septex &= ~(1<<a);
else
ma->septex |= (1<<a);
@@ -253,31 +253,31 @@ static void rna_MaterialTextureSlot_use_set(PointerRNA *ptr, int value)
static void rna_Material_use_diffuse_ramp_set(PointerRNA *ptr, int value)
{
- Material *ma= (Material*)ptr->data;
+ Material *ma = (Material*)ptr->data;
- if(value) ma->mode |= MA_RAMP_COL;
+ if (value) ma->mode |= MA_RAMP_COL;
else ma->mode &= ~MA_RAMP_COL;
- if((ma->mode & MA_RAMP_COL) && ma->ramp_col == NULL)
- ma->ramp_col= add_colorband(0);
+ if ((ma->mode & MA_RAMP_COL) && ma->ramp_col == NULL)
+ ma->ramp_col = add_colorband(0);
}
static void rna_Material_use_specular_ramp_set(PointerRNA *ptr, int value)
{
- Material *ma= (Material*)ptr->data;
+ Material *ma = (Material*)ptr->data;
- if(value) ma->mode |= MA_RAMP_SPEC;
+ if (value) ma->mode |= MA_RAMP_SPEC;
else ma->mode &= ~MA_RAMP_SPEC;
- if((ma->mode & MA_RAMP_SPEC) && ma->ramp_spec == NULL)
- ma->ramp_spec= add_colorband(0);
+ if ((ma->mode & MA_RAMP_SPEC) && ma->ramp_spec == NULL)
+ ma->ramp_spec = add_colorband(0);
}
static void rna_Material_use_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Material *ma= (Material*)ptr->data;
+ Material *ma = (Material*)ptr->data;
- if(ma->use_nodes && ma->nodetree==NULL)
+ if (ma->use_nodes && ma->nodetree == NULL)
ED_node_shader_default(scene, &ma->id);
rna_Material_update(bmain, scene, ptr);
@@ -286,15 +286,15 @@ static void rna_Material_use_nodes_update(Main *bmain, Scene *scene, PointerRNA
static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *UNUSED(C), PointerRNA *ptr,
PropertyRNA *UNUSED(prop), int *free)
{
- Material *ma= (Material*)ptr->id.data;
- EnumPropertyItem *item= NULL;
- int totitem= 0;
+ Material *ma = (Material*)ptr->id.data;
+ EnumPropertyItem *item = NULL;
+ int totitem = 0;
RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_GLOB);
RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_OBJECT);
RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_ORCO);
- if(ma->material_type == MA_TYPE_VOLUME) {
+ if (ma->material_type == MA_TYPE_VOLUME) {
}
else if (ELEM3(ma->material_type, MA_TYPE_SURFACE, MA_TYPE_HALO, MA_TYPE_WIRE)) {
@@ -309,14 +309,14 @@ static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *UNUSED
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
MTex *rna_mtex_texture_slots_add(ID *self_id, struct bContext *C, ReportList *reports)
{
- MTex *mtex= add_mtex_id(self_id, -1);
+ MTex *mtex = add_mtex_id(self_id, -1);
if (mtex == NULL) {
BKE_reportf(reports, RPT_ERROR, "maximum number of textures added %d", MAX_MTEX);
return NULL;
@@ -332,12 +332,12 @@ MTex *rna_mtex_texture_slots_create(ID *self_id, struct bContext *C, ReportList
{
MTex *mtex;
- if(index < 0 || index >= MAX_MTEX) {
+ if (index < 0 || index >= MAX_MTEX) {
BKE_reportf(reports, RPT_ERROR, "index %d is invalid", index);
return NULL;
}
- mtex= add_mtex_id(self_id, index);
+ mtex = add_mtex_id(self_id, index);
/* for redraw only */
WM_event_add_notifier(C, NC_TEXTURE, CTX_data_scene(C));
@@ -357,15 +357,15 @@ void rna_mtex_texture_slots_clear(ID *self_id, struct bContext *C, ReportList *r
return;
}
- if(index < 0 || index >= MAX_MTEX) {
+ if (index < 0 || index >= MAX_MTEX) {
BKE_reportf(reports, RPT_ERROR, "index %d is invalid", index);
return;
}
- if(mtex_ar[index]) {
+ if (mtex_ar[index]) {
id_us_min((ID *)mtex_ar[index]->tex);
MEM_freeN(mtex_ar[index]);
- mtex_ar[index]= NULL;
+ mtex_ar[index] = NULL;
}
/* for redraw only */
@@ -429,299 +429,299 @@ static void rna_def_material_mtex(BlenderRNA *brna)
{MTEX_BUMP_TEXTURESPACE, "BUMP_TEXTURESPACE", 0, "TextureSpace", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MaterialTextureSlot", "TextureSlot");
+ srna = RNA_def_struct(brna, "MaterialTextureSlot", "TextureSlot");
RNA_def_struct_sdna(srna, "MTex");
RNA_def_struct_ui_text(srna, "Material Texture Slot", "Texture slot for textures in a Material datablock");
- prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texco");
RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Material_texture_coordinates_itemf");
RNA_def_property_ui_text(prop, "Texture Coordinates", "");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvname");
RNA_def_property_ui_text(prop, "UV Map", "UV map to use for mapping with UV texture coordinates");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_from_dupli", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_from_dupli", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_DUPLI_MAPTO);
RNA_def_property_ui_text(prop, "From Dupli",
"Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_from_original", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_from_original", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_OB_DUPLI_ORIG);
RNA_def_property_ui_text(prop, "From Original",
"Dupli's derive their object coordinates from the original object's transformation");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_color_diffuse", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_color_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COL);
RNA_def_property_ui_text(prop, "Diffuse Color", "The texture affects basic color of the material");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_normal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_NORM);
RNA_def_property_ui_text(prop, "Normal", "The texture affects the rendered normal");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_color_spec", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_color_spec", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COLSPEC);
RNA_def_property_ui_text(prop, "Specular Color", "The texture affects the specularity color");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_mirror", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_mirror", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COLMIR);
RNA_def_property_ui_text(prop, "Mirror", "The texture affects the mirror color");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_diffuse", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REF);
RNA_def_property_ui_text(prop, "Diffuse", "The texture affects the value of diffuse reflectivity");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_specular", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SPEC);
RNA_def_property_ui_text(prop, "Specular", "The texture affects the value of specular reflectivity");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_ambient", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_ambient", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_AMB);
RNA_def_property_ui_text(prop, "Ambient", "The texture affects the value of ambient");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_hardness", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_hardness", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_HAR);
RNA_def_property_ui_text(prop, "Hardness", "The texture affects the hardness value");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_raymir", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_raymir", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_RAYMIRR);
RNA_def_property_ui_text(prop, "Ray-Mirror", "The texture affects the ray-mirror value");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_alpha", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ALPHA);
RNA_def_property_ui_text(prop, "Alpha", "The texture affects the alpha value");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_emit", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_emit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMIT);
RNA_def_property_ui_text(prop, "Emit", "The texture affects the emit value");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_translucency", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_translucency", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_TRANSLU);
RNA_def_property_ui_text(prop, "Translucency", "The texture affects the translucency value");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_displacement", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_displacement", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DISPLACE);
RNA_def_property_ui_text(prop, "Displacement", "Let the texture displace the surface");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_warp", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_warp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_WARP);
RNA_def_property_ui_text(prop, "Warp", "Let the texture warp texture coordinates of next channels");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "mapping_x", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping_x", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projx");
RNA_def_property_enum_items(prop, prop_x_mapping_items);
RNA_def_property_ui_text(prop, "X Mapping", "");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projy");
RNA_def_property_enum_items(prop, prop_y_mapping_items);
RNA_def_property_ui_text(prop, "Y Mapping", "");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projz");
RNA_def_property_enum_items(prop, prop_z_mapping_items);
RNA_def_property_ui_text(prop, "Z Mapping", "");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_mapping_items);
RNA_def_property_ui_text(prop, "Mapping", "");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "normal_map_space", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "normal_map_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "normapspace");
RNA_def_property_enum_items(prop, prop_normal_map_space_items);
RNA_def_property_ui_text(prop, "Normal Map Space", "Set space of normal map image");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "norfac");
RNA_def_property_ui_range(prop, -5, 5, 10, 3);
RNA_def_property_ui_text(prop, "Normal Factor", "Amount texture affects normal values");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "displacement_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "displacement_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dispfac");
RNA_def_property_ui_range(prop, -1, 1, 10, 3);
RNA_def_property_ui_text(prop, "Displacement Factor", "Amount texture displaces the surface");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "warp_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "warp_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "warpfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Warp Factor", "Amount texture affects texture coordinates of next channels");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "specular_color_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "specular_color_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colspecfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Specular Color Factor", "Amount texture affects specular color");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_color_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "diffuse_color_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Diffuse Color Factor", "Amount texture affects diffuse color");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "mirror_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "mirror_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mirrfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Mirror Factor", "Amount texture affects mirror color");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "alpha_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "alpha_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alphafac");
RNA_def_property_ui_range(prop, -1, 1, 10, 3);
RNA_def_property_ui_text(prop, "Alpha Factor", "Amount texture affects alpha");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "diffuse_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "difffac");
RNA_def_property_ui_range(prop, -1, 1, 10, 3);
RNA_def_property_ui_text(prop, "Diffuse Factor", "Amount texture affects diffuse reflectivity");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "specular_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "specular_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "specfac");
RNA_def_property_ui_range(prop, -1, 1, 10, 3);
RNA_def_property_ui_text(prop, "Specular Factor", "Amount texture affects specular reflectivity");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "emit_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "emit_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "emitfac");
RNA_def_property_ui_range(prop, -1, 1, 10, 3);
RNA_def_property_ui_text(prop, "Emit Factor", "Amount texture affects emission");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "hardness_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "hardness_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "hardfac");
RNA_def_property_ui_range(prop, -1, 1, 10, 3);
RNA_def_property_ui_text(prop, "Hardness Factor", "Amount texture affects hardness");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "raymir_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "raymir_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "raymirrfac");
RNA_def_property_ui_range(prop, -1, 1, 10, 3);
RNA_def_property_ui_text(prop, "Ray Mirror Factor", "Amount texture affects ray mirror");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "translucency_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "translucency_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "translfac");
RNA_def_property_ui_range(prop, -1, 1, 10, 3);
RNA_def_property_ui_text(prop, "Translucency Factor", "Amount texture affects translucency");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "ambient_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ambient_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ambfac");
RNA_def_property_ui_range(prop, -1, 1, 10, 3);
RNA_def_property_ui_text(prop, "Ambient Factor", "Amount texture affects ambient");
RNA_def_property_update(prop, 0, "rna_Material_update");
/* volume material */
- prop= RNA_def_property(srna, "use_map_color_emission", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_color_emission", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION_COL);
RNA_def_property_ui_text(prop, "Emission Color", "The texture affects the color of emission");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_color_reflection", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_color_reflection", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REFLECTION_COL);
RNA_def_property_ui_text(prop, "Reflection Color", "The texture affects the color of scattered light");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_color_transmission", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_color_transmission", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_TRANSMISSION_COL);
RNA_def_property_ui_text(prop, "Transmission Color",
"The texture affects the result color after other light has been scattered/absorbed");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "use_map_density", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_density", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DENSITY);
RNA_def_property_ui_text(prop, "Density", "The texture affects the volume's density");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_emission", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_emission", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION);
RNA_def_property_ui_text(prop, "Emission", "The texture affects the volume's emission");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_scatter", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_scatter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SCATTERING);
RNA_def_property_ui_text(prop, "Scattering", "The texture affects the volume's scattering");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_map_reflect", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_reflect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REFLECTION);
RNA_def_property_ui_text(prop, "Reflection", "The texture affects the reflected light's brightness");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "emission_color_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "emission_color_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colemitfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Emission Color Factor", "Amount texture affects emission color");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "reflection_color_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "reflection_color_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colreflfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Reflection Color Factor", "Amount texture affects color of out-scattered light");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "transmission_color_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "transmission_color_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "coltransfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Transmission Color Factor",
"Amount texture affects result color after light has been scattered/absorbed");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "density_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "density_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "densfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Density Factor", "Amount texture affects density");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "emission_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "emission_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "emitfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Emission Factor", "Amount texture affects emission");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "scattering_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "scattering_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scatterfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Scattering Factor", "Amount texture affects scattering");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "reflection_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "reflection_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "reflfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Reflection Factor", "Amount texture affects brightness of out-scattered light");
@@ -729,18 +729,18 @@ static void rna_def_material_mtex(BlenderRNA *brna)
/* end volume material */
- prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_MaterialTextureSlot_use_get", "rna_MaterialTextureSlot_use_set");
RNA_def_property_ui_text(prop, "Enabled", "Enable this material texture slot");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "bump_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "bump_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "texflag");
RNA_def_property_enum_items(prop, prop_bump_method_items);
RNA_def_property_ui_text(prop, "Bump Method", "Method to use for bump mapping");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "bump_objectspace", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "bump_objectspace", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "texflag");
RNA_def_property_enum_items(prop, prop_bump_space_items);
RNA_def_property_ui_text(prop, "Bump Space", "Space to apply bump mapping in");
@@ -767,37 +767,37 @@ static void rna_def_material_gamesettings(BlenderRNA *brna)
{GEMAT_SHADOW, "SHADOW", 0, "Shadow", "Faces are used for shadow"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MaterialGameSettings", NULL);
+ srna = RNA_def_struct(brna, "MaterialGameSettings", NULL);
RNA_def_struct_sdna(srna, "GameSettings");
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Game Settings", "Game Engine settings for a Material datablock");
- prop= RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GEMAT_BACKCULL); /* use bitflags */
RNA_def_property_ui_text(prop, "Backface Culling", "Hide Back of the face in Game Engine ");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "text", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "text", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GEMAT_TEXT); /* use bitflags */
RNA_def_property_ui_text(prop, "Text", "Use material as text in Game Engine ");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "invisible", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invisible", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GEMAT_INVISIBLE); /* use bitflags */
RNA_def_property_ui_text(prop, "Invisible", "Make face invisible");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "alpha_blend", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "alpha_blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "alpha_blend");
RNA_def_property_enum_items(prop, prop_alpha_blend_items);
RNA_def_property_ui_text(prop, "Blend Mode", "Blend Mode for Transparent Faces");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "face_orientation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "face_orientation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_face_orientation_items);
RNA_def_property_ui_text(prop, "Face Orientations", "Especial face orientation options");
- prop= RNA_def_property(srna, "physics", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "physics", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GEMAT_NOPHYSICS); /* use bitflags */
RNA_def_property_ui_text(prop, "Physics", "Use physics properties of materials ");
}
@@ -813,91 +813,91 @@ static void rna_def_material_colors(StructRNA *srna)
{MA_RAMP_IN_RESULT, "RESULT", 0, "Result", ""},
{0, NULL, 0, NULL, NULL}};
- prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Diffuse Color", "Diffuse color of the material");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "specr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Specular Color", "Specular color of the material");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "mirror_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "mirror_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "mirr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Mirror Color", "Mirror color of the material");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Alpha", "Alpha transparency of the material");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "specular_alpha", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "specular_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "spectra");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Specular Alpha", "Alpha transparency for specular areas");
RNA_def_property_update(prop, 0, "rna_Material_update");
/* Color bands */
- prop= RNA_def_property(srna, "use_diffuse_ramp", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_diffuse_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAMP_COL);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Material_use_diffuse_ramp_set");
RNA_def_property_ui_text(prop, "Use Diffuse Ramp", "Toggle diffuse ramp operations");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_ramp", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "diffuse_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ramp_col");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Diffuse Ramp", "Color ramp used to affect diffuse shading");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_specular_ramp", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_specular_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAMP_SPEC);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Material_use_specular_ramp_set");
RNA_def_property_ui_text(prop, "Use Specular Ramp", "Toggle specular ramp operations");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "specular_ramp", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "specular_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ramp_spec");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Specular Ramp", "Color ramp used to affect specular shading");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_ramp_blend", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "diffuse_ramp_blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampblend_col");
RNA_def_property_enum_items(prop, ramp_blend_items);
RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "Blending method of the ramp and the diffuse color");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "specular_ramp_blend", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "specular_ramp_blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampblend_spec");
RNA_def_property_enum_items(prop, ramp_blend_items);
RNA_def_property_ui_text(prop, "Specular Ramp Blend", "Blending method of the ramp and the specular color");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_ramp_input", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "diffuse_ramp_input", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampin_col");
RNA_def_property_enum_items(prop, prop_ramp_input_items);
RNA_def_property_ui_text(prop, "Diffuse Ramp Input", "How the ramp maps on the surface");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "specular_ramp_input", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "specular_ramp_input", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampin_spec");
RNA_def_property_enum_items(prop, prop_ramp_input_items);
RNA_def_property_ui_text(prop, "Specular Ramp Input", "How the ramp maps on the surface");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_ramp_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "diffuse_ramp_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "rampfac_col");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Diffuse Ramp Factor", "Blending factor (also uses alpha in Colorband)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "specular_ramp_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "specular_ramp_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "rampfac_spec");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Specular Ramp Factor", "Blending factor (also uses alpha in Colorband)");
@@ -916,48 +916,48 @@ static void rna_def_material_diffuse(StructRNA *srna)
{MA_DIFF_FRESNEL, "FRESNEL", 0, "Fresnel", "Use a Fresnel shader"},
{0, NULL, 0, NULL, NULL}};
- prop= RNA_def_property(srna, "diffuse_shader", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "diffuse_shader", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "diff_shader");
RNA_def_property_enum_items(prop, prop_diff_shader_items);
RNA_def_property_ui_text(prop, "Diffuse Shader Model", "");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_intensity", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "diffuse_intensity", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "ref");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Diffuse Intensity", "Amount of diffuse reflection");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "roughness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "roughness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 3.14f);
RNA_def_property_ui_text(prop, "Roughness", "Oren-Nayar Roughness");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_toon_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "diffuse_toon_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[0]");
RNA_def_property_range(prop, 0.0f, 3.14f);
RNA_def_property_ui_text(prop, "Diffuse Toon Size", "Size of diffuse toon area");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_toon_smooth", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "diffuse_toon_smooth", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "param[1]");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Diffuse Toon Smooth", "Smoothness of diffuse toon area");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_fresnel", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "diffuse_fresnel", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[1]");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Diffuse Fresnel", "Power of Fresnel");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_fresnel_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "diffuse_fresnel_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[0]");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Diffuse Fresnel Factor", "Blending factor of Fresnel");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "darkness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "darkness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Darkness", "Minnaert darkness");
RNA_def_property_update(prop, 0, "rna_Material_update");
@@ -973,55 +973,55 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
{MA_RAYMIR_FADETOMAT, "FADE_TO_MATERIAL", 0, "Material", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MaterialRaytraceMirror", NULL);
+ srna = RNA_def_struct(brna, "MaterialRaytraceMirror", NULL);
RNA_def_struct_sdna(srna, "Material");
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Raytrace Mirror", "Raytraced reflection settings for a Material datablock");
- prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYMIRROR); /* use bitflags */
RNA_def_property_ui_text(prop, "Enabled", "Enable raytraced reflections");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "reflect_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "reflect_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "ray_mirror");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Reflectivity", "Amount of mirror reflection for raytrace");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fresnel_mir");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for mirror reflection");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "fresnel_mir_i");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "gloss_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Amount",
"The shininess of the reflection (values < 1.0 give diffuse, blurry reflections)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "aniso_gloss_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Anisotropy",
"The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samp_gloss_mir");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry reflections");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Threshold",
@@ -1029,13 +1029,13 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
"this amount [as a percentage], sampling is stopped)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "ray_depth");
RNA_def_property_ui_range(prop, 0, 100, 1, 3);
RNA_def_property_ui_text(prop, "Depth", "Maximum allowed number of light inter-reflections");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist_mir");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_ui_text(prop, "Maximum Distance",
@@ -1043,7 +1043,7 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
"range fade to sky color or material color)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "fade_to", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "fade_to", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "fadeto_mir");
RNA_def_property_enum_items(prop, prop_fadeto_mir_items);
RNA_def_property_ui_text(prop, "Fade-out Color",
@@ -1057,43 +1057,43 @@ static void rna_def_material_raytra(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MaterialRaytraceTransparency", NULL);
+ srna = RNA_def_struct(brna, "MaterialRaytraceTransparency", NULL);
RNA_def_struct_sdna(srna, "Material");
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Raytrace Transparency", "Raytraced refraction settings for a Material datablock");
- prop= RNA_def_property(srna, "ior", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ior", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ang");
RNA_def_property_range(prop, 0.25f, 4.0f);
RNA_def_property_ui_text(prop, "IOR", "Angular index of refraction for raytraced refraction");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fresnel_tra");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for transparency (Ray or ZTransp)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "fresnel_tra_i");
RNA_def_property_range(prop, 1.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "gloss_tra");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Amount",
"The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samp_gloss_tra");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry refractions");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_tra");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Threshold",
@@ -1101,13 +1101,13 @@ static void rna_def_material_raytra(BlenderRNA *brna)
"this amount (as a percentage), sampling is stopped");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "ray_depth_tra");
RNA_def_property_ui_range(prop, 0, 100, 1, 3);
RNA_def_property_ui_text(prop, "Depth", "Maximum allowed number of light inter-refractions");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "filter", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "filter", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "filter");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Filter",
@@ -1115,7 +1115,7 @@ static void rna_def_material_raytra(BlenderRNA *brna)
"transparency (simulating absorption)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "depth_max", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "depth_max", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "tx_limit");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Limit",
@@ -1123,7 +1123,7 @@ static void rna_def_material_raytra(BlenderRNA *brna)
"before becoming fully filtered (0.0 is disabled)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "tx_falloff");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Falloff", "Falloff power for transmissivity filter effect (1.0 is linear)");
@@ -1146,72 +1146,72 @@ static void rna_def_material_volume(BlenderRNA *brna)
static EnumPropertyItem prop_stepsize_items[] = {
{MA_VOL_STEP_RANDOMIZED, "RANDOMIZED", 0, "Randomized", ""},
{MA_VOL_STEP_CONSTANT, "CONSTANT", 0, "Constant", ""},
- //{MA_VOL_STEP_ADAPTIVE, "ADAPTIVE", 0, "Adaptive", ""},
+ /*{MA_VOL_STEP_ADAPTIVE, "ADAPTIVE", 0, "Adaptive", ""}, */
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MaterialVolume", NULL);
+ srna = RNA_def_struct(brna, "MaterialVolume", NULL);
RNA_def_struct_sdna(srna, "VolumeSettings");
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Volume", "Volume rendering settings for a Material datablock");
- prop= RNA_def_property(srna, "step_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "step_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stepsize_type");
RNA_def_property_enum_items(prop, prop_stepsize_items);
RNA_def_property_ui_text(prop, "Step Calculation", "Method of calculating the steps through the volume");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "step_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "step_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stepsize");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001f, 1.0f, 1, 3);
RNA_def_property_ui_text(prop, "Step Size", "Distance between subsequent volume depth samples");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "light_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "light_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "shade_type");
RNA_def_property_enum_items(prop, prop_lighting_items);
RNA_def_property_ui_text(prop, "Lighting Mode", "Method of shading, attenuating, and scattering light through the volume");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_external_shadows", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_external_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_RECV_EXT_SHADOW); /* use bitflags */
RNA_def_property_ui_text(prop, "External Shadows", "Receive shadows from sources outside the volume (temporary)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_light_cache", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_light_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_PRECACHESHADING); /* use bitflags */
RNA_def_property_ui_text(prop, "Light Cache",
"Pre-calculate the shading information into a voxel grid, "
"speeds up shading at slightly less accuracy");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "cache_resolution", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "cache_resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "precache_resolution");
RNA_def_property_range(prop, 1, 1024);
RNA_def_property_ui_text(prop, "Resolution",
"Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "ms_diffusion", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ms_diffusion", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ms_diff");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Diffusion", "Diffusion factor, the strength of the blurring effect");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "ms_spread", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ms_spread", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ms_spread");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
RNA_def_property_ui_text(prop, "Spread", "Proportional distance over which the light is diffused");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "ms_intensity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ms_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ms_intensity");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Intensity", "Multiplier for multiple scattered light energy");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "depth_threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "depth_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "depth_cutoff");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Depth Cutoff",
@@ -1219,20 +1219,20 @@ static void rna_def_material_volume(BlenderRNA *brna)
"higher values give speedups in dense volumes at the expense of accuracy");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "density");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Density", "The base density of the volume");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "density_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "density_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "density_scale");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_ui_text(prop, "Density Scale", "Multiplier for the material's density");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "scattering", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "scattering", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scattering");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1 ,3);
@@ -1241,21 +1241,21 @@ static void rna_def_material_volume(BlenderRNA *brna)
"the more out-scattering, the shallower the light will penetrate");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "transmission_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "transmission_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "transmission_col");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Transmission Color",
"Result color of the volume, after other light has been scattered/absorbed");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "reflection_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "reflection_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "reflection_col");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Reflection Color",
"Color of light scattered out of the volume (does not affect transmission)");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "reflection", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "reflection", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "reflection");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1 ,3);
@@ -1263,20 +1263,20 @@ static void rna_def_material_volume(BlenderRNA *brna)
"Multiplier to make out-scattered light brighter or darker (non-physically correct)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "emission_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "emission_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "emission_col");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Emission Color", "Color of emitted light");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "emission", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "emission", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "emission");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_ui_text(prop, "Emission", "Amount of light that gets emitted by the volume");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "asymmetry", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "asymmetry", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "asymmetry");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Asymmetry", "Back scattering (-1.0) to Forward scattering (1.0) and the range in between");
@@ -1289,124 +1289,124 @@ static void rna_def_material_halo(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MaterialHalo", NULL);
+ srna = RNA_def_struct(brna, "MaterialHalo", NULL);
RNA_def_struct_sdna(srna, "Material");
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Halo", "Halo particle effect settings for a Material datablock");
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "hasize");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Size", "Dimension of the halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "hardness", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "hardness", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "har");
RNA_def_property_range(prop, 0, 127);
RNA_def_property_ui_text(prop, "Hardness", "Hardness of the halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "add", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "add", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "add");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Add", "Strength of the add effect");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "ring_count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "ring_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ringc");
RNA_def_property_range(prop, 0, 24);
RNA_def_property_ui_text(prop, "Rings", "Number of rings rendered over the halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "line_count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "line_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "linec");
RNA_def_property_range(prop, 0, 250);
RNA_def_property_ui_text(prop, "Line Number", "Number of star shaped lines rendered over the halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "star_tip_count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "star_tip_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "starc");
RNA_def_property_range(prop, 3, 50);
RNA_def_property_ui_text(prop, "Star Tips", "Number of points on the star shaped halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "seed1");
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Seed", "Randomize ring dimension and line location");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_flare_mode", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_flare_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_FLARE); /* use bitflags */
RNA_def_property_ui_text(prop, "Flare", "Render halo as a lens flare");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "flare_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "flare_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "flaresize");
RNA_def_property_range(prop, 0.1f, 25.0f);
RNA_def_property_ui_text(prop, "Flare Size", "Factor by which the flare is larger than the halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "flare_subflare_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "flare_subflare_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "subsize");
RNA_def_property_range(prop, 0.1f, 25.0f);
RNA_def_property_ui_text(prop, "Flare Subsize", "Dimension of the sub-flares, dots and circles");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "flare_boost", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "flare_boost", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "flareboost");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Flare Boost", "Give the flare extra strength");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "flare_seed", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "flare_seed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "seed2");
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Flare Seed", "Offset in the flare seed table");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "flare_subflare_count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "flare_subflare_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "flarec");
RNA_def_property_range(prop, 1, 32);
RNA_def_property_ui_text(prop, "Flares Sub", "Number of sub-flares");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_ring", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_ring", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_RINGS);
RNA_def_property_ui_text(prop, "Rings", "Render rings over halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_lines", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_lines", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_LINES);
RNA_def_property_ui_text(prop, "Lines", "Render star shaped lines over halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_star", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_star", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STAR);
RNA_def_property_ui_text(prop, "Star", "Render halo as a star");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_texture", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOTEX);
RNA_def_property_ui_text(prop, "Texture", "Give halo a texture");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_vertex_normal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_vertex_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOPUNO);
RNA_def_property_ui_text(prop, "Vertex Normal", "Use the vertex normal to specify the dimension of the halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_extreme_alpha", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_extreme_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_XALPHA);
RNA_def_property_ui_text(prop, "Extreme Alpha", "Use extreme alpha");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_shaded", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_shaded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_SHADE);
RNA_def_property_ui_text(prop, "Shaded", "Let halo receive light and shadows from external objects");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_soft", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_soft", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_SOFT);
RNA_def_property_ui_text(prop, "Soft", "Soften the edges of halos at intersections with other geometry");
RNA_def_property_update(prop, 0, "rna_Material_update");
@@ -1417,67 +1417,67 @@ static void rna_def_material_sss(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MaterialSubsurfaceScattering", NULL);
+ srna = RNA_def_struct(brna, "MaterialSubsurfaceScattering", NULL);
RNA_def_struct_sdna(srna, "Material");
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Subsurface Scattering",
"Diffuse subsurface scattering settings for a Material datablock");
- prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_COLOR|PROP_UNIT_LENGTH);
+ prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_COLOR|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "sss_radius");
RNA_def_property_range(prop, 0.001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001, 10000, 1, 3);
RNA_def_property_ui_text(prop, "Radius", "Mean red/green/blue scattering path length");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "sss_col");
RNA_def_property_ui_text(prop, "Color", "Scattering color");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "error_threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "error_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_error");
RNA_def_property_ui_range(prop, 0.0001, 10, 1, 3);
RNA_def_property_ui_text(prop, "Error Tolerance", "Error tolerance (low values are slower and higher quality)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_scale");
RNA_def_property_ui_range(prop, 0.001, 1000, 1, 3);
RNA_def_property_ui_text(prop, "Scale", "Object scale factor");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "ior", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ior", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_ior");
RNA_def_property_ui_range(prop, 0.1, 2, 1, 3);
RNA_def_property_ui_text(prop, "IOR", "Index of refraction (higher values are denser)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "sss_colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Color Factor", "Blend factor for SSS colors");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "texture_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "texture_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "sss_texfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Texture Factor", "Texture scattering blend factor");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "front", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "front", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_front");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Front", "Front scattering weight");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_back");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Back", "Back scattering weight");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sss_flag", MA_DIFF_SSS);
RNA_def_property_ui_text(prop, "Enabled", "Enable diffuse subsurface scatting effects in a material");
RNA_def_property_update(prop, 0, "rna_Material_update");
@@ -1495,13 +1495,13 @@ static void rna_def_material_specularity(StructRNA *srna)
{MA_SPEC_WARDISO, "WARDISO", 0, "WardIso", "Use a Ward anisotropic shader"},
{0, NULL, 0, NULL, NULL}};
- prop= RNA_def_property(srna, "specular_shader", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "specular_shader", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "spec_shader");
RNA_def_property_enum_items(prop, prop_specular_shader_items);
RNA_def_property_ui_text(prop, "Specular Shader Model", "");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "spec");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Specular Intensity", "How intense (bright) the specular reflection is");
@@ -1512,31 +1512,31 @@ static void rna_def_material_specularity(StructRNA *srna)
* multiple times, which may give somewhat strange changes in the outliner,
* but in the UI they are never visible at the same time. */
- prop= RNA_def_property(srna, "specular_hardness", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "specular_hardness", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "har");
RNA_def_property_range(prop, 1, 511);
RNA_def_property_ui_text(prop, "Specular Hardness", "How hard (sharp) the specular reflection is");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "specular_ior", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "specular_ior", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "refrac");
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Specular IOR", "Specular index of refraction");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "specular_toon_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "specular_toon_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[2]");
RNA_def_property_range(prop, 0.0f, 1.53f);
RNA_def_property_ui_text(prop, "Specular Toon Size", "Size of specular toon area");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "specular_toon_smooth", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "specular_toon_smooth", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "param[3]");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Specular Toon Smooth", "Smoothness of specular toon area");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "specular_slope", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "specular_slope", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "rms");
RNA_def_property_range(prop, 0, 0.4);
RNA_def_property_ui_text(prop, "Specular Slope", "The standard deviation of surface slope");
@@ -1548,67 +1548,67 @@ static void rna_def_material_strand(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MaterialStrand", NULL);
+ srna = RNA_def_struct(brna, "MaterialStrand", NULL);
RNA_def_struct_sdna(srna, "Material");
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Strand", "Strand settings for a Material datablock");
- prop= RNA_def_property(srna, "use_tangent_shading", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_tangent_shading", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_STR);
RNA_def_property_ui_text(prop, "Tangent Shading", "Use direction of strands as normal for tangent-shading");
RNA_def_property_update(prop, 0, "rna_Material_update");
/* this flag is only set when rendering, not to be edited manually */
- prop= RNA_def_property(srna, "use_surface_diffuse", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_surface_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STR_SURFDIFF);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Surface Diffuse", "Make diffuse shading more similar to shading the surface");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "blend_distance", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "blend_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "strand_surfnor");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Blend Distance", "Worldspace distance over which to blend in the surface normal");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_blender_units", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_blender_units", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STR_B_UNITS);
RNA_def_property_ui_text(prop, "Blender Units", "Use Blender units for widths instead of pixels");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "root_size", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "root_size", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "strand_sta");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_start_size_range");
RNA_def_property_ui_range(prop, 0, 10.0f, 10, 5);
RNA_def_property_ui_text(prop, "Root Size", "Start size of strands in pixels or Blender units");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "tip_size", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "tip_size", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "strand_end");
RNA_def_property_ui_range(prop, 0, 10.0f, 10, 5);
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_end_size_range");
RNA_def_property_ui_text(prop, "Tip Size", "End size of strands in pixels or Blender units");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "size_min", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "size_min", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "strand_min");
RNA_def_property_range(prop, 0.001, 10);
RNA_def_property_ui_text(prop, "Minimum Size", "Minimum size of strands in pixels");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "shape", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shape", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strand_ease");
RNA_def_property_range(prop, -0.9, 0.9);
RNA_def_property_ui_text(prop, "Shape", "Positive values make strands rounder, negative ones make strands spiky");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "width_fade", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "width_fade", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strand_widthfade");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Width Fade", "Transparency along the width of the strand");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "strand_uvname");
RNA_def_property_ui_text(prop, "UV Map", "Name of UV map to override");
RNA_def_property_update(prop, 0, "rna_Material_update");
@@ -1619,39 +1619,39 @@ static void rna_def_material_physics(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MaterialPhysics", NULL);
+ srna = RNA_def_struct(brna, "MaterialPhysics", NULL);
RNA_def_struct_sdna(srna, "Material");
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Physics", "Physics settings for a Material datablock");
- prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "friction");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Friction", "Coulomb friction coefficient, when inside the physics distance area");
- prop= RNA_def_property(srna, "elasticity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "elasticity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "reflect");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Elasticity", "Elasticity of collisions");
/* FH/Force Field Settings */
- prop= RNA_def_property(srna, "use_fh_normal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_fh_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dynamode", MA_FH_NOR);
RNA_def_property_ui_text(prop, "Align to Normal",
"Align dynamic game objects along the surface normal, when inside the physics distance area");
- prop= RNA_def_property(srna, "fh_force", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "fh_force", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fh");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 2);
RNA_def_property_ui_text(prop, "Force", "Upward spring force, when inside the physics distance area");
- prop= RNA_def_property(srna, "fh_distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "fh_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fhdist");
RNA_def_property_range(prop, 0, 20);
RNA_def_property_ui_text(prop, "Distance", "Distance of the physics area");
- prop= RNA_def_property(srna, "fh_damping", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "fh_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xyfrict");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Damping", "Damping of the spring force, when inside the physics distance area");
@@ -1691,213 +1691,213 @@ void RNA_def_material(BlenderRNA *brna)
"Improved shadow only method which also renders lightless areas as shadows"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Material", "ID");
+ srna = RNA_def_struct(brna, "Material", "ID");
RNA_def_struct_ui_text(srna, "Material",
"Material datablock to define the appearance of geometric objects for rendering");
RNA_def_struct_ui_icon(srna, ICON_MATERIAL_DATA);
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "material_type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Material type defining how the object is rendered");
RNA_def_property_enum_funcs(prop, NULL, "rna_Material_type_set", NULL);
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "use_transparency", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_transparency", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRANSP);
RNA_def_property_ui_text(prop, "Transparency", "Render material as transparent");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "transparency_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "transparency_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, transparency_items);
RNA_def_property_ui_text(prop, "Transparency Method", "Method to use for rendering transparency");
RNA_def_property_update(prop, 0, "rna_Material_update");
/* For Preview Render */
- prop= RNA_def_property(srna, "preview_render_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "preview_render_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "pr_type");
RNA_def_property_enum_items(prop, preview_type_items);
RNA_def_property_ui_text(prop, "Preview render type", "Type of preview render");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "amb");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Ambient", "Amount of global ambient color the material receives");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "emit", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "emit", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 2.0f, 1, 2);
RNA_def_property_ui_text(prop, "Emit", "Amount of light to emit");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "translucency", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "translucency", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Translucency", "Amount of diffuse shading on the back side");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_cubic", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_cubic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_CUBIC);
RNA_def_property_ui_text(prop, "Cubic Interpolation",
"Use cubic interpolation for diffuse values, for smoother transitions");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_object_color", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_object_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_OBCOLOR);
RNA_def_property_ui_text(prop, "Object Color", "Modulate the result with a per-object color");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "shadow_ray_bias", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_ray_bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sbias");
RNA_def_property_range(prop, 0, 0.25);
RNA_def_property_ui_text(prop, "Shadow Ray Bias",
"Shadow raytracing bias to prevent terminator problems on shadow boundary");
- prop= RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "lbias");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Factor to multiply shadow buffer bias with (0 is ignore)");
- prop= RNA_def_property(srna, "shadow_cast_alpha", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "shadow_cast_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "shad_alpha");
RNA_def_property_range(prop, 0.001, 1);
RNA_def_property_ui_text(prop, "Shadow Casting Alpha",
"Shadow casting alpha, in use for Irregular and Deep shadow buffer");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "light_group", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "light_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "group");
RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Light Group", "Limit lighting to lamps in this Group");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "index");
RNA_def_property_ui_text(prop, "Pass Index", "Index number for the IndexMA render pass");
RNA_def_property_update(prop, NC_OBJECT, NULL);
/* flags */
- prop= RNA_def_property(srna, "use_light_group_exclusive", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_light_group_exclusive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_GROUP_NOLAY);
RNA_def_property_ui_text(prop, "Light Group Exclusive",
"Material uses the light group exclusively - these lamps are excluded from other scene lighting");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRACEBLE);
RNA_def_property_ui_text(prop, "Traceable",
"Include this material and geometry that uses it in raytracing calculations");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW);
RNA_def_property_ui_text(prop, "Shadows", "Allow this material to receive shadows");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_shadeless", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_shadeless", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHLESS);
RNA_def_property_ui_text(prop, "Shadeless", "Make this material insensitive to light or shadow");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "use_vertex_color_light", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_vertex_color_light", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOL);
RNA_def_property_ui_text(prop, "Vertex Color Light", "Add vertex colors as additional lighting");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_vertex_color_paint", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_vertex_color_paint", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOLP);
RNA_def_property_ui_text(prop, "Vertex Color Paint",
"Replace object base color with vertex colors (multiply with "
"'texture face' face assigned textures)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ZINV);
RNA_def_property_ui_text(prop, "Invert Z Depth", "Render material's faces with an inverted Z buffer (scanline only)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "offset_z", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "offset_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zoffs");
RNA_def_property_ui_text(prop, "Z Offset", "Give faces an artificial offset in the Z buffer for Z transparency");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ENV);
RNA_def_property_ui_text(prop, "Sky",
"Render this material with zero alpha, with sky background in place (scanline only)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_only_shadow", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_only_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYSHADOW);
RNA_def_property_ui_text(prop, "Only Shadow",
"Render shadows as the material's alpha value, making the material "
"transparent except for shadowed areas");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "shadow_only_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_only_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "shadowonly_flag");
RNA_def_property_enum_items(prop, prop_shadows_only_items);
RNA_def_property_ui_text(prop, "Shadow Type", "How to draw shadows");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_face_texture", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_face_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE);
RNA_def_property_ui_text(prop, "Face Textures",
"Replace the object's base color with color from UV map image textures");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_face_texture_alpha", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_face_texture_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE_ALPHA);
RNA_def_property_ui_text(prop, "Face Textures Alpha",
"Replace the object's base alpha value with alpha from UV map image textures");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_cast_shadows_only", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_cast_shadows_only", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYCAST);
RNA_def_property_ui_text(prop, "Cast Shadows Only",
"Make objects with this material appear invisible (not rendered), only casting shadows");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_mist", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mist", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", MA_NOMIST);
RNA_def_property_ui_text(prop, "Use Mist", "Use mist with this material (in world settings)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_transparent_shadows", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_transparent_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW_TRA);
RNA_def_property_ui_text(prop, "Receive Transparent Shadows",
"Allow this object to receive transparent shadows cast through other objects");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_ray_shadow_bias", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_ray_shadow_bias", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYBIAS);
RNA_def_property_ui_text(prop, "Ray Shadow Bias",
"Prevent raytraced shadow errors on surfaces with smooth shaded normals (terminator problem)");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_full_oversampling", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_full_oversampling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FULL_OSA);
RNA_def_property_ui_text(prop, "Full Oversampling",
"Force this material to render full shading/textures for all anti-aliasing samples");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_cast_buffer_shadows", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_cast_buffer_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADBUF);
RNA_def_property_ui_text(prop, "Cast Buffer Shadows",
"Allow this material to cast shadows from shadow buffer lamps");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_cast_approximate", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_cast_approximate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_APPROX_OCCLUSION);
RNA_def_property_ui_text(prop, "Cast Approximate",
"Allow this material to cast shadows when using approximate ambient occlusion");
RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "use_tangent_shading", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_tangent_shading", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_V);
RNA_def_property_ui_text(prop, "Tangent Shading",
"Use the material's tangent vector instead of the normal for shading "
@@ -1905,67 +1905,67 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Material_update");
/* nested structs */
- prop= RNA_def_property(srna, "raytrace_mirror", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "raytrace_mirror", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialRaytraceMirror");
RNA_def_property_pointer_funcs(prop, "rna_Material_mirror_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Raytrace Mirror", "Raytraced reflection settings for the material");
- prop= RNA_def_property(srna, "raytrace_transparency", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "raytrace_transparency", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialRaytraceTransparency");
RNA_def_property_pointer_funcs(prop, "rna_Material_transp_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Raytrace Transparency", "Raytraced transparency settings for the material");
- prop= RNA_def_property(srna, "volume", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "volume", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "vol");
RNA_def_property_struct_type(prop, "MaterialVolume");
RNA_def_property_ui_text(prop, "Volume", "Volume settings for the material");
- prop= RNA_def_property(srna, "halo", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "halo", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialHalo");
RNA_def_property_pointer_funcs(prop, "rna_Material_halo_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Halo", "Halo settings for the material");
- prop= RNA_def_property(srna, "subsurface_scattering", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "subsurface_scattering", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialSubsurfaceScattering");
RNA_def_property_pointer_funcs(prop, "rna_Material_sss_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Subsurface Scattering", "Subsurface scattering settings for the material");
- prop= RNA_def_property(srna, "strand", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "strand", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialStrand");
RNA_def_property_pointer_funcs(prop, "rna_Material_strand_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Strand", "Strand settings for the material");
- prop= RNA_def_property(srna, "physics", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "physics", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialPhysics");
RNA_def_property_pointer_funcs(prop, "rna_Material_physics_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Physics", "Game physics settings");
/* game settings */
- prop= RNA_def_property(srna, "game_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "game_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "game");
RNA_def_property_struct_type(prop, "MaterialGameSettings");
RNA_def_property_ui_text(prop, "Game Settings", "Game material settings");
/* nodetree */
- prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based materials");
- prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the material");
RNA_def_property_update(prop, 0, "rna_Material_use_nodes_update");
- prop= RNA_def_property(srna, "active_node_material", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active_node_material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, "rna_Material_active_node_material_get",
@@ -1980,7 +1980,7 @@ void RNA_def_material(BlenderRNA *brna)
"MaterialTextureSlot", "MaterialTextureSlots", "rna_Material_update");
/* only material has this one */
- prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "septex", 1);
RNA_def_property_array(prop, 18);
RNA_def_property_ui_text(prop, "Use Textures", "Enable/Disable each texture");
@@ -2013,26 +2013,26 @@ static void rna_def_texture_slots(BlenderRNA *brna, PropertyRNA *cprop, const ch
PropertyRNA *parm;
RNA_def_property_srna(cprop, structname_slots);
- srna= RNA_def_struct(brna, structname_slots, NULL);
+ srna = RNA_def_struct(brna, structname_slots, NULL);
RNA_def_struct_sdna(srna, "ID");
RNA_def_struct_ui_text(srna, "Texture Slots", "Collection of texture slots");
/* functions */
- func= RNA_def_function(srna, "add", "rna_mtex_texture_slots_add");
+ func = RNA_def_function(srna, "add", "rna_mtex_texture_slots_add");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex");
+ parm = RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "create", "rna_mtex_texture_slots_create");
+ func = RNA_def_function(srna, "create", "rna_mtex_texture_slots_create");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to initialize", 0, INT_MAX);
+ parm = RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to initialize", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex");
+ parm = RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "clear", "rna_mtex_texture_slots_clear");
+ func = RNA_def_function(srna, "clear", "rna_mtex_texture_slots_clear");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to clear", 0, INT_MAX);
+ parm = RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to clear", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -2043,22 +2043,22 @@ void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin,
PropertyRNA *prop;
/* mtex */
- prop= RNA_def_property(srna, "texture_slots", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_slots", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, structname);
RNA_def_property_collection_funcs(prop, begin, "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_dereference_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Textures", "Texture slots defining the mapping and influence of textures");
rna_def_texture_slots(brna, prop, structname, structname_slots);
- prop= RNA_def_property(srna, "active_texture", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active_texture", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Texture");
RNA_def_property_flag(prop, PROP_EDITABLE);
- if(activeeditable)
+ if (activeeditable)
RNA_def_property_editable_func(prop, activeeditable);
RNA_def_property_pointer_funcs(prop, activeget, activeset, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Texture", "Active texture slot being displayed");
RNA_def_property_update(prop, 0, update);
- prop= RNA_def_property(srna, "active_texture_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "active_texture_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "texact");
RNA_def_property_range(prop, 0, MAX_MTEX-1);
RNA_def_property_ui_text(prop, "Active Texture Index", "Index of active texture slot");
diff --git a/source/blender/makesrna/intern/rna_material_api.c b/source/blender/makesrna/intern/rna_material_api.c
index f563f53744b..473f2c03158 100644
--- a/source/blender/makesrna/intern/rna_material_api.c
+++ b/source/blender/makesrna/intern/rna_material_api.c
@@ -44,8 +44,8 @@
void RNA_api_material(StructRNA *srna)
{
- // FunctionRNA *func;
- // PropertyRNA *parm;
+ /* FunctionRNA *func; */
+ /* PropertyRNA *parm; */
}
#endif
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 212088849ec..816ddc2758d 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -61,6 +61,7 @@
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_tessmesh.h"
+#include "BKE_report.h"
#include "ED_mesh.h" /* XXX Bad level call */
@@ -110,10 +111,10 @@ static CustomData *rna_mesh_fdata(PointerRNA *ptr)
static void rna_Mesh_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
/* cheating way for importers to avoid slow updates */
- if(id->us > 0) {
+ if (id->us > 0) {
DAG_id_tag_update(id, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
}
@@ -121,18 +122,18 @@ static void rna_Mesh_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Mesh_update_select(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
/* cheating way for importers to avoid slow updates */
- if(id->us > 0) {
+ if (id->us > 0) {
WM_main_add_notifier(NC_GEOM|ND_SELECT, id);
}
}
void rna_Mesh_update_draw(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
/* cheating way for importers to avoid slow updates */
- if(id->us > 0) {
+ if (id->us > 0) {
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
}
}
@@ -157,13 +158,13 @@ void rna_Mesh_update_facemask(Main *bmain, Scene *scene, PointerRNA *ptr)
}
static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value)
{
- MVert *mvert= (MVert*)ptr->data;
+ MVert *mvert = (MVert*)ptr->data;
normal_short_to_float_v3(value, mvert->no);
}
static void rna_MeshVertex_normal_set(PointerRNA *ptr, const float *value)
{
- MVert *mvert= (MVert*)ptr->data;
+ MVert *mvert = (MVert*)ptr->data;
float no[3];
copy_v3_v3(no, value);
@@ -173,44 +174,44 @@ static void rna_MeshVertex_normal_set(PointerRNA *ptr, const float *value)
static float rna_MeshVertex_bevel_weight_get(PointerRNA *ptr)
{
- MVert *mvert= (MVert*)ptr->data;
+ MVert *mvert = (MVert*)ptr->data;
return mvert->bweight/255.0f;
}
static void rna_MeshVertex_bevel_weight_set(PointerRNA *ptr, float value)
{
- MVert *mvert= (MVert*)ptr->data;
- mvert->bweight= (char)(CLAMPIS(value*255.0f, 0, 255));
+ MVert *mvert = (MVert*)ptr->data;
+ mvert->bweight = (char)(CLAMPIS(value*255.0f, 0, 255));
}
static float rna_MEdge_bevel_weight_get(PointerRNA *ptr)
{
- MEdge *medge= (MEdge*)ptr->data;
+ MEdge *medge = (MEdge*)ptr->data;
return medge->bweight/255.0f;
}
static void rna_MEdge_bevel_weight_set(PointerRNA *ptr, float value)
{
- MEdge *medge= (MEdge*)ptr->data;
- medge->bweight= (char)(CLAMPIS(value*255.0f, 0, 255));
+ MEdge *medge = (MEdge*)ptr->data;
+ medge->bweight = (char)(CLAMPIS(value*255.0f, 0, 255));
}
static float rna_MEdge_crease_get(PointerRNA *ptr)
{
- MEdge *medge= (MEdge*)ptr->data;
+ MEdge *medge = (MEdge*)ptr->data;
return medge->crease/255.0f;
}
static void rna_MEdge_crease_set(PointerRNA *ptr, float value)
{
- MEdge *medge= (MEdge*)ptr->data;
- medge->crease= (char)(CLAMPIS(value*255.0f, 0, 255));
+ MEdge *medge = (MEdge*)ptr->data;
+ medge->crease = (char)(CLAMPIS(value*255.0f, 0, 255));
}
static void rna_MeshPolygon_normal_get(PointerRNA *ptr, float *values)
{
Mesh *me = rna_mesh(ptr);
- MPoly *mp= (MPoly*)ptr->data;
+ MPoly *mp = (MPoly*)ptr->data;
/* BMESH_TODO: might be faster to look for a CD_NORMALS layer and use that */
mesh_calc_poly_normal(mp, me->mloop+mp->loopstart, me->mvert, values);
@@ -227,87 +228,89 @@ static float rna_MeshPolygon_area_get(PointerRNA *ptr)
static void rna_MeshFace_normal_get(PointerRNA *ptr, float *values)
{
Mesh *me = rna_mesh(ptr);
- MFace *mface= (MFace*)ptr->data;
+ MFace *mface = (MFace*)ptr->data;
- if(mface->v4)
- normal_quad_v3( values,me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co, me->mvert[mface->v4].co);
+ if (mface->v4)
+ normal_quad_v3(values, me->mvert[mface->v1].co, me->mvert[mface->v2].co,
+ me->mvert[mface->v3].co, me->mvert[mface->v4].co);
else
- normal_tri_v3( values,me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co);
+ normal_tri_v3(values, me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co);
}
static float rna_MeshFace_area_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- MFace *mface= (MFace*)ptr->data;
+ MFace *mface = (MFace*)ptr->data;
- if(mface->v4)
- return area_quad_v3(me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co, me->mvert[mface->v4].co);
+ if (mface->v4)
+ return area_quad_v3(me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co,
+ me->mvert[mface->v4].co);
else
return area_tri_v3(me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co);
}
static void rna_MeshTextureFace_uv1_get(PointerRNA *ptr, float *values)
{
- MTFace *mtface= (MTFace*)ptr->data;
+ MTFace *mtface = (MTFace*)ptr->data;
- values[0]= mtface->uv[0][0];
- values[1]= mtface->uv[0][1];
+ values[0] = mtface->uv[0][0];
+ values[1] = mtface->uv[0][1];
}
static void rna_MeshTextureFace_uv1_set(PointerRNA *ptr, const float *values)
{
- MTFace *mtface= (MTFace*)ptr->data;
+ MTFace *mtface = (MTFace*)ptr->data;
- mtface->uv[0][0]= values[0];
- mtface->uv[0][1]= values[1];
+ mtface->uv[0][0] = values[0];
+ mtface->uv[0][1] = values[1];
}
static void rna_MeshTextureFace_uv2_get(PointerRNA *ptr, float *values)
{
- MTFace *mtface= (MTFace*)ptr->data;
+ MTFace *mtface = (MTFace*)ptr->data;
- values[0]= mtface->uv[1][0];
- values[1]= mtface->uv[1][1];
+ values[0] = mtface->uv[1][0];
+ values[1] = mtface->uv[1][1];
}
static void rna_MeshTextureFace_uv2_set(PointerRNA *ptr, const float *values)
{
- MTFace *mtface= (MTFace*)ptr->data;
+ MTFace *mtface = (MTFace*)ptr->data;
- mtface->uv[1][0]= values[0];
- mtface->uv[1][1]= values[1];
+ mtface->uv[1][0] = values[0];
+ mtface->uv[1][1] = values[1];
}
static void rna_MeshTextureFace_uv3_get(PointerRNA *ptr, float *values)
{
- MTFace *mtface= (MTFace*)ptr->data;
+ MTFace *mtface = (MTFace*)ptr->data;
- values[0]= mtface->uv[2][0];
- values[1]= mtface->uv[2][1];
+ values[0] = mtface->uv[2][0];
+ values[1] = mtface->uv[2][1];
}
static void rna_MeshTextureFace_uv3_set(PointerRNA *ptr, const float *values)
{
- MTFace *mtface= (MTFace*)ptr->data;
+ MTFace *mtface = (MTFace*)ptr->data;
- mtface->uv[2][0]= values[0];
- mtface->uv[2][1]= values[1];
+ mtface->uv[2][0] = values[0];
+ mtface->uv[2][1] = values[1];
}
static void rna_MeshTextureFace_uv4_get(PointerRNA *ptr, float *values)
{
- MTFace *mtface= (MTFace*)ptr->data;
+ MTFace *mtface = (MTFace*)ptr->data;
- values[0]= mtface->uv[3][0];
- values[1]= mtface->uv[3][1];
+ values[0] = mtface->uv[3][0];
+ values[1] = mtface->uv[3][1];
}
static void rna_MeshTextureFace_uv4_set(PointerRNA *ptr, const float *values)
{
- MTFace *mtface= (MTFace*)ptr->data;
+ MTFace *mtface = (MTFace*)ptr->data;
- mtface->uv[3][0]= values[0];
- mtface->uv[3][1]= values[1];
+ mtface->uv[3][0] = values[0];
+ mtface->uv[3][1] = values[1];
}
static int rna_CustomDataData_numverts(PointerRNA *ptr, int type)
@@ -318,9 +321,9 @@ static int rna_CustomDataData_numverts(PointerRNA *ptr, int type)
int a, b;
for (cdl = fdata->layers, a = 0; a < fdata->totlayer; cdl++, a++) {
- if(cdl->type == type) {
+ if (cdl->type == type) {
b = ((char *)ptr->data - ((char*)cdl->data)) / CustomData_sizeof(type);
- if(b >= 0 && b < me->totface) {
+ if (b >= 0 && b < me->totface) {
return (me->mface[b].v4 ? 4 : 3);
}
}
@@ -331,23 +334,23 @@ static int rna_CustomDataData_numverts(PointerRNA *ptr, int type)
static int rna_MeshTextureFace_uv_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
- length[0]= rna_CustomDataData_numverts(ptr, CD_MTFACE);
- length[1]= 2;
+ length[0] = rna_CustomDataData_numverts(ptr, CD_MTFACE);
+ length[1] = 2;
return length[0]*length[1];
}
static void rna_MeshTextureFace_uv_get(PointerRNA *ptr, float *values)
{
- MTFace *mtface= (MTFace*)ptr->data;
- int totvert= rna_CustomDataData_numverts(ptr, CD_MTFACE);
+ MTFace *mtface = (MTFace*)ptr->data;
+ int totvert = rna_CustomDataData_numverts(ptr, CD_MTFACE);
memcpy(values, mtface->uv, totvert * 2 * sizeof(float));
}
static void rna_MeshTextureFace_uv_set(PointerRNA *ptr, const float *values)
{
- MTFace *mtface= (MTFace*)ptr->data;
- int totvert= rna_CustomDataData_numverts(ptr, CD_MTFACE);
+ MTFace *mtface = (MTFace*)ptr->data;
+ int totvert = rna_CustomDataData_numverts(ptr, CD_MTFACE);
memcpy(mtface->uv, values, totvert * 2 * sizeof(float));
}
@@ -355,97 +358,97 @@ static void rna_MeshTextureFace_uv_set(PointerRNA *ptr, const float *values)
/* notice red and blue are swapped */
static void rna_MeshColor_color1_get(PointerRNA *ptr, float *values)
{
- MCol *mcol= (MCol*)ptr->data;
+ MCol *mcol = (MCol*)ptr->data;
- values[2]= (&mcol[0].r)[0]/255.0f;
- values[1]= (&mcol[0].r)[1]/255.0f;
- values[0]= (&mcol[0].r)[2]/255.0f;
+ values[2] = (&mcol[0].r)[0]/255.0f;
+ values[1] = (&mcol[0].r)[1]/255.0f;
+ values[0] = (&mcol[0].r)[2]/255.0f;
}
static void rna_MeshColor_color1_set(PointerRNA *ptr, const float *values)
{
- MCol *mcol= (MCol*)ptr->data;
+ MCol *mcol = (MCol*)ptr->data;
- (&mcol[0].r)[2]= (char)(CLAMPIS(values[0]*255.0f, 0, 255));
- (&mcol[0].r)[1]= (char)(CLAMPIS(values[1]*255.0f, 0, 255));
- (&mcol[0].r)[0]= (char)(CLAMPIS(values[2]*255.0f, 0, 255));
+ (&mcol[0].r)[2] = (char)(CLAMPIS(values[0]*255.0f, 0, 255));
+ (&mcol[0].r)[1] = (char)(CLAMPIS(values[1]*255.0f, 0, 255));
+ (&mcol[0].r)[0] = (char)(CLAMPIS(values[2]*255.0f, 0, 255));
}
static void rna_MeshColor_color2_get(PointerRNA *ptr, float *values)
{
- MCol *mcol= (MCol*)ptr->data;
+ MCol *mcol = (MCol*)ptr->data;
- values[2]= (&mcol[1].r)[0]/255.0f;
- values[1]= (&mcol[1].r)[1]/255.0f;
- values[0]= (&mcol[1].r)[2]/255.0f;
+ values[2] = (&mcol[1].r)[0]/255.0f;
+ values[1] = (&mcol[1].r)[1]/255.0f;
+ values[0] = (&mcol[1].r)[2]/255.0f;
}
static void rna_MeshColor_color2_set(PointerRNA *ptr, const float *values)
{
- MCol *mcol= (MCol*)ptr->data;
+ MCol *mcol = (MCol*)ptr->data;
- (&mcol[1].r)[2]= (char)(CLAMPIS(values[0]*255.0f, 0, 255));
- (&mcol[1].r)[1]= (char)(CLAMPIS(values[1]*255.0f, 0, 255));
- (&mcol[1].r)[0]= (char)(CLAMPIS(values[2]*255.0f, 0, 255));
+ (&mcol[1].r)[2] = (char)(CLAMPIS(values[0]*255.0f, 0, 255));
+ (&mcol[1].r)[1] = (char)(CLAMPIS(values[1]*255.0f, 0, 255));
+ (&mcol[1].r)[0] = (char)(CLAMPIS(values[2]*255.0f, 0, 255));
}
static void rna_MeshColor_color3_get(PointerRNA *ptr, float *values)
{
- MCol *mcol= (MCol*)ptr->data;
+ MCol *mcol = (MCol*)ptr->data;
- values[2]= (&mcol[2].r)[0]/255.0f;
- values[1]= (&mcol[2].r)[1]/255.0f;
- values[0]= (&mcol[2].r)[2]/255.0f;
+ values[2] = (&mcol[2].r)[0]/255.0f;
+ values[1] = (&mcol[2].r)[1]/255.0f;
+ values[0] = (&mcol[2].r)[2]/255.0f;
}
static void rna_MeshColor_color3_set(PointerRNA *ptr, const float *values)
{
- MCol *mcol= (MCol*)ptr->data;
+ MCol *mcol = (MCol*)ptr->data;
- (&mcol[2].r)[2]= (char)(CLAMPIS(values[0]*255.0f, 0, 255));
- (&mcol[2].r)[1]= (char)(CLAMPIS(values[1]*255.0f, 0, 255));
- (&mcol[2].r)[0]= (char)(CLAMPIS(values[2]*255.0f, 0, 255));
+ (&mcol[2].r)[2] = (char)(CLAMPIS(values[0]*255.0f, 0, 255));
+ (&mcol[2].r)[1] = (char)(CLAMPIS(values[1]*255.0f, 0, 255));
+ (&mcol[2].r)[0] = (char)(CLAMPIS(values[2]*255.0f, 0, 255));
}
static void rna_MeshColor_color4_get(PointerRNA *ptr, float *values)
{
- MCol *mcol= (MCol*)ptr->data;
+ MCol *mcol = (MCol*)ptr->data;
- values[2]= (&mcol[3].r)[0]/255.0f;
- values[1]= (&mcol[3].r)[1]/255.0f;
- values[0]= (&mcol[3].r)[2]/255.0f;
+ values[2] = (&mcol[3].r)[0]/255.0f;
+ values[1] = (&mcol[3].r)[1]/255.0f;
+ values[0] = (&mcol[3].r)[2]/255.0f;
}
static void rna_MeshColor_color4_set(PointerRNA *ptr, const float *values)
{
- MCol *mcol= (MCol*)ptr->data;
+ MCol *mcol = (MCol*)ptr->data;
- (&mcol[3].r)[2]= (char)(CLAMPIS(values[0]*255.0f, 0, 255));
- (&mcol[3].r)[1]= (char)(CLAMPIS(values[1]*255.0f, 0, 255));
- (&mcol[3].r)[0]= (char)(CLAMPIS(values[2]*255.0f, 0, 255));
+ (&mcol[3].r)[2] = (char)(CLAMPIS(values[0]*255.0f, 0, 255));
+ (&mcol[3].r)[1] = (char)(CLAMPIS(values[1]*255.0f, 0, 255));
+ (&mcol[3].r)[0] = (char)(CLAMPIS(values[2]*255.0f, 0, 255));
}
static void rna_MeshLoopColor_color_get(PointerRNA *ptr, float *values)
{
- MLoopCol *mcol= (MLoopCol *)ptr->data;
+ MLoopCol *mcol = (MLoopCol *)ptr->data;
- values[2]= (&mcol->r)[0]/255.0f;
- values[1]= (&mcol->r)[1]/255.0f;
- values[0]= (&mcol->r)[2]/255.0f;
+ values[2] = (&mcol->r)[0]/255.0f;
+ values[1] = (&mcol->r)[1]/255.0f;
+ values[0] = (&mcol->r)[2]/255.0f;
}
static void rna_MeshLoopColor_color_set(PointerRNA *ptr, const float *values)
{
- MLoopCol *mcol= (MLoopCol *)ptr->data;
+ MLoopCol *mcol = (MLoopCol *)ptr->data;
- (&mcol->r)[2]= (char)(CLAMPIS(values[0]*255.0f, 0, 255));
- (&mcol->r)[1]= (char)(CLAMPIS(values[1]*255.0f, 0, 255));
- (&mcol->r)[0]= (char)(CLAMPIS(values[2]*255.0f, 0, 255));
+ (&mcol->r)[2] = (char)(CLAMPIS(values[0]*255.0f, 0, 255));
+ (&mcol->r)[1] = (char)(CLAMPIS(values[1]*255.0f, 0, 255));
+ (&mcol->r)[0] = (char)(CLAMPIS(values[2]*255.0f, 0, 255));
}
static int rna_Mesh_texspace_editable(PointerRNA *ptr)
{
- Mesh *me= (Mesh*)ptr->data;
+ Mesh *me = (Mesh*)ptr->data;
return (me->texflag & ME_AUTOSPACE)? 0: PROP_EDITABLE;
}
@@ -453,9 +456,9 @@ static void rna_MeshVertex_groups_begin(CollectionPropertyIterator *iter, Pointe
{
Mesh *me = rna_mesh(ptr);
- if(me->dvert) {
- MVert *mvert= (MVert*)ptr->data;
- MDeformVert *dvert= me->dvert + (mvert-me->mvert);
+ if (me->dvert) {
+ MVert *mvert = (MVert*)ptr->data;
+ MDeformVert *dvert = me->dvert + (mvert-me->mvert);
rna_iterator_array_begin(iter, (void*)dvert->dw, sizeof(MDeformWeight), dvert->totweight, 0, NULL);
}
@@ -466,42 +469,42 @@ static void rna_MeshVertex_groups_begin(CollectionPropertyIterator *iter, Pointe
static void rna_MeshFace_material_index_range(PointerRNA *ptr, int *min, int *max)
{
Mesh *me = rna_mesh(ptr);
- *min= 0;
- *max= me->totcol-1;
- *max= MAX2(0, *max);
+ *min = 0;
+ *max = me->totcol-1;
+ *max = MAX2(0, *max);
}
static int rna_CustomDataLayer_active_get(PointerRNA *ptr, CustomData *data, int type, int render)
{
- int n= ((CustomDataLayer*)ptr->data) - data->layers;
+ int n = ((CustomDataLayer*)ptr->data) - data->layers;
- if(render) return (n == CustomData_get_render_layer_index(data, type));
+ if (render) return (n == CustomData_get_render_layer_index(data, type));
else return (n == CustomData_get_active_layer_index(data, type));
}
static int rna_CustomDataLayer_clone_get(PointerRNA *ptr, CustomData *data, int type, int render)
{
- int n= ((CustomDataLayer*)ptr->data) - data->layers;
+ int n = ((CustomDataLayer*)ptr->data) - data->layers;
return (n == CustomData_get_clone_layer_index(data, type));
}
static void rna_CustomDataLayer_active_set(PointerRNA *ptr, CustomData *data, int value, int type, int render)
{
- int n= ((CustomDataLayer*)ptr->data) - data->layers;
+ int n = ((CustomDataLayer*)ptr->data) - data->layers;
- if(value == 0)
+ if (value == 0)
return;
- if(render) CustomData_set_layer_render_index(data, type, n);
+ if (render) CustomData_set_layer_render_index(data, type, n);
else CustomData_set_layer_active_index(data, type, n);
}
static void rna_CustomDataLayer_clone_set(PointerRNA *ptr, CustomData *data, int value, int type, int render)
{
- int n= ((CustomDataLayer*)ptr->data) - data->layers;
+ int n = ((CustomDataLayer*)ptr->data) - data->layers;
- if(value == 0)
+ if (value == 0)
return;
CustomData_set_layer_clone_index(data, type, n);
@@ -546,7 +549,7 @@ DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(tessface_uv_texture, fdata, CD_MTF
static void rna_MeshTextureFaceLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
+ CustomDataLayer *layer = (CustomDataLayer*)ptr->data;
rna_iterator_array_begin(iter, layer->data, sizeof(MTFace), (me->edit_btmesh)? 0: me->totface, 0, NULL);
}
@@ -588,8 +591,8 @@ static void rna_MeshTextureFaceLayer_clone_set(PointerRNA *ptr, int value)
static void rna_MeshTextureFaceLayer_name_set(PointerRNA *ptr, const char *value)
{
- CustomData *fdata= rna_mesh_fdata(ptr);
- CustomDataLayer *cdl= (CustomDataLayer*)ptr->data;
+ CustomData *fdata = rna_mesh_fdata(ptr);
+ CustomDataLayer *cdl = (CustomDataLayer*)ptr->data;
BLI_strncpy_utf8(cdl->name, value, sizeof(cdl->name));
CustomData_set_layer_unique_name(fdata, cdl - fdata->layers);
}
@@ -605,7 +608,7 @@ DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(uv_texture, pdata, CD_MTEXPOLY, re
static void rna_MeshTexturePolyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
+ CustomDataLayer *layer = (CustomDataLayer*)ptr->data;
rna_iterator_array_begin(iter, layer->data, sizeof(MTexPoly), (me->edit_btmesh) ? 0 : me->totpoly, 0, NULL);
}
@@ -647,8 +650,8 @@ static void rna_MeshTexturePolyLayer_clone_set(PointerRNA *ptr, int value)
static void rna_MeshTexturePolyLayer_name_set(PointerRNA *ptr, const char *value)
{
- CustomData *pdata= rna_mesh_pdata(ptr);
- CustomDataLayer *cdl= (CustomDataLayer*)ptr->data;
+ CustomData *pdata = rna_mesh_pdata(ptr);
+ CustomDataLayer *cdl = (CustomDataLayer*)ptr->data;
BLI_strncpy_utf8(cdl->name, value, sizeof(cdl->name));
CustomData_set_layer_unique_name(pdata, cdl - pdata->layers);
}
@@ -662,14 +665,14 @@ DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(tessface_vertex_color, fdata, CD_M
static void rna_MeshColorLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
- rna_iterator_array_begin(iter, layer->data, sizeof(CD_MCOL), me->totloop, 0, NULL);
+ CustomDataLayer *layer = (CustomDataLayer *)ptr->data;
+ rna_iterator_array_begin(iter, layer->data, sizeof(CD_MCOL), me->totface, 0, NULL);
}
static int rna_MeshColorLayer_data_length(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- return me->totloop;
+ return me->totface;
}
static int rna_MeshColorLayer_active_render_get(PointerRNA *ptr)
@@ -699,7 +702,7 @@ DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(vertex_color, ldata, CD_MLOOPCOL,
static void rna_MeshLoopColorLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
+ CustomDataLayer *layer = (CustomDataLayer*)ptr->data;
rna_iterator_array_begin(iter, layer->data, sizeof(CD_MLOOPCOL), me->totloop, 0, NULL);
}
@@ -733,7 +736,7 @@ static void rna_MeshLoopColorLayer_name_set(PointerRNA *ptr, const char *value)
{
/* Mesh *me = rna_mesh(ptr); */ /* UNUSED */
/* CustomData *pdata = rna_mesh_pdata(ptr); */ /* UNUSED */
- CustomDataLayer *cdl= (CustomDataLayer*)ptr->data;
+ CustomDataLayer *cdl = (CustomDataLayer*)ptr->data;
BLI_strncpy_utf8(cdl->name, value, sizeof(cdl->name));
CustomData_set_layer_unique_name(rna_mesh_ldata(ptr), cdl - rna_mesh_ldata(ptr)->layers);
}
@@ -741,7 +744,7 @@ static void rna_MeshLoopColorLayer_name_set(PointerRNA *ptr, const char *value)
static void rna_MeshFloatPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
+ CustomDataLayer *layer = (CustomDataLayer*)ptr->data;
rna_iterator_array_begin(iter, layer->data, sizeof(MFloatProperty), me->totface, 0, NULL);
}
@@ -753,14 +756,15 @@ static int rna_MeshFloatPropertyLayer_data_length(PointerRNA *ptr)
static int rna_float_layer_check(CollectionPropertyIterator *iter, void *data)
{
- CustomDataLayer *layer= (CustomDataLayer*)data;
+ CustomDataLayer *layer = (CustomDataLayer*)data;
return (layer->type != CD_PROP_FLT);
}
static void rna_Mesh_float_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
CustomData *pdata = rna_mesh_pdata(ptr);
- rna_iterator_array_begin(iter, (void*)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0, rna_float_layer_check);
+ rna_iterator_array_begin(iter, (void*)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0,
+ rna_float_layer_check);
}
static int rna_Mesh_float_layers_length(PointerRNA *ptr)
@@ -770,14 +774,14 @@ static int rna_Mesh_float_layers_length(PointerRNA *ptr)
static int rna_int_layer_check(CollectionPropertyIterator *iter, void *data)
{
- CustomDataLayer *layer= (CustomDataLayer*)data;
+ CustomDataLayer *layer = (CustomDataLayer*)data;
return (layer->type != CD_PROP_INT);
}
static void rna_MeshIntPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
+ CustomDataLayer *layer = (CustomDataLayer*)ptr->data;
rna_iterator_array_begin(iter, layer->data, sizeof(MIntProperty), me->totface, 0, NULL);
}
@@ -790,7 +794,8 @@ static int rna_MeshIntPropertyLayer_data_length(PointerRNA *ptr)
static void rna_Mesh_int_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
CustomData *pdata = rna_mesh_pdata(ptr);
- rna_iterator_array_begin(iter, (void*)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0, rna_int_layer_check);
+ rna_iterator_array_begin(iter, (void*)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0,
+ rna_int_layer_check);
}
static int rna_Mesh_int_layers_length(PointerRNA *ptr)
@@ -800,14 +805,14 @@ static int rna_Mesh_int_layers_length(PointerRNA *ptr)
static int rna_string_layer_check(CollectionPropertyIterator *iter, void *data)
{
- CustomDataLayer *layer= (CustomDataLayer*)data;
+ CustomDataLayer *layer = (CustomDataLayer*)data;
return (layer->type != CD_PROP_STR);
}
static void rna_MeshStringPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
+ CustomDataLayer *layer = (CustomDataLayer*)ptr->data;
rna_iterator_array_begin(iter, layer->data, sizeof(MStringProperty), me->totface, 0, NULL);
}
@@ -820,7 +825,8 @@ static int rna_MeshStringPropertyLayer_data_length(PointerRNA *ptr)
static void rna_Mesh_string_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
CustomData *pdata = rna_mesh_pdata(ptr);
- rna_iterator_array_begin(iter, (void*)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0, rna_string_layer_check);
+ rna_iterator_array_begin(iter, (void*)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0,
+ rna_string_layer_check);
}
static int rna_Mesh_string_layers_length(PointerRNA *ptr)
@@ -828,12 +834,31 @@ static int rna_Mesh_string_layers_length(PointerRNA *ptr)
return CustomData_number_of_layers(rna_mesh_pdata(ptr), CD_PROP_STR);
}
+static void rna_TexturePoly_image_set(PointerRNA *ptr, PointerRNA value)
+{
+ MTexPoly *tf = (MTexPoly*)ptr->data;
+ ID *id = value.data;
+
+ if (id) {
+ /* special exception here, individual faces don't count
+ * as reference, but we do ensure the refcount is not zero */
+ if (id->us == 0)
+ id_us_plus(id);
+ else
+ id_lib_extern(id);
+ }
+
+ tf->tpage = (struct Image *)id;
+}
+
+/* while this is supposed to be readonly,
+ * keep it to support importers that only make tessfaces */
static void rna_TextureFace_image_set(PointerRNA *ptr, PointerRNA value)
{
- MTexPoly *tf= (MTexPoly*)ptr->data;
- ID *id= value.data;
+ MTFace *tf = (MTFace*)ptr->data;
+ ID *id = value.data;
- if(id) {
+ if (id) {
/* special exception here, individual faces don't count
* as reference, but we do ensure the refcount is not zero */
if(id->us == 0)
@@ -842,15 +867,15 @@ static void rna_TextureFace_image_set(PointerRNA *ptr, PointerRNA value)
id_lib_extern(id);
}
- tf->tpage= (struct Image*)id;
+ tf->tpage = (struct Image *)id;
}
static void rna_Mesh_auto_smooth_angle_set(PointerRNA *ptr, float value)
{
Mesh *me = rna_mesh(ptr);
- value= RAD2DEGF(value);
+ value = RAD2DEGF(value);
CLAMP(value, 1.0f, 80.0f);
- me->smoothresh= (int)value;
+ me->smoothresh = (int)value;
}
static float rna_Mesh_auto_smooth_angle_get(PointerRNA *ptr)
@@ -861,43 +886,43 @@ static float rna_Mesh_auto_smooth_angle_get(PointerRNA *ptr)
static int rna_MeshFace_verts_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
- MFace *face= (MFace*)ptr->data;
+ MFace *face = (MFace*)ptr->data;
- if(face)
- length[0]= (face->v4)? 4: 3;
+ if (face)
+ length[0] = (face->v4)? 4: 3;
else
- length[0]= 4; // XXX rna_raw_access wants the length of a dummy face. this needs fixing. - Campbell
+ length[0] = 4; /* XXX rna_raw_access wants the length of a dummy face. this needs fixing. - Campbell */
return length[0];
}
static void rna_MeshFace_verts_get(PointerRNA *ptr, int *values)
{
- MFace *face= (MFace*)ptr->data;
+ MFace *face = (MFace*)ptr->data;
memcpy(values, &face->v1, (face->v4 ? 4 : 3) * sizeof(int));
}
static void rna_MeshFace_verts_set(PointerRNA *ptr, const int *values)
{
- MFace *face= (MFace*)ptr->data;
+ MFace *face = (MFace*)ptr->data;
memcpy(&face->v1, values, (face->v4 ? 4 : 3) * sizeof(int));
}
/* poly.vertices - this is faked loop access for convenience */
static int rna_MeshPoly_vertices_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
- MPoly *mp= (MPoly*)ptr->data;
+ MPoly *mp = (MPoly*)ptr->data;
/* note, raw access uses dummy item, this _could_ crash, watch out for this, mface uses it but it cant work here */
- return (length[0]= mp->totloop);
+ return (length[0] = mp->totloop);
}
static void rna_MeshPoly_vertices_get(PointerRNA *ptr, int *values)
{
Mesh *me = rna_mesh(ptr);
- MPoly *mp= (MPoly*)ptr->data;
- MLoop *ml= &me->mloop[mp->loopstart];
+ MPoly *mp = (MPoly*)ptr->data;
+ MLoop *ml = &me->mloop[mp->loopstart];
unsigned int i;
- for(i= mp->totloop; i > 0; i--, values++, ml++) {
+ for (i = mp->totloop; i > 0; i--, values++, ml++) {
*values = ml->v;
}
}
@@ -905,10 +930,10 @@ static void rna_MeshPoly_vertices_get(PointerRNA *ptr, int *values)
static void rna_MeshPoly_vertices_set(PointerRNA *ptr, const int *values)
{
Mesh *me = rna_mesh(ptr);
- MPoly *mp= (MPoly*)ptr->data;
- MLoop *ml= &me->mloop[mp->loopstart];
+ MPoly *mp = (MPoly*)ptr->data;
+ MLoop *ml = &me->mloop[mp->loopstart];
unsigned int i;
- for(i= mp->totloop; i > 0; i--, values++, ml++) {
+ for (i = mp->totloop; i > 0; i--, values++, ml++) {
ml->v = *values;
}
}
@@ -917,35 +942,35 @@ static void rna_MeshPoly_vertices_set(PointerRNA *ptr, const int *values)
static int rna_MeshVertex_index_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- MVert *vert= (MVert*)ptr->data;
+ MVert *vert = (MVert*)ptr->data;
return (int)(vert - me->mvert);
}
static int rna_MeshEdge_index_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- MEdge *edge= (MEdge*)ptr->data;
+ MEdge *edge = (MEdge*)ptr->data;
return (int)(edge - me->medge);
}
static int rna_MeshFace_index_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- MFace *face= (MFace*)ptr->data;
+ MFace *face = (MFace*)ptr->data;
return (int)(face - me->mface);
}
static int rna_MeshPolygon_index_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- MPoly *mpoly= (MPoly*)ptr->data;
+ MPoly *mpoly = (MPoly*)ptr->data;
return (int)(mpoly - me->mpoly);
}
static int rna_MeshLoop_index_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
- MLoop *mloop= (MLoop*)ptr->data;
+ MLoop *mloop = (MLoop*)ptr->data;
return (int)(mloop - me->mloop);
}
@@ -954,13 +979,13 @@ static int rna_MeshLoop_index_get(PointerRNA *ptr)
static char *rna_VertexGroupElement_path(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr); /* XXX not always! */
- MDeformWeight *dw= (MDeformWeight*)ptr->data;
+ MDeformWeight *dw = (MDeformWeight*)ptr->data;
MDeformVert *dvert;
int a, b;
-
- for(a=0, dvert=me->dvert; a<me->totvert; a++, dvert++)
- for(b=0; b<dvert->totweight; b++)
- if(dw == &dvert->dw[b])
+
+ for (a = 0, dvert = me->dvert; a < me->totvert; a++, dvert++)
+ for (b = 0; b < dvert->totweight; b++)
+ if (dw == &dvert->dw[b])
return BLI_sprintfN("verts[%d].groups[%d]", a, b);
return NULL;
@@ -1009,10 +1034,10 @@ static char *rna_PolyCustomData_data_path(PointerRNA *ptr, char *collection, int
CustomData *pdata = rna_mesh_pdata(ptr);
int a, b, totpoly = (me->edit_btmesh) ? 0 : me->totpoly;
- for(cdl=pdata->layers, a=0; a<pdata->totlayer; cdl++, a++) {
- if(cdl->type == type) {
- b= ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
- if(b >= 0 && b < totpoly)
+ for (cdl = pdata->layers, a = 0; a < pdata->totlayer; cdl++, a++) {
+ if (cdl->type == type) {
+ b = ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
+ if (b >= 0 && b < totpoly)
return BLI_sprintfN("%s[\"%s\"].data[%d]", collection, cdl->name, b);
}
}
@@ -1027,10 +1052,10 @@ static char *rna_LoopCustomData_data_path(PointerRNA *ptr, char *collection, int
CustomData *ldata = rna_mesh_ldata(ptr);
int a, b, totloop = (me->edit_btmesh) ? 0 : me->totloop;
- for(cdl=ldata->layers, a=0; a<ldata->totlayer; cdl++, a++) {
- if(cdl->type == type) {
- b= ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
- if(b >= 0 && b < totloop)
+ for (cdl = ldata->layers, a = 0; a < ldata->totlayer; cdl++, a++) {
+ if (cdl->type == type) {
+ b = ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
+ if (b >= 0 && b < totloop)
return BLI_sprintfN("%s[\"%s\"].data[%d]", collection, cdl->name, b);
}
}
@@ -1045,10 +1070,10 @@ static char *rna_FaceCustomData_data_path(PointerRNA *ptr, char *collection, int
CustomData *fdata = rna_mesh_fdata(ptr);
int a, b, totloop = (me->edit_btmesh) ? 0 : me->totloop;
- for(cdl=fdata->layers, a=0; a<fdata->totlayer; cdl++, a++) {
- if(cdl->type == type) {
- b= ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
- if(b >= 0 && b < totloop)
+ for (cdl = fdata->layers, a = 0; a < fdata->totlayer; cdl++, a++) {
+ if (cdl->type == type) {
+ b = ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
+ if (b >= 0 && b < totloop)
return BLI_sprintfN("%s[\"%s\"].data[%d]", collection, cdl->name, b);
}
}
@@ -1141,12 +1166,12 @@ static PointerRNA rna_Mesh_vertex_color_new(struct Mesh *me, struct bContext *C,
{
PointerRNA ptr;
CustomData *ldata;
- CustomDataLayer *cdl= NULL;
- int index= ED_mesh_color_add(C, NULL, NULL, me, name, FALSE);
+ CustomDataLayer *cdl = NULL;
+ int index = ED_mesh_color_add(C, NULL, NULL, me, name, FALSE);
- if(index != -1) {
- ldata= rna_mesh_ldata_helper(me);
- cdl= &ldata->layers[CustomData_get_layer_index_n(ldata, CD_MLOOPCOL, index)];
+ if (index != -1) {
+ ldata = rna_mesh_ldata_helper(me);
+ cdl = &ldata->layers[CustomData_get_layer_index_n(ldata, CD_MLOOPCOL, index)];
}
RNA_pointer_create(&me->id, &RNA_MeshLoopColorLayer, cdl, &ptr);
@@ -1202,18 +1227,50 @@ static PointerRNA rna_Mesh_uv_texture_new(struct Mesh *me, struct bContext *C, c
{
PointerRNA ptr;
CustomData *pdata;
- CustomDataLayer *cdl= NULL;
+ CustomDataLayer *cdl = NULL;
int index = ED_mesh_uv_texture_add(C, me, name, FALSE);
- if(index != -1) {
- pdata= rna_mesh_pdata_helper(me);
- cdl= &pdata->layers[CustomData_get_layer_index_n(pdata, CD_MTEXPOLY, index)];
+ if (index != -1) {
+ pdata = rna_mesh_pdata_helper(me);
+ cdl = &pdata->layers[CustomData_get_layer_index_n(pdata, CD_MTEXPOLY, index)];
}
RNA_pointer_create(&me->id, &RNA_MeshTexturePolyLayer, cdl, &ptr);
return ptr;
}
+/* while this is supposed to be readonly,
+ * keep it to support importers that only make tessfaces */
+
+static PointerRNA rna_Mesh_uv_tessface_texture_new(struct Mesh *me, struct bContext *C, ReportList *reports,
+ const char *name)
+{
+ PointerRNA ptr;
+ CustomData *fdata;
+ CustomDataLayer *cdl= NULL;
+ int index;
+
+ if (me->edit_btmesh) {
+ BKE_report(reports, RPT_ERROR, "Can't add tessface uv's in editmode");
+ return PointerRNA_NULL;
+ }
+
+ if (me->mpoly) {
+ BKE_report(reports, RPT_ERROR, "Can't add tessface uv's when MPoly's exist");
+ return PointerRNA_NULL;
+ }
+
+ index = ED_mesh_uv_texture_add(C, me, name, FALSE);
+
+ if(index != -1) {
+ fdata= rna_mesh_fdata_helper(me);
+ cdl= &fdata->layers[CustomData_get_layer_index_n(fdata, CD_MTFACE, index)];
+ }
+
+ RNA_pointer_create(&me->id, &RNA_MeshTextureFaceLayer, cdl, &ptr);
+ return ptr;
+}
+
#else
static void rna_def_mvert_group(BlenderRNA *brna)
@@ -1221,7 +1278,7 @@ static void rna_def_mvert_group(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "VertexGroupElement", NULL);
+ srna = RNA_def_struct(brna, "VertexGroupElement", NULL);
RNA_def_struct_sdna(srna, "MDeformWeight");
RNA_def_struct_path_func(srna, "rna_VertexGroupElement_path");
RNA_def_struct_ui_text(srna, "Vertex Group Element", "Weight value of a vertex in a vertex group");
@@ -1229,13 +1286,13 @@ static void rna_def_mvert_group(BlenderRNA *brna)
/* we can't point to actual group, it is in the object and so
* there is no unique group to point to, hence the index */
- prop= RNA_def_property(srna, "group", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "group", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "def_nr");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Group Index", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Weight", "Vertex Weight");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
@@ -1246,44 +1303,45 @@ static void rna_def_mvert(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MeshVertex", NULL);
+ srna = RNA_def_struct(brna, "MeshVertex", NULL);
RNA_def_struct_sdna(srna, "MVert");
RNA_def_struct_ui_text(srna, "Mesh Vertex", "Vertex in a Mesh datablock");
RNA_def_struct_path_func(srna, "rna_MeshVertex_path");
RNA_def_struct_ui_icon(srna, ICON_VERTEXSEL);
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
- // RNA_def_property_float_sdna(prop, NULL, "no");
+ prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
+ /* RNA_def_property_float_sdna(prop, NULL, "no"); */
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_float_funcs(prop, "rna_MeshVertex_normal_get", "rna_MeshVertex_normal_set", NULL);
RNA_def_property_ui_text(prop, "Normal", "Vertex Normal");
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
RNA_def_property_ui_text(prop, "Select", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
RNA_def_property_ui_text(prop, "Hide", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "bevel_weight", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bevel_weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_MeshVertex_bevel_weight_get", "rna_MeshVertex_bevel_weight_set", NULL);
RNA_def_property_ui_text(prop, "Bevel Weight", "Weight used by the Bevel modifier 'Only Vertices' option");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
+ prop = RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "VertexGroupElement");
RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this vertex is member of");
- prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_MeshVertex_index_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Index", "Index number of the vertex");
@@ -1294,62 +1352,62 @@ static void rna_def_medge(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MeshEdge", NULL);
+ srna = RNA_def_struct(brna, "MeshEdge", NULL);
RNA_def_struct_sdna(srna, "MEdge");
RNA_def_struct_ui_text(srna, "Mesh Edge", "Edge in a Mesh datablock");
RNA_def_struct_path_func(srna, "rna_MeshEdge_path");
RNA_def_struct_ui_icon(srna, ICON_EDGESEL);
- prop= RNA_def_property(srna, "vertices", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "vertices", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "v1");
RNA_def_property_array(prop, 2);
RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
- // XXX allows creating invalid meshes
+ /* XXX allows creating invalid meshes */
- prop= RNA_def_property(srna, "crease", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "crease", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_MEdge_crease_get", "rna_MEdge_crease_set", NULL);
RNA_def_property_ui_text(prop, "Crease", "Weight used by the Subsurf modifier for creasing");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "bevel_weight", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bevel_weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_MEdge_bevel_weight_get", "rna_MEdge_bevel_weight_set", NULL);
RNA_def_property_ui_text(prop, "Bevel Weight", "Weight used by the Bevel modifier");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
RNA_def_property_ui_text(prop, "Select", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
RNA_def_property_ui_text(prop, "Hide", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "use_seam", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_seam", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SEAM);
RNA_def_property_ui_text(prop, "Seam", "Seam edge for UV unwrapping");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "use_edge_sharp", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_edge_sharp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SHARP);
RNA_def_property_ui_text(prop, "Sharp", "Sharp edge for the EdgeSplit modifier");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "use_freestyle_edge_mark", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_freestyle_edge_mark", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FREESTYLE_EDGE);
RNA_def_property_ui_text(prop, "Freestyle Edge Mark", "Edge mark for Freestyle feature edge detection");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "is_loose", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_loose", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_LOOSEEDGE);
RNA_def_property_ui_text(prop, "Loose", "Loose edge");
- prop= RNA_def_property(srna, "is_fgon", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_fgon", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FGON);
RNA_def_property_ui_text(prop, "Fgon", "Fgon edge");
- prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_MeshEdge_index_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Index", "Index number of the vertex");
@@ -1360,14 +1418,14 @@ static void rna_def_mface(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MeshFace", NULL);
+ srna = RNA_def_struct(brna, "MeshFace", NULL);
RNA_def_struct_sdna(srna, "MFace");
RNA_def_struct_ui_text(srna, "Mesh Face", "Face in a Mesh datablock");
RNA_def_struct_path_func(srna, "rna_MeshFace_path");
RNA_def_struct_ui_icon(srna, ICON_FACESEL);
- // XXX allows creating invalid meshes
- prop= RNA_def_property(srna, "vertices", PROP_INT, PROP_UNSIGNED);
+ /* XXX allows creating invalid meshes */
+ prop = RNA_def_property(srna, "vertices", PROP_INT, PROP_UNSIGNED);
RNA_def_property_array(prop, 4);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_MeshFace_verts_get_length");
@@ -1375,50 +1433,50 @@ static void rna_def_mface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
/* leaving this fixed size array for foreach_set used in import scripts */
- prop= RNA_def_property(srna, "vertices_raw", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "vertices_raw", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "v1");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Vertices", "Fixed size vertex indices array");
- prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "mat_nr");
RNA_def_property_ui_text(prop, "Material Index", "");
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshFace_material_index_range");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FACE_SEL);
RNA_def_property_ui_text(prop, "Select", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
RNA_def_property_ui_text(prop, "Hide", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "use_smooth", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_smooth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SMOOTH);
RNA_def_property_ui_text(prop, "Smooth", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "use_freestyle_face_mark", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_freestyle_face_mark", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FREESTYLE_FACE);
RNA_def_property_ui_text(prop, "Freestyle Face Mark", "Face mark for Freestyle feature edge detection");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
+ prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_MeshFace_normal_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Face normal", "Local space unit length normal vector for this face");
- prop= RNA_def_property(srna, "area", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "area", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_MeshFace_area_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Face area", "Read only area of the face");
- prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_MeshFace_index_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Index", "Index number of the vertex");
@@ -1430,21 +1488,21 @@ static void rna_def_mloop(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MeshLoop", NULL);
+ srna = RNA_def_struct(brna, "MeshLoop", NULL);
RNA_def_struct_sdna(srna, "MLoop");
RNA_def_struct_ui_text(srna, "Mesh Loop", "Loop in a Mesh datablock");
RNA_def_struct_path_func(srna, "rna_MeshLoop_path");
RNA_def_struct_ui_icon(srna, ICON_EDGESEL);
- prop= RNA_def_property(srna, "vertex_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "vertex_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "v");
RNA_def_property_ui_text(prop, "Vertex", "Vertex index");
- prop= RNA_def_property(srna, "edge_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "edge_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "e");
RNA_def_property_ui_text(prop, "Edge", "Edge index");
- prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_MeshLoop_index_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Index", "Index number of the loop");
@@ -1455,64 +1513,67 @@ static void rna_def_mpolygon(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MeshPolygon", NULL);
+ srna = RNA_def_struct(brna, "MeshPolygon", NULL);
RNA_def_struct_sdna(srna, "MPoly");
RNA_def_struct_ui_text(srna, "Mesh Polygon", "Polygon in a Mesh datablock");
RNA_def_struct_path_func(srna, "rna_MeshPolygon_path");
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 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.
+ /* 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 indices, then calc edges automatic when creating
+ * meshes from rna/py. */
+ prop = RNA_def_property(srna, "vertices", PROP_INT, PROP_UNSIGNED);
+ /* Eek, this is still used in some cases but in fact we don't want to use it at all here. */
+ RNA_def_property_array(prop, 3);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_MeshPoly_vertices_get_length");
RNA_def_property_int_funcs(prop, "rna_MeshPoly_vertices_get", "rna_MeshPoly_vertices_set", NULL);
RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
/* these are both very low level access */
- prop= RNA_def_property(srna, "loop_start", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "loop_start", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "loopstart");
RNA_def_property_ui_text(prop, "Loop Start", "");
/* also low level */
- prop= RNA_def_property(srna, "loop_total", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "loop_total", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "totloop");
RNA_def_property_ui_text(prop, "Loop Total", "");
- prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "mat_nr");
RNA_def_property_ui_text(prop, "Material Index", "");
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshFace_material_index_range");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FACE_SEL);
RNA_def_property_ui_text(prop, "Select", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
RNA_def_property_ui_text(prop, "Hide", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "use_smooth", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_smooth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SMOOTH);
RNA_def_property_ui_text(prop, "Smooth", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
+ prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_MeshPolygon_normal_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Face normal", "Local space unit length normal vector for this polygon");
- prop= RNA_def_property(srna, "area", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "area", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_MeshPolygon_area_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Face area", "Read only area of the face");
- prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_MeshPolygon_index_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Index", "Index number of the vertex");
@@ -1524,30 +1585,32 @@ static void rna_def_mloopuv(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MeshUVLoopLayer", NULL);
+ srna = RNA_def_struct(brna, "MeshUVLoopLayer", NULL);
RNA_def_struct_sdna(srna, "CustomDataLayer");
RNA_def_struct_path_func(srna, "rna_MeshUVLoopLayer_path");
- prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MeshUVLoop");
- RNA_def_property_collection_funcs(prop, "rna_MeshUVLoopLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshUVLoopLayer_data_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_MeshUVLoopLayer_data_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_get",
+ "rna_MeshUVLoopLayer_data_length", NULL, NULL, NULL);
- srna= RNA_def_struct(brna, "MeshUVLoop", NULL);
+ srna = RNA_def_struct(brna, "MeshUVLoop", NULL);
RNA_def_struct_sdna(srna, "MLoopUV");
RNA_def_struct_path_func(srna, "rna_MeshUVLoop_path");
- prop= RNA_def_property(srna, "uv", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "uv", PROP_FLOAT, PROP_XYZ);
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "pin_uv", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "pin_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MLOOPUV_PINNED);
RNA_def_property_ui_text(prop, "UV Pinned", "");
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MLOOPUV_VERTSEL);
RNA_def_property_ui_text(prop, "UV Select", "");
- prop= RNA_def_property(srna, "select_edge", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_edge", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MLOOPUV_EDGESEL);
RNA_def_property_ui_text(prop, "UV Edge Select", "");
}
@@ -1556,94 +1619,95 @@ static void rna_def_mtface(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- const int uv_dim[]= {4, 2};
+ const int uv_dim[] = {4, 2};
- srna= RNA_def_struct(brna, "MeshTextureFaceLayer", NULL);
+ srna = RNA_def_struct(brna, "MeshTextureFaceLayer", NULL);
RNA_def_struct_ui_text(srna, "Mesh UV Map", "UV map with assigned image textures in a Mesh datablock");
RNA_def_struct_sdna(srna, "CustomDataLayer");
RNA_def_struct_path_func(srna, "rna_MeshTextureFaceLayer_path");
RNA_def_struct_ui_icon(srna, ICON_GROUP_UVS);
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_struct_name_property(srna, prop);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshTextureFaceLayer_name_set");
RNA_def_property_ui_text(prop, "Name", "Name of UV map");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_get", "rna_MeshTextureFaceLayer_active_set");
RNA_def_property_ui_text(prop, "Active", "Set the map as active for display and editing");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0);
RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_render_get",
"rna_MeshTextureFaceLayer_active_render_set");
RNA_def_property_ui_text(prop, "Active Render", "Set the map as active for rendering");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "active_clone", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "active_clone", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "active_clone", 0);
RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_clone_get", "rna_MeshTextureFaceLayer_clone_set");
RNA_def_property_ui_text(prop, "Active Clone", "Set the map as active for cloning");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MeshTextureFace");
RNA_def_property_ui_text(prop, "Data", "");
RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next",
"rna_iterator_array_end", "rna_iterator_array_get",
"rna_MeshTextureFaceLayer_data_length", NULL, NULL, NULL);
- srna= RNA_def_struct(brna, "MeshTextureFace", NULL);
+ srna = RNA_def_struct(brna, "MeshTextureFace", NULL);
RNA_def_struct_sdna(srna, "MTFace");
RNA_def_struct_ui_text(srna, "Mesh UV Map Face", "UV map and image texture for a face");
RNA_def_struct_path_func(srna, "rna_MeshTextureFace_path");
RNA_def_struct_ui_icon(srna, ICON_FACESEL_HLT);
- prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tpage");
RNA_def_property_pointer_funcs(prop, NULL, "rna_TextureFace_image_set", NULL, NULL);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "select_uv", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TF_SEL1);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "UV Selected", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "pin_uv", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "pin_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "unwrap", TF_PIN1);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "UV Pinned", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "uv1", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "uv1", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv1_get", "rna_MeshTextureFace_uv1_set", NULL);
RNA_def_property_ui_text(prop, "UV 1", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "uv2", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "uv2", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv2_get", "rna_MeshTextureFace_uv2_set", NULL);
RNA_def_property_ui_text(prop, "UV 2", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "uv3", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "uv3", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv3_get", "rna_MeshTextureFace_uv3_set", NULL);
RNA_def_property_ui_text(prop, "UV 3", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "uv4", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "uv4", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv4_get", "rna_MeshTextureFace_uv4_set", NULL);
RNA_def_property_ui_text(prop, "UV 4", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "uv", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "uv", PROP_FLOAT, PROP_NONE);
RNA_def_property_multi_array(prop, 2, uv_dim);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_MeshTextureFace_uv_get_length");
@@ -1651,7 +1715,7 @@ static void rna_def_mtface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "UV", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "uv_raw", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_raw", PROP_FLOAT, PROP_NONE);
RNA_def_property_multi_array(prop, 2, uv_dim);
RNA_def_property_float_sdna(prop, NULL, "uv");
RNA_def_property_ui_text(prop, "UV", "Fixed size UV coordinates array");
@@ -1663,70 +1727,73 @@ static void rna_def_mtexpoly(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
#if 0 /* BMESH_TODO: needed later when do another todo */
- int uv_dim[]= {4, 2};
+ int uv_dim[] = {4, 2};
#endif
- srna= RNA_def_struct(brna, "MeshTexturePolyLayer", NULL);
+ srna = RNA_def_struct(brna, "MeshTexturePolyLayer", NULL);
RNA_def_struct_ui_text(srna, "Mesh UV Map", "UV map with assigned image textures in a Mesh datablock");
RNA_def_struct_sdna(srna, "CustomDataLayer");
RNA_def_struct_path_func(srna, "rna_MeshTexturePolyLayer_path");
RNA_def_struct_ui_icon(srna, ICON_GROUP_UVS);
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_struct_name_property(srna, prop);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshTexturePolyLayer_name_set");
RNA_def_property_ui_text(prop, "Name", "Name of UV map");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_MeshTexturePolyLayer_active_get", "rna_MeshTexturePolyLayer_active_set");
RNA_def_property_ui_text(prop, "Active", "Set the map as active for display and editing");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0);
- RNA_def_property_boolean_funcs(prop, "rna_MeshTexturePolyLayer_active_render_get", "rna_MeshTexturePolyLayer_active_render_set");
+ RNA_def_property_boolean_funcs(prop, "rna_MeshTexturePolyLayer_active_render_get",
+ "rna_MeshTexturePolyLayer_active_render_set");
RNA_def_property_ui_text(prop, "Active Render", "Set the map as active for rendering");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "active_clone", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "active_clone", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "active_clone", 0);
RNA_def_property_boolean_funcs(prop, "rna_MeshTexturePolyLayer_clone_get", "rna_MeshTexturePolyLayer_clone_set");
RNA_def_property_ui_text(prop, "Active Clone", "Set the map as active for cloning");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MeshTexturePoly");
RNA_def_property_ui_text(prop, "Data", "");
- RNA_def_property_collection_funcs(prop, "rna_MeshTexturePolyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshTexturePolyLayer_data_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_MeshTexturePolyLayer_data_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_get",
+ "rna_MeshTexturePolyLayer_data_length", NULL, NULL, NULL);
- srna= RNA_def_struct(brna, "MeshTexturePoly", NULL);
+ srna = RNA_def_struct(brna, "MeshTexturePoly", NULL);
RNA_def_struct_sdna(srna, "MTexPoly");
RNA_def_struct_ui_text(srna, "Mesh UV Map Face", "UV map and image texture for a face");
RNA_def_struct_path_func(srna, "rna_MeshTexturePoly_path");
RNA_def_struct_ui_icon(srna, ICON_FACESEL_HLT);
- prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tpage");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_TextureFace_image_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_TexturePoly_image_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "select_uv", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TF_SEL1);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "UV Selected", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
#if 0 /* moved to MeshUVLoopLayer */
- prop= RNA_def_property(srna, "pin_uv", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "pin_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "unwrap", TF_PIN1);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "UV Pinned", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_select");
- prop= RNA_def_property(srna, "uv_raw", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_raw", PROP_FLOAT, PROP_NONE);
RNA_def_property_multi_array(prop, 2, uv_dim);
RNA_def_property_float_sdna(prop, NULL, "uv");
RNA_def_property_ui_text(prop, "UV", "Fixed size UV coordinates array");
@@ -1738,12 +1805,12 @@ static void rna_def_msticky(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MeshSticky", NULL);
+ srna = RNA_def_struct(brna, "MeshSticky", NULL);
RNA_def_struct_sdna(srna, "MSticky");
RNA_def_struct_ui_text(srna, "Mesh Vertex Sticky Texture Coordinate", "Stricky texture coordinate");
RNA_def_struct_path_func(srna, "rna_MeshSticky_path");
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
RNA_def_property_ui_text(prop, "Location", "Sticky texture coordinate location");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
}
@@ -1753,61 +1820,64 @@ static void rna_def_mcol(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MeshColorLayer", NULL);
+ srna = RNA_def_struct(brna, "MeshColorLayer", NULL);
RNA_def_struct_ui_text(srna, "Mesh Vertex Color Layer", "Layer of vertex colors in a Mesh datablock");
RNA_def_struct_sdna(srna, "CustomDataLayer");
RNA_def_struct_path_func(srna, "rna_MeshColorLayer_path");
RNA_def_struct_ui_icon(srna, ICON_GROUP_VCOL);
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_struct_name_property(srna, prop);
RNA_def_property_string_funcs(prop, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Name", "Name of Vertex color layer");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_MeshColorLayer_active_get", "rna_MeshColorLayer_active_set");
RNA_def_property_ui_text(prop, "Active", "Sets the layer as active for display and editing");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0);
- RNA_def_property_boolean_funcs(prop, "rna_MeshColorLayer_active_render_get", "rna_MeshColorLayer_active_render_set");
+ RNA_def_property_boolean_funcs(prop, "rna_MeshColorLayer_active_render_get",
+ "rna_MeshColorLayer_active_render_set");
RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MeshColor");
RNA_def_property_ui_text(prop, "Data", "");
- RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshColorLayer_data_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_get",
+ "rna_MeshColorLayer_data_length", NULL, NULL, NULL);
- srna= RNA_def_struct(brna, "MeshColor", NULL);
+ srna = RNA_def_struct(brna, "MeshColor", NULL);
RNA_def_struct_sdna(srna, "MCol");
RNA_def_struct_ui_text(srna, "Mesh Vertex Color", "Vertex colors for a face in a Mesh");
RNA_def_struct_path_func(srna, "rna_MeshColor_path");
- prop= RNA_def_property(srna, "color1", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "color1", PROP_FLOAT, PROP_COLOR);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_float_funcs(prop, "rna_MeshColor_color1_get", "rna_MeshColor_color1_set", NULL);
RNA_def_property_ui_text(prop, "Color 1", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "color2", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "color2", PROP_FLOAT, PROP_COLOR);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_float_funcs(prop, "rna_MeshColor_color2_get", "rna_MeshColor_color2_set", NULL);
RNA_def_property_ui_text(prop, "Color 2", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "color3", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "color3", PROP_FLOAT, PROP_COLOR);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_float_funcs(prop, "rna_MeshColor_color3_get", "rna_MeshColor_color3_set", NULL);
RNA_def_property_ui_text(prop, "Color 3", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "color4", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "color4", PROP_FLOAT, PROP_COLOR);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_float_funcs(prop, "rna_MeshColor_color4_get", "rna_MeshColor_color4_set", NULL);
@@ -1820,41 +1890,44 @@ static void rna_def_mloopcol(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MeshLoopColorLayer", NULL);
+ srna = RNA_def_struct(brna, "MeshLoopColorLayer", NULL);
RNA_def_struct_ui_text(srna, "Mesh Vertex Color Layer", "Layer of vertex colors in a Mesh datablock");
RNA_def_struct_sdna(srna, "CustomDataLayer");
RNA_def_struct_path_func(srna, "rna_MeshLoopColorLayer_path");
RNA_def_struct_ui_icon(srna, ICON_GROUP_VCOL);
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_struct_name_property(srna, prop);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshLoopColorLayer_name_set");
RNA_def_property_ui_text(prop, "Name", "Name of Vertex color layer");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_MeshLoopColorLayer_active_get", "rna_MeshLoopColorLayer_active_set");
RNA_def_property_ui_text(prop, "Active", "Sets the layer as active for display and editing");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0);
- RNA_def_property_boolean_funcs(prop, "rna_MeshLoopColorLayer_active_render_get", "rna_MeshLoopColorLayer_active_render_set");
+ RNA_def_property_boolean_funcs(prop, "rna_MeshLoopColorLayer_active_render_get",
+ "rna_MeshLoopColorLayer_active_render_set");
RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MeshLoopColor");
RNA_def_property_ui_text(prop, "Data", "");
- RNA_def_property_collection_funcs(prop, "rna_MeshLoopColorLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshLoopColorLayer_data_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_MeshLoopColorLayer_data_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_get",
+ "rna_MeshLoopColorLayer_data_length", NULL, NULL, NULL);
- srna= RNA_def_struct(brna, "MeshLoopColor", NULL);
+ srna = RNA_def_struct(brna, "MeshLoopColor", NULL);
RNA_def_struct_sdna(srna, "MLoopCol");
RNA_def_struct_ui_text(srna, "Mesh Vertex Color", "Vertex loop colors in a Mesh");
RNA_def_struct_path_func(srna, "rna_MeshColor_path");
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_float_funcs(prop, "rna_MeshLoopColor_color_get", "rna_MeshLoopColor_color_set", NULL);
@@ -1868,80 +1941,89 @@ static void rna_def_mproperties(BlenderRNA *brna)
PropertyRNA *prop;
/* Float */
- srna= RNA_def_struct(brna, "MeshFloatPropertyLayer", NULL);
+ srna = RNA_def_struct(brna, "MeshFloatPropertyLayer", NULL);
RNA_def_struct_sdna(srna, "CustomDataLayer");
RNA_def_struct_ui_text(srna, "Mesh Float Property Layer", "User defined layer of floating pointer number values");
RNA_def_struct_path_func(srna, "rna_MeshFloatPropertyLayer_path");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_struct_name_property(srna, prop);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MeshFloatProperty");
RNA_def_property_ui_text(prop, "Data", "");
- RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshFloatPropertyLayer_data_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_get",
+ "rna_MeshFloatPropertyLayer_data_length", NULL, NULL, NULL);
- srna= RNA_def_struct(brna, "MeshFloatProperty", NULL);
+ srna = RNA_def_struct(brna, "MeshFloatProperty", NULL);
RNA_def_struct_sdna(srna, "MFloatProperty");
- RNA_def_struct_ui_text(srna, "Mesh Float Property", "User defined floating point number value in a float properties layer");
+ RNA_def_struct_ui_text(srna, "Mesh Float Property",
+ "User defined floating point number value in a float properties layer");
RNA_def_struct_path_func(srna, "rna_MeshFloatProperty_path");
- prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f");
RNA_def_property_ui_text(prop, "Value", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
/* Int */
- srna= RNA_def_struct(brna, "MeshIntPropertyLayer", NULL);
+ srna = RNA_def_struct(brna, "MeshIntPropertyLayer", NULL);
RNA_def_struct_sdna(srna, "CustomDataLayer");
RNA_def_struct_ui_text(srna, "Mesh Int Property Layer", "User defined layer of integer number values");
RNA_def_struct_path_func(srna, "rna_MeshIntPropertyLayer_path");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_struct_name_property(srna, prop);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MeshIntProperty");
RNA_def_property_ui_text(prop, "Data", "");
- RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshIntPropertyLayer_data_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_get",
+ "rna_MeshIntPropertyLayer_data_length", NULL, NULL, NULL);
- srna= RNA_def_struct(brna, "MeshIntProperty", NULL);
+ srna = RNA_def_struct(brna, "MeshIntProperty", NULL);
RNA_def_struct_sdna(srna, "MIntProperty");
- RNA_def_struct_ui_text(srna, "Mesh Int Property", "User defined integer number value in an integer properties layer");
+ RNA_def_struct_ui_text(srna, "Mesh Int Property",
+ "User defined integer number value in an integer properties layer");
RNA_def_struct_path_func(srna, "rna_MeshIntProperty_path");
- prop= RNA_def_property(srna, "value", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "value", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "i");
RNA_def_property_ui_text(prop, "Value", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
/* String */
- srna= RNA_def_struct(brna, "MeshStringPropertyLayer", NULL);
+ srna = RNA_def_struct(brna, "MeshStringPropertyLayer", NULL);
RNA_def_struct_sdna(srna, "CustomDataLayer");
RNA_def_struct_ui_text(srna, "Mesh String Property Layer", "User defined layer of string text values");
RNA_def_struct_path_func(srna, "rna_MeshStringPropertyLayer_path");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_struct_name_property(srna, prop);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MeshStringProperty");
RNA_def_property_ui_text(prop, "Data", "");
- RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshStringPropertyLayer_data_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_get",
+ "rna_MeshStringPropertyLayer_data_length", NULL, NULL, NULL);
- srna= RNA_def_struct(brna, "MeshStringProperty", NULL);
+ srna = RNA_def_struct(brna, "MeshStringProperty", NULL);
RNA_def_struct_sdna(srna, "MStringProperty");
- RNA_def_struct_ui_text(srna, "Mesh String Property", "User defined string text value in a string properties layer");
+ RNA_def_struct_ui_text(srna, "Mesh String Property",
+ "User defined string text value in a string properties layer");
RNA_def_struct_path_func(srna, "rna_MeshStringProperty_path");
/* low level mesh data access, treat as bytes */
- prop= RNA_def_property(srna, "value", PROP_STRING, PROP_BYTESTRING);
+ prop = RNA_def_property(srna, "value", PROP_STRING, PROP_BYTESTRING);
RNA_def_property_string_sdna(prop, NULL, "s");
RNA_def_property_ui_text(prop, "Value", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
@@ -1952,31 +2034,32 @@ void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable)
PropertyRNA *prop;
/* texture space */
- prop= RNA_def_property(srna, "auto_texspace", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "auto_texspace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", ME_AUTOSPACE);
- RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjust active object's texture space automatically when transforming object");
+ RNA_def_property_ui_text(prop, "Auto Texture Space",
+ "Adjust active object's texture space automatically when transforming object");
- prop= RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Texure Space Location", "Texture space location");
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size");
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
/* not supported yet
- prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
+ prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
RNA_def_property_float(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");*/
/* materials */
- prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_ui_text(prop, "Materials", "");
@@ -1990,21 +2073,21 @@ void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable)
static void rna_def_mesh_vertices(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
-// PropertyRNA *prop;
+/* PropertyRNA *prop; */
FunctionRNA *func;
-// PropertyRNA *parm;
+/* PropertyRNA *parm; */
RNA_def_property_srna(cprop, "MeshVertices");
- srna= RNA_def_struct(brna, "MeshVertices", NULL);
+ srna = RNA_def_struct(brna, "MeshVertices", NULL);
RNA_def_struct_sdna(srna, "Mesh");
RNA_def_struct_ui_text(srna, "Mesh Vertices", "Collection of mesh vertices");
- func= RNA_def_function(srna, "add", "ED_mesh_vertices_add");
+ func = RNA_def_function(srna, "add", "ED_mesh_vertices_add");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add", 0, INT_MAX);
-#if 0 // Remove until BMesh merge
- func= RNA_def_function(srna, "remove", "ED_mesh_vertices_remove");
+#if 0 /* BMESH_TODO Remove until BMesh merge */
+ func = RNA_def_function(srna, "remove", "ED_mesh_vertices_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to remove", 0, INT_MAX);
#endif
@@ -2014,21 +2097,21 @@ static void rna_def_mesh_vertices(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_mesh_edges(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
-// PropertyRNA *prop;
+/* PropertyRNA *prop; */
FunctionRNA *func;
-// PropertyRNA *parm;
+/* PropertyRNA *parm; */
RNA_def_property_srna(cprop, "MeshEdges");
- srna= RNA_def_struct(brna, "MeshEdges", NULL);
+ srna = RNA_def_struct(brna, "MeshEdges", NULL);
RNA_def_struct_sdna(srna, "Mesh");
RNA_def_struct_ui_text(srna, "Mesh Edges", "Collection of mesh edges");
- func= RNA_def_function(srna, "add", "ED_mesh_edges_add");
+ func = RNA_def_function(srna, "add", "ED_mesh_edges_add");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of edges to add", 0, INT_MAX);
-#if 0 // Remove until BMesh merge
- func= RNA_def_function(srna, "remove", "ED_mesh_edges_remove");
+#if 0 /* BMESH_TODO Remove until BMesh merge */
+ func = RNA_def_function(srna, "remove", "ED_mesh_edges_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of edges to remove", 0, INT_MAX);
#endif
@@ -2041,22 +2124,22 @@ static void rna_def_mesh_faces(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
FunctionRNA *func;
-// PropertyRNA *parm;
+/* PropertyRNA *parm; */
RNA_def_property_srna(cprop, "MeshFaces");
- srna= RNA_def_struct(brna, "MeshFaces", NULL);
+ srna = RNA_def_struct(brna, "MeshFaces", NULL);
RNA_def_struct_sdna(srna, "Mesh");
RNA_def_struct_ui_text(srna, "Mesh Faces", "Collection of mesh faces");
- prop= RNA_def_property(srna, "active", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "act_face");
RNA_def_property_ui_text(prop, "Active Face", "The active face for this mesh");
- func= RNA_def_function(srna, "add", "ED_mesh_faces_add");
+ func = RNA_def_function(srna, "add", "ED_mesh_faces_add");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of faces to add", 0, INT_MAX);
-#if 0 // Remove until BMesh merge
- func= RNA_def_function(srna, "remove", "ED_mesh_faces_remove");
+#if 0 /* BMESH_TODO Remove until BMesh merge */
+ func = RNA_def_function(srna, "remove", "ED_mesh_faces_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of faces to remove", 0, INT_MAX);
#endif
@@ -2073,17 +2156,17 @@ static void rna_def_mesh_loops(BlenderRNA *brna, PropertyRNA *cprop)
/*PropertyRNA *parm;*/
RNA_def_property_srna(cprop, "MeshLoops");
- srna= RNA_def_struct(brna, "MeshLoops", NULL);
+ srna = RNA_def_struct(brna, "MeshLoops", NULL);
RNA_def_struct_sdna(srna, "Mesh");
RNA_def_struct_ui_text(srna, "Mesh Loops", "Collection of mesh loops");
-#if 0 // BMESH_TODO
- prop= RNA_def_property(srna, "active", PROP_INT, PROP_NONE);
+#if 0 /* BMESH_TODO */
+ prop = RNA_def_property(srna, "active", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "act_face");
RNA_def_property_ui_text(prop, "Active Polygon", "The active polygon for this mesh");
#endif
- func= RNA_def_function(srna, "add", "ED_mesh_loops_add");
+ func = RNA_def_function(srna, "add", "ED_mesh_loops_add");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of loops to add", 0, INT_MAX);
}
@@ -2096,18 +2179,18 @@ static void rna_def_mesh_polygons(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
FunctionRNA *func;
- //PropertyRNA *parm;
+ /* PropertyRNA *parm; */
RNA_def_property_srna(cprop, "MeshPolygons");
- srna= RNA_def_struct(brna, "MeshPolygons", NULL);
+ srna = RNA_def_struct(brna, "MeshPolygons", NULL);
RNA_def_struct_sdna(srna, "Mesh");
RNA_def_struct_ui_text(srna, "Mesh Polygons", "Collection of mesh polygons");
- prop= RNA_def_property(srna, "active", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "act_face");
RNA_def_property_ui_text(prop, "Active Polygon", "The active polygon for this mesh");
- func= RNA_def_function(srna, "add", "ED_mesh_polys_add");
+ func = RNA_def_function(srna, "add", "ED_mesh_polys_add");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of polygons to add", 0, INT_MAX);
}
@@ -2119,22 +2202,24 @@ static void rna_def_tessface_vertex_colors(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna;
PropertyRNA *prop;
- //FunctionRNA *func;
- //PropertyRNA *parm;
+ /* FunctionRNA *func; */
+ /* PropertyRNA *parm; */
RNA_def_property_srna(cprop, "VertexColors");
- srna= RNA_def_struct(brna, "VertexColors", NULL);
+ srna = RNA_def_struct(brna, "VertexColors", NULL);
RNA_def_struct_sdna(srna, "Mesh");
RNA_def_struct_ui_text(srna, "Vertex Colors", "Collection of vertex colors");
-
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
+
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "MeshColorLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_tessface_vertex_color_active_get", "rna_Mesh_tessface_vertex_color_active_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_tessface_vertex_color_active_get",
+ "rna_Mesh_tessface_vertex_color_active_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Active Vertex Color Layer", "Active vertex color layer");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_tessface_vertex_color_active_index_get", "rna_Mesh_tessface_vertex_color_active_index_set", "rna_Mesh_vertex_color_index_range");
+
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Mesh_tessface_vertex_color_active_index_get",
+ "rna_Mesh_tessface_vertex_color_active_index_set", "rna_Mesh_vertex_color_index_range");
RNA_def_property_ui_text(prop, "Active Vertex Color Index", "Active vertex color index");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
}
@@ -2148,34 +2233,36 @@ static void rna_def_loop_colors(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "LoopColors");
- srna= RNA_def_struct(brna, "LoopColors", NULL);
+ srna = RNA_def_struct(brna, "LoopColors", NULL);
RNA_def_struct_sdna(srna, "Mesh");
RNA_def_struct_ui_text(srna, "Loop Colors", "Collection of vertex colors");
-
- func= RNA_def_function(srna, "new", "rna_Mesh_vertex_color_new");
+
+ func = RNA_def_function(srna, "new", "rna_Mesh_vertex_color_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Add a vertex color layer to Mesh");
RNA_def_string(func, "name", "Col", 0, "", "Vertex color name");
- parm= RNA_def_pointer(func, "layer", "MeshLoopColorLayer", "", "The newly created layer");
+ parm = RNA_def_pointer(func, "layer", "MeshLoopColorLayer", "", "The newly created layer");
RNA_def_property_flag(parm, PROP_RNAPTR);
RNA_def_function_return(func, parm);
-
+
/*
- func= RNA_def_function(srna, "remove", "rna_Mesh_vertex_color_remove");
+ func = RNA_def_function(srna, "remove", "rna_Mesh_vertex_color_remove");
RNA_def_function_ui_description(func, "Remove a vertex color layer");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove");
+ parm = RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
*/
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "MeshLoopColorLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_vertex_color_active_get", "rna_Mesh_vertex_color_active_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_vertex_color_active_get",
+ "rna_Mesh_vertex_color_active_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Vertex Color Layer", "Active vertex color layer");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_vertex_color_active_index_get", "rna_Mesh_vertex_color_active_index_set", "rna_Mesh_vertex_color_index_range");
+
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Mesh_vertex_color_active_index_get",
+ "rna_Mesh_vertex_color_active_index_set", "rna_Mesh_vertex_color_index_range");
RNA_def_property_ui_text(prop, "Active Vertex Color Index", "Active vertex color index");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
}
@@ -2185,23 +2272,25 @@ static void rna_def_uv_loop_layers(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna;
PropertyRNA *prop;
- //FunctionRNA *func;
- //PropertyRNA *parm;
+ /* FunctionRNA *func; */
+ /* PropertyRNA *parm; */
RNA_def_property_srna(cprop, "UVLoopLayers");
- srna= RNA_def_struct(brna, "UVLoopLayers", NULL);
+ srna = RNA_def_struct(brna, "UVLoopLayers", NULL);
RNA_def_struct_sdna(srna, "Mesh");
RNA_def_struct_ui_text(srna, "UV Loop Layers", "Collection of uv loop layers");
-
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
+
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "MeshUVLoopLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_loop_layer_active_get", "rna_Mesh_uv_loop_layer_active_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_loop_layer_active_get",
+ "rna_Mesh_uv_loop_layer_active_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active UV loop layer", "Active UV loop layer");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_uv_loop_layer_active_index_get", "rna_Mesh_uv_loop_layer_active_index_set", "rna_Mesh_uv_loop_layer_index_range");
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Mesh_uv_loop_layer_active_index_get",
+ "rna_Mesh_uv_loop_layer_active_index_set", "rna_Mesh_uv_loop_layer_index_range");
RNA_def_property_ui_text(prop, "Active UV loop layer Index", "Active UV loop layer index");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
}
@@ -2215,15 +2304,15 @@ static void rna_def_int_layers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "IntProperties");
- srna= RNA_def_struct(brna, "IntProperties", NULL);
+ srna = RNA_def_struct(brna, "IntProperties", NULL);
RNA_def_struct_sdna(srna, "Mesh");
RNA_def_struct_ui_text(srna, "Int Properties", "Collection of int properties");
- func= RNA_def_function(srna, "new", "rna_Mesh_int_property_new");
+ func = RNA_def_function(srna, "new", "rna_Mesh_int_property_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Add a integer property layer to Mesh");
RNA_def_string(func, "name", "Int Prop", 0, "", "Int property name");
- parm= RNA_def_pointer(func, "layer", "MeshIntPropertyLayer", "", "The newly created layer");
+ parm = RNA_def_pointer(func, "layer", "MeshIntPropertyLayer", "", "The newly created layer");
RNA_def_property_flag(parm, PROP_RNAPTR);
RNA_def_function_return(func, parm);
}
@@ -2237,15 +2326,15 @@ static void rna_def_float_layers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "FloatProperties");
- srna= RNA_def_struct(brna, "FloatProperties", NULL);
+ srna = RNA_def_struct(brna, "FloatProperties", NULL);
RNA_def_struct_sdna(srna, "Mesh");
RNA_def_struct_ui_text(srna, "Float Properties", "Collection of float properties");
- func= RNA_def_function(srna, "new", "rna_Mesh_float_property_new");
+ func = RNA_def_function(srna, "new", "rna_Mesh_float_property_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Add a float property layer to Mesh");
RNA_def_string(func, "name", "Float Prop", 0, "", "Float property name");
- parm= RNA_def_pointer(func, "layer", "MeshFloatPropertyLayer", "", "The newly created layer");
+ parm = RNA_def_pointer(func, "layer", "MeshFloatPropertyLayer", "", "The newly created layer");
RNA_def_property_flag(parm, PROP_RNAPTR);
RNA_def_function_return(func, parm);
}
@@ -2259,15 +2348,15 @@ static void rna_def_string_layers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "StringProperties");
- srna= RNA_def_struct(brna, "StringProperties", NULL);
+ srna = RNA_def_struct(brna, "StringProperties", NULL);
RNA_def_struct_sdna(srna, "Mesh");
RNA_def_struct_ui_text(srna, "String Properties", "Collection of string properties");
- func= RNA_def_function(srna, "new", "rna_Mesh_string_property_new");
+ func = RNA_def_function(srna, "new", "rna_Mesh_string_property_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Add a string property layer to Mesh");
RNA_def_string(func, "name", "String Prop", 0, "", "String property name");
- parm= RNA_def_pointer(func, "layer", "MeshStringPropertyLayer", "", "The newly created layer");
+ parm = RNA_def_pointer(func, "layer", "MeshStringPropertyLayer", "", "The newly created layer");
RNA_def_property_flag(parm, PROP_RNAPTR);
RNA_def_function_return(func, parm);
}
@@ -2278,22 +2367,34 @@ static void rna_def_tessface_uv_textures(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna;
PropertyRNA *prop;
- //FunctionRNA *func;
- //PropertyRNA *parm;
+ FunctionRNA *func;
+ PropertyRNA *parm;
RNA_def_property_srna(cprop, "TessfaceUVTextures");
- srna= RNA_def_struct(brna, "TessfaceUVTextures", NULL);
+ srna = RNA_def_struct(brna, "TessfaceUVTextures", NULL);
RNA_def_struct_sdna(srna, "Mesh");
- RNA_def_struct_ui_text(srna, "UV Maps", "Collection of UV maps for tesselated faces");
-
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
+ RNA_def_struct_ui_text(srna, "UV Maps", "Collection of UV maps for tessellated faces");
+
+ /* eventually deprecate this */
+ func= RNA_def_function(srna, "new", "rna_Mesh_uv_tessface_texture_new");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Add a UV tessface-texture layer to Mesh (only for meshes with no polygons)");
+ RNA_def_string(func, "name", "UVMap", 0, "", "UV map name");
+ parm= RNA_def_pointer(func, "layer", "MeshTextureFaceLayer", "", "The newly created layer");
+ RNA_def_property_flag(parm, PROP_RNAPTR);
+ RNA_def_function_return(func, parm);
+
+
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_tessface_uv_texture_active_get", "rna_Mesh_tessface_uv_texture_active_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_tessface_uv_texture_active_get",
+ "rna_Mesh_tessface_uv_texture_active_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Active UV Map", "Active UV Map");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_tessface_uv_texture_active_index_get", "rna_Mesh_tessface_uv_texture_active_index_set", "rna_Mesh_uv_texture_index_range");
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Mesh_tessface_uv_texture_active_index_get",
+ "rna_Mesh_tessface_uv_texture_active_index_set", "rna_Mesh_uv_texture_index_range");
RNA_def_property_ui_text(prop, "Active UV Map Index", "Active UV Map index");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
}
@@ -2308,34 +2409,36 @@ static void rna_def_uv_textures(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "UVTextures");
- srna= RNA_def_struct(brna, "UVTextures", NULL);
+ srna = RNA_def_struct(brna, "UVTextures", NULL);
RNA_def_struct_sdna(srna, "Mesh");
RNA_def_struct_ui_text(srna, "UV Maps", "Collection of UV maps");
-
- func= RNA_def_function(srna, "new", "rna_Mesh_uv_texture_new");
+
+ func = RNA_def_function(srna, "new", "rna_Mesh_uv_texture_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Add a UV map layer to Mesh");
RNA_def_string(func, "name", "UVMap", 0, "", "UV map name");
- parm= RNA_def_pointer(func, "layer", "MeshTexturePolyLayer", "", "The newly created layer");
+ parm = RNA_def_pointer(func, "layer", "MeshTexturePolyLayer", "", "The newly created layer");
RNA_def_property_flag(parm, PROP_RNAPTR);
RNA_def_function_return(func, parm);
/*
- func= RNA_def_function(srna, "remove", "rna_Mesh_uv_layers_remove");
+ func = RNA_def_function(srna, "remove", "rna_Mesh_uv_layers_remove");
RNA_def_function_ui_description(func, "Remove a vertex color layer");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove");
+ parm = RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
*/
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "MeshTexturePolyLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_active_get", "rna_Mesh_uv_texture_active_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_active_get",
+ "rna_Mesh_uv_texture_active_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active UV Map", "Active UV Map");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_uv_texture_active_index_get", "rna_Mesh_uv_texture_active_index_set", "rna_Mesh_uv_texture_index_range");
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Mesh_uv_texture_active_index_get",
+ "rna_Mesh_uv_texture_active_index_set", "rna_Mesh_uv_texture_index_range");
RNA_def_property_ui_text(prop, "Active UV Map Index", "Active UV Map index");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
}
@@ -2345,53 +2448,54 @@ static void rna_def_mesh(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Mesh", "ID");
+ srna = RNA_def_struct(brna, "Mesh", "ID");
RNA_def_struct_ui_text(srna, "Mesh", "Mesh datablock defining geometric surfaces");
RNA_def_struct_ui_icon(srna, ICON_MESH_DATA);
- prop= RNA_def_property(srna, "vertices", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "vertices", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mvert", "totvert");
RNA_def_property_struct_type(prop, "MeshVertex");
RNA_def_property_ui_text(prop, "Vertices", "Vertices of the mesh");
rna_def_mesh_vertices(brna, prop);
- prop= RNA_def_property(srna, "edges", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "edges", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "medge", "totedge");
RNA_def_property_struct_type(prop, "MeshEdge");
RNA_def_property_ui_text(prop, "Edges", "Edges of the mesh");
rna_def_mesh_edges(brna, prop);
- prop= RNA_def_property(srna, "faces", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "faces", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mface", "totface");
RNA_def_property_struct_type(prop, "MeshFace");
RNA_def_property_ui_text(prop, "Faces", "Faces of the mesh");
rna_def_mesh_faces(brna, prop);
- prop= RNA_def_property(srna, "loops", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "loops", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mloop", "totloop");
RNA_def_property_struct_type(prop, "MeshLoop");
RNA_def_property_ui_text(prop, "Loops", "Loops of the mesh");
rna_def_mesh_loops(brna, prop);
- prop= RNA_def_property(srna, "polygons", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "polygons", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mpoly", "totpoly");
RNA_def_property_struct_type(prop, "MeshPolygon");
RNA_def_property_ui_text(prop, "Polygons", "Polygons of the mesh");
rna_def_mesh_polygons(brna, prop);
- prop= RNA_def_property(srna, "sticky", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "sticky", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "msticky", "totvert");
RNA_def_property_struct_type(prop, "MeshSticky");
RNA_def_property_ui_text(prop, "Sticky", "Sticky texture coordinates");
/* TODO, should this be allowed to be its self? */
- prop= RNA_def_property(srna, "texture_mesh", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_mesh", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "texcomesh");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
- RNA_def_property_ui_text(prop, "Texture Mesh", "Use another mesh for texture indices (vertex indices must be aligned)");
+ RNA_def_property_ui_text(prop, "Texture Mesh",
+ "Use another mesh for texture indices (vertex indices must be aligned)");
/* UV loop layers */
- prop= RNA_def_property(srna, "uv_loop_layers", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_loop_layers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "ldata.layers", "ldata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_loop_layers_begin", NULL, NULL, NULL,
"rna_Mesh_uv_loop_layers_length", NULL, NULL, NULL);
@@ -2399,37 +2503,42 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "UV Loop Layers", "All UV loop layers");
rna_def_uv_loop_layers(brna, prop);
- prop= RNA_def_property(srna, "uv_loop_layer_clone", PROP_POINTER, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "uv_loop_layer_clone", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "MeshUVLoopLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_loop_layer_clone_get", "rna_Mesh_uv_loop_layer_clone_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_loop_layer_clone_get",
+ "rna_Mesh_uv_loop_layer_clone_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Clone UV loop layer", "UV loop layer to be used as cloning source");
- prop= RNA_def_property(srna, "uv_loop_layer_clone_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_uv_loop_layer_clone_index_get", "rna_Mesh_uv_loop_layer_clone_index_set", "rna_Mesh_uv_loop_layer_index_range");
+ prop = RNA_def_property(srna, "uv_loop_layer_clone_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Mesh_uv_loop_layer_clone_index_get",
+ "rna_Mesh_uv_loop_layer_clone_index_set", "rna_Mesh_uv_loop_layer_index_range");
RNA_def_property_ui_text(prop, "Clone UV loop layer Index", "Clone UV loop layer index");
- prop= RNA_def_property(srna, "uv_loop_layer_stencil", PROP_POINTER, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "uv_loop_layer_stencil", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "MeshUVLoopLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_loop_layer_stencil_get", "rna_Mesh_uv_loop_layer_stencil_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_loop_layer_stencil_get",
+ "rna_Mesh_uv_loop_layer_stencil_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mask UV loop layer", "UV loop layer to mask the painted area");
- prop= RNA_def_property(srna, "uv_loop_layer_stencil_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_uv_loop_layer_stencil_index_get", "rna_Mesh_uv_loop_layer_stencil_index_set", "rna_Mesh_uv_loop_layer_index_range");
+ prop = RNA_def_property(srna, "uv_loop_layer_stencil_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Mesh_uv_loop_layer_stencil_index_get",
+ "rna_Mesh_uv_loop_layer_stencil_index_set", "rna_Mesh_uv_loop_layer_index_range");
RNA_def_property_ui_text(prop, "Mask UV loop layer Index", "Mask UV loop layer index");
- /* Tesselated face UV maps - used by renderers */
- prop= RNA_def_property(srna, "tessface_uv_textures", PROP_COLLECTION, PROP_NONE);
+ /* Tessellated face UV maps - used by renderers */
+ prop = RNA_def_property(srna, "tessface_uv_textures", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_tessface_uv_textures_begin", NULL, NULL, NULL,
"rna_Mesh_tessface_uv_textures_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
- RNA_def_property_ui_text(prop, "Tesselated Face UV Maps", "All UV maps for tesselated faces (read-only, for use by renderers)");
+ RNA_def_property_ui_text(prop, "Tessellated Face UV Maps",
+ "All UV maps for tessellated faces (read-only, for use by renderers)");
rna_def_tessface_uv_textures(brna, prop);
/* UV maps */
- prop= RNA_def_property(srna, "uv_textures", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_textures", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "pdata.layers", "pdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", NULL, NULL, NULL,
"rna_Mesh_uv_textures_length", NULL, NULL, NULL);
@@ -2437,39 +2546,44 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "UV Maps", "All UV maps");
rna_def_uv_textures(brna, prop);
- prop= RNA_def_property(srna, "uv_texture_clone", PROP_POINTER, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "uv_texture_clone", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "MeshTexturePolyLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_clone_get", "rna_Mesh_uv_texture_clone_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_clone_get",
+ "rna_Mesh_uv_texture_clone_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Clone UV Map", "UV map to be used as cloning source");
- prop= RNA_def_property(srna, "uv_texture_clone_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_uv_texture_clone_index_get", "rna_Mesh_uv_texture_clone_index_set", "rna_Mesh_uv_texture_index_range");
+ prop = RNA_def_property(srna, "uv_texture_clone_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Mesh_uv_texture_clone_index_get",
+ "rna_Mesh_uv_texture_clone_index_set", "rna_Mesh_uv_texture_index_range");
RNA_def_property_ui_text(prop, "Clone UV Map Index", "Clone UV map index");
- prop= RNA_def_property(srna, "uv_texture_stencil", PROP_POINTER, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "uv_texture_stencil", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "MeshTexturePolyLayer");
- RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_stencil_get", "rna_Mesh_uv_texture_stencil_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_stencil_get",
+ "rna_Mesh_uv_texture_stencil_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mask UV Map", "UV map to mask the painted area");
- prop= RNA_def_property(srna, "uv_texture_stencil_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_uv_texture_stencil_index_get", "rna_Mesh_uv_texture_stencil_index_set", "rna_Mesh_uv_texture_index_range");
+ prop = RNA_def_property(srna, "uv_texture_stencil_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Mesh_uv_texture_stencil_index_get",
+ "rna_Mesh_uv_texture_stencil_index_set", "rna_Mesh_uv_texture_index_range");
RNA_def_property_ui_text(prop, "Mask UV Map Index", "Mask UV map index");
- /* Tesselated face colors - used by renderers */
+ /* Tessellated face colors - used by renderers */
- prop= RNA_def_property(srna, "tessface_vertex_colors", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "tessface_vertex_colors", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_tessface_vertex_colors_begin", NULL, NULL, NULL,
"rna_Mesh_tessface_vertex_colors_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshColorLayer");
- RNA_def_property_ui_text(prop, "Tesselated Face Colors", "All tesselated face colors (read-only, for use by renderers)");
+ RNA_def_property_ui_text(prop, "Tessellated Face Colors",
+ "All tessellated face colors (read-only, for use by renderers)");
rna_def_tessface_vertex_colors(brna, prop);
/* Vertex colors */
- prop= RNA_def_property(srna, "vertex_colors", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_colors", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "ldata.layers", "ldata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", NULL, NULL, NULL,
"rna_Mesh_vertex_colors_length", NULL, NULL, NULL);
@@ -2477,7 +2591,7 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertex Colors", "All vertex colors");
rna_def_loop_colors(brna, prop);
- prop= RNA_def_property(srna, "layers_float", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "layers_float", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "pdata.layers", "pdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", NULL, NULL, NULL,
"rna_Mesh_float_layers_length", NULL, NULL, NULL);
@@ -2485,7 +2599,7 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Float Property Layers", "");
rna_def_float_layers(brna, prop);
- prop= RNA_def_property(srna, "layers_int", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "layers_int", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "pdata.layers", "pdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", NULL, NULL, NULL,
"rna_Mesh_int_layers_length", NULL, NULL, NULL);
@@ -2493,7 +2607,7 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Int Property Layers", "");
rna_def_int_layers(brna, prop);
- prop= RNA_def_property(srna, "layers_string", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "layers_string", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "pdata.layers", "pdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", NULL, NULL, NULL,
"rna_Mesh_string_layers_length", NULL, NULL, NULL);
@@ -2501,41 +2615,45 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "String Property Layers", "");
rna_def_string_layers(brna, prop);
- prop= RNA_def_property(srna, "use_auto_smooth", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_smooth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_AUTOSMOOTH);
- RNA_def_property_ui_text(prop, "Auto Smooth", "Treat all set-smoothed faces with angles less than the specified angle as 'smooth' during render");
+ RNA_def_property_ui_text(prop, "Auto Smooth",
+ "Treat all set-smoothed faces with angles less than the specified angle "
+ "as 'smooth' during render");
#if 1 /* expose as radians */
- prop= RNA_def_property(srna, "auto_smooth_angle", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "auto_smooth_angle", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_funcs(prop, "rna_Mesh_auto_smooth_angle_get", "rna_Mesh_auto_smooth_angle_set", NULL);
RNA_def_property_ui_range(prop, DEG2RAD(1.0), DEG2RAD(80), 1.0, 1);
#else
- prop= RNA_def_property(srna, "auto_smooth_angle", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "auto_smooth_angle", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "smoothresh");
RNA_def_property_range(prop, 1, 80);
#endif
- RNA_def_property_ui_text(prop, "Auto Smooth Angle", "Maximum angle between face normals that 'Auto Smooth' will operate on");
+ RNA_def_property_ui_text(prop, "Auto Smooth Angle",
+ "Maximum angle between face normals that 'Auto Smooth' will operate on");
- prop= RNA_def_property(srna, "show_double_sided", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_double_sided", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_TWOSIDED);
RNA_def_property_ui_text(prop, "Double Sided", "Render/display the mesh with double or single sided lighting");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- prop= RNA_def_property(srna, "texco_mesh", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "texco_mesh", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "texcomesh");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture Space Mesh", "Derive texture coordinates from another mesh");
- prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "key");
RNA_def_property_ui_text(prop, "Shape Keys", "");
-
+
/* texture space */
- prop= RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", ME_AUTOSPACE);
- RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjust active object's texture space automatically when transforming object");
+ RNA_def_property_ui_text(prop, "Auto Texture Space",
+ "Adjust active object's texture space automatically when transforming object");
- /*prop= RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
+ /*prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Texture Space Location", "Texture space location");
RNA_def_property_editable_func(prop, "rna_Mesh_texspace_editable");
@@ -2544,7 +2662,7 @@ static void rna_def_mesh(BlenderRNA *brna)
*/
/* not supported yet
- prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
+ prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
RNA_def_property_float(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
RNA_def_property_editable_func(prop, texspace_editable);
@@ -2552,125 +2670,132 @@ static void rna_def_mesh(BlenderRNA *brna)
*/
/* Mesh Draw Options for Edit Mode*/
-
- prop= RNA_def_property(srna, "show_edges", PROP_BOOLEAN, PROP_NONE);
+
+ prop = RNA_def_property(srna, "show_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEDGES);
RNA_def_property_ui_text(prop, "Draw Edges", "Display selected edges using hilights in the 3D view and UV editor");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
-
- prop= RNA_def_property(srna, "show_all_edges", PROP_BOOLEAN, PROP_NONE);
+
+ prop = RNA_def_property(srna, "show_all_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_ALLEDGES);
RNA_def_property_ui_text(prop, "All Edges", "Display all edges for wireframe in all view modes in the 3D view");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWFACES);
RNA_def_property_ui_text(prop, "Draw Faces", "Display all faces as shades in the 3D view and UV editor");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
-
- prop= RNA_def_property(srna, "show_normal_face", PROP_BOOLEAN, PROP_NONE);
+
+ prop = RNA_def_property(srna, "show_normal_face", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWNORMALS);
RNA_def_property_ui_text(prop, "Draw Normals", "Display face normals as lines");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
-
- prop= RNA_def_property(srna, "show_normal_vertex", PROP_BOOLEAN, PROP_NONE);
+
+ prop = RNA_def_property(srna, "show_normal_vertex", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_VNORMALS);
RNA_def_property_ui_text(prop, "Draw Vertex Normals", "Display vertex normals as lines");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
-
- prop= RNA_def_property(srna, "show_edge_crease", PROP_BOOLEAN, PROP_NONE);
+
+ prop = RNA_def_property(srna, "show_edge_crease", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWCREASES);
RNA_def_property_ui_text(prop, "Draw Creases", "Display creases created for subsurf weighting");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
-
- prop= RNA_def_property(srna, "show_edge_bevel_weight", PROP_BOOLEAN, PROP_NONE);
+
+ prop = RNA_def_property(srna, "show_edge_bevel_weight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWBWEIGHTS);
RNA_def_property_ui_text(prop, "Draw Bevel Weights", "Display weights created for the Bevel modifier");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
-
- prop= RNA_def_property(srna, "show_edge_seams", PROP_BOOLEAN, PROP_NONE);
+
+ prop = RNA_def_property(srna, "show_edge_seams", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSEAMS);
RNA_def_property_ui_text(prop, "Draw Seams", "Display UV unwrapping seams");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
-
- prop= RNA_def_property(srna, "show_edge_sharp", PROP_BOOLEAN, PROP_NONE);
+
+ prop = RNA_def_property(srna, "show_edge_sharp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSHARP);
RNA_def_property_ui_text(prop, "Draw Sharp", "Display sharp edges, used with the EdgeSplit modifier");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "show_freestyle_edge_marks", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_freestyle_edge_marks", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_FREESTYLE_EDGE);
RNA_def_property_ui_text(prop, "Draw Freestyle Edge Marks", "Display Freestyle edge marks, used with the Freestyle renderer");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "show_freestyle_face_marks", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_freestyle_face_marks", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_FREESTYLE_FACE);
RNA_def_property_ui_text(prop, "Draw Freestyle Face Marks", "Display Freestyle face marks, used with the Freestyle renderer");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "show_extra_edge_length", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_extra_edge_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_EDGELEN);
- RNA_def_property_ui_text(prop, "Edge Length", "Display selected edge lengths, using global values when set in the transform panel");
+ RNA_def_property_ui_text(prop, "Edge Length",
+ "Display selected edge lengths, using global values when set in the transform panel");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
-
- prop= RNA_def_property(srna, "show_extra_face_angle", PROP_BOOLEAN, PROP_NONE);
+
+ prop = RNA_def_property(srna, "show_extra_face_angle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_FACEANG);
- RNA_def_property_ui_text(prop, "Face Angles", "Display the angles in the selected edges in degrees, using global values when set in the transform panel");
+ RNA_def_property_ui_text(prop, "Face Angles",
+ "Display the angles in the selected edges in degrees, "
+ "using global values when set in the transform panel");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
-
- prop= RNA_def_property(srna, "show_extra_face_area", PROP_BOOLEAN, PROP_NONE);
+
+ prop = RNA_def_property(srna, "show_extra_face_area", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_FACEAREA);
- RNA_def_property_ui_text(prop, "Face Area", "Display the area of selected faces, using global values when set in the transform panel");
+ RNA_def_property_ui_text(prop, "Face Area",
+ "Display the area of selected faces, "
+ "using global values when set in the transform panel");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
- prop= RNA_def_property(srna, "show_extra_indices", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_extra_indices", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_INDICES);
RNA_def_property_ui_text(prop, "Indices", "Display the index numbers of selected vertices, edges, and faces");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
/* editflag */
- prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_X);
RNA_def_property_ui_text(prop, "X Mirror", "X Axis mirror editing");
/*
- prop= RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Y);
RNA_def_property_ui_text(prop, "Y Mirror", "Y Axis mirror editing");
- prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Z);
RNA_def_property_ui_text(prop, "Z Mirror", "Z Axis mirror editing");
*/
- prop= RNA_def_property(srna, "use_mirror_topology", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mirror_topology", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_TOPO);
- RNA_def_property_ui_text(prop, "Topology Mirror", "Use topology based mirroring (for when both sides of mesh have matching, unique topology)");
+ RNA_def_property_ui_text(prop, "Topology Mirror",
+ "Use topology based mirroring "
+ "(for when both sides of mesh have matching, unique topology)");
- prop= RNA_def_property(srna, "use_paint_mask", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_paint_mask", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_PAINT_MASK);
RNA_def_property_ui_text(prop, "Paint Mask", "Face selection masking for painting");
RNA_def_property_ui_icon(prop, ICON_FACESEL_HLT, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Mesh_update_facemask");
-
- prop= RNA_def_property(srna, "use_paint_mask_vertex", PROP_BOOLEAN, PROP_NONE);
+
+ prop = RNA_def_property(srna, "use_paint_mask_vertex", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_VERT_SEL);
RNA_def_property_ui_text(prop, "Vertex Selection", "Vertex selection masking for painting (weight paint only)");
RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Mesh_update_vertmask");
/* readonly editmesh info - use for extrude menu */
- prop= RNA_def_property(srna, "total_vert_sel", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "total_vert_sel", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_Mesh_tot_vert_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Selected Vert Total", "Selected vertex count in editmode");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "total_edge_sel", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "total_edge_sel", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_Mesh_tot_edge_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Selected Edge Total", "Selected edge count in editmode");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "total_face_sel", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "total_face_sel", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_Mesh_tot_face_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Selected Face Total", "Selected face count in editmode");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c
index 988eaccadb2..b58f568309a 100644
--- a/source/blender/makesrna/intern/rna_mesh_api.c
+++ b/source/blender/makesrna/intern/rna_mesh_api.c
@@ -57,31 +57,31 @@ void RNA_api_mesh(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "transform", "ED_mesh_transform");
+ func = RNA_def_function(srna, "transform", "ED_mesh_transform");
RNA_def_function_ui_description(func, "Transform mesh vertices by a matrix");
- parm= RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f);
+ parm = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f);
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "calc_normals", "ED_mesh_calc_normals");
+ func = RNA_def_function(srna, "calc_normals", "ED_mesh_calc_normals");
RNA_def_function_ui_description(func, "Calculate vertex normals");
- func= RNA_def_function(srna, "update", "ED_mesh_update");
+ 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");
- parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to compare to");
+ func = RNA_def_function(srna, "unit_test_compare", "rna_Mesh_unit_test_compare");
+ parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to compare to");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
/* return value */
- parm= RNA_def_string(func, "result", "nothing", 64, "Return value", "String description of result of comparison");
+ parm = RNA_def_string(func, "result", "nothing", 64, "Return value", "String description of result of comparison");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "validate", "BKE_mesh_validate");
+ func = RNA_def_function(srna, "validate", "BKE_mesh_validate");
RNA_def_function_ui_description(func, "validate geometry, return True when the mesh has had "
"invalid geometry corrected/removed");
RNA_def_boolean(func, "verbose", 0, "Verbose", "Output information about the errors found");
- parm= RNA_def_boolean(func, "result", 0, "Result", "");
+ parm = RNA_def_boolean(func, "result", 0, "Result", "");
RNA_def_function_return(func, parm);
}
diff --git a/source/blender/makesrna/intern/rna_mesh_utils.h b/source/blender/makesrna/intern/rna_mesh_utils.h
index b946089b8d2..9b67ad61470 100644
--- a/source/blender/makesrna/intern/rna_mesh_utils.h
+++ b/source/blender/makesrna/intern/rna_mesh_utils.h
@@ -35,77 +35,99 @@
/* Macros to help reduce code clutter in rna_mesh.c */
/* Define the accessors for a basic CustomDataLayer collection */
-#define DEFINE_CUSTOMDATA_LAYER_COLLECTION(collection_name, customdata_type, layer_type) \
- \
- static int rna_##collection_name##_check(CollectionPropertyIterator *iter, void *data) \
- { \
- CustomDataLayer *layer= (CustomDataLayer*)data; \
- return (layer->type != layer_type); \
- } \
- \
- static void rna_Mesh_##collection_name##s_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) \
- { \
- CustomData *data = rna_mesh_##customdata_type(ptr); \
- rna_iterator_array_begin(iter, (void*)data->layers, sizeof(CustomDataLayer), data->totlayer, 0, rna_##collection_name##_check); \
- } \
- \
- static int rna_Mesh_##collection_name##s_length(PointerRNA *ptr) \
- { \
- CustomData *data = rna_mesh_##customdata_type(ptr); \
- return data ? CustomData_number_of_layers(data, layer_type) : 0; \
- } \
- \
- static void rna_Mesh_##collection_name##_index_range(PointerRNA *ptr, int *min, int *max) \
- { \
- CustomData *data= rna_mesh_##customdata_type(ptr); \
- \
- *min= 0; \
- *max= data ? CustomData_number_of_layers(data, layer_type) - 1 : 0; \
- *max= MAX2(0, *max); \
+#define DEFINE_CUSTOMDATA_LAYER_COLLECTION(collection_name, customdata_type, layer_type) \
+ /* check */ \
+ static int rna_##collection_name##_check(CollectionPropertyIterator *iter, void *data) \
+ { \
+ CustomDataLayer *layer = (CustomDataLayer *)data; \
+ return (layer->type != layer_type); \
+ } \
+ /* begin */ \
+ static void rna_Mesh_##collection_name##s_begin(CollectionPropertyIterator *iter, \
+ PointerRNA *ptr) \
+ { \
+ CustomData *data = rna_mesh_##customdata_type(ptr); \
+ if (data) { \
+ rna_iterator_array_begin(iter, \
+ (void *)data->layers, sizeof(CustomDataLayer), \
+ data->totlayer, 0, \
+ rna_##collection_name##_check); \
+ } \
+ else { \
+ rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL); \
+ } \
+ } \
+ /* length */ \
+ static int rna_Mesh_##collection_name##s_length(PointerRNA *ptr) \
+ { \
+ CustomData *data = rna_mesh_##customdata_type(ptr); \
+ return data ? CustomData_number_of_layers(data, layer_type) : 0; \
+ } \
+ /* index range */ \
+ static void rna_Mesh_##collection_name##_index_range(PointerRNA *ptr, int *min, int *max) \
+ { \
+ CustomData *data = rna_mesh_##customdata_type(ptr); \
+ *min = 0; \
+ *max = data ? CustomData_number_of_layers(data, layer_type) - 1 : 0; \
+ *max = MAX2(0, *max); \
}
/* Define the accessors for special CustomDataLayers in the collection
- (active, render, clone, stencil, etc) */
-#define DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(collection_name, customdata_type, layer_type, active_type, layer_rna_type) \
- \
- static PointerRNA rna_Mesh_##collection_name##_##active_type##_get(PointerRNA *ptr) \
- { \
- CustomData *data = rna_mesh_##customdata_type(ptr); \
- int index= CustomData_get_##active_type##_layer_index(data, layer_type); \
- CustomDataLayer *cdl= (index == -1)? NULL: &data->layers[index]; \
- \
- return rna_pointer_inherit_refine(ptr, &RNA_##layer_rna_type, cdl); \
- } \
- \
- static void rna_Mesh_##collection_name##_##active_type##_set(PointerRNA *ptr, PointerRNA value) \
- { \
- Mesh *me = rna_mesh(ptr); \
- CustomData *data = rna_mesh_##customdata_type(ptr); \
- CustomDataLayer *cdl; \
- int a; \
- \
- for(cdl=data->layers, a=0; a<data->totlayer; cdl++, a++) { \
- if(value.data == cdl) { \
- CustomData_set_layer_##active_type##_index(data, layer_type, a); \
- mesh_update_customdata_pointers(me, TRUE); \
- return; \
- } \
- } \
- } \
- \
- static int rna_Mesh_##collection_name##_##active_type##_index_get(PointerRNA *ptr) \
- { \
- CustomData *data = rna_mesh_##customdata_type(ptr); \
- return CustomData_get_##active_type##_layer(data, layer_type); \
- } \
- \
+ * (active, render, clone, stencil, etc) */
+#define DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(collection_name, customdata_type, \
+ layer_type, active_type, layer_rna_type) \
+ \
+ static PointerRNA rna_Mesh_##collection_name##_##active_type##_get(PointerRNA *ptr) \
+ { \
+ CustomData *data = rna_mesh_##customdata_type(ptr); \
+ CustomDataLayer *layer; \
+ if (data) { \
+ int index = CustomData_get_##active_type##_layer_index(data, layer_type); \
+ layer = (index == -1) ? NULL: &data->layers[index]; \
+ } \
+ else { \
+ layer = NULL; \
+ } \
+ return rna_pointer_inherit_refine(ptr, &RNA_##layer_rna_type, layer); \
+ } \
+ \
+ static void rna_Mesh_##collection_name##_##active_type##_set(PointerRNA *ptr, \
+ PointerRNA value) \
+ { \
+ Mesh *me = rna_mesh(ptr); \
+ CustomData *data = rna_mesh_##customdata_type(ptr); \
+ int a; \
+ if (data) { \
+ CustomDataLayer *layer; \
+ for (layer = data->layers, a = 0; a<data->totlayer; layer++, a++) { \
+ if (value.data == layer) { \
+ CustomData_set_layer_##active_type##_index(data, layer_type, a); \
+ mesh_update_customdata_pointers(me, TRUE); \
+ return; \
+ } \
+ } \
+ } \
+ } \
+ \
+ static int rna_Mesh_##collection_name##_##active_type##_index_get(PointerRNA *ptr) \
+ { \
+ CustomData *data = rna_mesh_##customdata_type(ptr); \
+ if (data) { \
+ return CustomData_get_##active_type##_layer(data, layer_type); \
+ } \
+ else { \
+ return 0; \
+ } \
+ } \
+ \
static void rna_Mesh_##collection_name##_##active_type##_index_set(PointerRNA *ptr, int value) \
- { \
- Mesh *me = rna_mesh(ptr); \
- CustomData *data = rna_mesh_##customdata_type(ptr); \
- \
- CustomData_set_layer_##active_type(data, layer_type, value); \
- mesh_update_customdata_pointers(me, TRUE); \
+ { \
+ Mesh *me = rna_mesh(ptr); \
+ CustomData *data = rna_mesh_##customdata_type(ptr); \
+ if (data) { \
+ CustomData_set_layer_##active_type(data, layer_type, value); \
+ mesh_update_customdata_pointers(me, TRUE); \
+ } \
}
#endif /* __RNA_MESH_UTILS_H__ */
diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c
index a6d256975c0..8ba391e1bb9 100644
--- a/source/blender/makesrna/intern/rna_meta.c
+++ b/source/blender/makesrna/intern/rna_meta.c
@@ -53,13 +53,13 @@
static int rna_Meta_texspace_editable(PointerRNA *ptr)
{
- MetaBall *mb= (MetaBall*)ptr->data;
+ MetaBall *mb = (MetaBall*)ptr->data;
return (mb->texflag & MB_AUTOSPACE)? 0: PROP_EDITABLE;
}
static void rna_Meta_texspace_loc_get(PointerRNA *ptr, float *values)
{
- MetaBall *mb= (MetaBall*)ptr->data;
+ MetaBall *mb = (MetaBall*)ptr->data;
/* tex_space_mball() needs object.. ugh */
@@ -68,14 +68,14 @@ static void rna_Meta_texspace_loc_get(PointerRNA *ptr, float *values)
static void rna_Meta_texspace_loc_set(PointerRNA *ptr, const float *values)
{
- MetaBall *mb= (MetaBall*)ptr->data;
+ MetaBall *mb = (MetaBall*)ptr->data;
copy_v3_v3(mb->loc, values);
}
static void rna_Meta_texspace_size_get(PointerRNA *ptr, float *values)
{
- MetaBall *mb= (MetaBall*)ptr->data;
+ MetaBall *mb = (MetaBall*)ptr->data;
/* tex_space_mball() needs object.. ugh */
@@ -84,7 +84,7 @@ static void rna_Meta_texspace_size_get(PointerRNA *ptr, float *values)
static void rna_Meta_texspace_size_set(PointerRNA *ptr, const float *values)
{
- MetaBall *mb= (MetaBall*)ptr->data;
+ MetaBall *mb = (MetaBall*)ptr->data;
copy_v3_v3(mb->size, values);
}
@@ -92,13 +92,13 @@ static void rna_Meta_texspace_size_set(PointerRNA *ptr, const float *values)
static void rna_MetaBall_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- MetaBall *mb= ptr->id.data;
+ MetaBall *mb = ptr->id.data;
Object *ob;
/* cheating way for importers to avoid slow updates */
- if(mb->id.us > 0) {
- for(ob=bmain->object.first; ob; ob= ob->id.next)
- if(ob->data == mb)
+ if (mb->id.us > 0) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next)
+ if (ob->data == mb)
copy_mball_properties(scene, ob);
DAG_id_tag_update(&mb->id, 0);
@@ -108,17 +108,17 @@ static void rna_MetaBall_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_MetaBall_update_rotation(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- MetaElem *ml= ptr->data;
+ MetaElem *ml = ptr->data;
normalize_qt(ml->quat);
rna_MetaBall_update_data(bmain, scene, ptr);
}
static MetaElem *rna_MetaBall_elements_new(MetaBall *mb, int type)
{
- MetaElem *ml= add_metaball_element(mb, type);
+ MetaElem *ml = add_metaball_element(mb, type);
/* cheating way for importers to avoid slow updates */
- if(mb->id.us > 0) {
+ if (mb->id.us > 0) {
DAG_id_tag_update(&mb->id, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id);
}
@@ -128,11 +128,11 @@ static MetaElem *rna_MetaBall_elements_new(MetaBall *mb, int type)
static void rna_MetaBall_elements_remove(MetaBall *mb, ReportList *reports, MetaElem *ml)
{
- int found= 0;
+ int found = 0;
- found= BLI_remlink_safe(&mb->elems, ml);
+ found = BLI_remlink_safe(&mb->elems, ml);
- if(!found) {
+ if (!found) {
BKE_reportf(reports, RPT_ERROR, "Metaball \"%s\" does not contain spline given", mb->id.name+2);
return;
}
@@ -141,7 +141,7 @@ static void rna_MetaBall_elements_remove(MetaBall *mb, ReportList *reports, Meta
/* invalidate pointer!, no can do */
/* cheating way for importers to avoid slow updates */
- if(mb->id.us > 0) {
+ if (mb->id.us > 0) {
DAG_id_tag_update(&mb->id, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id);
}
@@ -152,7 +152,7 @@ static void rna_MetaBall_elements_clear(MetaBall *mb)
BLI_freelistN(&mb->elems);
/* cheating way for importers to avoid slow updates */
- if(mb->id.us > 0) {
+ if (mb->id.us > 0) {
DAG_id_tag_update(&mb->id, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id);
}
@@ -165,66 +165,66 @@ static void rna_def_metaelement(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MetaElement", NULL);
+ 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_icon(srna, ICON_OUTLINER_DATA_META);
/* enums */
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, metaelem_type_items);
RNA_def_property_ui_text(prop, "Type", "Metaball types");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
/* number values */
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
+ prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "quat");
RNA_def_property_ui_text(prop, "Rotation", "Normalized quaternion rotation");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_rotation");
- prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_UNSIGNED|PROP_UNIT_LENGTH);
+ prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_UNSIGNED|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "rad");
RNA_def_property_ui_text(prop, "Radius", "");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- prop= RNA_def_property(srna, "size_x", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "size_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "expx");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Size X", "Size of element, use of components depends on element type");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- prop= RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "expy");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Size Y", "Size of element, use of components depends on element type");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- prop= RNA_def_property(srna, "size_z", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "size_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "expz");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Size Z", "Size of element, use of components depends on element type");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- prop= RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "s");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Stiffness", "Stiffness defines how much of the element to fill");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
/* flags */
- prop= RNA_def_property(srna, "use_negative", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_negative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MB_NEGATIVE);
RNA_def_property_ui_text(prop, "Negative", "Set metaball as negative one");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MB_HIDE);
RNA_def_property_ui_text(prop, "Hide", "Hide element");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
@@ -240,26 +240,26 @@ static void rna_def_metaball_elements(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MetaBallElements");
- srna= RNA_def_struct(brna, "MetaBallElements", NULL);
+ srna = RNA_def_struct(brna, "MetaBallElements", NULL);
RNA_def_struct_sdna(srna, "MetaBall");
RNA_def_struct_ui_text(srna, "Meta Elements", "Collection of metaball elements");
- func= RNA_def_function(srna, "new", "rna_MetaBall_elements_new");
+ func = RNA_def_function(srna, "new", "rna_MetaBall_elements_new");
RNA_def_function_ui_description(func, "Add a new element to the metaball");
RNA_def_enum(func, "type", metaelem_type_items, MB_BALL, "", "type for the new meta-element");
- parm= RNA_def_pointer(func, "element", "MetaElement", "", "The newly created meta-element");
+ parm = RNA_def_pointer(func, "element", "MetaElement", "", "The newly created meta-element");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_MetaBall_elements_remove");
+ func = RNA_def_function(srna, "remove", "rna_MetaBall_elements_remove");
RNA_def_function_ui_description(func, "Remove an element from the metaball");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "element", "MetaElement", "", "The element to remove");
+ parm = RNA_def_pointer(func, "element", "MetaElement", "", "The element to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "clear", "rna_MetaBall_elements_clear");
+ func = RNA_def_function(srna, "clear", "rna_MetaBall_elements_clear");
RNA_def_function_ui_description(func, "Remove all elements from the metaball");
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "lastelem");
RNA_def_property_ui_text(prop, "Active Element", "Last selected element");
}
@@ -275,55 +275,55 @@ static void rna_def_metaball(BlenderRNA *brna)
{MB_UPDATE_NEVER, "NEVER", 0, "Never", "While editing, don't update metaball at all"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MetaBall", "ID");
+ srna = RNA_def_struct(brna, "MetaBall", "ID");
RNA_def_struct_ui_text(srna, "MetaBall", "Metaball datablock to defined blobby surfaces");
RNA_def_struct_ui_icon(srna, ICON_META_DATA);
- prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "elems", NULL);
RNA_def_property_struct_type(prop, "MetaElement");
RNA_def_property_ui_text(prop, "Elements", "Meta elements");
rna_def_metaball_elements(brna, prop);
/* enums */
- prop= RNA_def_property(srna, "update_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "update_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_update_items);
RNA_def_property_ui_text(prop, "Update", "Metaball edit update behavior");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
/* number values */
- prop= RNA_def_property(srna, "resolution", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "resolution", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "wiresize");
RNA_def_property_range(prop, 0.050f, 1.0f);
RNA_def_property_ui_text(prop, "Wire Size", "Polygonization resolution in the 3D viewport");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- prop= RNA_def_property(srna, "render_resolution", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "render_resolution", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "rendersize");
RNA_def_property_range(prop, 0.050f, 1.0f);
RNA_def_property_ui_text(prop, "Render Size", "Polygonization resolution in rendering");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "thresh");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Threshold", "Influence of meta elements");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
/* texture space */
- prop= RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MB_AUTOSPACE);
RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjust active object's texture space automatically when transforming object");
- prop= RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Texture Space Location", "Texture space location");
RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable");
RNA_def_property_float_funcs(prop, "rna_Meta_texspace_loc_get", "rna_Meta_texspace_loc_set", NULL);
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size");
RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable");
@@ -339,7 +339,7 @@ static void rna_def_metaball(BlenderRNA *brna)
*/
/* materials */
- prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_ui_text(prop, "Materials", "");
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 021ae87d60b..6185d1dee79 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -54,7 +54,7 @@
#include "WM_api.h"
#include "WM_types.h"
-EnumPropertyItem modifier_type_items[] ={
+EnumPropertyItem modifier_type_items[] = {
{0, "", 0, "Modify", ""},
{eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""},
{eModifierType_WeightVGEdit, "VERTEX_WEIGHT_EDIT", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Edit", ""},
@@ -114,15 +114,15 @@ EnumPropertyItem modifier_type_items[] ={
static void rna_UVProject_projectors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- UVProjectModifierData *uvp= (UVProjectModifierData*)ptr->data;
+ UVProjectModifierData *uvp = (UVProjectModifierData*)ptr->data;
rna_iterator_array_begin(iter, (void*)uvp->projectors, sizeof(Object*), uvp->num_projectors, 0, NULL);
}
static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr)
{
- ModifierData *md= (ModifierData*)ptr->data;
+ ModifierData *md = (ModifierData*)ptr->data;
- switch(md->type) {
+ switch (md->type) {
case eModifierType_Subsurf:
return &RNA_SubsurfModifier;
case eModifierType_Lattice:
@@ -210,7 +210,7 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr)
void rna_Modifier_name_set(PointerRNA *ptr, const char *value)
{
- ModifierData *md= ptr->data;
+ ModifierData *md = ptr->data;
char oldname[sizeof(md->name)];
/* make a copy of the old name first */
@@ -221,7 +221,7 @@ void rna_Modifier_name_set(PointerRNA *ptr, const char *value)
/* make sure the name is truly unique */
if (ptr->id.data) {
- Object *ob= ptr->id.data;
+ Object *ob = ptr->id.data;
modifier_unique_name(&ob->modifiers, md);
}
@@ -248,32 +248,31 @@ static void rna_Modifier_dependency_update(Main *bmain, Scene *scene, PointerRNA
static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- SmokeModifierData *smd= (SmokeModifierData *)ptr->data;
- Object *ob= (Object*)ptr->id.data;
+ SmokeModifierData *smd = (SmokeModifierData *)ptr->data;
+ Object *ob = (Object*)ptr->id.data;
ParticleSystemModifierData *psmd = NULL;
ParticleSystem *psys = NULL;
ParticleSettings *part = NULL;
- // nothing changed
- if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
+ /* nothing changed */
+ if ((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
return;
- smokeModifier_free(smd); // XXX TODO: completely free all 3 pointers
- smokeModifier_createType(smd); // create regarding of selected type
+ smokeModifier_free(smd); /* XXX TODO: completely free all 3 pointers */
+ smokeModifier_createType(smd); /* create regarding of selected type */
switch (smd->type) {
case MOD_SMOKE_TYPE_DOMAIN:
ob->dt = OB_WIRE;
break;
case MOD_SMOKE_TYPE_FLOW:
- for(psys=ob->particlesystem.first; psys; psys=psys->next)
- if(psys->part->type == PART_EMITTER)
+ for (psys = ob->particlesystem.first; psys; psys = psys->next)
+ if (psys->part->type == PART_EMITTER)
break;
- if(ob->type == OB_MESH && !psys) {
+ if (ob->type == OB_MESH && !psys) {
/* add particle system */
psmd = (ParticleSystemModifierData *)object_add_particle_system(scene, ob, NULL);
- if(psmd)
- {
+ if (psmd) {
psys = psmd->psys;
part = psys->part;
part->lifetime = 1.0f;
@@ -286,7 +285,7 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
}
}
- if(smd->flow)
+ if (smd->flow)
smd->flow->psys = psys;
case MOD_SMOKE_TYPE_COLL:
case 0:
@@ -295,103 +294,103 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
break;
}
- // update dependency 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);
}
static void rna_ExplodeModifier_vgroup_get(PointerRNA *ptr, char *value)
{
- ExplodeModifierData *emd= (ExplodeModifierData*)ptr->data;
+ ExplodeModifierData *emd = (ExplodeModifierData*)ptr->data;
rna_object_vgroup_name_index_get(ptr, value, emd->vgroup);
}
static int rna_ExplodeModifier_vgroup_length(PointerRNA *ptr)
{
- ExplodeModifierData *emd= (ExplodeModifierData*)ptr->data;
+ ExplodeModifierData *emd = (ExplodeModifierData*)ptr->data;
return rna_object_vgroup_name_index_length(ptr, emd->vgroup);
}
static void rna_ExplodeModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- ExplodeModifierData *emd= (ExplodeModifierData*)ptr->data;
+ ExplodeModifierData *emd = (ExplodeModifierData*)ptr->data;
rna_object_vgroup_name_index_set(ptr, value, &emd->vgroup);
}
static void rna_SimpleDeformModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- SimpleDeformModifierData *smd= (SimpleDeformModifierData*)ptr->data;
+ SimpleDeformModifierData *smd = (SimpleDeformModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, smd->vgroup_name, sizeof(smd->vgroup_name));
}
static void rna_ShrinkwrapModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- ShrinkwrapModifierData *smd= (ShrinkwrapModifierData*)ptr->data;
+ ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, smd->vgroup_name, sizeof(smd->vgroup_name));
}
static void rna_LatticeModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- LatticeModifierData *lmd= (LatticeModifierData*)ptr->data;
+ LatticeModifierData *lmd = (LatticeModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, lmd->name, sizeof(lmd->name));
}
static void rna_ArmatureModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- ArmatureModifierData *lmd= (ArmatureModifierData*)ptr->data;
+ ArmatureModifierData *lmd = (ArmatureModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
}
static void rna_CurveModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- CurveModifierData *lmd= (CurveModifierData*)ptr->data;
+ CurveModifierData *lmd = (CurveModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, lmd->name, sizeof(lmd->name));
}
static void rna_DisplaceModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- DisplaceModifierData *lmd= (DisplaceModifierData*)ptr->data;
+ DisplaceModifierData *lmd = (DisplaceModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
}
static void rna_HookModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- HookModifierData *lmd= (HookModifierData*)ptr->data;
+ HookModifierData *lmd = (HookModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, lmd->name, sizeof(lmd->name));
}
static void rna_MaskModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- MaskModifierData *lmd= (MaskModifierData*)ptr->data;
+ MaskModifierData *lmd = (MaskModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, lmd->vgroup, sizeof(lmd->vgroup));
}
static void rna_MeshDeformModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- MeshDeformModifierData *lmd= (MeshDeformModifierData*)ptr->data;
+ MeshDeformModifierData *lmd = (MeshDeformModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
}
static void rna_SmoothModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- SmoothModifierData *lmd= (SmoothModifierData*)ptr->data;
+ SmoothModifierData *lmd = (SmoothModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
}
static void rna_WaveModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- WaveModifierData *lmd= (WaveModifierData*)ptr->data;
+ WaveModifierData *lmd = (WaveModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
}
static void rna_CastModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- CastModifierData *lmd= (CastModifierData*)ptr->data;
+ CastModifierData *lmd = (CastModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name));
}
static void rna_SolidifyModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- SolidifyModifierData *smd= (SolidifyModifierData*)ptr->data;
+ SolidifyModifierData *smd = (SolidifyModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, smd->defgrp_name, sizeof(smd->defgrp_name));
}
@@ -399,15 +398,15 @@ static void rna_WeightVGModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
ModifierData *md = (ModifierData*)ptr->data;
if (md->type == eModifierType_WeightVGEdit) {
- WeightVGEditModifierData *wmd= (WeightVGEditModifierData*)md;
+ WeightVGEditModifierData *wmd = (WeightVGEditModifierData*)md;
rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name, sizeof(wmd->defgrp_name));
}
else if (md->type == eModifierType_WeightVGMix) {
- WeightVGMixModifierData *wmd= (WeightVGMixModifierData*)md;
+ WeightVGMixModifierData *wmd = (WeightVGMixModifierData*)md;
rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name_a, sizeof(wmd->defgrp_name_a));
}
else if (md->type == eModifierType_WeightVGProximity) {
- WeightVGProximityModifierData *wmd= (WeightVGProximityModifierData*)md;
+ WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData*)md;
rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name, sizeof(wmd->defgrp_name));
}
}
@@ -416,40 +415,40 @@ static void rna_WeightVGModifier_mask_vgroup_set(PointerRNA *ptr, const char *va
{
ModifierData *md = (ModifierData*)ptr->data;
if (md->type == eModifierType_WeightVGEdit) {
- WeightVGEditModifierData *wmd= (WeightVGEditModifierData*)md;
+ WeightVGEditModifierData *wmd = (WeightVGEditModifierData*)md;
rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name));
}
else if (md->type == eModifierType_WeightVGMix) {
- WeightVGMixModifierData *wmd= (WeightVGMixModifierData*)md;
+ WeightVGMixModifierData *wmd = (WeightVGMixModifierData*)md;
rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name));
}
else if (md->type == eModifierType_WeightVGProximity) {
- WeightVGProximityModifierData *wmd= (WeightVGProximityModifierData*)md;
+ WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData*)md;
rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name));
}
}
static void rna_WeightVGMixModifier_vgroup2_set(PointerRNA *ptr, const char *value)
{
- WeightVGMixModifierData *wmd= (WeightVGMixModifierData*)ptr->data;
+ WeightVGMixModifierData *wmd = (WeightVGMixModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name_b, sizeof(wmd->defgrp_name_b));
}
static void rna_MappingInfo_uvlayer_set(PointerRNA *ptr, const char *value)
{
- MappingInfoModifierData *mmd= (MappingInfoModifierData *)ptr->data;
+ MappingInfoModifierData *mmd = (MappingInfoModifierData *)ptr->data;
rna_object_uvlayer_name_set(ptr, value, mmd->uvlayer_name, sizeof(mmd->uvlayer_name));
}
static void rna_UVProjectModifier_uvlayer_set(PointerRNA *ptr, const char *value)
{
- UVProjectModifierData *umd= (UVProjectModifierData*)ptr->data;
+ UVProjectModifierData *umd = (UVProjectModifierData*)ptr->data;
rna_object_uvlayer_name_set(ptr, value, umd->uvlayer_name, sizeof(umd->uvlayer_name));
}
static void RNA_WarpModifier_vgroup_set(PointerRNA *ptr, const char *value)
{
- WarpModifierData *tmd= (WarpModifierData*)ptr->data;
+ WarpModifierData *tmd = (WarpModifierData*)ptr->data;
rna_object_vgroup_name_set(ptr, value, tmd->defgrp_name, sizeof(tmd->defgrp_name));
}
@@ -476,31 +475,31 @@ static void rna_MultiresModifier_level_range(PointerRNA *ptr, int *min, int *max
*min = 0;
*max = mmd->totlvl; /* intentionally _not_ -1 */
- *max= MAX2(0, *max);
+ *max = MAX2(0, *max);
}
static int rna_MultiresModifier_external_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- Mesh *me= ob->data;
+ Object *ob = (Object*)ptr->id.data;
+ Mesh *me = ob->data;
return CustomData_external_test(&me->ldata, CD_MDISPS);
}
static void rna_MultiresModifier_filepath_get(PointerRNA *ptr, char *value)
{
- Object *ob= (Object*)ptr->id.data;
- CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
+ Object *ob = (Object*)ptr->id.data;
+ CustomDataExternal *external = ((Mesh*)ob->data)->fdata.external;
BLI_strncpy(value, (external)? external->filename: "", sizeof(external->filename));
}
static void rna_MultiresModifier_filepath_set(PointerRNA *ptr, const char *value)
{
- Object *ob= (Object*)ptr->id.data;
- CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
+ Object *ob = (Object*)ptr->id.data;
+ CustomDataExternal *external = ((Mesh*)ob->data)->fdata.external;
- if(external && strcmp(external->filename, value)) {
+ if (external && strcmp(external->filename, value)) {
BLI_strncpy(external->filename, value, sizeof(external->filename));
multires_force_external_reload(ob);
}
@@ -508,20 +507,20 @@ static void rna_MultiresModifier_filepath_set(PointerRNA *ptr, const char *value
static int rna_MultiresModifier_filepath_length(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
+ Object *ob = (Object*)ptr->id.data;
+ CustomDataExternal *external = ((Mesh*)ob->data)->fdata.external;
return strlen((external)? external->filename: "");
}
static void modifier_object_set(Object *self, Object **ob_p, int type, PointerRNA value)
{
- Object *ob= value.data;
+ Object *ob = value.data;
- if(!self || ob != self) {
- if(!ob || type == OB_EMPTY || ob->type == type) {
+ if (!self || ob != self) {
+ if (!ob || type == OB_EMPTY || ob->type == type) {
id_lib_extern((ID *)ob);
- *ob_p= ob;
+ *ob_p = ob;
}
}
}
@@ -568,15 +567,15 @@ static void rna_ShrinkwrapModifier_target_set(PointerRNA *ptr, PointerRNA value)
static int rna_ShrinkwrapModifier_face_cull_get(PointerRNA *ptr)
{
- ShrinkwrapModifierData *swm= (ShrinkwrapModifierData*)ptr->data;
+ ShrinkwrapModifierData *swm = (ShrinkwrapModifierData*)ptr->data;
return swm->shrinkOpts & (MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE|MOD_SHRINKWRAP_CULL_TARGET_BACKFACE);
}
static void rna_ShrinkwrapModifier_face_cull_set(struct PointerRNA *ptr, int value)
{
- ShrinkwrapModifierData *swm= (ShrinkwrapModifierData*)ptr->data;
+ ShrinkwrapModifierData *swm = (ShrinkwrapModifierData*)ptr->data;
- swm->shrinkOpts= (swm->shrinkOpts & ~(MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE|MOD_SHRINKWRAP_CULL_TARGET_BACKFACE)) | value;
+ swm->shrinkOpts = (swm->shrinkOpts & ~(MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE|MOD_SHRINKWRAP_CULL_TARGET_BACKFACE)) | value;
}
static void rna_MeshDeformModifier_object_set(PointerRNA *ptr, PointerRNA value)
@@ -606,62 +605,62 @@ static int rna_MeshDeformModifier_is_bound_get(PointerRNA *ptr)
static PointerRNA rna_SoftBodyModifier_settings_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
return rna_pointer_inherit_refine(ptr, &RNA_SoftBodySettings, ob->soft);
}
static PointerRNA rna_SoftBodyModifier_point_cache_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
return rna_pointer_inherit_refine(ptr, &RNA_PointCache, ob->soft->pointcache);
}
static PointerRNA rna_CollisionModifier_settings_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd);
}
static PointerRNA rna_UVProjector_object_get(PointerRNA *ptr)
{
- Object **ob= (Object**)ptr->data;
+ Object **ob = (Object**)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_Object, *ob);
}
static void rna_UVProjector_object_set(PointerRNA *ptr, PointerRNA value)
{
- Object **ob= (Object**)ptr->data;
+ Object **ob = (Object**)ptr->data;
- if(*ob)
+ if (*ob)
id_us_min((ID*)*ob);
- if(value.data)
+ if (value.data)
id_us_plus((ID*)value.data);
- *ob= value.data;
+ *ob = value.data;
}
static void rna_UVProjectModifier_num_projectors_set(PointerRNA *ptr, int value)
{
- UVProjectModifierData *md= (UVProjectModifierData*)ptr->data;
+ UVProjectModifierData *md = (UVProjectModifierData*)ptr->data;
int a;
- md->num_projectors= CLAMPIS(value, 1, MOD_UVPROJECT_MAX);
- for(a=md->num_projectors; a<MOD_UVPROJECT_MAX; a++)
- md->projectors[a]= NULL;
+ md->num_projectors = CLAMPIS(value, 1, MOD_UVPROJECT_MAX);
+ for (a = md->num_projectors; a<MOD_UVPROJECT_MAX; a++)
+ md->projectors[a] = NULL;
}
static int rna_OceanModifier_is_build_enabled_get(PointerRNA *UNUSED(ptr))
{
#ifdef WITH_OCEANSIM
return 1;
-#else // WITH_OCEANSIM
+#else /* WITH_OCEANSIM */
return 0;
-#endif // WITH_OCEANSIM
+#endif /* WITH_OCEANSIM */
}
static void rna_OceanModifier_init_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- OceanModifierData *omd= (OceanModifierData*)ptr->data;
+ OceanModifierData *omd = (OceanModifierData*)ptr->data;
omd->refresh |= (MOD_OCEAN_REFRESH_RESET|MOD_OCEAN_REFRESH_SIM|MOD_OCEAN_REFRESH_CLEAR_CACHE);
@@ -670,7 +669,7 @@ static void rna_OceanModifier_init_update(Main *bmain, Scene *scene, PointerRNA
static void rna_OceanModifier_sim_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- OceanModifierData *omd= (OceanModifierData*)ptr->data;
+ OceanModifierData *omd = (OceanModifierData*)ptr->data;
omd->refresh |= MOD_OCEAN_REFRESH_SIM;
@@ -679,7 +678,7 @@ static void rna_OceanModifier_sim_update(Main *bmain, Scene *scene, PointerRNA *
static void rna_OceanModifier_topology_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- OceanModifierData *omd= (OceanModifierData*)ptr->data;
+ OceanModifierData *omd = (OceanModifierData*)ptr->data;
omd->refresh |= MOD_OCEAN_REFRESH_TOPOLOGY;
@@ -688,7 +687,7 @@ static void rna_OceanModifier_topology_update(Main *bmain, Scene *scene, Pointer
static void rna_OceanModifier_ocean_chop_set(PointerRNA *ptr, float value)
{
- OceanModifierData *omd= (OceanModifierData*)ptr->data;
+ OceanModifierData *omd = (OceanModifierData*)ptr->data;
float old_value = omd->chop_amount;
omd->chop_amount = value;
@@ -703,30 +702,30 @@ static void rna_OceanModifier_ocean_chop_set(PointerRNA *ptr, float value)
static float rna_EdgeSplitModifier_split_angle_get(PointerRNA *ptr)
{
- EdgeSplitModifierData *md= (EdgeSplitModifierData*)ptr->data;
+ EdgeSplitModifierData *md = (EdgeSplitModifierData*)ptr->data;
return DEG2RADF(md->split_angle);
}
static void rna_EdgeSplitModifier_split_angle_set(PointerRNA *ptr, float value)
{
- EdgeSplitModifierData *md= (EdgeSplitModifierData*)ptr->data;
- value= RAD2DEGF(value);
+ EdgeSplitModifierData *md = (EdgeSplitModifierData*)ptr->data;
+ value = RAD2DEGF(value);
CLAMP(value, 0.0f, 180.0f);
- md->split_angle= (int)value;
+ md->split_angle = (int)value;
}
static float rna_BevelModifier_angle_limit_get(PointerRNA *ptr)
{
- BevelModifierData *md= (BevelModifierData*)ptr->data;
+ BevelModifierData *md = (BevelModifierData*)ptr->data;
return DEG2RADF(md->bevel_angle);
}
static void rna_BevelModifier_angle_limit_set(PointerRNA *ptr, float value)
{
- BevelModifierData *md= (BevelModifierData*)ptr->data;
- value= RAD2DEGF(value);
+ BevelModifierData *md = (BevelModifierData*)ptr->data;
+ value = RAD2DEGF(value);
CLAMP(value, 0.0f, 180.0f);
- md->bevel_angle= (int)value;
+ md->bevel_angle = (int)value;
}
#else
@@ -738,7 +737,7 @@ static void rna_def_property_subdivision_common(StructRNA *srna, const char type
{1, "SIMPLE", 0, "Simple", ""},
{0, NULL, 0, NULL, NULL}};
- PropertyRNA *prop= RNA_def_property(srna, "subdivision_type", PROP_ENUM, PROP_NONE);
+ PropertyRNA *prop = RNA_def_property(srna, "subdivision_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, type);
RNA_def_property_enum_items(prop, prop_subdivision_type_items);
RNA_def_property_ui_text(prop, "Subdivision Type", "Select type of subdivision algorithm");
@@ -750,30 +749,30 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SubsurfModifier", "Modifier");
+ srna = RNA_def_struct(brna, "SubsurfModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Subsurf Modifier", "Subdivision surface modifier");
RNA_def_struct_sdna(srna, "SubsurfModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_SUBSURF);
rna_def_property_subdivision_common(srna, "subdivType");
- prop= RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "levels");
RNA_def_property_ui_range(prop, 0, 6, 1, 0);
RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to perform");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "renderLevels");
RNA_def_property_ui_range(prop, 0, 6, 1, 0);
RNA_def_property_ui_text(prop, "Render Levels", "Number of subdivisions to perform when rendering");
- prop= RNA_def_property(srna, "show_only_control_edges", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_only_control_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_ControlEdges);
RNA_def_property_ui_text(prop, "Optimal Display", "Skip drawing/rendering of interior subdivided edges");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_subsurf_uv", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_subsurf_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_SubsurfUv);
RNA_def_property_ui_text(prop, "Subdivide UVs", "Use subsurf to subdivide UVs");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -790,24 +789,24 @@ static void rna_def_modifier_generic_map_info(StructRNA *srna)
PropertyRNA *prop;
- prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Texture", "");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texmapping");
RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", "");
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
RNA_def_property_ui_text(prop, "UV Map", "UV map name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MappingInfo_uvlayer_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "texture_coords_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_coords_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "map_object");
RNA_def_property_ui_text(prop, "Texture Coordinate Object", "Object to set the texture coordinates");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
@@ -830,47 +829,47 @@ static void rna_def_modifier_warp(BlenderRNA *brna)
{eWarp_Falloff_Const, "CONSTANT", ICON_NOCURVE, "Constant", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "WarpModifier", "Modifier");
+ srna = RNA_def_struct(brna, "WarpModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Warp Modifier", "Warp modifier");
RNA_def_struct_sdna(srna, "WarpModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_WARP);
- prop= RNA_def_property(srna, "object_from", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object_from", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "From", "Object to transform from");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "object_to", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object_to", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "To", "Object to transform to");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -100, 100, 10, 2);
RNA_def_property_ui_text(prop, "Strength", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_falloff_items);
RNA_def_property_ui_text(prop, "Falloff Type", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_UNSIGNED | PROP_DISTANCE);
+ prop = RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_UNSIGNED | PROP_DISTANCE);
RNA_def_property_ui_text(prop, "Radius", "Radius to apply");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curfalloff");
RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_volume_preserve", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_volume_preserve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WARP_VOLUME_PRESERVE);
RNA_def_property_ui_text(prop, "Preserve Volume", "Preserve volume when rotations are used");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the deform");
RNA_def_property_string_funcs(prop, NULL, NULL, "RNA_WarpModifier_vgroup_set");
@@ -884,51 +883,51 @@ static void rna_def_modifier_multires(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MultiresModifier", "Modifier");
+ srna = RNA_def_struct(brna, "MultiresModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Multires Modifier", "Multiresolution mesh modifier");
RNA_def_struct_sdna(srna, "MultiresModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_MULTIRES);
rna_def_property_subdivision_common(srna, "simple");
- prop= RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "lvl");
RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to use in the viewport");
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "sculpt_levels", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "sculpt_levels", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "sculptlvl");
RNA_def_property_ui_text(prop, "Sculpt Levels", "Number of subdivisions to use in sculpt mode");
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "renderlvl");
RNA_def_property_ui_text(prop, "Render Levels", "The subdivision level visible at render time");
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
- prop= RNA_def_property(srna, "total_levels", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "total_levels", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "totlvl");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Total Levels", "Number of subdivisions for which displacements are stored");
- prop= RNA_def_property(srna, "is_external", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_external", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_MultiresModifier_external_get", NULL);
RNA_def_property_ui_text(prop, "External", "Store multires displacements outside the .blend file, to save memory");
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_funcs(prop, "rna_MultiresModifier_filepath_get", "rna_MultiresModifier_filepath_length", "rna_MultiresModifier_filepath_set");
RNA_def_property_ui_text(prop, "File Path", "Path to external displacements file");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "show_only_control_edges", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_only_control_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", eMultiresModifierFlag_ControlEdges);
RNA_def_property_ui_text(prop, "Optimal Display", "Skip drawing/rendering of interior subdivided edges");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_subsurf_uv", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_subsurf_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flags", eMultiresModifierFlag_PlainUv);
RNA_def_property_ui_text(prop, "Subdivide UVs", "Use subsurf to subdivide UVs");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -939,18 +938,18 @@ static void rna_def_modifier_lattice(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "LatticeModifier", "Modifier");
+ srna = RNA_def_struct(brna, "LatticeModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Lattice Modifier", "Lattice deformation modifier");
RNA_def_struct_sdna(srna, "LatticeModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_LATTICE);
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Object", "Lattice object to deform with");
RNA_def_property_pointer_funcs(prop, NULL, "rna_LatticeModifier_object_set", NULL, "rna_Lattice_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_LatticeModifier_vgroup_set");
@@ -971,24 +970,24 @@ static void rna_def_modifier_curve(BlenderRNA *brna)
{MOD_CURVE_NEGZ, "NEG_Z", 0, "-Z", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "CurveModifier", "Modifier");
+ srna = RNA_def_struct(brna, "CurveModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Curve Modifier", "Curve deformation modifier");
RNA_def_struct_sdna(srna, "CurveModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_CURVE);
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Object", "Curve object to deform with");
RNA_def_property_pointer_funcs(prop, NULL, "rna_CurveModifier_object_set", NULL, "rna_Curve_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_CurveModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "deform_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "deform_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "defaxis");
RNA_def_property_enum_items(prop, prop_deform_axis_items);
RNA_def_property_ui_text(prop, "Deform Axis", "The axis that the curve deforms along");
@@ -1000,29 +999,29 @@ static void rna_def_modifier_build(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "BuildModifier", "Modifier");
+ srna = RNA_def_struct(brna, "BuildModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Build Modifier", "Build effect modifier");
RNA_def_struct_sdna(srna, "BuildModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_BUILD);
- prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "start");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start", "Start frame of the effect");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "frame_duration", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_duration", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "length");
RNA_def_property_range(prop, 1, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Length", "Total time the build effect requires");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_random_order", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_random_order", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "randomize", 1);
RNA_def_property_ui_text(prop, "Randomize", "Randomize the faces or edges during build");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Seed", "Seed for random if used");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1033,59 +1032,59 @@ static void rna_def_modifier_mirror(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MirrorModifier", "Modifier");
+ srna = RNA_def_struct(brna, "MirrorModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Mirror Modifier", "Mirroring modifier");
RNA_def_struct_sdna(srna, "MirrorModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_MIRROR);
- prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_X);
RNA_def_property_ui_text(prop, "X", "Enable X axis mirror");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_Y);
RNA_def_property_ui_text(prop, "Y", "Enable Y axis mirror");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_Z);
RNA_def_property_ui_text(prop, "Z", "Enable Z axis mirror");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_CLIPPING);
RNA_def_property_ui_text(prop, "Clip", "Prevent vertices from going through the mirror during transform");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_mirror_vertex_groups", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mirror_vertex_groups", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_VGROUP);
RNA_def_property_ui_text(prop, "Mirror Vertex Groups", "Mirror vertex groups (e.g. .R->.L)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_mirror_merge", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mirror_merge", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", MOD_MIR_NO_MERGE);
RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices within the merge threshold");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_mirror_u", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mirror_u", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_U);
RNA_def_property_ui_text(prop, "Mirror U", "Mirror the U texture coordinate around the 0.5 point");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_mirror_v", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mirror_v", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_V);
RNA_def_property_ui_text(prop, "Mirror V", "Mirror the V texture coordinate around the 0.5 point");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "tolerance");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 1, 0.01, 6);
RNA_def_property_ui_text(prop, "Merge Limit", "Distance from axis within which mirrored vertices are merged");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "mirror_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "mirror_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mirror_ob");
RNA_def_property_ui_text(prop, "Mirror Object", "Object to use as mirror");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
@@ -1097,19 +1096,19 @@ static void rna_def_modifier_decimate(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "DecimateModifier", "Modifier");
+ srna = RNA_def_struct(brna, "DecimateModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Decimate Modifier", "Decimation modifier");
RNA_def_struct_sdna(srna, "DecimateModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_DECIM);
- prop= RNA_def_property(srna, "ratio", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ratio", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "percent");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_range(prop, 0, 1, 1, 2);
RNA_def_property_ui_text(prop, "Ratio", "Ratio of triangles to reduce to");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "face_count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "face_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "faceCount");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Face Count", "The current number of faces in the decimated mesh");
@@ -1120,116 +1119,116 @@ static void rna_def_modifier_wave(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "WaveModifier", "Modifier");
+ srna = RNA_def_struct(brna, "WaveModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Wave Modifier", "Wave effect modifier");
RNA_def_struct_sdna(srna, "WaveModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_WAVE);
- prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_X);
RNA_def_property_ui_text(prop, "X", "X axis motion");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_Y);
RNA_def_property_ui_text(prop, "Y", "Y axis motion");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_CYCL);
RNA_def_property_ui_text(prop, "Cyclic", "Cyclic wave effect");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM);
RNA_def_property_ui_text(prop, "Normals", "Displace along normals");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_normal_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_normal_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_X);
RNA_def_property_ui_text(prop, "X Normal", "Enable displacement along the X normal");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_normal_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_normal_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_Y);
RNA_def_property_ui_text(prop, "Y Normal", "Enable displacement along the Y normal");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_normal_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_normal_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_Z);
RNA_def_property_ui_text(prop, "Z Normal", "Enable displacement along the Z normal");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "timeoffs");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Time Offset", "Either the starting frame (for positive speed) or ending frame (for negative speed.)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "lifetime");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Lifetime", "Lifetime of the wave in frames, zero means infinite");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "damping_time", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "damping_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "damp");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Damping Time", "Number of frames in which the wave damps out after it dies");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "falloff");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 100, 100, 2);
RNA_def_property_ui_text(prop, "Falloff Radius", "Distance after which it fades out");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "start_position_x", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "start_position_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "startx");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -100, 100, 100, 2);
RNA_def_property_ui_text(prop, "Start Position X", "X coordinate of the start position");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "start_position_y", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "start_position_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "starty");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -100, 100, 100, 2);
RNA_def_property_ui_text(prop, "Start Position Y", "Y coordinate of the start position");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "start_position_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "start_position_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "objectcenter");
RNA_def_property_ui_text(prop, "Start Position Object", "Object which defines the wave center");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the wave");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WaveModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -1, 1, 10, 2);
RNA_def_property_ui_text(prop, "Speed", "Speed of the wave, towards the starting point when negative");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -2, 2, 10, 2);
RNA_def_property_ui_text(prop, "Height", "Height of the wave");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 5, 10, 2);
RNA_def_property_ui_text(prop, "Width", "Distance between the waves");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "narrowness", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "narrowness", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "narrow");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10, 10, 2);
@@ -1244,44 +1243,44 @@ static void rna_def_modifier_armature(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ArmatureModifier", "Modifier");
+ srna = RNA_def_struct(brna, "ArmatureModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Armature Modifier", "Armature deformation modifier");
RNA_def_struct_sdna(srna, "ArmatureModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_ARMATURE);
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Object", "Armature object to deform with");
RNA_def_property_pointer_funcs(prop, NULL, "rna_ArmatureModifier_object_set", NULL, "rna_Armature_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_ENVELOPE);
RNA_def_property_ui_text(prop, "Use Bone Envelopes", "Bind Bone envelopes to armature modifier");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_vertex_groups", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_vertex_groups", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_VGROUP);
RNA_def_property_ui_text(prop, "Use Vertex Groups", "Bind vertex groups to armature modifier");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_QUATERNION);
RNA_def_property_ui_text(prop, "Preserve Volume", "Deform rotation interpolation with quaternions");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_multi_modifier", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_multi_modifier", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "multi", 0);
RNA_def_property_ui_text(prop, "Multi Modifier", "Use same input as previous modifier, and mix results using overall vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ArmatureModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_INVERT_VGROUP);
RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1292,33 +1291,33 @@ static void rna_def_modifier_hook(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "HookModifier", "Modifier");
+ srna = RNA_def_struct(brna, "HookModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Hook Modifier", "Hook modifier to modify the location of vertices");
RNA_def_struct_sdna(srna, "HookModifierData");
RNA_def_struct_ui_icon(srna, ICON_HOOK);
- prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 100, 100, 2);
RNA_def_property_ui_text(prop, "Falloff", "If not zero, the distance from the hook where influence ends");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "force", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Force", "Relative force of the hook");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Object", "Parent Object for hook, also recalculates and clears offset");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "subtarget");
RNA_def_property_ui_text(prop, "Sub-Target", "Name of Parent Bone for hook (if applicable), also recalculates and clears offset");
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_HookModifier_vgroup_set");
@@ -1330,18 +1329,18 @@ static void rna_def_modifier_softbody(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SoftBodyModifier", "Modifier");
+ srna = RNA_def_struct(brna, "SoftBodyModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Soft Body Modifier", "Soft body simulation modifier");
RNA_def_struct_sdna(srna, "SoftbodyModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_SOFT);
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "SoftBodySettings");
RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_settings_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Soft Body Settings", "");
- prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_point_cache_get", NULL, NULL, NULL);
@@ -1359,18 +1358,18 @@ static void rna_def_modifier_boolean(BlenderRNA *brna)
{eBooleanModifierOp_Difference, "DIFFERENCE", 0, "Difference", "Combine two meshes in a subtractive way"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "BooleanModifier", "Modifier");
+ srna = RNA_def_struct(brna, "BooleanModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Boolean Modifier", "Boolean operations modifier");
RNA_def_struct_sdna(srna, "BooleanModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_BOOLEAN);
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Object", "Mesh object to use for Boolean operation");
RNA_def_property_pointer_funcs(prop, NULL, "rna_BooleanModifier_object_set", NULL, "rna_Mesh_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_operation_items);
RNA_def_property_ui_text(prop, "Operation", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1387,31 +1386,31 @@ static void rna_def_modifier_array(BlenderRNA *brna)
{MOD_ARR_FITCURVE, "FIT_CURVE", 0, "Fit Curve", "Fit the duplicated objects to a curve"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ArrayModifier", "Modifier");
+ srna = RNA_def_struct(brna, "ArrayModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Array Modifier", "Array duplication modifier");
RNA_def_struct_sdna(srna, "ArrayModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_ARRAY);
/* Length parameters */
- prop= RNA_def_property(srna, "fit_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "fit_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_fit_type_items);
RNA_def_property_ui_text(prop, "Fit Type", "Array length calculation method");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, INT_MAX);
RNA_def_property_ui_range(prop, 1, 1000, 1, 0);
RNA_def_property_ui_text(prop, "Count", "Number of duplicates to make");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "fit_length", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "fit_length", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "length");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Length", "Length to fit array within");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curve_ob");
RNA_def_property_ui_text(prop, "Curve", "Curve object to fit array length to");
RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_curve_set", NULL, "rna_Curve_object_poll");
@@ -1419,38 +1418,38 @@ static void rna_def_modifier_array(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
/* Offset parameters */
- prop= RNA_def_property(srna, "use_constant_offset", PROP_BOOLEAN, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "use_constant_offset", PROP_BOOLEAN, PROP_TRANSLATION);
RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_CONST);
RNA_def_property_ui_text(prop, "Constant Offset", "Add a constant offset");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "constant_offset_displace", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "constant_offset_displace", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "offset");
RNA_def_property_ui_text(prop, "Constant Offset Displacement", "Value for the distance between arrayed items");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_relative_offset", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_relative_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_RELATIVE);
RNA_def_property_ui_text(prop, "Relative Offset", "Add an offset relative to the object's bounding box");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "relative_offset_displace", PROP_FLOAT, PROP_NONE); /* PROP_TRANSLATION causes units to be used which we dont want */
+ prop = RNA_def_property(srna, "relative_offset_displace", PROP_FLOAT, PROP_NONE); /* PROP_TRANSLATION causes units to be used which we dont want */
RNA_def_property_float_sdna(prop, NULL, "scale");
RNA_def_property_ui_text(prop, "Relative Offset Displacement", "The size of the geometry will determine the distance between arrayed items");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
/* Vertex merging parameters */
- prop= RNA_def_property(srna, "use_merge_vertices", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_merge_vertices", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_ARR_MERGE);
RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices in adjacent duplicates");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_merge_vertices_cap", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_merge_vertices_cap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_ARR_MERGEFINAL);
RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices in first and last duplicates");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "merge_dist");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 1, 1, 4);
@@ -1458,25 +1457,25 @@ static void rna_def_modifier_array(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Modifier_update");
/* Offset object */
- prop= RNA_def_property(srna, "use_object_offset", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_object_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_OBJ);
RNA_def_property_ui_text(prop, "Object Offset", "Add another object's transformation to the total offset");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "offset_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "offset_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "offset_ob");
RNA_def_property_ui_text(prop, "Object Offset", "Use the location and rotation of another object to determine the distance and rotational change between arrayed items");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
/* Caps */
- prop= RNA_def_property(srna, "start_cap", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "start_cap", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Start Cap", "Mesh object to use as a start cap");
RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_start_cap_set", NULL, "rna_Mesh_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "end_cap", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "end_cap", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "End Cap", "Mesh object to use as an end cap");
RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_end_cap_set", NULL, "rna_Mesh_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
@@ -1488,30 +1487,30 @@ static void rna_def_modifier_edgesplit(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "EdgeSplitModifier", "Modifier");
+ srna = RNA_def_struct(brna, "EdgeSplitModifier", "Modifier");
RNA_def_struct_ui_text(srna, "EdgeSplit Modifier", "Edge splitting modifier to create sharp edges");
RNA_def_struct_sdna(srna, "EdgeSplitModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_EDGESPLIT);
#if 1 /* expose as radians */
- prop= RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_funcs(prop, "rna_EdgeSplitModifier_split_angle_get", "rna_EdgeSplitModifier_split_angle_set", NULL);
RNA_def_property_range(prop, 0, DEG2RAD(180));
RNA_def_property_ui_range(prop, 0, DEG2RAD(180), 100, 2);
#else
- prop= RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0, 180);
RNA_def_property_ui_range(prop, 0, 180, 100, 2);
#endif
RNA_def_property_ui_text(prop, "Split Angle", "Angle above which to split edges");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_edge_angle", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_edge_angle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_EDGESPLIT_FROMANGLE);
RNA_def_property_ui_text(prop, "Use Edge Angle", "Split edges with high angle between faces");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_edge_sharp", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_edge_sharp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_EDGESPLIT_FROMFLAG);
RNA_def_property_ui_text(prop, "Use Sharp Edges", "Split edges that are marked as sharp");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1530,31 +1529,31 @@ static void rna_def_modifier_displace(BlenderRNA *brna)
{MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ", "Use the texture's RGB values to displace the mesh in the XYZ direction"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "DisplaceModifier", "Modifier");
+ srna = RNA_def_struct(brna, "DisplaceModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Displace Modifier", "Displacement modifier");
RNA_def_struct_sdna(srna, "DisplaceModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_DISPLACE);
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DisplaceModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "mid_level", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "mid_level", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "midlevel");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Midlevel", "Material value that gives no displacement");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -100, 100, 10, 3);
RNA_def_property_ui_text(prop, "Strength", "Amount to displace geometry");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_direction_items);
RNA_def_property_ui_text(prop, "Direction", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1567,71 +1566,71 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "UVProjectModifier", "Modifier");
+ srna = RNA_def_struct(brna, "UVProjectModifier", "Modifier");
RNA_def_struct_ui_text(srna, "UV Project Modifier", "UV projection modifier to set UVs from a projector");
RNA_def_struct_sdna(srna, "UVProjectModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_UVPROJECT);
- prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
RNA_def_property_ui_text(prop, "UV Map", "UV map name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_UVProjectModifier_uvlayer_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "projector_count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "projector_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "num_projectors");
RNA_def_property_ui_text(prop, "Number of Projectors", "Number of projectors to use");
RNA_def_property_int_funcs(prop, NULL, "rna_UVProjectModifier_num_projectors_set", NULL);
RNA_def_property_range(prop, 1, MOD_UVPROJECT_MAX);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "projectors", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "projectors", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "UVProjector");
RNA_def_property_collection_funcs(prop, "rna_UVProject_projectors_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Projectors", "");
- prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Image", "");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "aspect_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "aspect_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aspectx");
RNA_def_property_range(prop, 1, FLT_MAX);
RNA_def_property_ui_range(prop, 1, 1000, 1, 3);
RNA_def_property_ui_text(prop, "Horizontal Aspect Ratio", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "aspect_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "aspect_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aspecty");
RNA_def_property_range(prop, 1, FLT_MAX);
RNA_def_property_ui_range(prop, 1, 1000, 1, 3);
RNA_def_property_ui_text(prop, "Vertical Aspect Ratio", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scalex");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 1000, 1, 3);
RNA_def_property_ui_text(prop, "Horizontal Scale", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scaley");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 1000, 1, 3);
RNA_def_property_ui_text(prop, "Vertical Scale", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_image_override", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_image_override", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_UVPROJECT_OVERRIDEIMAGE);
RNA_def_property_ui_text(prop, "Override Image", "Override faces' current images with the given image");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- srna= RNA_def_struct(brna, "UVProjector", NULL);
+ srna = RNA_def_struct(brna, "UVProjector", NULL);
RNA_def_struct_ui_text(srna, "UVProjector", "UV projector used by the UV project modifier");
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_funcs(prop, "rna_UVProjector_object_get", "rna_UVProjector_object_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
@@ -1644,40 +1643,40 @@ static void rna_def_modifier_smooth(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SmoothModifier", "Modifier");
+ srna = RNA_def_struct(brna, "SmoothModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Smooth Modifier", "Smoothing effect modifier");
RNA_def_struct_sdna(srna, "SmoothModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_SMOOTH);
- prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_X);
RNA_def_property_ui_text(prop, "X", "Smooth object along X axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Y);
RNA_def_property_ui_text(prop, "Y", "Smooth object along Y axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Z);
RNA_def_property_ui_text(prop, "Z", "Smooth object along Z axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fac");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -10, 10, 1, 3);
RNA_def_property_ui_text(prop, "Factor", "Strength of modifier effect");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "repeat");
RNA_def_property_ui_range(prop, 0, 30, 1, 0);
RNA_def_property_ui_text(prop, "Repeat", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
RNA_def_property_ui_text(prop, "Vertex Group", "Name of Vertex Group which determines influence of modifier per point");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SmoothModifier_vgroup_set");
@@ -1695,68 +1694,68 @@ static void rna_def_modifier_cast(BlenderRNA *brna)
{MOD_CAST_TYPE_CUBOID, "CUBOID", 0, "Cuboid", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "CastModifier", "Modifier");
+ srna = RNA_def_struct(brna, "CastModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Cast Modifier", "Modifier to cast to other shapes");
RNA_def_struct_sdna(srna, "CastModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_CAST);
- prop= RNA_def_property(srna, "cast_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "cast_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_cast_type_items);
RNA_def_property_ui_text(prop, "Cast Type", "Target object shape");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Object", "Control object: if available, its location determines the center of the effect");
RNA_def_property_pointer_funcs(prop, NULL, "rna_CastModifier_object_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_X);
RNA_def_property_ui_text(prop, "X", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_Y);
RNA_def_property_ui_text(prop, "Y", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_Z);
RNA_def_property_ui_text(prop, "Z", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_radius_as_size", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_radius_as_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_SIZE_FROM_RADIUS);
RNA_def_property_ui_text(prop, "From Radius", "Use radius as size of projection shape (0 = auto)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_transform", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_transform", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_USE_OB_TRANSFORM);
RNA_def_property_ui_text(prop, "Use transform", "Use object transform to control projection shape");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fac");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -10, 10, 5, 2);
RNA_def_property_ui_text(prop, "Factor", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 100, 5, 2);
RNA_def_property_ui_text(prop, "Radius", "Only deform vertices within this distance from the center of the effect (leave as 0 for infinite.)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 100, 5, 2);
RNA_def_property_ui_text(prop, "Size", "Size of projection shape (leave as 0 for auto)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_CastModifier_vgroup_set");
@@ -1774,46 +1773,46 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
#endif
- srna= RNA_def_struct(brna, "MeshDeformModifier", "Modifier");
+ srna = RNA_def_struct(brna, "MeshDeformModifier", "Modifier");
RNA_def_struct_ui_text(srna, "MeshDeform Modifier", "Mesh deformation modifier to deform with other meshes");
RNA_def_struct_sdna(srna, "MeshDeformModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM);
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Object", "Mesh object to deform with");
RNA_def_property_pointer_funcs(prop, NULL, "rna_MeshDeformModifier_object_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "is_bound", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_bound", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_MeshDeformModifier_is_bound_get", NULL);
RNA_def_property_ui_text(prop, "Bound", "Whether geometry has been bound to control cage");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_INVERT_VGROUP);
RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshDeformModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "precision", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "precision", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gridsize");
RNA_def_property_range(prop, 2, 10);
RNA_def_property_ui_text(prop, "Precision", "The grid size for binding");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_dynamic_bind", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_dynamic_bind", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_DYNAMIC_BIND);
RNA_def_property_ui_text(prop, "Dynamic", "Recompute binding dynamically on top of other deformers (slower and more memory consuming)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
#if 0
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_mode_items);
RNA_def_property_ui_text(prop, "Mode", "Method of binding vertices are bound to cage mesh");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1825,12 +1824,12 @@ static void rna_def_modifier_particlesystem(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ParticleSystemModifier", "Modifier");
+ srna = RNA_def_struct(brna, "ParticleSystemModifier", "Modifier");
RNA_def_struct_ui_text(srna, "ParticleSystem Modifier", "Particle system simulation modifier");
RNA_def_struct_sdna(srna, "ParticleSystemModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_PARTICLES);
- prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "psys");
RNA_def_property_ui_text(prop, "Particle System", "Particle System that this modifier controls");
@@ -1848,76 +1847,76 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- srna= RNA_def_struct(brna, "ParticleInstanceModifier", "Modifier");
+ srna = RNA_def_struct(brna, "ParticleInstanceModifier", "Modifier");
RNA_def_struct_ui_text(srna, "ParticleInstance Modifier", "Particle system instancing modifier");
RNA_def_struct_sdna(srna, "ParticleInstanceModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_PARTICLES);
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_ui_text(prop, "Object", "Object that has the particle system");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "particle_system_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "particle_system_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "psys");
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Particle System Number", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "axis");
RNA_def_property_enum_items(prop, particleinstance_axis);
RNA_def_property_ui_text(prop, "Axis", "Pole axis for rotation");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Parents);
RNA_def_property_ui_text(prop, "Normal", "Create instances from normal particles");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_children", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_children", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Children);
RNA_def_property_ui_text(prop, "Children", "Create instances from child particles");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_path", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_path", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Path);
RNA_def_property_ui_text(prop, "Path", "Create instances along particle paths");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Unborn);
RNA_def_property_ui_text(prop, "Unborn", "Show instances when particles are unborn");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "show_alive", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_alive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Alive);
RNA_def_property_ui_text(prop, "Alive", "Show instances when particles are alive");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "show_dead", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_dead", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Dead);
RNA_def_property_ui_text(prop, "Dead", "Show instances when particles are dead");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_preserve_shape", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_preserve_shape", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_KeepShape);
RNA_def_property_ui_text(prop, "Keep Shape", "Don't stretch the object");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_size", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_UseSize);
RNA_def_property_ui_text(prop, "Size", "Use particle size to scale the instances");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "position");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Position", "Position along path");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "random_position", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "random_position", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "random_position");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Random Position", "Randomize position along path");
@@ -1929,46 +1928,46 @@ static void rna_def_modifier_explode(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ExplodeModifier", "Modifier");
+ srna = RNA_def_struct(brna, "ExplodeModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Explode Modifier", "Explosion effect modifier based on a particle system");
RNA_def_struct_sdna(srna, "ExplodeModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_EXPLODE);
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ExplodeModifier_vgroup_get", "rna_ExplodeModifier_vgroup_length", "rna_ExplodeModifier_vgroup_set");
RNA_def_property_ui_text(prop, "Vertex Group", "");
- prop= RNA_def_property(srna, "protect", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "protect", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Protect", "Clean vertex group edges");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_edge_cut", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_edge_cut", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_EdgeCut);
RNA_def_property_ui_text(prop, "Cut Edges", "Cut face edges for nicer shrapnel");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Unborn);
RNA_def_property_ui_text(prop, "Unborn", "Show mesh when particles are unborn");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "show_alive", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_alive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Alive);
RNA_def_property_ui_text(prop, "Alive", "Show mesh when particles are alive");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "show_dead", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_dead", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Dead);
RNA_def_property_ui_text(prop, "Dead", "Show mesh when particles are dead");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_size", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_PaSize);
RNA_def_property_ui_text(prop, "Size", "Use particle size for the shrapnel");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "particle_uv", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "particle_uv", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvname");
RNA_def_property_string_maxlength(prop, MAX_CUSTOMDATA_LAYER_NAME);
RNA_def_property_ui_text(prop, "Particle UV", "UV map to change with particle age");
@@ -1980,22 +1979,22 @@ static void rna_def_modifier_cloth(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ClothModifier", "Modifier");
+ srna = RNA_def_struct(brna, "ClothModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Cloth Modifier", "Cloth simulation modifier");
RNA_def_struct_sdna(srna, "ClothModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_CLOTH);
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "sim_parms");
RNA_def_property_ui_text(prop, "Cloth Settings", "");
- prop= RNA_def_property(srna, "collision_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "collision_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coll_parms");
RNA_def_property_ui_text(prop, "Cloth Collision Settings", "");
- prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Point Cache", "");
}
@@ -2012,24 +2011,24 @@ static void rna_def_modifier_smoke(BlenderRNA *brna)
{MOD_SMOKE_TYPE_COLL, "COLLISION", 0, "Collision", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SmokeModifier", "Modifier");
+ srna = RNA_def_struct(brna, "SmokeModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Smoke Modifier", "Smoke simulation modifier");
RNA_def_struct_sdna(srna, "SmokeModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_SMOKE);
- prop= RNA_def_property(srna, "domain_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "domain_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "domain");
RNA_def_property_ui_text(prop, "Domain Settings", "");
- prop= RNA_def_property(srna, "flow_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "flow_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "flow");
RNA_def_property_ui_text(prop, "Flow Settings", "");
- prop= RNA_def_property(srna, "coll_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "coll_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "coll");
RNA_def_property_ui_text(prop, "Collision Settings", "");
- prop= RNA_def_property(srna, "smoke_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "smoke_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_smoke_type_items);
RNA_def_property_ui_text(prop, "Type", "");
@@ -2041,20 +2040,20 @@ static void rna_def_modifier_dynamic_paint(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "DynamicPaintModifier", "Modifier");
+ srna = RNA_def_struct(brna, "DynamicPaintModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Dynamic Paint Modifier", "Dynamic Paint modifier");
RNA_def_struct_sdna(srna, "DynamicPaintModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_DYNAMICPAINT);
- prop= RNA_def_property(srna, "canvas_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "canvas_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "canvas");
RNA_def_property_ui_text(prop, "Canvas Settings", "");
- prop= RNA_def_property(srna, "brush_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "brush_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "brush");
RNA_def_property_ui_text(prop, "Brush Settings", "");
- prop= RNA_def_property(srna, "ui_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "ui_type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_dynamicpaint_type_items);
@@ -2066,12 +2065,12 @@ static void rna_def_modifier_collision(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "CollisionModifier", "Modifier");
+ srna = RNA_def_struct(brna, "CollisionModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Collision Modifier", "Collision modifier defining modifier stack position used for collision");
RNA_def_struct_sdna(srna, "CollisionModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_PHYSICS);
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "CollisionSettings");
RNA_def_property_pointer_funcs(prop, "rna_CollisionModifier_settings_get", NULL, NULL, NULL);
@@ -2095,42 +2094,42 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
{BME_BEVEL_EMAX, "LARGEST", 0, "Largest", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "BevelModifier", "Modifier");
+ srna = RNA_def_struct(brna, "BevelModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Bevel Modifier", "Bevel modifier to make edges and vertices more rounded");
RNA_def_struct_sdna(srna, "BevelModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_BEVEL);
- prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "value");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10, 0.1, 4);
RNA_def_property_ui_text(prop, "Width", "Bevel value/amount");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_only_vertices", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_only_vertices", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", BME_BEVEL_VERT);
RNA_def_property_ui_text(prop, "Only Vertices", "Bevel verts/corners, not edges");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "limit_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "limit_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "lim_flags");
RNA_def_property_enum_items(prop, prop_limit_method_items);
RNA_def_property_ui_text(prop, "Limit Method", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "edge_weight_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "edge_weight_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "e_flags");
RNA_def_property_enum_items(prop, prop_edge_weight_method_items);
RNA_def_property_ui_text(prop, "Edge Weight Method", "What edge weight to use for weighting a vertex");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
#if 1 /* expose as radians */
- prop= RNA_def_property(srna, "angle_limit", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "angle_limit", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_funcs(prop, "rna_BevelModifier_angle_limit_get", "rna_BevelModifier_angle_limit_set", NULL);
RNA_def_property_range(prop, 0, DEG2RAD(180));
RNA_def_property_ui_range(prop, 0, DEG2RAD(180), 100, 2);
#else
- prop= RNA_def_property(srna, "angle_limit", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "angle_limit", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bevel_angle");
RNA_def_property_range(prop, 0, 180);
RNA_def_property_ui_range(prop, 0, 180, 100, 2);
@@ -2139,12 +2138,12 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Modifier_update");
/* BMESH_BRANCH ONLY */
- prop= RNA_def_property(srna, "use_even_offset", PROP_BOOLEAN, PROP_NONE); /* name matches solidify */
+ prop = RNA_def_property(srna, "use_even_offset", PROP_BOOLEAN, PROP_NONE); /* name matches solidify */
RNA_def_property_boolean_sdna(prop, NULL, "flags", BME_BEVEL_EVEN);
RNA_def_property_ui_text(prop, "Even", "Use even bevel distance correction");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
/* BMESH_BRANCH ONLY */
- prop= RNA_def_property(srna, "use_distance_offset", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_distance_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", BME_BEVEL_DIST);
RNA_def_property_ui_text(prop, "Distance", "Use the width as a distance in rather then a factor of the face size");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -2169,83 +2168,83 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna)
{MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, "BACK", 0, "Back", "No projection when behind the face"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ShrinkwrapModifier", "Modifier");
+ srna = RNA_def_struct(brna, "ShrinkwrapModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Shrinkwrap Modifier", "Shrink wrapping modifier to shrink wrap and object to a target");
RNA_def_struct_sdna(srna, "ShrinkwrapModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_SHRINKWRAP);
- prop= RNA_def_property(srna, "wrap_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "wrap_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "shrinkType");
RNA_def_property_enum_items(prop, shrink_type_items);
RNA_def_property_ui_text(prop, "Mode", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "cull_face", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "cull_face", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "shrinkOpts");
RNA_def_property_enum_items(prop, shrink_face_cull_items);
RNA_def_property_enum_funcs(prop, "rna_ShrinkwrapModifier_face_cull_get", "rna_ShrinkwrapModifier_face_cull_set", NULL);
RNA_def_property_ui_text(prop, "Face Cull", "Stop vertices from projecting to a face on the target when facing towards/away");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Target", "Mesh target to shrink to");
RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_target_set", NULL, "rna_Mesh_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "auxiliary_target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "auxiliary_target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "auxTarget");
RNA_def_property_ui_text(prop, "Auxiliary Target", "Additional mesh target to shrink to");
RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_auxiliary_target_set", NULL, "rna_Mesh_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "vgroup_name");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ShrinkwrapModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "keepDist");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -100, 100, 1, 2);
RNA_def_property_ui_text(prop, "Offset", "Distance to keep from the target");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_project_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_project_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS);
RNA_def_property_ui_text(prop, "X", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_project_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_project_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS);
RNA_def_property_ui_text(prop, "Y", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_project_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_project_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS);
RNA_def_property_ui_text(prop, "Z", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "subsurf_levels", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "subsurf_levels", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "subsurfLevels");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_range(prop, 0, 6, 1, 0);
RNA_def_property_ui_text(prop, "Subsurf Levels", "Number of subdivisions that must be performed before extracting vertices' positions and normals");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_negative_direction", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_negative_direction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR);
RNA_def_property_ui_text(prop, "Negative", "Allow vertices to move in the negative direction of axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_positive_direction", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_positive_direction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR);
RNA_def_property_ui_text(prop, "Positive", "Allow vertices to move in the positive direction of axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_keep_above_surface", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_keep_above_surface", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE);
RNA_def_property_ui_text(prop, "Keep Above Surface", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -2256,12 +2255,12 @@ static void rna_def_modifier_fluidsim(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "FluidSimulationModifier", "Modifier");
+ srna = RNA_def_struct(brna, "FluidSimulationModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Fluid Simulation Modifier", "Fluid simulation modifier");
RNA_def_struct_sdna(srna, "FluidsimModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_FLUIDSIM);
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "fss");
RNA_def_property_ui_text(prop, "Settings", "Settings for how this object is used in the fluid simulation");
@@ -2277,30 +2276,30 @@ static void rna_def_modifier_mask(BlenderRNA *brna)
{MOD_MASK_MODE_ARM, "ARMATURE", 0, "Armature", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MaskModifier", "Modifier");
+ srna = RNA_def_struct(brna, "MaskModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Mask Modifier", "Mask modifier to hide parts of the mesh");
RNA_def_struct_sdna(srna, "MaskModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_MASK);
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, modifier_mask_mode_items);
RNA_def_property_ui_text(prop, "Mode", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "armature", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "armature", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob_arm");
RNA_def_property_ui_text(prop, "Armature", "Armature to use as source of bones to mask");
RNA_def_property_pointer_funcs(prop, NULL, "rna_MaskModifier_armature_set", NULL, "rna_Armature_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "vgroup");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MaskModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MASK_INV);
RNA_def_property_ui_text(prop, "Invert", "Use vertices that are not part of region defined");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -2318,40 +2317,40 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna)
{MOD_SIMPLEDEFORM_MODE_STRETCH, "STRETCH", 0, "Stretch", "Stretch the object along the Z axis of the modifier space"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SimpleDeformModifier", "Modifier");
+ srna = RNA_def_struct(brna, "SimpleDeformModifier", "Modifier");
RNA_def_struct_ui_text(srna, "SimpleDeform Modifier", "Simple deformation modifier to apply effects such as twisting and bending");
RNA_def_struct_sdna(srna, "SimpleDeformModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_SIMPLEDEFORM);
- prop= RNA_def_property(srna, "deform_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "deform_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, simple_deform_mode_items);
RNA_def_property_ui_text(prop, "Mode", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "vgroup_name");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SimpleDeformModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "origin", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "origin", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Origin", "Origin of modifier space coordinates");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "originOpts", MOD_SIMPLEDEFORM_ORIGIN_LOCAL);
RNA_def_property_ui_text(prop, "Relative", "Set the origin of deform space to be relative to the object");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -10, 10, 1, 3);
RNA_def_property_ui_text(prop, "Factor", "Amount to deform object");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "limits", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "limits", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "limit");
RNA_def_property_array(prop, 2);
RNA_def_property_range(prop, 0, 1);
@@ -2359,12 +2358,12 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Limits", "Lower/Upper limits for deform");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_X);
RNA_def_property_ui_text(prop, "Lock X Axis", "Do not allow tapering along the X axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_Y);
RNA_def_property_ui_text(prop, "Lock Y Axis", "Do not allow tapering along the Y axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -2374,7 +2373,7 @@ static void rna_def_modifier_surface(BlenderRNA *brna)
{
StructRNA *srna;
- srna= RNA_def_struct(brna, "SurfaceModifier", "Modifier");
+ srna = RNA_def_struct(brna, "SurfaceModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Surface Modifier", "Surface modifier defining modifier stack position used for surface fields");
RNA_def_struct_sdna(srna, "SurfaceModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_PHYSICS);
@@ -2385,87 +2384,87 @@ static void rna_def_modifier_solidify(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SolidifyModifier", "Modifier");
+ srna = RNA_def_struct(brna, "SolidifyModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Solidify Modifier", "Create a solid skin by extruding, compensating for sharp angles");
RNA_def_struct_sdna(srna, "SolidifyModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_SOLIDIFY);
- prop= RNA_def_property(srna, "thickness", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "thickness", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "offset");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -10, 10, 0.1, 4);
RNA_def_property_ui_text(prop, "Thickness", "Thickness of the shell");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "thickness_vertex_group", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "thickness_vertex_group", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "offset_fac_vg");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
RNA_def_property_ui_text(prop, "Vertex Group Factor", "Thickness factor to use for zero vertex group influence");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "offset_fac");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -1, 1, 0.1, 4);
RNA_def_property_ui_text(prop, "Offset", "Offset the thickness from the center");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "edge_crease_inner", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "edge_crease_inner", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "crease_inner");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
RNA_def_property_ui_text(prop, "Inner Crease", "Assign a crease to inner edges");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "edge_crease_outer", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "edge_crease_outer", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "crease_outer");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
RNA_def_property_ui_text(prop, "Outer Crease", "Assign a crease to outer edges");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "edge_crease_rim", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "edge_crease_rim", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "crease_rim");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
RNA_def_property_ui_text(prop, "Rim Crease", "Assign a crease to the edges making up the rim");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "material_offset", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "material_offset", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "mat_ofs");
RNA_def_property_range(prop, SHRT_MIN, SHRT_MAX);
RNA_def_property_ui_text(prop, "Material Offset", "Offset material index of generated faces");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "material_offset_rim", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "material_offset_rim", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "mat_ofs_rim");
RNA_def_property_range(prop, SHRT_MIN, SHRT_MAX);
RNA_def_property_ui_text(prop, "Rim Material Offset", "Offset material index of generated rim faces");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SolidifyModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_rim", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_rim", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_RIM);
RNA_def_property_ui_text(prop, "Fill Rim", "Create edge loops between the inner and outer surfaces on face edges (slow, disable when not needed)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_even_offset", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_even_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_EVEN);
RNA_def_property_ui_text(prop, "Even Thickness", "Maintain thickness by adjusting for sharp corners (slow, disable when not needed)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_quality_normals", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_quality_normals", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_NORMAL_CALC);
RNA_def_property_ui_text(prop, "High Quality Normals", "Calculate normals which result in more even thickness (slow, disable when not needed)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_VGROUP_INV);
RNA_def_property_ui_text(prop, "Vertex Group Invert", "Invert the vertex group influence");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -2475,7 +2474,7 @@ static void rna_def_modifier_solidify(BlenderRNA *brna)
static void rna_def_modifier_screw(BlenderRNA *brna)
{
- static EnumPropertyItem axis_items[]= {
+ static EnumPropertyItem axis_items[] = {
{0, "X", 0, "X Axis", ""},
{1, "Y", 0, "Y Axis", ""},
{2, "Z", 0, "Z Axis", ""},
@@ -2484,63 +2483,63 @@ static void rna_def_modifier_screw(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ScrewModifier", "Modifier");
+ srna = RNA_def_struct(brna, "ScrewModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Screw Modifier", "Revolve edges");
RNA_def_struct_sdna(srna, "ScrewModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_SCREW);
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob_axis");
RNA_def_property_ui_text(prop, "Object", "Object to define the screw axis");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "steps", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "steps", PROP_INT, PROP_UNSIGNED);
RNA_def_property_range(prop, 2, 10000);
RNA_def_property_ui_range(prop, 3, 512, 1, 0);
RNA_def_property_ui_text(prop, "Steps", "Number of steps in the revolution");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "render_steps", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "render_steps", PROP_INT, PROP_UNSIGNED);
RNA_def_property_range(prop, 2, 10000);
RNA_def_property_ui_range(prop, 2, 512, 1, 0);
RNA_def_property_ui_text(prop, "Render Steps", "Number of steps in the revolution");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "iterations", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "iter");
RNA_def_property_range(prop, 1, 10000);
RNA_def_property_ui_range(prop, 1, 100, 1, 0);
RNA_def_property_ui_text(prop, "Iterations", "Number of times to apply the screw operation");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, axis_items);
RNA_def_property_ui_text(prop, "Axis", "Screw axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_ui_range(prop, 0, -M_PI*2, M_PI*2, 2);
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_text(prop, "Angle", "Angle of revolution");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "screw_offset", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "screw_offset", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "screw_ofs");
RNA_def_property_ui_text(prop, "Screw", "Offset the revolution along its axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_normal_flip", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_normal_flip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_NORMAL_FLIP);
RNA_def_property_ui_text(prop, "Flip", "Flip normals of lathed faces");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_normal_calculate", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_normal_calculate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_NORMAL_CALC);
RNA_def_property_ui_text(prop, "Calc Order", "Calculate the order of edges (needed for meshes, but not curves)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_object_screw_offset", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_object_screw_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_OBJECT_OFFSET);
RNA_def_property_ui_text(prop, "Object Screw", "Use the distance between the objects to make a screw");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -2573,41 +2572,41 @@ static void rna_def_modifier_weightvg_mask(BlenderRNA *brna, StructRNA *srna)
PropertyRNA *prop;
- prop= RNA_def_property(srna, "mask_constant", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "mask_constant", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0);
RNA_def_property_ui_text(prop, "Influence", "Global influence of current modifications on vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "mask_vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "mask_vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "mask_defgrp_name");
RNA_def_property_ui_text(prop, "Mask VGroup", "Masking vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_mask_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Masking Tex", "Masking texture");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "mask_tex_use_channel", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mask_tex_use_channel", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, weightvg_mask_tex_used_items);
RNA_def_property_ui_text(prop, "Use Channel", "Which texture channel to use for masking");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "mask_tex_mapping", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mask_tex_mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, weightvg_mask_tex_map_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", "Which texture coordinates "
"to use for mapping");
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "mask_tex_uv_layer", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "mask_tex_uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "mask_tex_uvlayer_name");
RNA_def_property_ui_text(prop, "UV Map", "UV map name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_mask_uvlayer_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "mask_tex_map_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "mask_tex_map_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mask_tex_map_obj");
RNA_def_property_ui_text(prop, "Texture Coordinate Object", "Which object to take texture "
"coordinates from");
@@ -2632,48 +2631,48 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "VertexWeightEditModifier", "Modifier");
+ srna = RNA_def_struct(brna, "VertexWeightEditModifier", "Modifier");
RNA_def_struct_ui_text(srna, "WeightVG Edit Modifier",
"Edit the weights of vertices in a group");
RNA_def_struct_sdna(srna, "WeightVGEditModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, weightvg_edit_falloff_type_items);
RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_ADD2VG);
RNA_def_property_ui_text(prop, "Group Add", "Add vertices with weight over threshold "
"to vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "use_remove", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_remove", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_REMFVG);
RNA_def_property_ui_text(prop, "Group Remove", "Remove vertices with weight below threshold "
"from vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "default_weight", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "default_weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0f);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0);
RNA_def_property_ui_text(prop, "Default Weight", "Default weight a vertex will have if "
"it is not in the vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "map_curve", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "map_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "cmap_curve");
RNA_def_property_ui_text(prop, "Mapping Curve", "Custom mapping curve");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "add_threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "add_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "add_threshold");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0);
@@ -2681,7 +2680,7 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna)
"to be added to the vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "remove_threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "remove_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rem_threshold");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0);
@@ -2716,45 +2715,45 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "VertexWeightMixModifier", "Modifier");
+ srna = RNA_def_struct(brna, "VertexWeightMixModifier", "Modifier");
RNA_def_struct_ui_text(srna, "WeightVG Mix Modifier",
"Mix the weights of two vertex groups");
RNA_def_struct_sdna(srna, "WeightVGMixModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
- prop= RNA_def_property(srna, "vertex_group_a", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_a", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name_a");
RNA_def_property_ui_text(prop, "Vertex Group A", "First vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "vertex_group_b", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_b", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name_b");
RNA_def_property_ui_text(prop, "Vertex Group B", "Second vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGMixModifier_vgroup2_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "default_weight_a", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "default_weight_a", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0f);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0);
RNA_def_property_ui_text(prop, "Default Weight A", "Default weight a vertex will have if "
"it is not in the first A vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "default_weight_b", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "default_weight_b", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0f);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0);
RNA_def_property_ui_text(prop, "Default Weight B", "Default weight a vertex will have if "
"it is not in the second B vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, weightvg_mix_modes_items);
RNA_def_property_ui_text(prop, "Mix Mode", "How weights from vgroup B affect weights "
"of vgroup A");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "mix_set", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mix_set", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, weightvg_mix_set_items);
RNA_def_property_ui_text(prop, "Vertex Set", "Which vertices should be affected");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -2794,26 +2793,26 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "VertexWeightProximityModifier", "Modifier");
+ srna = RNA_def_struct(brna, "VertexWeightProximityModifier", "Modifier");
RNA_def_struct_ui_text(srna, "WeightVG Proximity Modifier",
"Set the weights of vertices in a group from a target object's "
"distance");
RNA_def_struct_sdna(srna, "WeightVGProximityModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
- prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "proximity_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "proximity_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, weightvg_proximity_modes_items);
RNA_def_property_enum_default(prop, MOD_WVG_PROXIMITY_GEOMETRY);
RNA_def_property_ui_text(prop, "Proximity Mode", "Which distances to target object to use");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "proximity_geometry", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "proximity_geometry", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "proximity_flags");
RNA_def_property_enum_items(prop, proximity_geometry_items);
RNA_def_property_flag(prop, PROP_ENUM_FLAG); /* important to run before default set */
@@ -2823,25 +2822,25 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
"as weight");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "proximity_ob_target");
RNA_def_property_ui_text(prop, "Target Object", "Object to calculate vertices distances from");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "min_dist", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "min_dist", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0.0, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 0);
RNA_def_property_ui_text(prop, "Lowest Dist", "Distance mapping to weight 0.0");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "max_dist", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "max_dist", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0.0, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 0);
RNA_def_property_ui_text(prop, "Highest Dist", "Distance mapping to weight 1.0");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, weightvg_proximity_falloff_type_items);
RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -2852,7 +2851,7 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
static void rna_def_modifier_remesh(BlenderRNA *brna)
{
- static EnumPropertyItem mode_items[]= {
+ static EnumPropertyItem mode_items[] = {
{MOD_REMESH_CENTROID, "BLOCKS", 0, "Blocks", "Output a blocky surface with no smoothing"},
{MOD_REMESH_MASS_POINT, "SMOOTH", 0, "Smooth", "Output a smooth surface with no sharp-features detection"},
{MOD_REMESH_SHARP_FEATURES, "SHARP", 0, "Sharp", "Output a surface that reproduces sharp edges and corners from the input mesh"},
@@ -2861,41 +2860,41 @@ static void rna_def_modifier_remesh(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "RemeshModifier", "Modifier");
+ srna = RNA_def_struct(brna, "RemeshModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Remesh Modifier", "Generate a new surface with regular topology that follows the shape of the input mesh");
RNA_def_struct_sdna(srna, "RemeshModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_REMESH);
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, mode_items);
RNA_def_property_ui_text(prop, "Mode", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 0.99, 0.01, 3);
RNA_def_property_range(prop, 0, 0.99);
RNA_def_property_ui_text(prop, "Scale", "The ratio of the largest dimension of the model over the size of the grid");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Threshold", "If removing disconnected pieces, minimum size of components to preserve as a ratio of the number of polygons in the largest component");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "octree_depth", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "octree_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "depth");
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Octree Depth", "Resolution of the octree; higher values give finer details");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "sharpness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "sharpness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "hermite_num");
RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_ui_text(prop, "Sharpness", "Tolerance for outliers; lower values filter noise while higher values will reproduce edges closer to the input");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "remove_disconnected_pieces", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "remove_disconnected_pieces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_REMESH_FLOOD_FILL);
RNA_def_property_ui_text(prop, "Remove Disconnected Pieces", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -2906,36 +2905,36 @@ static void rna_def_modifier_ocean(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem geometry_items[]= {
+ static EnumPropertyItem geometry_items[] = {
{MOD_OCEAN_GEOM_GENERATE, "GENERATE", 0, "Generate", "Generate ocean surface geometry at the specified resolution"},
{MOD_OCEAN_GEOM_DISPLACE, "DISPLACE", 0, "Displace", "Displace existing geometry according to simulation"},
- //{MOD_OCEAN_GEOM_SIM_ONLY, "SIM_ONLY", 0, "Sim Only", "Leaves geometry unchanged, but still runs simulation (to be used from texture)"},
+ /*{MOD_OCEAN_GEOM_SIM_ONLY, "SIM_ONLY", 0, "Sim Only", "Leaves geometry unchanged, but still runs simulation (to be used from texture)"}, */
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "OceanModifier", "Modifier");
+ srna = RNA_def_struct(brna, "OceanModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Ocean Modifier", "Simulate an ocean surface");
RNA_def_struct_sdna(srna, "OceanModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_OCEAN);
/* General check if blender was built with OceanSim modifier support */
- prop= RNA_def_property(srna, "is_build_enabled", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_build_enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_OceanModifier_is_build_enabled_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Build Enabled", "True if the OceanSim modifier is enabled in this build");
- prop= RNA_def_property(srna, "geometry_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "geometry_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "geometry_mode");
RNA_def_property_enum_items(prop, geometry_items);
RNA_def_property_ui_text(prop, "Geometry", "Method of modifying geometry");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Size", "");
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 0);
RNA_def_property_update(prop, 0, "rna_OceanModifier_topology_update");
- prop= RNA_def_property(srna, "repeat_x", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "repeat_x", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "repeat_x");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1, 1024);
@@ -2943,7 +2942,7 @@ static void rna_def_modifier_ocean(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Repeat X", "Repetitions of the generated surface in X");
RNA_def_property_update(prop, 0, "rna_OceanModifier_topology_update");
- prop= RNA_def_property(srna, "repeat_y", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "repeat_y", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "repeat_y");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1, 1024);
@@ -2951,19 +2950,19 @@ static void rna_def_modifier_ocean(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Repeat Y", "Repetitions of the generated surface in Y");
RNA_def_property_update(prop, 0, "rna_OceanModifier_topology_update");
- prop= RNA_def_property(srna, "use_normals", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_normals", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_OCEAN_GENERATE_NORMALS);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Generate Normals", "Output normals for bump mapping - disabling can speed up performance if its not needed");
RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
- prop= RNA_def_property(srna, "use_foam", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_foam", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_OCEAN_GENERATE_FOAM);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Generate Foam", "Generate foam mask as a vertex color channel");
RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
- prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "resolution");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1, 1024);
@@ -2971,112 +2970,112 @@ static void rna_def_modifier_ocean(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Resolution", "Resolution of the generated surface");
RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
- prop= RNA_def_property(srna, "spatial_size", PROP_INT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "spatial_size", PROP_INT, PROP_DISTANCE);
RNA_def_property_int_sdna(prop, NULL, "spatial_size");
RNA_def_property_ui_range(prop, 1, 512, 2, 0);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Spatial Size", "Physical size of the simulation domain (m)");
RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
- prop= RNA_def_property(srna, "wind_velocity", PROP_FLOAT, PROP_VELOCITY);
+ prop = RNA_def_property(srna, "wind_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "wind_velocity");
RNA_def_property_ui_text(prop, "Wind Velocity", "Wind speed (m/s)");
RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
- prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "damping", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "damp");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Damping", "Damp reflected waves going in opposite direction to the wind");
RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
- prop= RNA_def_property(srna, "wave_scale_min", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "wave_scale_min", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "smallest_wave");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0, FLT_MAX);
RNA_def_property_ui_text(prop, "Smallest Wave", "Shortest allowed wavelength (m)");
RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
- prop= RNA_def_property(srna, "wave_alignment", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "wave_alignment", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "wave_alignment");
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Wave Alignment", "");
RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
- prop= RNA_def_property(srna, "wave_direction", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "wave_direction", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "wave_direction");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Wave Direction", "");
RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
- prop= RNA_def_property(srna, "wave_scale", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "wave_scale", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "wave_scale");
RNA_def_property_ui_text(prop, "Wave Scale", "");
RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update");
- prop= RNA_def_property(srna, "depth", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "depth", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "depth");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Depth", "");
RNA_def_property_ui_range(prop, 0, 250, 1, 0);
RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
- prop= RNA_def_property(srna, "foam_coverage", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "foam_coverage", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "foam_coverage");
RNA_def_property_ui_text(prop, "Foam Coverage", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "bake_foam_fade", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "bake_foam_fade", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "foam_fade");
RNA_def_property_ui_text(prop, "Foam Fade", "");
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 0);
RNA_def_property_update(prop, 0, NULL);
- prop= RNA_def_property(srna, "foam_layer_name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "foam_layer_name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "foamlayername");
RNA_def_property_ui_text(prop, "Foam Layer Name", "Name of the vertex color layer used for foam");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "choppiness", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "choppiness", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "chop_amount");
RNA_def_property_ui_text(prop, "Choppiness", "");
RNA_def_property_ui_range(prop, 0.0, 4.0, 3, 0);
RNA_def_property_float_funcs(prop, NULL, "rna_OceanModifier_ocean_chop_set", NULL);
RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update");
- prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "time");
RNA_def_property_ui_text(prop, "Time", "");
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 0);
RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update");
- prop= RNA_def_property(srna, "random_seed", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "random_seed", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "seed");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Random Seed", "");
RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
- prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "bakestart");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Bake Start", "");
RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
- prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "bakeend");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Bake End", "");
RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
- prop= RNA_def_property(srna, "is_cached", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_cached", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cached", 1);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Ocean is Cached", "Whether the ocean is using cached data or simulating");
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "cachepath");
RNA_def_property_ui_text(prop, "Cache Path", "Path to a folder to store external baked images");
- //RNA_def_property_update(prop, 0, "rna_Modifier_update");
- // XXX how to update?
+ /*RNA_def_property_update(prop, 0, "rna_Modifier_update"); */
+ /* XXX how to update? */
}
void RNA_def_modifier(BlenderRNA *brna)
@@ -3085,57 +3084,57 @@ void RNA_def_modifier(BlenderRNA *brna)
PropertyRNA *prop;
/* data */
- srna= RNA_def_struct(brna, "Modifier", NULL);
+ srna = RNA_def_struct(brna, "Modifier", NULL);
RNA_def_struct_ui_text(srna , "Modifier", "Modifier affecting the geometry data of an object");
RNA_def_struct_refine_func(srna, "rna_Modifier_refine");
RNA_def_struct_path_func(srna, "rna_Modifier_path");
RNA_def_struct_sdna(srna, "ModifierData");
/* strings */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Modifier_name_set");
RNA_def_property_ui_text(prop, "Name", "Modifier name");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER|NA_RENAME, NULL);
RNA_def_struct_name_property(srna, prop);
/* enums */
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, modifier_type_items);
RNA_def_property_ui_text(prop, "Type", "");
/* flags */
- prop= RNA_def_property(srna, "show_viewport", PROP_BOOLEAN, PROP_NONE);
+ 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", "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);
- prop= RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Render);
RNA_def_property_ui_text(prop, "Render", "Use modifier during rendering");
RNA_def_property_ui_icon(prop, ICON_SCENE, 0);
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL);
- prop= RNA_def_property(srna, "show_in_editmode", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_in_editmode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Editmode);
RNA_def_property_ui_text(prop, "Editmode", "Use modifier while in the edit mode");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0);
- prop= RNA_def_property(srna, "show_on_cage", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_on_cage", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_OnCage);
RNA_def_property_ui_text(prop, "On Cage", "Enable direct editing of modifier control cage");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded);
RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
- prop= RNA_def_property(srna, "use_apply_on_spline", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_apply_on_spline", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_ApplyOnSpline);
RNA_def_property_ui_text(prop, "Apply on spline", "Apply this and all preceding deformation modifiers on splines' points rather than on filled curve/surface");
RNA_def_property_ui_icon(prop, ICON_SURFACE_DATA, 0);
diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c
index a640f996b1a..9b558d9dcdf 100644
--- a/source/blender/makesrna/intern/rna_movieclip.c
+++ b/source/blender/makesrna/intern/rna_movieclip.c
@@ -52,7 +52,7 @@
static void rna_MovieClip_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
BKE_movieclip_reload(clip);
DAG_id_tag_update(&clip->id, 0);
@@ -60,10 +60,10 @@ static void rna_MovieClip_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene
static void rna_MovieClip_size_get(PointerRNA *ptr, int *values)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
- values[0]= clip->lastsize[0];
- values[1]= clip->lastsize[1];
+ values[0] = clip->lastsize[0];
+ values[1] = clip->lastsize[1];
}
#else
@@ -73,7 +73,7 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static const EnumPropertyItem clip_tc_items[]= {
+ static const EnumPropertyItem clip_tc_items[] = {
{IMB_TC_NONE, "NONE", 0, "No TC in use", ""},
{IMB_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run", "Use images in the order they are recorded"},
{IMB_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", "Use global timestamp written by recording device"},
@@ -86,70 +86,70 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "MovieClipProxy");
/* build proxy sized */
- prop= RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_25);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "25%", "Build proxy resolution 25% of the original footage dimension");
- prop= RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_50);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "50%", "Build proxy resolution 50% of the original footage dimension");
- prop= RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_75);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "75%", "Build proxy resolution 75% of the original footage dimension");
- prop= RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_100);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "100%", "Build proxy resolution 100% of the original footage dimension");
- prop= RNA_def_property(srna, "build_undistorted_25", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_undistorted_25", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_25);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "25%", "Build proxy resolution 25% of the original undistorted footage dimension");
- prop= RNA_def_property(srna, "build_undistorted_50", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_undistorted_50", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_50);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "50%", "Build proxy resolution 50% of the original undistorted footage dimension");
- prop= RNA_def_property(srna, "build_undistorted_75", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_undistorted_75", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_75);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "75%", "Build proxy resolution 75% of the original undistorted footage dimension");
- prop= RNA_def_property(srna, "build_undistorted_100", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_undistorted_100", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_100);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "100%", "Build proxy resolution 100% of the original undistorted footage dimension");
/* build timecodes */
- prop= RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_RECORD_RUN);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index");
- prop= RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_FREE_RUN);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index");
- prop= RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time");
/* quality of proxied image */
- prop= RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "quality");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Quality", "JPEG quality of proxy images");
RNA_def_property_ui_range(prop, 1, 100, 1, 0);
- prop= RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "tc");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, clip_tc_items);
@@ -157,7 +157,7 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* directory */
- prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "dir");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files");
@@ -177,24 +177,24 @@ static void rna_def_moviecliUser(BlenderRNA *brna)
{MCLIP_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MovieClipUser", NULL);
+ srna = RNA_def_struct(brna, "MovieClipUser", NULL);
RNA_def_struct_ui_text(srna, "Movie Clip User", "Parameters defining how a MovieClip datablock is used by another datablock");
- prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "current_frame", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_sdna(prop, NULL, "framenr");
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Current Frame", "Current frame number in movie or image sequence");
/* render size */
- prop= RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "render_size");
RNA_def_property_enum_items(prop, clip_render_size_items);
RNA_def_property_ui_text(prop, "Proxy render size", "Draw preview using full resolution or different proxy resolutions");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* render undistorted */
- prop= RNA_def_property(srna, "use_render_undistorted", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_render_undistorted", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "render_flag", MCLIP_PROXY_RENDER_UNDISTORT);
RNA_def_property_ui_text(prop, "Render Undistorted", "Render preview using undistorted proxy");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
@@ -204,7 +204,7 @@ static void rna_def_movieClipScopes(BlenderRNA *brna)
{
StructRNA *srna;
- srna= RNA_def_struct(brna, "MovieClipScopes", NULL);
+ srna = RNA_def_struct(brna, "MovieClipScopes", NULL);
RNA_def_struct_ui_text(srna, "MovieClipScopes", "Scopes for statistical view of a movie clip");
}
@@ -214,38 +214,38 @@ static void rna_def_movieclip(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem clip_source_items[]= {
+ static EnumPropertyItem clip_source_items[] = {
{MCLIP_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"},
{MCLIP_SRC_MOVIE, "MOVIE", 0, "Movie File", "Movie file"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MovieClip", "ID");
+ srna = RNA_def_struct(brna, "MovieClip", "ID");
RNA_def_struct_ui_text(srna, "MovieClip", "MovieClip datablock referencing an external movie file");
RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ 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", "Filename of the movie or sequence file");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update");
- prop= RNA_def_property(srna, "tracking", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "tracking", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "MovieTracking");
- prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "MovieClipProxy");
/* use proxy */
- prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this clip");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
- prop= RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size" , "Width and height in pixels, zero when image data cant be loaded" , 0 , 0);
+ prop = RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size" , "Width and height in pixels, zero when image data cant be loaded" , 0 , 0);
RNA_def_property_int_funcs(prop, "rna_MovieClip_size_get" , NULL, NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "aspx");
RNA_def_property_array(prop, 2);
RNA_def_property_range(prop, 0.1f, 5000.0f);
@@ -254,20 +254,20 @@ static void rna_def_movieclip(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* source */
- prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, clip_source_items);
RNA_def_property_ui_text(prop, "Source", "Where the clip comes from");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* custom proxy directory */
- prop= RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY_CUSTOM_DIR);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Create proxy images in a custom directory (default is movie location)");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update");
/* grease pencil */
- prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "gpd");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "GreasePencil");
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index b2ea4cd966b..f790f0c56d1 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -56,32 +56,32 @@
static void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value)
{
- NlaStrip *data= (NlaStrip *)ptr->data;
+ NlaStrip *data = (NlaStrip *)ptr->data;
/* copy the name first */
BLI_strncpy_utf8(data->name, value, sizeof(data->name));
/* validate if there's enough info to do so */
if (ptr->id.data) {
- AnimData *adt= BKE_animdata_from_id(ptr->id.data);
+ AnimData *adt = BKE_animdata_from_id(ptr->id.data);
BKE_nlastrip_validate_name(adt, data);
}
}
static char *rna_NlaStrip_path(PointerRNA *ptr)
{
- NlaStrip *strip= (NlaStrip *)ptr->data;
- AnimData *adt= BKE_animdata_from_id(ptr->id.data);
+ NlaStrip *strip = (NlaStrip *)ptr->data;
+ AnimData *adt = BKE_animdata_from_id(ptr->id.data);
/* if we're attached to AnimData, try to resolve path back to AnimData */
if (adt) {
NlaTrack *nlt;
NlaStrip *nls;
- for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) {
+ for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) {
for (nls = nlt->strips.first; nls; nls = nls->next) {
if (nls == strip) {
- // XXX but if we animate like this, the control will never work...
+ /* XXX but if we animate like this, the control will never work... */
return BLI_sprintfN("animation_data.nla_tracks[\"%s\"].strips[\"%s\"]", nlt->name, strip->name);
}
}
@@ -94,14 +94,14 @@ static char *rna_NlaStrip_path(PointerRNA *ptr)
static void rna_NlaStrip_transform_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- NlaStrip *strip= (NlaStrip*)ptr->data;
+ NlaStrip *strip = (NlaStrip*)ptr->data;
BKE_nlameta_flush_transforms(strip);
}
static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value)
{
- NlaStrip *data= (NlaStrip*)ptr->data;
+ NlaStrip *data = (NlaStrip*)ptr->data;
/* clamp value to lie within valid limits
* - cannot start past the end of the strip + some flexibility threshold
@@ -115,7 +115,7 @@ static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value)
CLAMP(value, data->prev->start+NLASTRIP_MIN_LEN_THRESH, data->end-NLASTRIP_MIN_LEN_THRESH);
/* readjust the transition to stick to the endpoints of the action-clips */
- data->prev->end= value;
+ data->prev->end = value;
}
else {
CLAMP(value, data->prev->end, data->end-NLASTRIP_MIN_LEN_THRESH);
@@ -124,12 +124,12 @@ static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value)
else {
CLAMP(value, MINAFRAME, data->end);
}
- data->start= value;
+ data->start = value;
}
static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value)
{
- NlaStrip *data= (NlaStrip*)ptr->data;
+ NlaStrip *data = (NlaStrip*)ptr->data;
/* clamp value to lie within valid limits
* - must not have zero or negative length strip, so cannot start before the first frame
@@ -143,7 +143,7 @@ static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value)
CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, data->next->end-NLASTRIP_MIN_LEN_THRESH);
/* readjust the transition to stick to the endpoints of the action-clips */
- data->next->start= value;
+ data->next->start = value;
}
else {
CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, data->next->start);
@@ -152,29 +152,29 @@ static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value)
else {
CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, MAXFRAME);
}
- data->end= value;
+ data->end = value;
/* calculate the lengths the strip and its action (if applicable) */
if (data->type == NLASTRIP_TYPE_CLIP) {
float len, actlen;
- len= data->end - data->start;
- actlen= data->actend - data->actstart;
- if (IS_EQF(actlen, 0.0f)) actlen= 1.0f;
+ len = data->end - data->start;
+ actlen = data->actend - data->actstart;
+ if (IS_EQF(actlen, 0.0f)) actlen = 1.0f;
/* now, adjust the 'scale' setting to reflect this (so that this change can be valid) */
- data->scale= len / ((actlen) * data->repeat);
+ data->scale = len / ((actlen) * data->repeat);
}
}
static void rna_NlaStrip_scale_set(PointerRNA *ptr, float value)
{
- NlaStrip *data= (NlaStrip*)ptr->data;
+ NlaStrip *data = (NlaStrip*)ptr->data;
/* set scale value */
CLAMP(value, 0.0001f, 1000.0f); /* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */
- data->scale= value;
+ data->scale = value;
/* adjust the strip extents in response to this */
BKE_nlastrip_recalculate_bounds(data);
@@ -182,11 +182,11 @@ static void rna_NlaStrip_scale_set(PointerRNA *ptr, float value)
static void rna_NlaStrip_repeat_set(PointerRNA *ptr, float value)
{
- NlaStrip *data= (NlaStrip*)ptr->data;
+ NlaStrip *data = (NlaStrip*)ptr->data;
/* set repeat value */
CLAMP(value, 0.01f, 1000.0f); /* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */
- data->repeat= value;
+ data->repeat = value;
/* adjust the strip extents in response to this */
BKE_nlastrip_recalculate_bounds(data);
@@ -194,30 +194,30 @@ static void rna_NlaStrip_repeat_set(PointerRNA *ptr, float value)
static void rna_NlaStrip_blend_in_set(PointerRNA *ptr, float value)
{
- NlaStrip *data= (NlaStrip*)ptr->data;
+ NlaStrip *data = (NlaStrip*)ptr->data;
float len;
/* blend-in is limited to the length of the strip, and also cannot overlap with blendout */
- len= (data->end - data->start) - data->blendout;
+ len = (data->end - data->start) - data->blendout;
CLAMP(value, 0, len);
- data->blendin= value;
+ data->blendin = value;
}
static void rna_NlaStrip_blend_out_set(PointerRNA *ptr, float value)
{
- NlaStrip *data= (NlaStrip*)ptr->data;
+ NlaStrip *data = (NlaStrip*)ptr->data;
float len;
/* blend-out is limited to the length of the strip */
- len= (data->end - data->start);
+ len = (data->end - data->start);
CLAMP(value, 0, len);
/* it also cannot overlap with blendin */
if ((len - value) < data->blendin)
- value= len - data->blendin;
+ value = len - data->blendin;
- data->blendout= value;
+ data->blendout = value;
}
static int rna_NlaStrip_action_editable(PointerRNA *ptr)
@@ -245,24 +245,24 @@ static int rna_NlaStrip_action_editable(PointerRNA *ptr)
static void rna_NlaStrip_action_start_frame_set(PointerRNA *ptr, float value)
{
- NlaStrip *data= (NlaStrip*)ptr->data;
+ NlaStrip *data = (NlaStrip*)ptr->data;
/* prevent start frame from occurring after end of action */
CLAMP(value, MINAFRAME, data->actend);
- data->actstart= value;
+ data->actstart = value;
/* adjust the strip extents in response to this */
- // TODO: should the strip be moved backwards instead as a special case?
+ /* TODO: should the strip be moved backwards instead as a special case? */
BKE_nlastrip_recalculate_bounds(data);
}
static void rna_NlaStrip_action_end_frame_set(PointerRNA *ptr, float value)
{
- NlaStrip *data= (NlaStrip*)ptr->data;
+ NlaStrip *data = (NlaStrip*)ptr->data;
/* prevent end frame from starting before start of action */
CLAMP(value, data->actstart, MAXFRAME);
- data->actend= value;
+ data->actend = value;
/* adjust the strip extents in response to this */
BKE_nlastrip_recalculate_bounds(data);
@@ -270,7 +270,7 @@ static void rna_NlaStrip_action_end_frame_set(PointerRNA *ptr, float value)
static void rna_NlaStrip_animated_influence_set(PointerRNA *ptr, int value)
{
- NlaStrip *data= (NlaStrip*)ptr->data;
+ NlaStrip *data = (NlaStrip*)ptr->data;
if (value) {
/* set the flag, then make sure a curve for this exists */
@@ -283,7 +283,7 @@ static void rna_NlaStrip_animated_influence_set(PointerRNA *ptr, int value)
static void rna_NlaStrip_animated_time_set(PointerRNA *ptr, int value)
{
- NlaStrip *data= (NlaStrip*)ptr->data;
+ NlaStrip *data = (NlaStrip*)ptr->data;
if (value) {
/* set the flag, then make sure a curve for this exists */
@@ -343,7 +343,7 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo
static void rna_NlaStrip_remove(NlaTrack *track, bContext *C, ReportList *reports, NlaStrip *strip)
{
- if(BLI_findindex(&track->strips, strip) == -1) {
+ if (BLI_findindex(&track->strips, strip) == -1) {
BKE_reportf(reports, RPT_ERROR, "NLA's Strip '%s' not found in track '%s'", strip->name, track->name);
return;
}
@@ -382,71 +382,71 @@ static void rna_def_nlastrip(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
/* struct definition */
- srna= RNA_def_struct(brna, "NlaStrip", NULL);
+ srna = RNA_def_struct(brna, "NlaStrip", NULL);
RNA_def_struct_ui_text(srna, "NLA Strip", "A container referencing an existing Action");
RNA_def_struct_path_func(srna, "rna_NlaStrip_path");
- RNA_def_struct_ui_icon(srna, ICON_NLA); // XXX
+ RNA_def_struct_ui_icon(srna, ICON_NLA); /* XXX */
/* name property */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_NlaStrip_name_set");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Enums */
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, not editable, since this is dangerous
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* XXX for now, not editable, since this is dangerous */
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of NLA Strip");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extendmode");
RNA_def_property_enum_items(prop, nla_mode_extend_items);
RNA_def_property_ui_text(prop, "Extrapolation", "Action to take for gaps past the strip extents");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blendmode");
RNA_def_property_enum_items(prop, nla_mode_blend_items);
RNA_def_property_ui_text(prop, "Blending", "Method used for combining strip's result with accumulated result");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Strip extents */
- prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "start");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Start Frame", "");
RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update");
- prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "end");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "End Frame", "");
RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update");
/* Blending */
- prop= RNA_def_property(srna, "blend_in", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "blend_in", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "blendin");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_in_set", NULL);
RNA_def_property_ui_text(prop, "Blend In", "Number of frames at start of strip to fade in influence");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "blendout");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_out_set", NULL);
RNA_def_property_ui_text(prop, "Blend Out", "");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "use_auto_blend", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_blend", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_AUTO_BLENDS);
RNA_def_property_ui_text(prop, "Auto Blend In/Out", "Number of frames for Blending In/Out is automatically determined from overlapping strips");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Action */
- prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act");
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Action_id_poll");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -455,27 +455,27 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Action extents */
- prop= RNA_def_property(srna, "action_frame_start", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "action_frame_start", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "actstart");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Action Start Frame", "");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "action_frame_end", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "action_frame_end", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "actend");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "Action End Frame", "");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Action Reuse */
- prop= RNA_def_property(srna, "repeat", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "repeat", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "repeat");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_repeat_set", NULL);
RNA_def_property_range(prop, 0.1f, 1000.0f); /* these limits have currently be chosen arbitarily, but could be extended (minimum should still be > 0 though) if needed... */
RNA_def_property_ui_text(prop, "Repeat", "Number of times to repeat the action range");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scale");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_scale_set", NULL);
RNA_def_property_range(prop, 0.0001f, 1000.0f); /* these limits can be extended, but beyond this, we can get some crazy+annoying bugs due to numeric errors */
@@ -483,72 +483,72 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Strip's F-Curves */
- prop= RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "FCurve");
RNA_def_property_ui_text(prop, "F-Curves", "F-Curves for controlling the strip's influence and timing");
/* Strip's F-Modifiers */
- prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "FModifier");
RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting all the F-Curves in the referenced Action");
/* Strip's Sub-Strips (for Meta-Strips) */
- prop= RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "NlaStrip");
RNA_def_property_ui_text(prop, "NLA Strips", "NLA Strips that this strip acts as a container for (if it is of type Meta)");
/* Settings - Values necessary for evaluation */
- prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Influence", "Amount the strip contributes to the current result");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "strip_time", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "strip_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_ui_text(prop, "Strip Time", "Frame of referenced Action to evaluate");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- // TODO: should the animated_influence/time settings be animatable themselves?
- prop= RNA_def_property(srna, "use_animated_influence", PROP_BOOLEAN, PROP_NONE);
+ /* TODO: should the animated_influence/time settings be animatable themselves? */
+ prop = RNA_def_property(srna, "use_animated_influence", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_INFLUENCE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_influence_set");
RNA_def_property_ui_text(prop, "Animated Influence", "Influence setting is controlled by an F-Curve rather than automatically determined");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "use_animated_time", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_animated_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME);
RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_time_set");
RNA_def_property_ui_text(prop, "Animated Strip Time", "Strip time is controlled by an F-Curve rather than automatically determined");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "use_animated_time_cyclic", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_animated_time_cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic Strip Time", "Cycle the animated time within the action start & end");
- RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update"); // is there a better update flag?
+ RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update"); /* is there a better update flag? */
/* settings */
- prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_ACTIVE);
RNA_def_property_ui_text(prop, "Active", "NLA Strip is active");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_SELECT);
RNA_def_property_ui_text(prop, "Select", "NLA Strip is selected");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_MUTED);
RNA_def_property_ui_text(prop, "Muted", "NLA Strip is not evaluated");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "use_reverse", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_reverse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_REVERSE);
RNA_def_property_ui_text(prop, "Reversed", "NLA Strip is played back in reverse order (only when timing is automatically determined)");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- // TODO:
- // - sync length
+ /* TODO: */
+ /* - sync length */
}
static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop)
@@ -558,14 +558,14 @@ static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
RNA_def_property_srna(cprop, "NlaStrips");
- srna= RNA_def_struct(brna, "NlaStrips", NULL);
+ srna = RNA_def_struct(brna, "NlaStrips", NULL);
RNA_def_struct_sdna(srna, "NlaTrack");
RNA_def_struct_ui_text(srna, "Nla Strips", "Collection of Nla Strips");
func = RNA_def_function(srna, "new", "rna_NlaStrip_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new Action-Clip strip to the track");
- parm= RNA_def_string(func, "name", "NlaStrip", 0, "", "Name for the NLA Strips");
+ parm = RNA_def_string(func, "name", "NlaStrip", 0, "", "Name for the NLA Strips");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm = RNA_def_int(func, "start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame for this strip", INT_MIN, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -587,47 +587,47 @@ static void rna_def_nlatrack(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "NlaTrack", NULL);
+ srna = RNA_def_struct(brna, "NlaTrack", NULL);
RNA_def_struct_ui_text(srna, "NLA Track", "A animation layer containing Actions referenced as NLA strips");
RNA_def_struct_ui_icon(srna, ICON_NLA);
/* strips collection */
- prop= RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "NlaStrip");
RNA_def_property_ui_text(prop, "NLA Strips", "NLA Strips on this NLA-track");
rna_api_nlatrack_strips(brna, prop);
/* name property */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* settings */
- prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_ACTIVE);
RNA_def_property_ui_text(prop, "Active", "NLA Track is active");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "is_solo", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_solo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SOLO);
RNA_def_property_ui_text(prop, "Solo", "NLA Track is evaluated itself (i.e. active Action and all other NLA Tracks in the same AnimData block are disabled)");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SELECTED);
RNA_def_property_ui_text(prop, "Select", "NLA Track is selected");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_MUTED);
RNA_def_property_ui_text(prop, "Muted", "NLA Track is not evaluated");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
- prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_PROTECTED);
RNA_def_property_ui_text(prop, "Locked", "NLA Track is locked");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 01131709f3b..d3a2e406992 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -187,7 +187,7 @@ static StructRNA *rna_Node_refine(struct PointerRNA *ptr)
{
bNode *node = (bNode*)ptr->data;
- switch(node->type) {
+ switch (node->type) {
#define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \
case ID: return &RNA_##Category##StructName;
@@ -208,9 +208,9 @@ static StructRNA *rna_Node_refine(struct PointerRNA *ptr)
static StructRNA *rna_NodeTree_refine(struct PointerRNA *ptr)
{
- bNodeTree *ntree= (bNodeTree*)ptr->data;
+ bNodeTree *ntree = (bNodeTree*)ptr->data;
- switch(ntree->type) {
+ switch (ntree->type) {
case NTREE_SHADER:
return &RNA_ShaderNodeTree;
case NTREE_COMPOSIT:
@@ -224,14 +224,14 @@ static StructRNA *rna_NodeTree_refine(struct PointerRNA *ptr)
static char *rna_Node_path(PointerRNA *ptr)
{
- bNode *node= (bNode*)ptr->data;
+ bNode *node = (bNode*)ptr->data;
return BLI_sprintfN("nodes[\"%s\"]", node->name);
}
static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr)
{
- bNodeSocket *sock= (bNodeSocket*)ptr->data;
+ bNodeSocket *sock = (bNodeSocket*)ptr->data;
if (sock->default_value) {
/* This returns the refined socket type with the full definition
@@ -240,8 +240,8 @@ static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr)
#define SUBTYPE(socktype, stypename, id, idname) \
{ \
- bNodeSocketValue##stypename *value= (bNodeSocketValue##stypename*)sock->default_value; \
- if (value->subtype==PROP_##id) \
+ bNodeSocketValue##stypename *value = (bNodeSocketValue##stypename*)sock->default_value; \
+ if (value->subtype == PROP_##id) \
return &RNA_NodeSocket##stypename##idname; \
}
@@ -277,8 +277,8 @@ static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr)
static char *rna_NodeSocket_path(PointerRNA *ptr)
{
- bNodeTree *ntree= (bNodeTree*)ptr->id.data;
- bNodeSocket *sock= (bNodeSocket*)ptr->data;
+ bNodeTree *ntree = (bNodeTree*)ptr->id.data;
+ bNodeSocket *sock = (bNodeSocket*)ptr->data;
bNode *node;
int socketindex;
@@ -308,21 +308,21 @@ static char *rna_NodeSocket_path(PointerRNA *ptr)
/* Button Set Funcs for Matte Nodes */
static void rna_Matte_t1_set(PointerRNA *ptr, float value)
{
- bNode *node= (bNode*)ptr->data;
+ bNode *node = (bNode*)ptr->data;
NodeChroma *chroma = node->storage;
chroma->t1 = value;
- if(value < chroma->t2)
+ if (value < chroma->t2)
chroma->t2 = value;
}
static void rna_Matte_t2_set(PointerRNA *ptr, float value)
{
- bNode *node= (bNode*)ptr->data;
+ bNode *node = (bNode*)ptr->data;
NodeChroma *chroma = node->storage;
- if(value > chroma->t1)
+ if (value > chroma->t1)
value = chroma->t1;
chroma->t2 = value;
@@ -330,14 +330,14 @@ static void rna_Matte_t2_set(PointerRNA *ptr, float value)
static void rna_Node_scene_set(PointerRNA *ptr, PointerRNA value)
{
- bNode *node= (bNode*)ptr->data;
+ bNode *node = (bNode*)ptr->data;
if (node->id) {
id_us_min(node->id);
- node->id= NULL;
+ node->id = NULL;
}
- node->id= value.data;
+ node->id = value.data;
id_us_plus(node->id);
}
@@ -351,16 +351,16 @@ static void node_update(Main *bmain, Scene *UNUSED(scene), bNodeTree *ntree, bNo
static void rna_Node_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- bNodeTree *ntree= (bNodeTree*)ptr->id.data;
- bNode *node= (bNode*)ptr->data;
+ bNodeTree *ntree = (bNodeTree*)ptr->id.data;
+ bNode *node = (bNode*)ptr->data;
node_update(bmain, scene, ntree, node);
}
static void rna_Node_image_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- bNodeTree *ntree= (bNodeTree*)ptr->id.data;
- bNode *node= (bNode*)ptr->data;
+ bNodeTree *ntree = (bNodeTree*)ptr->id.data;
+ bNode *node = (bNode*)ptr->data;
node_update(bmain, scene, ntree, node);
WM_main_add_notifier(NC_IMAGE, NULL);
@@ -368,10 +368,10 @@ static void rna_Node_image_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Node_material_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- bNodeTree *ntree= (bNodeTree*)ptr->id.data;
- bNode *node= (bNode*)ptr->data;
+ bNodeTree *ntree = (bNodeTree*)ptr->id.data;
+ bNode *node = (bNode*)ptr->data;
- if(node->id)
+ if (node->id)
nodeSetActive(ntree, node);
node_update(bmain, scene, ntree, node);
@@ -379,8 +379,8 @@ static void rna_Node_material_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_NodeGroup_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- bNodeTree *ntree= (bNodeTree*)ptr->id.data;
- bNode *node= (bNode*)ptr->data;
+ bNodeTree *ntree = (bNodeTree*)ptr->id.data;
+ bNode *node = (bNode*)ptr->data;
ntreeUpdateTree((bNodeTree *)node->id);
@@ -389,8 +389,8 @@ static void rna_NodeGroup_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Node_name_set(PointerRNA *ptr, const char *value)
{
- bNodeTree *ntree= (bNodeTree*)ptr->id.data;
- bNode *node= (bNode*)ptr->data;
+ bNodeTree *ntree = (bNodeTree*)ptr->id.data;
+ bNode *node = (bNode*)ptr->data;
char oldname[sizeof(node->name)];
/* make a copy of the old name first */
@@ -406,8 +406,8 @@ static void rna_Node_name_set(PointerRNA *ptr, const char *value)
static void rna_NodeSocket_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- bNodeTree *ntree= (bNodeTree*)ptr->id.data;
- bNodeSocket *sock= (bNodeSocket*)ptr->data;
+ bNodeTree *ntree = (bNodeTree*)ptr->id.data;
+ bNodeSocket *sock = (bNodeSocket*)ptr->data;
bNode *node;
if (nodeFindNode(ntree, sock, &node, NULL, NULL))
@@ -416,8 +416,8 @@ static void rna_NodeSocket_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_NodeGroupSocket_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- bNodeTree *ntree= (bNodeTree*)ptr->id.data;
- bNodeSocket *sock= (bNodeSocket*)ptr->data;
+ bNodeTree *ntree = (bNodeTree*)ptr->id.data;
+ bNodeSocket *sock = (bNodeSocket*)ptr->data;
bNode *node;
ntreeUpdateTree(ntree);
@@ -429,7 +429,7 @@ static void rna_NodeGroupSocket_update(Main *bmain, Scene *scene, PointerRNA *pt
#if 0 /* UNUSED */
static void rna_NodeLink_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- bNodeTree *ntree= (bNodeTree*)ptr->id.data;
+ bNodeTree *ntree = (bNodeTree*)ptr->id.data;
ntree->update |= NTREE_UPDATE_LINKS;
ntreeUpdateTree(ntree);
@@ -438,33 +438,33 @@ static void rna_NodeLink_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_NodeSocketInt_range(PointerRNA *ptr, int *min, int *max)
{
- bNodeSocket *sock= (bNodeSocket*)ptr->data;
- bNodeSocketValueInt *val= (bNodeSocketValueInt*)sock->default_value;
+ bNodeSocket *sock = (bNodeSocket*)ptr->data;
+ bNodeSocketValueInt *val = (bNodeSocketValueInt*)sock->default_value;
*min = val->min;
*max = val->max;
}
static void rna_NodeSocketFloat_range(PointerRNA *ptr, float *min, float *max)
{
- bNodeSocket *sock= (bNodeSocket*)ptr->data;
- bNodeSocketValueFloat *val= (bNodeSocketValueFloat*)sock->default_value;
+ bNodeSocket *sock = (bNodeSocket*)ptr->data;
+ bNodeSocketValueFloat *val = (bNodeSocketValueFloat*)sock->default_value;
*min = val->min;
*max = val->max;
}
static void rna_NodeSocketVector_range(PointerRNA *ptr, float *min, float *max)
{
- bNodeSocket *sock= (bNodeSocket*)ptr->data;
- bNodeSocketValueVector *val= (bNodeSocketValueVector*)sock->default_value;
+ bNodeSocket *sock = (bNodeSocket*)ptr->data;
+ bNodeSocketValueVector *val = (bNodeSocketValueVector*)sock->default_value;
*min = val->min;
*max = val->max;
}
static void rna_Node_image_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- bNode *node= (bNode*)ptr->data;
+ bNode *node = (bNode*)ptr->data;
Image *ima = (Image *)node->id;
- ImageUser *iuser= node->storage;
+ ImageUser *iuser = node->storage;
BKE_image_multilayer_index(ima->rr, iuser);
BKE_image_signal(ima, iuser, IMA_SIGNAL_SRC_CHANGE);
@@ -474,16 +474,16 @@ static void rna_Node_image_layer_update(Main *bmain, Scene *scene, PointerRNA *p
static EnumPropertyItem *renderresult_layers_add_enum(RenderLayer *rl)
{
- EnumPropertyItem *item= NULL;
+ EnumPropertyItem *item = NULL;
EnumPropertyItem tmp = {0, "", 0, "", ""};
- int i=0, totitem=0;
+ int i = 0, totitem = 0;
while (rl) {
tmp.identifier = rl->name;
- tmp.name= rl->name;
+ tmp.name = rl->name;
tmp.value = i++;
RNA_enum_item_add(&item, &totitem, &tmp);
- rl=rl->next;
+ rl = rl->next;
}
RNA_enum_item_end(&item, &totitem);
@@ -493,9 +493,9 @@ static EnumPropertyItem *renderresult_layers_add_enum(RenderLayer *rl)
static EnumPropertyItem *rna_Node_image_layer_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{
- bNode *node= (bNode*)ptr->data;
+ bNode *node = (bNode*)ptr->data;
Image *ima = (Image *)node->id;
- EnumPropertyItem *item= NULL;
+ EnumPropertyItem *item = NULL;
RenderLayer *rl;
if (!ima || !(ima->rr)) return NULL;
@@ -503,16 +503,16 @@ static EnumPropertyItem *rna_Node_image_layer_itemf(bContext *UNUSED(C), Pointer
rl = ima->rr->layers.first;
item = renderresult_layers_add_enum(rl);
- *free= 1;
+ *free = 1;
return item;
}
static EnumPropertyItem *rna_Node_scene_layer_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{
- bNode *node= (bNode*)ptr->data;
+ bNode *node = (bNode*)ptr->data;
Scene *sce = (Scene *)node->id;
- EnumPropertyItem *item= NULL;
+ EnumPropertyItem *item = NULL;
RenderLayer *rl;
if (!sce) return NULL;
@@ -520,49 +520,49 @@ static EnumPropertyItem *rna_Node_scene_layer_itemf(bContext *UNUSED(C), Pointer
rl = sce->r.layers.first;
item = renderresult_layers_add_enum(rl);
- *free= 1;
+ *free = 1;
return item;
}
static EnumPropertyItem *rna_Node_channel_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{
- bNode *node= (bNode*)ptr->data;
- EnumPropertyItem *item= NULL;
+ bNode *node = (bNode*)ptr->data;
+ EnumPropertyItem *item = NULL;
EnumPropertyItem tmp = {0, "", 0, "", ""};
- int totitem=0;
+ int totitem = 0;
- switch(node->custom1) {
+ switch (node->custom1) {
case CMP_NODE_CHANNEL_MATTE_CS_RGB:
- tmp.identifier= "R"; tmp.name= "R"; tmp.value= 1;
+ tmp.identifier = "R"; tmp.name = "R"; tmp.value = 1;
RNA_enum_item_add(&item, &totitem, &tmp);
- tmp.identifier= "G"; tmp.name= "G"; tmp.value= 2;
+ tmp.identifier = "G"; tmp.name = "G"; tmp.value = 2;
RNA_enum_item_add(&item, &totitem, &tmp);
- tmp.identifier= "B"; tmp.name= "B"; tmp.value= 3;
+ tmp.identifier = "B"; tmp.name = "B"; tmp.value = 3;
RNA_enum_item_add(&item, &totitem, &tmp);
break;
case CMP_NODE_CHANNEL_MATTE_CS_HSV:
- tmp.identifier= "H"; tmp.name= "H"; tmp.value= 1;
+ tmp.identifier = "H"; tmp.name = "H"; tmp.value = 1;
RNA_enum_item_add(&item, &totitem, &tmp);
- tmp.identifier= "S"; tmp.name= "S"; tmp.value= 2;
+ tmp.identifier = "S"; tmp.name = "S"; tmp.value = 2;
RNA_enum_item_add(&item, &totitem, &tmp);
- tmp.identifier= "V"; tmp.name= "V"; tmp.value= 3;
+ tmp.identifier = "V"; tmp.name = "V"; tmp.value = 3;
RNA_enum_item_add(&item, &totitem, &tmp);
break;
case CMP_NODE_CHANNEL_MATTE_CS_YUV:
- tmp.identifier= "Y"; tmp.name= "Y"; tmp.value= 1;
+ tmp.identifier = "Y"; tmp.name = "Y"; tmp.value = 1;
RNA_enum_item_add(&item, &totitem, &tmp);
- tmp.identifier= "G"; tmp.name= "U"; tmp.value= 2;
+ tmp.identifier = "G"; tmp.name = "U"; tmp.value = 2;
RNA_enum_item_add(&item, &totitem, &tmp);
- tmp.identifier= "V"; tmp.name= "V"; tmp.value= 3;
+ tmp.identifier = "V"; tmp.name = "V"; tmp.value = 3;
RNA_enum_item_add(&item, &totitem, &tmp);
break;
case CMP_NODE_CHANNEL_MATTE_CS_YCC:
- tmp.identifier= "Y"; tmp.name= "Y"; tmp.value= 1;
+ tmp.identifier = "Y"; tmp.name = "Y"; tmp.value = 1;
RNA_enum_item_add(&item, &totitem, &tmp);
- tmp.identifier= "CB"; tmp.name= "Cr"; tmp.value= 2;
+ tmp.identifier = "CB"; tmp.name = "Cr"; tmp.value = 2;
RNA_enum_item_add(&item, &totitem, &tmp);
- tmp.identifier= "CR"; tmp.name= "Cb"; tmp.value= 3;
+ tmp.identifier = "CR"; tmp.name = "Cb"; tmp.value = 3;
RNA_enum_item_add(&item, &totitem, &tmp);
break;
default:
@@ -570,7 +570,7 @@ static EnumPropertyItem *rna_Node_channel_itemf(bContext *UNUSED(C), PointerRNA
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
@@ -607,18 +607,18 @@ static bNode *rna_NodeTree_node_new(bNodeTree *ntree, bContext *UNUSED(C), Repor
static bNode *rna_NodeTree_node_composite_new(bNodeTree *ntree, bContext *C, ReportList *reports, int type, bNodeTree *group)
{
/* raises error on failure */
- bNode *node= rna_NodeTree_node_new(ntree, C, reports, type, group);
+ bNode *node = rna_NodeTree_node_new(ntree, C, reports, type, group);
if (node) {
- if(ELEM4(node->type, CMP_NODE_COMPOSITE, CMP_NODE_DEFOCUS, CMP_NODE_OUTPUT_FILE, CMP_NODE_R_LAYERS)) {
+ if (ELEM4(node->type, CMP_NODE_COMPOSITE, CMP_NODE_DEFOCUS, CMP_NODE_OUTPUT_FILE, CMP_NODE_R_LAYERS)) {
/* annoying, find the node tree we are in, scene can be NULL */
Scene *scene;
- for(scene= CTX_data_main(C)->scene.first; scene; scene= scene->id.next) {
- if(scene->nodetree == ntree) {
+ for (scene = CTX_data_main(C)->scene.first; scene; scene = scene->id.next) {
+ if (scene->nodetree == ntree) {
break;
}
}
- node->id= (ID *)scene;
+ node->id = (ID *)scene;
id_us_plus(node->id);
}
@@ -632,7 +632,7 @@ static bNode *rna_NodeTree_node_composite_new(bNodeTree *ntree, bContext *C, Rep
static bNode *rna_NodeTree_node_texture_new(bNodeTree *ntree, bContext *C, ReportList *reports, int type, bNodeTree *group)
{
/* raises error on failure */
- bNode *node= rna_NodeTree_node_new(ntree, C, reports, type, group);
+ bNode *node = rna_NodeTree_node_new(ntree, C, reports, type, group);
if (node) {
ntreeTexCheckCyclics(ntree);
@@ -659,17 +659,17 @@ static void rna_NodeTree_node_remove(bNodeTree *ntree, ReportList *reports, bNod
static void rna_NodeTree_node_clear(bNodeTree *ntree)
{
- bNode *node= ntree->nodes.first;
+ bNode *node = ntree->nodes.first;
- while(node) {
- bNode *next_node= node->next;
+ while (node) {
+ bNode *next_node = node->next;
if (node->id)
id_us_min(node->id);
nodeFreeNode(ntree, node);
- node= next_node;
+ node = next_node;
}
ntreeUpdateTree(ntree); /* update group node socket links*/
@@ -680,7 +680,7 @@ static void rna_NodeTree_node_clear(bNodeTree *ntree)
static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, ReportList *reports, bNodeSocket *in, bNodeSocket *out)
{
bNodeLink *ret;
- bNode *fromnode= NULL, *tonode= NULL;
+ bNode *fromnode = NULL, *tonode = NULL;
int from_in_out, to_in_out;
nodeFindNode(ntree, in, &fromnode, NULL, &from_in_out);
@@ -694,9 +694,9 @@ static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, ReportList *reports, b
/* unlink node input socket */
nodeRemSocketLinks(ntree, out);
- ret= nodeAddLink(ntree, fromnode, in, tonode, out);
+ ret = nodeAddLink(ntree, fromnode, in, tonode, out);
- if(ret) {
+ if (ret) {
nodeUpdate(ntree, tonode);
ntreeUpdateTree(ntree);
@@ -721,14 +721,14 @@ static void rna_NodeTree_link_remove(bNodeTree *ntree, ReportList *reports, bNod
static void rna_NodeTree_link_clear(bNodeTree *ntree)
{
- bNodeLink *link= ntree->links.first;
+ bNodeLink *link = ntree->links.first;
- while(link) {
- bNodeLink *next_link= link->next;
+ while (link) {
+ bNodeLink *next_link = link->next;
nodeRemLink(ntree, link);
- link= next_link;
+ link = next_link;
}
ntreeUpdateTree(ntree);
@@ -738,7 +738,7 @@ static void rna_NodeTree_link_clear(bNodeTree *ntree)
static bNodeSocket *rna_NodeTree_input_new(bNodeTree *ntree, ReportList *UNUSED(reports), const char *name, int type)
{
/* XXX should check if tree is a group here! no good way to do this currently. */
- bNodeSocket *gsock= node_group_add_socket(ntree, name, type, SOCK_IN);
+ bNodeSocket *gsock = node_group_add_socket(ntree, name, type, SOCK_IN);
ntree->update |= NTREE_UPDATE_GROUP_IN;
ntreeUpdateTree(ntree);
@@ -749,7 +749,7 @@ static bNodeSocket *rna_NodeTree_input_new(bNodeTree *ntree, ReportList *UNUSED(
static bNodeSocket *rna_NodeTree_output_new(bNodeTree *ntree, ReportList *UNUSED(reports), const char *name, int type)
{
/* XXX should check if tree is a group here! no good way to do this currently. */
- bNodeSocket *gsock= node_group_add_socket(ntree, name, type, SOCK_OUT);
+ bNodeSocket *gsock = node_group_add_socket(ntree, name, type, SOCK_OUT);
ntree->update |= NTREE_UPDATE_GROUP_OUT;
ntreeUpdateTree(ntree);
@@ -765,7 +765,7 @@ static bNodeSocket *rna_NodeTree_input_expose(bNodeTree *ntree, ReportList *repo
if (!nodeFindNode(ntree, sock, &node, &index, &in_out))
BKE_reportf(reports, RPT_ERROR, "Unable to locate socket in nodetree");
- else if (in_out!=SOCK_IN)
+ else if (in_out != SOCK_IN)
BKE_reportf(reports, RPT_ERROR, "Socket is not an input");
else {
/* XXX should check if tree is a group here! no good way to do this currently. */
@@ -789,7 +789,7 @@ static bNodeSocket *rna_NodeTree_output_expose(bNodeTree *ntree, ReportList *rep
if (!nodeFindNode(ntree, sock, &node, &index, &in_out))
BKE_reportf(reports, RPT_ERROR, "Unable to locate socket in nodetree");
- else if (in_out!=SOCK_OUT)
+ else if (in_out != SOCK_OUT)
BKE_reportf(reports, RPT_ERROR, "Socket is not an output");
else {
/* XXX should check if tree is a group here! no good way to do this currently. */
@@ -929,15 +929,15 @@ static void alloc_node_type_items(EnumPropertyItem *items, int category)
int count = 3;
EnumPropertyItem *item = items;
- for(i=0; i<MaxNodes; i++)
- if(nodes[i].defined && nodes[i].category == category)
+ for (i = 0; i<MaxNodes; i++)
+ if (nodes[i].defined && nodes[i].category == category)
count++;
/*item = items = MEM_callocN(count * sizeof(EnumPropertyItem), "alloc_node_type_items");*/
- for(i=0; i<MaxNodes; i++) {
+ for (i = 0; i<MaxNodes; i++) {
NodeInfo *node = nodes + i;
- if(node->defined && node->category == category) {
+ if (node->defined && node->category == category) {
item->value = i;
item->identifier = node->enum_name;
item->icon = node->icon;
@@ -1016,7 +1016,7 @@ static void def_whileloop(StructRNA *srna)
static void def_frame(StructRNA *srna)
{
-// PropertyRNA *prop;
+/* PropertyRNA *prop; */
}
@@ -1165,37 +1165,37 @@ static void def_sh_mapping(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "TexMapping", "storage");
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_Mapping_Node_update");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); /* Not PROP_XYZ, this is now in radians, no more degrees */
+ prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); /* Not PROP_XYZ, this is now in radians, no more degrees */
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Rotation", "");
RNA_def_property_update(prop, 0, "rna_Mapping_Node_update");
- prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Scale", "");
RNA_def_property_update(prop, 0, "rna_Mapping_Node_update");
- prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping");
RNA_def_property_update(prop, 0, "rna_Mapping_Node_update");
- prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping");
RNA_def_property_update(prop, 0, "rna_Mapping_Node_update");
- prop= RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN);
RNA_def_property_ui_text(prop, "Has Minimum", "Whether to use minimum clipping value");
RNA_def_property_update(prop, 0, "rna_Mapping_Node_update");
- prop= RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX);
RNA_def_property_ui_text(prop, "Has Maximum", "Whether to use maximum clipping value");
RNA_def_property_update(prop, 0, "rna_Mapping_Node_update");
@@ -1234,12 +1234,12 @@ static void def_sh_tex(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "texture_mapping", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_mapping", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "base.tex_mapping");
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Texture Mapping", "Texture coordinate mapping settings");
- prop= RNA_def_property(srna, "color_mapping", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "color_mapping", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "base.color_mapping");
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Color Mapping", "Color mapping settings");
@@ -1263,11 +1263,16 @@ static void def_sh_tex_sky(StructRNA *srna)
static void def_sh_tex_environment(StructRNA *srna)
{
- static const EnumPropertyItem prop_color_space_items[]= {
- {SHD_COLORSPACE_SRGB, "SRGB", 0, "sRGB", "Image is in sRGB color space"},
- {SHD_COLORSPACE_LINEAR, "LINEAR", 0, "Linear", "Image is in scene linear color space"},
+ static const EnumPropertyItem prop_color_space_items[] = {
+ {SHD_COLORSPACE_COLOR, "COLOR", 0, "Color", "Image contains color data, and will be converted to linear color for rendering"},
+ {SHD_COLORSPACE_NONE, "NONE", 0, "Non-Color Data", "Image contains non-color data, for example a displacement or normal map, and will not be converted"},
{0, NULL, 0, NULL, NULL}};
+ static const EnumPropertyItem prop_projection_items[] = {
+ {SHD_PROJ_EQUIRECTANGULAR, "EQUIRECTANGULAR", 0, "Equirectangular", "Equirectangular or latitude-longitude projection"},
+ {SHD_PROJ_MIRROR_BALL, "MIRROR_BALL", 0, "Mirror Ball", "Projection from an orthographic photo of a mirror ball"},
+ {0, NULL, 0, NULL, NULL}};
+
PropertyRNA *prop;
prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
@@ -1277,20 +1282,26 @@ static void def_sh_tex_environment(StructRNA *srna)
RNA_def_property_ui_text(prop, "Image", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_image_update");
- RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage");
+ RNA_def_struct_sdna_from(srna, "NodeTexEnvironment", "storage");
def_sh_tex(srna);
- prop= RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_color_space_items);
RNA_def_property_ui_text(prop, "Color Space", "Image file color space");
RNA_def_property_update(prop, 0, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "projection", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_projection_items);
+ RNA_def_property_ui_text(prop, "Projection", "Projection of the input image");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
+
}
static void def_sh_tex_image(StructRNA *srna)
{
- static const EnumPropertyItem prop_color_space_items[]= {
- {SHD_COLORSPACE_LINEAR, "LINEAR", 0, "Linear", "Image is in scene linear color space"},
- {SHD_COLORSPACE_SRGB, "SRGB", 0, "sRGB", "Image is in sRGB color space"},
+ static const EnumPropertyItem prop_color_space_items[] = {
+ {SHD_COLORSPACE_COLOR, "COLOR", 0, "Color", "Image contains color data, and will be converted to linear color for rendering"},
+ {SHD_COLORSPACE_NONE, "NONE", 0, "Non-Color Data", "Image contains non-color data, for example a displacement or normal map, and will not be converted"},
{0, NULL, 0, NULL, NULL}};
PropertyRNA *prop;
@@ -1305,7 +1316,7 @@ static void def_sh_tex_image(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage");
def_sh_tex(srna);
- prop= RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_color_space_items);
RNA_def_property_ui_text(prop, "Color Space", "Image file color space");
RNA_def_property_update(prop, 0, "rna_Node_update");
@@ -1328,7 +1339,7 @@ static void def_sh_tex_gradient(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTexGradient", "storage");
def_sh_tex(srna);
- prop= RNA_def_property(srna, "gradient_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "gradient_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_gradient_type);
RNA_def_property_ui_text(prop, "Gradient Type", "Style of the color blending");
RNA_def_property_update(prop, 0, "rna_Node_update");
@@ -1353,7 +1364,7 @@ static void def_sh_tex_magic(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTexMagic", "storage");
def_sh_tex(srna);
- prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "depth");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise");
@@ -1375,7 +1386,7 @@ static void def_sh_tex_musgrave(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTexMusgrave", "storage");
def_sh_tex(srna);
- prop= RNA_def_property(srna, "musgrave_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "musgrave_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "musgrave_type");
RNA_def_property_enum_items(prop, prop_musgrave_type);
RNA_def_property_ui_text(prop, "Type", "");
@@ -1394,7 +1405,7 @@ static void def_sh_tex_voronoi(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTexVoronoi", "storage");
def_sh_tex(srna);
- prop= RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "coloring");
RNA_def_property_enum_items(prop, prop_coloring_items);
RNA_def_property_ui_text(prop, "Coloring", "");
@@ -1413,7 +1424,7 @@ static void def_sh_tex_wave(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTexWave", "storage");
def_sh_tex(srna);
- prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "wave_type");
RNA_def_property_enum_items(prop, prop_wave_type_items);
RNA_def_property_ui_text(prop, "Wave Type", "");
@@ -1437,7 +1448,7 @@ static void def_cmp_alpha_over(StructRNA *srna)
{
PropertyRNA *prop;
- // XXX: Tooltip
+ /* XXX: Tooltip */
prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
RNA_def_property_ui_text(prop, "Convert Premul", "");
@@ -1720,7 +1731,7 @@ static void def_cmp_image(StructRNA *srna)
RNA_def_property_ui_text(prop, "Auto-Refresh", "Always refresh image on frame changes"); /* copied from the rna_image.c */
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop= RNA_def_property(srna, "layer", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "layer", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "layer");
RNA_def_property_enum_items(prop, prop_image_layer_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_image_layer_itemf");
@@ -1740,7 +1751,7 @@ static void def_cmp_render_layers(StructRNA *srna)
RNA_def_property_ui_text(prop, "Scene", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop= RNA_def_property(srna, "layer", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "layer", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, prop_scene_layer_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_scene_layer_itemf");
@@ -2062,7 +2073,7 @@ static void def_cmp_channel_matte(StructRNA *srna)
RNA_def_property_ui_text(prop, "Color Space", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop= RNA_def_property(srna, "matte_channel", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "matte_channel", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom2");
RNA_def_property_enum_items(prop, prop_tri_channel_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_channel_itemf");
@@ -2917,28 +2928,28 @@ static void rna_def_nodetree_link_api(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
RNA_def_property_srna(cprop, "NodeLinks");
- srna= RNA_def_struct(brna, "NodeLinks", NULL);
+ srna = RNA_def_struct(brna, "NodeLinks", NULL);
RNA_def_struct_sdna(srna, "bNodeTree");
RNA_def_struct_ui_text(srna, "Node Links", "Collection of Node Links");
- func= RNA_def_function(srna, "new", "rna_NodeTree_link_new");
+ func = RNA_def_function(srna, "new", "rna_NodeTree_link_new");
RNA_def_function_ui_description(func, "Add a node link to this node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "input", "NodeSocket", "", "The input socket");
+ parm = RNA_def_pointer(func, "input", "NodeSocket", "", "The input socket");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "output", "NodeSocket", "", "The output socket");
+ parm = RNA_def_pointer(func, "output", "NodeSocket", "", "The output socket");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return */
- parm= RNA_def_pointer(func, "link", "NodeLink", "", "New node link");
+ parm = RNA_def_pointer(func, "link", "NodeLink", "", "New node link");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_NodeTree_link_remove");
+ func = RNA_def_function(srna, "remove", "rna_NodeTree_link_remove");
RNA_def_function_ui_description(func, "remove a node link from the node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "link", "NodeLink", "", "The node link to remove");
+ parm = RNA_def_pointer(func, "link", "NodeLink", "", "The node link to remove");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "clear", "rna_NodeTree_link_clear");
+ func = RNA_def_function(srna, "clear", "rna_NodeTree_link_clear");
RNA_def_function_ui_description(func, "remove all node links from the node tree");
}
@@ -2949,27 +2960,27 @@ static void rna_def_composite_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
RNA_def_property_srna(cprop, "CompositorNodes");
- srna= RNA_def_struct(brna, "CompositorNodes", NULL);
+ srna = RNA_def_struct(brna, "CompositorNodes", NULL);
RNA_def_struct_sdna(srna, "bNodeTree");
RNA_def_struct_ui_text(srna, "Compositor Nodes", "Collection of Compositor Nodes");
- func= RNA_def_function(srna, "new", "rna_NodeTree_node_composite_new");
+ func = RNA_def_function(srna, "new", "rna_NodeTree_node_composite_new");
RNA_def_function_ui_description(func, "Add a node to this node tree");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_enum(func, "type", compositor_node_type_items, 0, "Type", "Type of node to add");
+ parm = RNA_def_enum(func, "type", compositor_node_type_items, 0, "Type", "Type of node to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
/* return value */
- parm= RNA_def_pointer(func, "node", "Node", "", "New node");
+ parm = RNA_def_pointer(func, "node", "Node", "", "New node");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_NodeTree_node_remove");
+ func = RNA_def_function(srna, "remove", "rna_NodeTree_node_remove");
RNA_def_function_ui_description(func, "Remove a node from this node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove");
+ parm = RNA_def_pointer(func, "node", "Node", "", "The node to remove");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "clear", "rna_NodeTree_node_clear");
+ func = RNA_def_function(srna, "clear", "rna_NodeTree_node_clear");
RNA_def_function_ui_description(func, "Remove all nodes from this node tree");
}
@@ -2980,27 +2991,27 @@ static void rna_def_shader_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
RNA_def_property_srna(cprop, "ShaderNodes");
- srna= RNA_def_struct(brna, "ShaderNodes", NULL);
+ srna = RNA_def_struct(brna, "ShaderNodes", NULL);
RNA_def_struct_sdna(srna, "bNodeTree");
RNA_def_struct_ui_text(srna, "Shader Nodes", "Collection of Shader Nodes");
- func= RNA_def_function(srna, "new", "rna_NodeTree_node_new");
+ func = RNA_def_function(srna, "new", "rna_NodeTree_node_new");
RNA_def_function_ui_description(func, "Add a node to this node tree");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_enum(func, "type", shader_node_type_items, 0, "Type", "Type of node to add");
+ parm = RNA_def_enum(func, "type", shader_node_type_items, 0, "Type", "Type of node to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
/* return value */
- parm= RNA_def_pointer(func, "node", "Node", "", "New node");
+ parm = RNA_def_pointer(func, "node", "Node", "", "New node");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_NodeTree_node_remove");
+ func = RNA_def_function(srna, "remove", "rna_NodeTree_node_remove");
RNA_def_function_ui_description(func, "Remove a node from this node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove");
+ parm = RNA_def_pointer(func, "node", "Node", "", "The node to remove");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "clear", "rna_NodeTree_node_clear");
+ func = RNA_def_function(srna, "clear", "rna_NodeTree_node_clear");
RNA_def_function_ui_description(func, "Remove all nodes from this node tree");
}
@@ -3011,27 +3022,27 @@ static void rna_def_texture_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
RNA_def_property_srna(cprop, "TextureNodes");
- srna= RNA_def_struct(brna, "TextureNodes", NULL);
+ srna = RNA_def_struct(brna, "TextureNodes", NULL);
RNA_def_struct_sdna(srna, "bNodeTree");
RNA_def_struct_ui_text(srna, "Texture Nodes", "Collection of Texture Nodes");
- func= RNA_def_function(srna, "new", "rna_NodeTree_node_texture_new");
+ func = RNA_def_function(srna, "new", "rna_NodeTree_node_texture_new");
RNA_def_function_ui_description(func, "Add a node to this node tree");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_enum(func, "type", texture_node_type_items, 0, "Type", "Type of node to add");
+ parm = RNA_def_enum(func, "type", texture_node_type_items, 0, "Type", "Type of node to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
/* return value */
- parm= RNA_def_pointer(func, "node", "Node", "", "New node");
+ parm = RNA_def_pointer(func, "node", "Node", "", "New node");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_NodeTree_node_remove");
+ func = RNA_def_function(srna, "remove", "rna_NodeTree_node_remove");
RNA_def_function_ui_description(func, "Remove a node from this node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove");
+ parm = RNA_def_pointer(func, "node", "Node", "", "The node to remove");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "clear", "rna_NodeTree_node_clear");
+ func = RNA_def_function(srna, "clear", "rna_NodeTree_node_clear");
RNA_def_function_ui_description(func, "Remove all nodes from this node tree");
}
@@ -3056,7 +3067,7 @@ static void rna_def_node_socket(BlenderRNA *brna)
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
/* XXX must be editable for group sockets. if necessary use a special rna definition for these */
-// RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+/* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_ui_text(prop, "Name", "Socket name");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_NodeGroupSocket_update");
@@ -3075,8 +3086,8 @@ static void rna_def_node_socket(BlenderRNA *brna)
static void rna_def_node_socket_subtype(BlenderRNA *brna, int type, int subtype, const char *name, const char *ui_name)
{
StructRNA *srna;
- PropertyRNA *prop=NULL;
- PropertySubType propsubtype= PROP_NONE;
+ PropertyRNA *prop = NULL;
+ PropertySubType propsubtype = PROP_NONE;
#define SUBTYPE(socktype, stypename, id, idname) { PROP_##id, #socktype "_" #id, 0, #idname, ""},
static EnumPropertyItem subtype_items[] = {
@@ -3252,28 +3263,28 @@ static void rna_def_group_sockets_api(BlenderRNA *brna, PropertyRNA *cprop, int
PropertyRNA *parm;
FunctionRNA *func;
- RNA_def_property_srna(cprop, (in_out==SOCK_IN ? "GroupInputs" : "GroupOutputs"));
- srna= RNA_def_struct(brna, (in_out==SOCK_IN ? "GroupInputs" : "GroupOutputs"), NULL);
+ RNA_def_property_srna(cprop, (in_out == SOCK_IN ? "GroupInputs" : "GroupOutputs"));
+ srna = RNA_def_struct(brna, (in_out == SOCK_IN ? "GroupInputs" : "GroupOutputs"), NULL);
RNA_def_struct_sdna(srna, "bNodeTree");
RNA_def_struct_ui_text(srna, "Group Sockets", "Collection of group sockets");
- func= RNA_def_function(srna, "new", (in_out==SOCK_IN ? "rna_NodeTree_input_new" : "rna_NodeTree_output_new"));
+ func = RNA_def_function(srna, "new", (in_out == SOCK_IN ? "rna_NodeTree_input_new" : "rna_NodeTree_output_new"));
RNA_def_function_ui_description(func, "Add a socket to the group tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_string(func, "name", "Socket", MAX_NAME, "Name", "Name of the socket");
RNA_def_enum(func, "type", node_socket_type_items, SOCK_FLOAT, "Type", "Type of socket");
/* return value */
- parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket");
+ parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "expose", (in_out==SOCK_IN ? "rna_NodeTree_input_expose" : "rna_NodeTree_output_expose"));
+ func = RNA_def_function(srna, "expose", (in_out == SOCK_IN ? "rna_NodeTree_input_expose" : "rna_NodeTree_output_expose"));
RNA_def_function_ui_description(func, "Expose an internal socket in the group tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_pointer(func, "sock", "NodeSocket", "Socket", "Internal node socket to expose");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_boolean(func, "add_link", TRUE, "Add Link", "If TRUE, adds a link to the internal socket");
/* return value */
- parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket");
+ parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket");
RNA_def_function_return(func, parm);
}
@@ -3299,7 +3310,7 @@ static void rna_def_nodetree(BlenderRNA *brna)
rna_def_nodetree_link_api(brna, prop);
/* Grease Pencil */
- prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "gpd");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "GreasePencil");
@@ -3386,7 +3397,7 @@ static void define_specific_node(BlenderRNA *brna, int id, void (*func)(StructRN
{
StructRNA *srna = def_node(brna, id);
- if(func)
+ if (func)
func(srna);
}
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 433f89309d5..088d4870143 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -71,7 +71,7 @@ static EnumPropertyItem parent_type_items[] = {
{PARCURVE, "CURVE", 0, "Curve", "The object is parented to a curve"},
{PARKEY, "KEY", 0, "Key", ""},
{PARSKEL, "ARMATURE", 0, "Armature", ""},
- {PARSKEL, "LATTICE", 0, "Lattice", "The object is parented to a lattice"}, // PARSKEL reuse will give issues
+ {PARSKEL, "LATTICE", 0, "Lattice", "The object is parented to a lattice"}, /* PARSKEL reuse will give issues */
{PARVERT1, "VERTEX", 0, "Vertex", "The object is parented to a vertex"},
{PARVERT3, "VERTEX_3", 0, "3 Vertices", ""},
{PARBONE, "BONE", 0, "Bone", "The object is parented to a bone"},
@@ -85,14 +85,14 @@ static EnumPropertyItem collision_bounds_items[] = {
{OB_BOUND_CONVEX_HULL, "CONVEX_HULL", 0, "Convex Hull", ""},
{OB_BOUND_TRIANGLE_MESH, "TRIANGLE_MESH", 0, "Triangle Mesh", ""},
{OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", ""},
- //{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""},
+ /*{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""}, */
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem metaelem_type_items[] = {
{MB_BALL, "BALL", ICON_META_BALL, "Ball", ""},
{MB_TUBE, "CAPSULE", ICON_META_CAPSULE, "Capsule", ""},
{MB_PLANE, "PLANE", ICON_META_PLANE, "Plane", ""},
- {MB_ELIPSOID, "ELLIPSOID", ICON_META_ELLIPSOID, "Ellipsoid", ""}, // NOTE: typo at original definition!
+ {MB_ELIPSOID, "ELLIPSOID", ICON_META_ELLIPSOID, "Ellipsoid", ""}, /* NOTE: typo at original definition! */
{MB_CUBE, "CUBE", ICON_META_CUBE, "Cube", ""},
{0, NULL, 0, NULL, NULL}};
@@ -168,9 +168,9 @@ static void rna_Object_matrix_world_update(Main *bmain, Scene *scene, PointerRNA
static void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16])
{
- Object *ob= ptr->id.data;
+ Object *ob = ptr->id.data;
- if(ob->parent) {
+ if (ob->parent) {
float invmat[4][4]; /* for inverse of parent's matrix */
invert_m4_m4(invmat, ob->parent->obmat);
mult_m4_m4m4((float(*)[4])values, invmat, ob->obmat);
@@ -182,12 +182,12 @@ static void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16])
static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16])
{
- Object *ob= ptr->id.data;
+ Object *ob = ptr->id.data;
/* localspace matrix is truly relative to the parent, but parameters
* stored in object are relative to parentinv matrix. Undo the parent
* inverse part before updating obmat and calling apply_obmat() */
- if(ob->parent) {
+ if (ob->parent) {
float invmat[4][4];
invert_m4_m4(invmat, ob->parentinv);
mult_m4_m4m4(ob->obmat, invmat, (float(*)[4])values);
@@ -202,13 +202,13 @@ static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16])
static void rna_Object_matrix_basis_get(PointerRNA *ptr, float values[16])
{
- Object *ob= ptr->id.data;
+ Object *ob = ptr->id.data;
object_to_mat4(ob, (float(*)[4])values);
}
static void rna_Object_matrix_basis_set(PointerRNA *ptr, const float values[16])
{
- Object *ob= ptr->id.data;
+ Object *ob = ptr->id.data;
object_apply_mat4(ob, (float(*)[4])values, FALSE, FALSE);
}
@@ -220,14 +220,15 @@ void rna_Object_internal_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene),
void rna_Object_active_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Object *ob= ptr->id.data;
+ Object *ob = ptr->id.data;
- if(scene->obedit == ob) {
+ if (scene->obedit == ob) {
/* exit/enter editmode to get new shape */
- switch(ob->type) {
+ switch (ob->type) {
case OB_MESH:
EDBM_LoadEditBMesh(scene, ob);
EDBM_MakeEditBMesh(scene->toolsettings, scene, ob);
+ BMEdit_RecalcTessellation(((Mesh*)ob->data)->edit_btmesh);
break;
case OB_CURVE:
case OB_SURF:
@@ -257,7 +258,7 @@ static void rna_Object_dependency_update(Main *bmain, Scene *scene, PointerRNA *
static void rna_Object_select_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
if (scene) {
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
short mode = ob->flag & SELECT ? BA_SELECT : BA_DESELECT;
ED_base_object_select(object_in_scene(ob, scene), mode);
}
@@ -265,7 +266,7 @@ static void rna_Object_select_update(Main *UNUSED(bmain), Scene *scene, PointerR
static void rna_Base_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Base *base= (Base*)ptr->data;
+ Base *base = (Base*)ptr->data;
short mode = base->flag & BA_SELECT ? BA_SELECT : BA_DESELECT;
ED_base_object_select(base, mode);
}
@@ -273,13 +274,13 @@ static void rna_Base_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po
static void rna_Object_layer_update__internal(Main *bmain, Scene *scene, Base *base, Object *ob)
{
/* try to avoid scene sort */
- if(scene == NULL) {
+ if (scene == NULL) {
/* pass - unlikely but when running scripts on startup it happens */
}
- else if((ob->lay & scene->lay) && (base->lay & scene->lay)) {
+ else if ((ob->lay & scene->lay) && (base->lay & scene->lay)) {
/* pass */
}
- else if((ob->lay & scene->lay)==0 && (base->lay & scene->lay)==0) {
+ else if ((ob->lay & scene->lay) == 0 && (base->lay & scene->lay) == 0) {
/* pass */
}
else {
@@ -291,42 +292,42 @@ static void rna_Object_layer_update__internal(Main *bmain, Scene *scene, Base *b
static void rna_Object_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
Base *base;
- base= scene ? object_in_scene(ob, scene) : NULL;
- if(!base)
+ base = scene ? object_in_scene(ob, scene) : NULL;
+ if (!base)
return;
SWAP(int, base->lay, ob->lay);
rna_Object_layer_update__internal(bmain, scene, base, ob);
- ob->lay= base->lay;
+ ob->lay = base->lay;
WM_main_add_notifier(NC_SCENE|ND_LAYER_CONTENT, scene);
}
static void rna_Base_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Base *base= (Base*)ptr->data;
- Object *ob= (Object*)base->object;
+ Base *base = (Base*)ptr->data;
+ Object *ob = (Object*)base->object;
rna_Object_layer_update__internal(bmain, scene, base, ob);
- ob->lay= base->lay;
+ ob->lay = base->lay;
WM_main_add_notifier(NC_SCENE|ND_LAYER_CONTENT, scene);
}
static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value)
{
- Object *ob= (Object*)ptr->data;
- ID *id= value.data;
+ Object *ob = (Object*)ptr->data;
+ ID *id = value.data;
if (id == NULL || ob->mode & OB_MODE_EDIT)
return;
if (ob->type == OB_EMPTY) {
- if(ob->data) {
+ if (ob->data) {
id_us_min((ID*)ob->data);
ob->data = NULL;
}
@@ -336,30 +337,30 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value)
ob->data = id;
}
}
- else if(ob->type == OB_MESH) {
+ else if (ob->type == OB_MESH) {
set_mesh(ob, (Mesh*)id);
}
else {
- if(ob->data)
+ if (ob->data)
id_us_min((ID*)ob->data);
- if(id)
+ if (id)
id_us_plus(id);
- ob->data= id;
+ ob->data = id;
test_object_materials(id);
- if(GS(id->name)==ID_CU)
+ if (GS(id->name) == ID_CU)
test_curve_type(ob);
- else if(ob->type==OB_ARMATURE)
+ else if (ob->type == OB_ARMATURE)
armature_rebuild_pose(ob, ob->data);
}
}
static StructRNA *rna_Object_data_typef(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->data;
+ Object *ob = (Object*)ptr->data;
- switch(ob->type) {
+ switch (ob->type) {
case OB_EMPTY: return &RNA_Image;
case OB_MESH: return &RNA_Mesh;
case OB_CURVE: return &RNA_Curve;
@@ -377,15 +378,15 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr)
static void rna_Object_parent_set(PointerRNA *ptr, PointerRNA value)
{
- Object *ob= (Object*)ptr->data;
- Object *par= (Object*)value.data;
+ Object *ob = (Object*)ptr->data;
+ Object *par = (Object*)value.data;
ED_object_parent(ob, par, ob->partype, ob->parsubstr);
}
static void rna_Object_parent_type_set(PointerRNA *ptr, int value)
{
- Object *ob= (Object*)ptr->data;
+ Object *ob = (Object*)ptr->data;
ED_object_parent(ob, ob->parent, value, ob->parsubstr);
}
@@ -393,31 +394,31 @@ static void rna_Object_parent_type_set(PointerRNA *ptr, int value)
static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C), PointerRNA *ptr,
PropertyRNA *UNUSED(prop), int *free)
{
- Object *ob= (Object*)ptr->data;
- EnumPropertyItem *item= NULL;
- int totitem= 0;
+ Object *ob = (Object*)ptr->data;
+ EnumPropertyItem *item = NULL;
+ int totitem = 0;
RNA_enum_items_add_value(&item, &totitem, parent_type_items, PAROBJECT);
- if(ob->parent) {
- Object *par= ob->parent;
+ if (ob->parent) {
+ Object *par = ob->parent;
- if(par->type == OB_CURVE)
+ if (par->type == OB_CURVE)
RNA_enum_items_add_value(&item, &totitem, parent_type_items, PARCURVE);
- else if(par->type == OB_LATTICE)
- RNA_enum_items_add_value(&item, &totitem, &parent_type_items[4], PARSKEL); // special hack: prevents this overriding others
- else if(par->type == OB_ARMATURE) {
- RNA_enum_items_add_value(&item, &totitem, &parent_type_items[3], PARSKEL); // special hack: prevents this being overrided
+ else if (par->type == OB_LATTICE)
+ RNA_enum_items_add_value(&item, &totitem, &parent_type_items[4], PARSKEL); /* special hack: prevents this overriding others */
+ else if (par->type == OB_ARMATURE) {
+ RNA_enum_items_add_value(&item, &totitem, &parent_type_items[3], PARSKEL); /* special hack: prevents this being overrided */
RNA_enum_items_add_value(&item, &totitem, parent_type_items, PARBONE);
}
- else if(par->type == OB_MESH) {
+ else if (par->type == OB_MESH) {
RNA_enum_items_add_value(&item, &totitem, parent_type_items, PARVERT1);
RNA_enum_items_add_value(&item, &totitem, parent_type_items, PARVERT3);
}
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
@@ -425,14 +426,14 @@ static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C), Point
static EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *UNUSED(C), PointerRNA *ptr,
PropertyRNA *UNUSED(prop), int *free)
{
- Object *ob= (Object*)ptr->data;
- EnumPropertyItem *item= NULL;
- int totitem= 0;
+ Object *ob = (Object*)ptr->data;
+ EnumPropertyItem *item = NULL;
+ int totitem = 0;
RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_TRIANGLE_MESH);
RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_CONVEX_HULL);
- if(ob->body_type!=OB_BODY_TYPE_SOFT) {
+ if (ob->body_type != OB_BODY_TYPE_SOFT) {
RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_CONE);
RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_CYLINDER);
RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_SPHERE);
@@ -441,21 +442,21 @@ static EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *UNUSED(C),
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
static void rna_Object_parent_bone_set(PointerRNA *ptr, const char *value)
{
- Object *ob= (Object*)ptr->data;
+ Object *ob = (Object*)ptr->data;
ED_object_parent(ob, ob->parent, ob->partype, value);
}
static void rna_Object_dup_group_set(PointerRNA *ptr, PointerRNA value)
{
- Object *ob= (Object *)ptr->data;
+ Object *ob = (Object *)ptr->data;
Group *grp = (Group *)value.data;
/* must not let this be set if the object belongs in this group already,
@@ -469,169 +470,169 @@ static void rna_Object_dup_group_set(PointerRNA *ptr, PointerRNA value)
void rna_VertexGroup_name_set(PointerRNA *ptr, const char *value)
{
- Object *ob= (Object *)ptr->id.data;
- bDeformGroup *dg= (bDeformGroup *)ptr->data;
+ Object *ob = (Object *)ptr->id.data;
+ bDeformGroup *dg = (bDeformGroup *)ptr->data;
BLI_strncpy_utf8(dg->name, value, sizeof(dg->name));
defgroup_unique_name(dg, ob);
}
static int rna_VertexGroup_index_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
return BLI_findindex(&ob->defbase, ptr->data);
}
static PointerRNA rna_Object_active_vertex_group_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
return rna_pointer_inherit_refine(ptr, &RNA_VertexGroup, BLI_findlink(&ob->defbase, ob->actdef-1));
}
static int rna_Object_active_vertex_group_index_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
return ob->actdef-1;
}
static void rna_Object_active_vertex_group_index_set(PointerRNA *ptr, int value)
{
- Object *ob= (Object*)ptr->id.data;
- ob->actdef= value+1;
+ Object *ob = (Object*)ptr->id.data;
+ ob->actdef = value+1;
}
static void rna_Object_active_vertex_group_index_range(PointerRNA *ptr, int *min, int *max)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
- *min= 0;
- *max= BLI_countlist(&ob->defbase)-1;
- *max= MAX2(0, *max);
+ *min = 0;
+ *max = BLI_countlist(&ob->defbase)-1;
+ *max = MAX2(0, *max);
}
void rna_object_vgroup_name_index_get(PointerRNA *ptr, char *value, int index)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
bDeformGroup *dg;
- dg= BLI_findlink(&ob->defbase, index-1);
+ dg = BLI_findlink(&ob->defbase, index-1);
- if(dg) BLI_strncpy(value, dg->name, sizeof(dg->name));
- else value[0]= '\0';
+ if (dg) BLI_strncpy(value, dg->name, sizeof(dg->name));
+ else value[0] = '\0';
}
int rna_object_vgroup_name_index_length(PointerRNA *ptr, int index)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
bDeformGroup *dg;
- dg= BLI_findlink(&ob->defbase, index-1);
+ dg = BLI_findlink(&ob->defbase, index-1);
return (dg)? strlen(dg->name): 0;
}
void rna_object_vgroup_name_index_set(PointerRNA *ptr, const char *value, short *index)
{
- Object *ob= (Object*)ptr->id.data;
- *index= defgroup_name_index(ob, value) + 1;
+ Object *ob = (Object*)ptr->id.data;
+ *index = defgroup_name_index(ob, value) + 1;
}
void rna_object_vgroup_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
{
- Object *ob= (Object*)ptr->id.data;
- bDeformGroup *dg= defgroup_find_name(ob, value);
- if(dg) {
+ Object *ob = (Object*)ptr->id.data;
+ bDeformGroup *dg = defgroup_find_name(ob, value);
+ if (dg) {
BLI_strncpy(result, value, maxlen); /* no need for BLI_strncpy_utf8, since this matches an existing group */
return;
}
- result[0]= '\0';
+ result[0] = '\0';
}
void rna_object_uvlayer_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
Mesh *me;
CustomDataLayer *layer;
int a;
- if(ob->type == OB_MESH && ob->data) {
- me= (Mesh*)ob->data;
+ if (ob->type == OB_MESH && ob->data) {
+ me = (Mesh*)ob->data;
- for(a=0; a<me->fdata.totlayer; a++) {
- layer= &me->fdata.layers[a];
+ for (a = 0; a<me->pdata.totlayer; a++) {
+ layer = &me->pdata.layers[a];
- if(layer->type == CD_MTFACE && strcmp(layer->name, value) == 0) {
+ if (layer->type == CD_MTEXPOLY && strcmp(layer->name, value) == 0) {
BLI_strncpy(result, value, maxlen);
return;
}
}
}
- result[0]= '\0';
+ result[0] = '\0';
}
void rna_object_vcollayer_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
Mesh *me;
CustomDataLayer *layer;
int a;
- if(ob->type == OB_MESH && ob->data) {
- me= (Mesh*)ob->data;
+ if (ob->type == OB_MESH && ob->data) {
+ me = (Mesh*)ob->data;
- for(a=0; a<me->fdata.totlayer; a++) {
- layer= &me->fdata.layers[a];
+ for (a = 0; a<me->fdata.totlayer; a++) {
+ layer = &me->fdata.layers[a];
- if(layer->type == CD_MCOL && strcmp(layer->name, value) == 0) {
+ if (layer->type == CD_MCOL && strcmp(layer->name, value) == 0) {
BLI_strncpy(result, value, maxlen);
return;
}
}
}
- result[0]= '\0';
+ result[0] = '\0';
}
static int rna_Object_active_material_index_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
return MAX2(ob->actcol-1, 0);
}
static void rna_Object_active_material_index_set(PointerRNA *ptr, int value)
{
- Object *ob= (Object*)ptr->id.data;
- ob->actcol= value+1;
+ Object *ob = (Object*)ptr->id.data;
+ ob->actcol = value+1;
- if(ob->type==OB_MESH) {
- Mesh *me= ob->data;
+ if (ob->type == OB_MESH) {
+ Mesh *me = ob->data;
- if(me->edit_btmesh)
- me->edit_btmesh->mat_nr= value;
+ if (me->edit_btmesh)
+ me->edit_btmesh->mat_nr = value;
}
}
static void rna_Object_active_material_index_range(PointerRNA *ptr, int *min, int *max)
{
- Object *ob= (Object*)ptr->id.data;
- *min= 0;
- *max= MAX2(ob->totcol-1, 0);
+ Object *ob = (Object*)ptr->id.data;
+ *min = 0;
+ *max = MAX2(ob->totcol-1, 0);
}
/* returns active base material */
static PointerRNA rna_Object_active_material_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
Material *ma;
- ma= (ob->totcol)? give_current_material(ob, ob->actcol): NULL;
+ ma = (ob->totcol)? give_current_material(ob, ob->actcol): NULL;
return rna_pointer_inherit_refine(ptr, &RNA_Material, ma);
}
static void rna_Object_active_material_set(PointerRNA *ptr, PointerRNA value)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
DAG_id_tag_update(value.data, 0);
assign_material(ob, value.data, ob->actcol);
@@ -639,27 +640,27 @@ static void rna_Object_active_material_set(PointerRNA *ptr, PointerRNA value)
static void rna_Object_active_particle_system_index_range(PointerRNA *ptr, int *min, int *max)
{
- Object *ob= (Object*)ptr->id.data;
- *min= 0;
- *max= BLI_countlist(&ob->particlesystem)-1;
- *max= MAX2(0, *max);
+ Object *ob = (Object*)ptr->id.data;
+ *min = 0;
+ *max = BLI_countlist(&ob->particlesystem)-1;
+ *max = MAX2(0, *max);
}
static int rna_Object_active_particle_system_index_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
return psys_get_current_num(ob);
}
static void rna_Object_active_particle_system_index_set(PointerRNA *ptr, int value)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
psys_set_current_num(ob, value);
}
static void rna_Object_particle_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
PE_current_changed(scene, ob);
}
@@ -667,51 +668,51 @@ static void rna_Object_particle_update(Main *UNUSED(bmain), Scene *scene, Pointe
/* rotation - axis-angle */
static void rna_Object_rotation_axis_angle_get(PointerRNA *ptr, float *value)
{
- Object *ob= ptr->data;
+ Object *ob = ptr->data;
/* for now, assume that rotation mode is axis-angle */
- value[0]= ob->rotAngle;
+ value[0] = ob->rotAngle;
copy_v3_v3(&value[1], ob->rotAxis);
}
/* rotation - axis-angle */
static void rna_Object_rotation_axis_angle_set(PointerRNA *ptr, const float *value)
{
- Object *ob= ptr->data;
+ Object *ob = ptr->data;
/* for now, assume that rotation mode is axis-angle */
- ob->rotAngle= value[0];
+ ob->rotAngle = value[0];
copy_v3_v3(ob->rotAxis, (float *)&value[1]);
- // TODO: validate axis?
+ /* TODO: validate axis? */
}
static void rna_Object_rotation_mode_set(PointerRNA *ptr, int value)
{
- Object *ob= ptr->data;
+ Object *ob = ptr->data;
/* use API Method for conversions... */
BKE_rotMode_change_values(ob->quat, ob->rot, ob->rotAxis, &ob->rotAngle, ob->rotmode, (short)value);
/* finally, set the new rotation type */
- ob->rotmode= value;
+ ob->rotmode = value;
}
static void rna_Object_dimensions_get(PointerRNA *ptr, float *value)
{
- Object *ob= ptr->data;
+ Object *ob = ptr->data;
object_get_dimensions(ob, value);
}
static void rna_Object_dimensions_set(PointerRNA *ptr, const float *value)
{
- Object *ob= ptr->data;
+ Object *ob = ptr->data;
object_set_dimensions(ob, value);
}
static int rna_Object_location_editable(PointerRNA *ptr, int index)
{
- Object *ob= (Object *)ptr->data;
+ Object *ob = (Object *)ptr->data;
/* only if the axis in question is locked, not editable... */
if ((index == 0) && (ob->protectflag & OB_LOCK_LOCX))
@@ -726,7 +727,7 @@ static int rna_Object_location_editable(PointerRNA *ptr, int index)
static int rna_Object_scale_editable(PointerRNA *ptr, int index)
{
- Object *ob= (Object *)ptr->data;
+ Object *ob = (Object *)ptr->data;
/* only if the axis in question is locked, not editable... */
if ((index == 0) && (ob->protectflag & OB_LOCK_SCALEX))
@@ -741,7 +742,7 @@ static int rna_Object_scale_editable(PointerRNA *ptr, int index)
static int rna_Object_rotation_euler_editable(PointerRNA *ptr, int index)
{
- Object *ob= (Object *)ptr->data;
+ Object *ob = (Object *)ptr->data;
/* only if the axis in question is locked, not editable... */
if ((index == 0) && (ob->protectflag & OB_LOCK_ROTX))
@@ -756,7 +757,7 @@ static int rna_Object_rotation_euler_editable(PointerRNA *ptr, int index)
static int rna_Object_rotation_4d_editable(PointerRNA *ptr, int index)
{
- Object *ob= (Object *)ptr->data;
+ Object *ob = (Object *)ptr->data;
/* only consider locks if locking components individually... */
if (ob->protectflag & OB_LOCK_ROT4D) {
@@ -777,54 +778,54 @@ static int rna_Object_rotation_4d_editable(PointerRNA *ptr, int index)
static PointerRNA rna_MaterialSlot_material_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
Material *ma;
- int index= (Material**)ptr->data - ob->mat;
+ int index = (Material**)ptr->data - ob->mat;
- ma= give_current_material(ob, index+1);
+ ma = give_current_material(ob, index+1);
return rna_pointer_inherit_refine(ptr, &RNA_Material, ma);
}
static void rna_MaterialSlot_material_set(PointerRNA *ptr, PointerRNA value)
{
- Object *ob= (Object*)ptr->id.data;
- int index= (Material**)ptr->data - ob->mat;
+ Object *ob = (Object*)ptr->id.data;
+ int index = (Material**)ptr->data - ob->mat;
assign_material(ob, value.data, index+1);
}
static int rna_MaterialSlot_link_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- int index= (Material**)ptr->data - ob->mat;
+ Object *ob = (Object*)ptr->id.data;
+ int index = (Material**)ptr->data - ob->mat;
return ob->matbits[index] != 0;
}
static void rna_MaterialSlot_link_set(PointerRNA *ptr, int value)
{
- Object *ob= (Object*)ptr->id.data;
- int index= (Material**)ptr->data - ob->mat;
+ Object *ob = (Object*)ptr->id.data;
+ int index = (Material**)ptr->data - ob->mat;
- if(value) {
- ob->matbits[index]= 1;
+ if (value) {
+ ob->matbits[index] = 1;
/* ob->colbits |= (1<<index); */ /* DEPRECATED */
}
else {
- ob->matbits[index]= 0;
+ ob->matbits[index] = 0;
/* ob->colbits &= ~(1<<index); */ /* DEPRECATED */
}
}
static int rna_MaterialSlot_name_length(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
Material *ma;
- int index= (Material**)ptr->data - ob->mat;
+ int index = (Material**)ptr->data - ob->mat;
- ma= give_current_material(ob, index+1);
+ ma = give_current_material(ob, index+1);
- if(ma)
+ if (ma)
return strlen(ma->id.name+2);
return 0;
@@ -832,16 +833,16 @@ static int rna_MaterialSlot_name_length(PointerRNA *ptr)
static void rna_MaterialSlot_name_get(PointerRNA *ptr, char *str)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
Material *ma;
- int index= (Material**)ptr->data - ob->mat;
+ int index = (Material**)ptr->data - ob->mat;
- ma= give_current_material(ob, index+1);
+ ma = give_current_material(ob, index+1);
- if(ma)
+ if (ma)
strcpy(str, ma->id.name+2);
else
- str[0]= '\0';
+ str[0] = '\0';
}
static void rna_MaterialSlot_update(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -857,7 +858,7 @@ static void rna_MaterialSlot_update(Main *bmain, Scene *scene, PointerRNA *ptr)
* */
static int rna_GameObjectSettings_physics_type_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
/* determine the body_type setting based on flags */
if (!(ob->gameflag & OB_COLLISION)) {
@@ -888,9 +889,9 @@ static int rna_GameObjectSettings_physics_type_get(PointerRNA *ptr)
static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
{
- Object *ob= (Object*)ptr->id.data;
- const int was_navmesh= (ob->gameflag & OB_NAVMESH);
- ob->body_type= value;
+ Object *ob = (Object*)ptr->id.data;
+ const int was_navmesh = (ob->gameflag & OB_NAVMESH);
+ ob->body_type = value;
switch (ob->body_type) {
case OB_BODY_TYPE_SENSOR:
@@ -933,9 +934,8 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
ob->gameflag &= ~(OB_RIGID_BODY|OB_OCCLUDER|OB_SENSOR|OB_NAVMESH);
/* assume triangle mesh, if no bounds chosen for soft body */
- if ((ob->gameflag & OB_BOUNDS) && (ob->boundtype<OB_BOUND_TRIANGLE_MESH))
- {
- ob->boundtype= OB_BOUND_TRIANGLE_MESH;
+ if ((ob->gameflag & OB_BOUNDS) && (ob->boundtype<OB_BOUND_TRIANGLE_MESH)) {
+ ob->boundtype = OB_BOUND_TRIANGLE_MESH;
}
/* create a BulletSoftBody structure if not already existing */
if (!ob->bsoft)
@@ -955,8 +955,8 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
static PointerRNA rna_Object_active_particle_system_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- ParticleSystem *psys= psys_get_current(ob);
+ Object *ob = (Object*)ptr->id.data;
+ ParticleSystem *psys = psys_get_current(ob);
return rna_pointer_inherit_refine(ptr, &RNA_ParticleSystem, psys);
}
@@ -968,18 +968,18 @@ static PointerRNA rna_Object_game_settings_get(PointerRNA *ptr)
static unsigned int rna_Object_layer_validate__internal(const int *values, unsigned int lay)
{
- int i, tot= 0;
+ int i, tot = 0;
/* ensure we always have some layer selected */
- for(i=0; i<20; i++)
- if(values[i])
+ for (i = 0; i<20; i++)
+ if (values[i])
tot++;
- if(tot==0)
+ if (tot == 0)
return 0;
- for(i=0; i<20; i++) {
- if(values[i]) lay |= (1<<i);
+ for (i = 0; i<20; i++) {
+ if (values[i]) lay |= (1<<i);
else lay &= ~(1<<i);
}
@@ -988,66 +988,66 @@ static unsigned int rna_Object_layer_validate__internal(const int *values, unsig
static void rna_Object_layer_set(PointerRNA *ptr, const int *values)
{
- Object *ob= (Object*)ptr->data;
+ Object *ob = (Object*)ptr->data;
unsigned int lay;
- lay= rna_Object_layer_validate__internal(values, ob->lay);
- if(lay)
- ob->lay= lay;
+ lay = rna_Object_layer_validate__internal(values, ob->lay);
+ if (lay)
+ ob->lay = lay;
}
static void rna_Base_layer_set(PointerRNA *ptr, const int *values)
{
- Base *base= (Base*)ptr->data;
+ Base *base = (Base*)ptr->data;
unsigned int lay;
- lay= rna_Object_layer_validate__internal(values, base->lay);
- if(lay)
- base->lay= lay;
+ lay = rna_Object_layer_validate__internal(values, base->lay);
+ if (lay)
+ base->lay = lay;
/* rna_Base_layer_update updates the objects layer */
}
static void rna_GameObjectSettings_state_get(PointerRNA *ptr, int *values)
{
- Object *ob= (Object*)ptr->data;
+ Object *ob = (Object*)ptr->data;
int i;
int all_states = (ob->scaflag & OB_ALLSTATE?1:0);
memset(values, 0, sizeof(int)*OB_MAX_STATES);
- for(i=0; i<OB_MAX_STATES; i++)
+ for (i = 0; i<OB_MAX_STATES; i++)
values[i] = (ob->state & (1<<i)) | all_states;
}
static void rna_GameObjectSettings_state_set(PointerRNA *ptr, const int *values)
{
- Object *ob= (Object*)ptr->data;
- int i, tot= 0;
+ Object *ob = (Object*)ptr->data;
+ int i, tot = 0;
/* ensure we always have some state selected */
- for(i=0; i<OB_MAX_STATES; i++)
- if(values[i])
+ for (i = 0; i<OB_MAX_STATES; i++)
+ if (values[i])
tot++;
- if(tot==0)
+ if (tot == 0)
return;
- for(i=0; i<OB_MAX_STATES; i++) {
- if(values[i]) ob->state |= (1<<i);
+ for (i = 0; i<OB_MAX_STATES; i++) {
+ if (values[i]) ob->state |= (1<<i);
else ob->state &= ~(1<<i);
}
}
static void rna_GameObjectSettings_used_state_get(PointerRNA *ptr, int *values)
{
- Object *ob= (Object*)ptr->data;
+ Object *ob = (Object*)ptr->data;
bController *cont;
memset(values, 0, sizeof(int)*OB_MAX_STATES);
- for (cont=ob->controllers.first; cont; cont=cont->next) {
+ for (cont = ob->controllers.first; cont; cont = cont->next) {
int i;
- for (i=0; i<OB_MAX_STATES; i++) {
+ for (i = 0; i<OB_MAX_STATES; i++) {
if (cont->state_mask & (1<<i))
values[i] = 1;
}
@@ -1056,83 +1056,83 @@ static void rna_GameObjectSettings_used_state_get(PointerRNA *ptr, int *values)
static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, int *max)
{
- Object *ob= (Object*)ptr->id.data;
- Key *key= ob_get_key(ob);
+ Object *ob = (Object*)ptr->id.data;
+ Key *key = ob_get_key(ob);
- *min= 0;
- if(key) {
- *max= BLI_countlist(&key->block)-1;
- if(*max < 0) *max= 0;
+ *min = 0;
+ if (key) {
+ *max = BLI_countlist(&key->block)-1;
+ if (*max < 0) *max = 0;
}
else {
- *max= 0;
+ *max = 0;
}
}
static int rna_Object_active_shape_key_index_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
return MAX2(ob->shapenr-1, 0);
}
static void rna_Object_active_shape_key_index_set(PointerRNA *ptr, int value)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
- ob->shapenr= value+1;
+ ob->shapenr = value+1;
}
static PointerRNA rna_Object_active_shape_key_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- Key *key= ob_get_key(ob);
+ Object *ob = (Object*)ptr->id.data;
+ Key *key = ob_get_key(ob);
KeyBlock *kb;
PointerRNA keyptr;
- if(key==NULL)
+ if (key == NULL)
return PointerRNA_NULL;
- kb= BLI_findlink(&key->block, ob->shapenr-1);
+ kb = BLI_findlink(&key->block, ob->shapenr-1);
RNA_pointer_create((ID *)key, &RNA_ShapeKey, kb, &keyptr);
return keyptr;
}
static PointerRNA rna_Object_field_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
/* weak */
- if(!ob->pd)
- ob->pd= object_add_collision_fields(0);
+ if (!ob->pd)
+ ob->pd = object_add_collision_fields(0);
return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, ob->pd);
}
static PointerRNA rna_Object_collision_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
- if(ob->type != OB_MESH)
+ if (ob->type != OB_MESH)
return PointerRNA_NULL;
/* weak */
- if(!ob->pd)
- ob->pd= object_add_collision_fields(0);
+ if (!ob->pd)
+ ob->pd = object_add_collision_fields(0);
return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd);
}
static PointerRNA rna_Object_active_constraint_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- bConstraint *con= constraints_get_active(&ob->constraints);
+ Object *ob = (Object*)ptr->id.data;
+ bConstraint *con = constraints_get_active(&ob->constraints);
return rna_pointer_inherit_refine(ptr, &RNA_Constraint, con);
}
static void rna_Object_active_constraint_set(PointerRNA *ptr, PointerRNA value)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
constraints_set_active(&ob->constraints, (bConstraint *)value.data);
}
@@ -1144,7 +1144,7 @@ static bConstraint *rna_Object_constraints_new(Object *object, int type)
static void rna_Object_constraints_remove(Object *object, ReportList *reports, bConstraint *con)
{
- if(BLI_findindex(&object->constraints, con) == -1) {
+ if (BLI_findindex(&object->constraints, con) == -1) {
BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in object '%s'", con->name, object->id.name+2);
return;
}
@@ -1186,9 +1186,9 @@ static void rna_Object_modifier_clear(Object *object, bContext *C)
static void rna_Object_boundbox_get(PointerRNA *ptr, float *values)
{
- Object *ob= (Object*)ptr->id.data;
- BoundBox *bb= object_get_boundbox(ob);
- if(bb) {
+ Object *ob = (Object*)ptr->id.data;
+ BoundBox *bb = object_get_boundbox(ob);
+ if (bb) {
memcpy(values, bb->vec, sizeof(bb->vec));
}
else {
@@ -1225,12 +1225,12 @@ static void rna_VertexGroup_vertex_add(ID *id, bDeformGroup *def, ReportList *re
{
Object *ob = (Object *)id;
- if(ED_vgroup_object_is_edit_mode(ob)) {
+ if (ED_vgroup_object_is_edit_mode(ob)) {
BKE_reportf(reports, RPT_ERROR, "VertexGroup.add(): Can't be called while object is in edit mode");
return;
}
- while(index_len--)
+ while (index_len--)
ED_vgroup_vert_add(ob, def, *index++, weight, assignmode); /* XXX, not efficient calling within loop*/
WM_main_add_notifier(NC_GEOM|ND_DATA, (ID *)ob->data);
@@ -1240,12 +1240,12 @@ static void rna_VertexGroup_vertex_remove(ID *id, bDeformGroup *dg, ReportList *
{
Object *ob = (Object *)id;
- if(ED_vgroup_object_is_edit_mode(ob)) {
+ if (ED_vgroup_object_is_edit_mode(ob)) {
BKE_reportf(reports, RPT_ERROR, "VertexGroup.remove(): Can't be called while object is in edit mode");
return;
}
- while(index_len--)
+ while (index_len--)
ED_vgroup_vert_remove(ob, dg, *index++);
WM_main_add_notifier(NC_GEOM|ND_DATA, (ID *)ob->data);
@@ -1255,7 +1255,7 @@ static float rna_VertexGroup_weight(ID *id, bDeformGroup *dg, ReportList *report
{
float weight = ED_vgroup_vert_weight((Object *)id, dg, index);
- if(weight < 0) {
+ if (weight < 0) {
BKE_reportf(reports, RPT_ERROR, "Vertex not in group");
}
return weight;
@@ -1289,7 +1289,7 @@ int rna_Camera_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
#else
-static int rna_matrix_dimsize_4x4[]= {4, 4};
+static int rna_matrix_dimsize_4x4[] = {4, 4};
static void rna_def_vertex_group(BlenderRNA *brna)
{
@@ -1304,51 +1304,51 @@ static void rna_def_vertex_group(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- srna= RNA_def_struct(brna, "VertexGroup", NULL);
+ srna = RNA_def_struct(brna, "VertexGroup", NULL);
RNA_def_struct_sdna(srna, "bDeformGroup");
RNA_def_struct_ui_text(srna, "Vertex Group", "Group of vertices, used for armature deform and other purposes");
RNA_def_struct_ui_icon(srna, ICON_GROUP_VERTEX);
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Vertex group name");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_VertexGroup_name_set");
RNA_def_property_update(prop, NC_GEOM|ND_DATA|NA_RENAME, "rna_Object_internal_update_data"); /* update data because modifiers may use [#24761] */
- prop= RNA_def_property(srna, "lock_weight", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_weight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "", "Maintain the relative weights for the group");
RNA_def_property_boolean_sdna(prop, NULL, "flag", 0);
RNA_def_property_update(prop, NC_GEOM|ND_DATA|NA_RENAME, "rna_Object_internal_update_data"); /* update data because modifiers may use [#24761] */
- prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_VertexGroup_index_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Index", "Index number of the vertex group");
- func= RNA_def_function(srna, "add", "rna_VertexGroup_vertex_add");
+ func = RNA_def_function(srna, "add", "rna_VertexGroup_vertex_add");
RNA_def_function_ui_description(func, "Add vertices to the group");
RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID);
/* TODO, see how array size of 0 works, this shouldnt be used */
- prop= RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0);
+ prop = RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0);
RNA_def_property_flag(prop, PROP_DYNAMIC|PROP_REQUIRED);
- prop= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f);
+ prop = RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f);
RNA_def_property_flag(prop, PROP_REQUIRED);
- prop= RNA_def_enum(func, "type", assign_mode_items, 0, "", "Vertex assign mode");
+ prop = RNA_def_enum(func, "type", assign_mode_items, 0, "", "Vertex assign mode");
RNA_def_property_flag(prop, PROP_REQUIRED);
- func= RNA_def_function(srna, "remove", "rna_VertexGroup_vertex_remove");
+ func = RNA_def_function(srna, "remove", "rna_VertexGroup_vertex_remove");
RNA_def_function_ui_description(func, "Remove a vertex from the group");
RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID);
/* TODO, see how array size of 0 works, this shouldnt be used */
- prop= RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0);
+ prop = RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0);
RNA_def_property_flag(prop, PROP_DYNAMIC|PROP_REQUIRED);
- func= RNA_def_function(srna, "weight", "rna_VertexGroup_weight");
+ func = RNA_def_function(srna, "weight", "rna_VertexGroup_weight");
RNA_def_function_ui_description(func, "Get a vertex weight from the group");
RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID);
- prop=RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "The index of the vertex", 0, INT_MAX);
+ prop = RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "The index of the vertex", 0, INT_MAX);
RNA_def_property_flag(prop, PROP_REQUIRED);
- prop= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f);
+ prop = RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f);
RNA_def_function_return(func, prop);
}
@@ -1366,24 +1366,24 @@ static void rna_def_material_slot(BlenderRNA *brna)
* pointer data points to ob->mat + index, and we manually implement
* get/set for the properties. */
- srna= RNA_def_struct(brna, "MaterialSlot", NULL);
+ srna = RNA_def_struct(brna, "MaterialSlot", NULL);
RNA_def_struct_ui_text(srna, "Material Slot", "Material slot in an object");
RNA_def_struct_ui_icon(srna, ICON_MATERIAL_DATA);
- prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, "rna_MaterialSlot_material_get", "rna_MaterialSlot_material_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Material", "Material datablock used by this material slot");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_MaterialSlot_update");
- prop= RNA_def_property(srna, "link", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "link", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, link_items);
RNA_def_property_enum_funcs(prop, "rna_MaterialSlot_link_get", "rna_MaterialSlot_link_set", NULL);
RNA_def_property_ui_text(prop, "Link", "Link material to object or the object's data");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_MaterialSlot_update");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_MaterialSlot_name_get", "rna_MaterialSlot_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "Material slot name");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -1407,7 +1407,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
{OB_BODY_TYPE_NAVMESH, "NAVMESH", 0, "Navigation Mesh", "Navigation mesh"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "GameObjectSettings", NULL);
+ srna = RNA_def_struct(brna, "GameObjectSettings", NULL);
RNA_def_struct_sdna(srna, "Object");
RNA_def_struct_nested(brna, srna, "Object");
RNA_def_struct_ui_text(srna, "Game Object Settings", "Game engine related settings for the object");
@@ -1415,209 +1415,209 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
/* logic */
- prop= RNA_def_property(srna, "sensors", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "sensors", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Sensor");
RNA_def_property_ui_text(prop, "Sensors", "Game engine sensor to detect events");
- prop= RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Controller");
RNA_def_property_ui_text(prop, "Controllers",
"Game engine controllers to process events, connecting sensors to actuators");
- prop= RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Actuator");
RNA_def_property_ui_text(prop, "Actuators", "Game engine actuators to act on events");
- prop= RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "prop", NULL);
RNA_def_property_struct_type(prop, "GameProperty"); /* rna_property.c */
RNA_def_property_ui_text(prop, "Properties", "Game engine properties");
- prop= RNA_def_property(srna, "show_sensors", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_sensors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWSENS);
RNA_def_property_ui_text(prop, "Show Sensors", "Shows sensors for this object in the user interface");
- prop= RNA_def_property(srna, "show_controllers", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_controllers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWCONT);
RNA_def_property_ui_text(prop, "Show Controllers", "Shows controllers for this object in the user interface");
- prop= RNA_def_property(srna, "show_actuators", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_actuators", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWACT);
RNA_def_property_ui_text(prop, "Show Actuators", "Shows actuators for this object in the user interface");
/* physics */
- prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "body_type");
RNA_def_property_enum_items(prop, body_type_items);
RNA_def_property_enum_funcs(prop, "rna_GameObjectSettings_physics_type_get", "rna_GameObjectSettings_physics_type_set", NULL);
RNA_def_property_ui_text(prop, "Physics Type", "Select the type of physical representation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_actor", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_actor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ACTOR);
RNA_def_property_ui_text(prop, "Actor", "Object is detected by the Near and Radar sensor");
- prop= RNA_def_property(srna, "use_ghost", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_ghost", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_GHOST);
RNA_def_property_ui_text(prop, "Ghost", "Object does not restitute collisions, like a ghost");
- prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 10000.0);
RNA_def_property_ui_text(prop, "Mass", "Mass of the object");
- prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
+ prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "inertia");
RNA_def_property_range(prop, 0.01, 10.0);
RNA_def_property_ui_text(prop, "Radius", "Radius of bounding sphere and material physics");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "use_sleep", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_sleep", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_COLLISION_RESPONSE);
RNA_def_property_ui_text(prop, "No Sleeping", "Disable auto (de)activation in physics simulation");
- prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "damping");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Damping", "General movement damping");
- prop= RNA_def_property(srna, "rotation_damping", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "rotation_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rdamping");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Rotation Damping", "General rotation damping");
- prop= RNA_def_property(srna, "velocity_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "velocity_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min_vel");
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Velocity Min", "Clamp velocity to this minimum speed (except when totally still)");
- prop= RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max_vel");
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Velocity Max", "Clamp velocity to this maximum speed");
/* lock position */
- prop= RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_AXIS);
RNA_def_property_ui_text(prop, "Lock X Axis", "Disable simulation of linear motion along the X axis");
- prop= RNA_def_property(srna, "lock_location_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_location_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Y_AXIS);
RNA_def_property_ui_text(prop, "Lock Y Axis", "Disable simulation of linear motion along the Y axis");
- prop= RNA_def_property(srna, "lock_location_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_location_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Z_AXIS);
RNA_def_property_ui_text(prop, "Lock Z Axis", "Disable simulation of linear motion along the Z axis");
/* lock rotation */
- prop= RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_ROT_AXIS);
RNA_def_property_ui_text(prop, "Lock X Rotation Axis", "Disable simulation of angular motion along the X axis");
- prop= RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Y_ROT_AXIS);
RNA_def_property_ui_text(prop, "Lock Y Rotation Axis", "Disable simulation of angular motion along the Y axis");
- prop= RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Z_ROT_AXIS);
RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis");
/* is this used anywhere ? */
- prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflag2", OB_NEVER_DO_ACTIVITY_CULLING);
RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis");
- prop= RNA_def_property(srna, "use_material_physics_fh", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_material_physics_fh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_DO_FH);
RNA_def_property_ui_text(prop, "Use Material Force Field", "React to force field physics settings in materials");
- prop= RNA_def_property(srna, "use_rotate_from_normal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_rotate_from_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ROT_FH);
RNA_def_property_ui_text(prop, "Rotate From Normal",
"Use face normal to rotate object, so that it points away from the surface");
- prop= RNA_def_property(srna, "form_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "form_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "formfactor");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Form Factor", "Form factor scales the inertia tensor");
- prop= RNA_def_property(srna, "use_anisotropic_friction", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_anisotropic_friction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ANISOTROPIC_FRICTION);
RNA_def_property_ui_text(prop, "Anisotropic Friction", "Enable anisotropic friction");
- prop= RNA_def_property(srna, "friction_coefficients", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "friction_coefficients", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "anisotropicFriction");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Friction Coefficients",
"Relative friction coefficients in the in the X, Y and Z directions, "
"when anisotropic friction is enabled");
- prop= RNA_def_property(srna, "use_collision_bounds", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_collision_bounds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_BOUNDS);
RNA_def_property_ui_text(prop, "Use Collision Bounds", "Specify a collision bounds type other than the default");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "collision_bounds_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "collision_bounds_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "collision_boundtype");
RNA_def_property_enum_items(prop, collision_bounds_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Object_collision_bounds_itemf");
RNA_def_property_ui_text(prop, "Collision Bounds", "Select the collision type");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "use_collision_compound", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_collision_compound", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_CHILD);
RNA_def_property_ui_text(prop, "Collision Compound", "Add children to form a compound collision object");
- prop= RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
+ prop = RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "margin");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Collision Margin",
"Extra margin around object for collision detection, small amount required for stability");
- prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "bsoft");
RNA_def_property_ui_text(prop, "Soft Body Settings", "Settings for Bullet soft body simulation");
- prop= RNA_def_property(srna, "use_obstacle_create", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_obstacle_create", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_HASOBSTACLE);
RNA_def_property_ui_text(prop, "Create obstacle", "Create representation for obstacle simulation");
- prop= RNA_def_property(srna, "obstacle_radius", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
+ prop = RNA_def_property(srna, "obstacle_radius", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "obstacleRad");
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Obstacle Radius", "Radius of object representation in obstacle simulation");
/* state */
- prop= RNA_def_property(srna, "states_visible", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop = RNA_def_property(srna, "states_visible", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "state", 1);
RNA_def_property_array(prop, OB_MAX_STATES);
RNA_def_property_ui_text(prop, "State", "State determining which controllers are displayed");
RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_state_get", "rna_GameObjectSettings_state_set");
- prop= RNA_def_property(srna, "used_states", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop = RNA_def_property(srna, "used_states", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_array(prop, OB_MAX_STATES);
RNA_def_property_ui_text(prop, "Used State", "States which are being used by controllers");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_used_state_get", NULL);
- prop= RNA_def_property(srna, "states_initial", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "states_initial", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "init_state", 1);
RNA_def_property_array(prop, OB_MAX_STATES);
RNA_def_property_ui_text(prop, "Initial State", "Initial state when the game starts");
- prop= RNA_def_property(srna, "show_debug_state", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_debug_state", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_DEBUGSTATE);
RNA_def_property_ui_text(prop, "Debug State", "Print state debug info in the game engine");
RNA_def_property_ui_icon(prop, ICON_INFO, 0);
- prop= RNA_def_property(srna, "use_all_states", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_all_states", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_ALLSTATE);
RNA_def_property_ui_text(prop, "All", "Set all state bits");
- prop= RNA_def_property(srna, "show_state_panel", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_state_panel", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWSTATE);
RNA_def_property_ui_text(prop, "States", "Show state panel");
RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);
@@ -1632,13 +1632,13 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "ObjectConstraints");
- srna= RNA_def_struct(brna, "ObjectConstraints", NULL);
+ srna = RNA_def_struct(brna, "ObjectConstraints", NULL);
RNA_def_struct_sdna(srna, "Object");
RNA_def_struct_ui_text(srna, "Object Constraints", "Collection of object constraints");
/* Collection active property */
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Constraint");
RNA_def_property_pointer_funcs(prop, "rna_Object_active_constraint_get", "rna_Object_active_constraint_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -1646,23 +1646,23 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop)
/* Constraint collection */
- func= RNA_def_function(srna, "new", "rna_Object_constraints_new");
+ func = RNA_def_function(srna, "new", "rna_Object_constraints_new");
RNA_def_function_ui_description(func, "Add a new constraint to this object");
/* object to add */
- parm= RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add");
+ parm = RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint");
+ parm = RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Object_constraints_remove");
+ func = RNA_def_function(srna, "remove", "rna_Object_constraints_remove");
RNA_def_function_ui_description(func, "Remove a constraint from this object");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* constraint to remove */
- parm= RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint");
+ parm = RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "clear", "rna_Object_constraints_clear");
+ func = RNA_def_function(srna, "clear", "rna_Object_constraints_clear");
RNA_def_function_ui_description(func, "Remove all constraint from this object");
}
@@ -1675,46 +1675,46 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "ObjectModifiers");
- srna= RNA_def_struct(brna, "ObjectModifiers", NULL);
+ srna = RNA_def_struct(brna, "ObjectModifiers", NULL);
RNA_def_struct_sdna(srna, "Object");
RNA_def_struct_ui_text(srna, "Object Modifiers", "Collection of object modifiers");
#if 0
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EditBone");
RNA_def_property_pointer_sdna(prop, NULL, "act_edbone");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active EditBone", "Armatures active edit bone");
- //RNA_def_property_update(prop, 0, "rna_Armature_act_editbone_update");
+ /*RNA_def_property_update(prop, 0, "rna_Armature_act_editbone_update"); */
RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL, NULL);
/* todo, redraw */
-// RNA_def_property_collection_active(prop, prop_act);
+/* RNA_def_property_collection_active(prop, prop_act); */
#endif
/* add target */
- func= RNA_def_function(srna, "new", "rna_Object_modifier_new");
+ func = RNA_def_function(srna, "new", "rna_Object_modifier_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new modifier");
- parm= RNA_def_string(func, "name", "Name", 0, "", "New name for the bone");
+ parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the bone");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* modifier to add */
- parm= RNA_def_enum(func, "type", modifier_type_items, 1, "", "Modifier type to add");
+ parm = RNA_def_enum(func, "type", modifier_type_items, 1, "", "Modifier type to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Newly created modifier");
+ parm = RNA_def_pointer(func, "modifier", "Modifier", "", "Newly created modifier");
RNA_def_function_return(func, parm);
/* remove target */
- func= RNA_def_function(srna, "remove", "rna_Object_modifier_remove");
+ func = RNA_def_function(srna, "remove", "rna_Object_modifier_remove");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove an existing modifier from the object");
/* target to remove*/
- parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove");
+ parm = RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* clear all modifiers */
- func= RNA_def_function(srna, "clear", "rna_Object_modifier_clear");
+ func = RNA_def_function(srna, "clear", "rna_Object_modifier_clear");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Remove all modifiers from the object");
}
@@ -1726,21 +1726,21 @@ static void rna_def_object_particle_systems(BlenderRNA *brna, PropertyRNA *cprop
PropertyRNA *prop;
- // FunctionRNA *func;
- // PropertyRNA *parm;
+ /* FunctionRNA *func; */
+ /* PropertyRNA *parm; */
RNA_def_property_srna(cprop, "ParticleSystems");
- srna= RNA_def_struct(brna, "ParticleSystems", NULL);
+ srna = RNA_def_struct(brna, "ParticleSystems", NULL);
RNA_def_struct_sdna(srna, "Object");
RNA_def_struct_ui_text(srna, "Particle Systems", "Collection of particle systems");
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_funcs(prop, "rna_Object_active_particle_system_index_get",
"rna_Object_active_particle_system_index_set",
@@ -1761,18 +1761,18 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "VertexGroups");
- srna= RNA_def_struct(brna, "VertexGroups", NULL);
+ srna = RNA_def_struct(brna, "VertexGroups", NULL);
RNA_def_struct_sdna(srna, "Object");
RNA_def_struct_ui_text(srna, "Vertex Groups", "Collection of vertex groups");
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "VertexGroup");
RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get",
"rna_Object_active_vertex_group_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object");
RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data");
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "actdef");
RNA_def_property_int_funcs(prop, "rna_Object_active_vertex_group_index_get", "rna_Object_active_vertex_group_index_set",
@@ -1780,19 +1780,19 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_ui_text(prop, "Active Vertex Group Index", "Active index in vertex group array");
RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data");
- /* vertex groups */ // add_vertex_group
- func= RNA_def_function(srna, "new", "rna_Object_vgroup_new");
+ /* vertex groups */ /* add_vertex_group */
+ func = RNA_def_function(srna, "new", "rna_Object_vgroup_new");
RNA_def_function_ui_description(func, "Add vertex group to object");
RNA_def_string(func, "name", "Group", 0, "", "Vertex group name"); /* optional */
- parm= RNA_def_pointer(func, "group", "VertexGroup", "", "New vertex group");
+ parm = RNA_def_pointer(func, "group", "VertexGroup", "", "New vertex group");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_Object_vgroup_remove");
+ func = RNA_def_function(srna, "remove", "rna_Object_vgroup_remove");
RNA_def_function_ui_description(func, "Delete vertex group from object");
- parm= RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to remove");
+ parm = RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "clear", "rna_Object_vgroup_clear");
+ func = RNA_def_function(srna, "clear", "rna_Object_vgroup_clear");
RNA_def_function_ui_description(func, "Delete all vertex groups from object");
}
@@ -1850,7 +1850,7 @@ static void rna_def_object(BlenderRNA *brna)
{OB_DUPLIGROUP, "GROUP", 0, "Group", "Enable group instancing"},
{0, NULL, 0, NULL, NULL}};
- // XXX: this RNA enum define is currently duplicated for objects, since there is some text here which is not applicable
+ /* XXX: this RNA enum define is currently duplicated for objects, since there is some text here which is not applicable */
static EnumPropertyItem prop_rotmode_items[] = {
{ROT_MODE_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock"},
{ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order - prone to Gimbal Lock (default)"},
@@ -1866,33 +1866,33 @@ static void rna_def_object(BlenderRNA *brna)
static float default_quat[4] = {1,0,0,0}; /* default quaternion values */
static float default_axisAngle[4] = {0,0,1,0}; /* default axis-angle rotation values */
static float default_scale[3] = {1,1,1}; /* default scale values */
- static int boundbox_dimsize[]= {8, 3};
+ static int boundbox_dimsize[] = {8, 3};
- srna= RNA_def_struct(brna, "Object", "ID");
+ srna = RNA_def_struct(brna, "Object", "ID");
RNA_def_struct_ui_text(srna, "Object", "Object datablock defining an object in a scene");
RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
RNA_def_struct_ui_icon(srna, ICON_OBJECT_DATA);
- prop= RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ID");
RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_data_set", "rna_Object_data_typef", NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK);
RNA_def_property_ui_text(prop, "Data", "Object data");
RNA_def_property_update(prop, 0, "rna_Object_internal_update_data");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, object_type_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Type", "Type of Object");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, object_mode_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mode", "Object interaction mode");
- prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_ui_text(prop, "Layers", "Layers the object is on");
@@ -1900,13 +1900,13 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_layer_update");
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
RNA_def_property_ui_text(prop, "Select", "Object selection state");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_select_update");
/* for data access */
- prop= RNA_def_property(srna, "bound_box", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bound_box", PROP_FLOAT, PROP_NONE);
RNA_def_property_multi_array(prop, 2, boundbox_dimsize);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_Object_boundbox_get", NULL, NULL);
@@ -1914,34 +1914,34 @@ static void rna_def_object(BlenderRNA *brna)
"Object's bounding box in object-space coordinates, all values are -1.0 when not available");
/* parent */
- prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_ui_text(prop, "Parent", "Parent Object");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
- prop= RNA_def_property(srna, "parent_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "parent_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "partype");
RNA_def_property_enum_items(prop, parent_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Object_parent_type_set", "rna_Object_parent_type_itemf");
RNA_def_property_ui_text(prop, "Parent Type", "Type of parent relation");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
- prop= RNA_def_property(srna, "parent_vertices", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "parent_vertices", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "par1");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Parent Vertices", "Indices of vertices in case of a vertex parenting relation");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "parent_bone", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "parent_bone", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "parsubstr");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Object_parent_bone_set");
RNA_def_property_ui_text(prop, "Parent Bone", "Name of parent bone in case of a bone parenting relation");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
/* Track and Up flags */
- // XXX: these have been saved here for a bit longer (after old track was removed), since some other tools still refer to this
- prop= RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
+ /* XXX: these have been saved here for a bit longer (after old track was removed), since some other tools still refer to this */
+ prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "trackflag");
RNA_def_property_enum_items(prop, track_items);
RNA_def_property_ui_text(prop, "Track Axis",
@@ -1949,7 +1949,7 @@ static void rna_def_object(BlenderRNA *brna)
"parent 'Follow' is enabled)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "upflag");
RNA_def_property_enum_items(prop, up_items);
RNA_def_property_ui_text(prop, "Up Axis",
@@ -1958,27 +1958,27 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
/* proxy */
- prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Proxy", "Library object this proxy object controls");
- prop= RNA_def_property(srna, "proxy_group", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "proxy_group", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Proxy Group", "Library group duplicator object this proxy object controls");
/* materials */
- prop= RNA_def_property(srna, "material_slots", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "material_slots", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
RNA_def_property_struct_type(prop, "MaterialSlot");
RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL, NULL); /* don't dereference pointer! */
RNA_def_property_ui_text(prop, "Material Slots", "Material slots in the object");
- prop= RNA_def_property(srna, "active_material", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active_material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_pointer_funcs(prop, "rna_Object_active_material_get", "rna_Object_active_material_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Material", "Active material being displayed");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_MaterialSlot_update");
- prop= RNA_def_property(srna, "active_material_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "active_material_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "actcol");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_funcs(prop, "rna_Object_active_material_index_get", "rna_Object_active_material_index_set",
@@ -1987,14 +1987,14 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
/* transform */
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_editable_array_func(prop, "rna_Object_location_editable");
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3);
RNA_def_property_ui_text(prop, "Location", "Location of the object");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
+ prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "quat");
RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable");
RNA_def_property_float_array_default(prop, default_quat);
@@ -2004,7 +2004,7 @@ static void rna_def_object(BlenderRNA *brna)
/* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but
* having a single one is better for Keyframing and other property-management situations...
*/
- prop= RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
+ prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
RNA_def_property_array(prop, 4);
RNA_def_property_float_funcs(prop, "rna_Object_rotation_axis_angle_get", "rna_Object_rotation_axis_angle_set", NULL);
RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable");
@@ -2012,20 +2012,20 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
+ prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_editable_array_func(prop, "rna_Object_rotation_euler_editable");
RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rotmode");
- RNA_def_property_enum_items(prop, prop_rotmode_items); // XXX move to using a single define of this someday
+ RNA_def_property_enum_items(prop, prop_rotmode_items); /* XXX move to using a single define of this someday */
RNA_def_property_enum_funcs(prop, NULL, "rna_Object_rotation_mode_set", NULL);
RNA_def_property_ui_text(prop, "Rotation Mode", "");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_editable_array_func(prop, "rna_Object_scale_editable");
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3);
@@ -2033,7 +2033,7 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Scale", "Scaling of the object");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "dimensions", PROP_FLOAT, PROP_XYZ_LENGTH);
+ prop = RNA_def_property(srna, "dimensions", PROP_FLOAT, PROP_XYZ_LENGTH);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_Object_dimensions_get", "rna_Object_dimensions_set", NULL);
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3);
@@ -2042,34 +2042,34 @@ static void rna_def_object(BlenderRNA *brna)
/* delta transforms */
- prop= RNA_def_property(srna, "delta_location", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "delta_location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "dloc");
RNA_def_property_ui_text(prop, "Delta Location", "Extra translation added to the location of the object");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "delta_rotation_euler", PROP_FLOAT, PROP_EULER);
+ prop = RNA_def_property(srna, "delta_rotation_euler", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "drot");
RNA_def_property_ui_text(prop, "Delta Rotation (Euler)",
"Extra rotation added to the rotation of the object (when using Euler rotations)");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "delta_rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
+ prop = RNA_def_property(srna, "delta_rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "dquat");
RNA_def_property_float_array_default(prop, default_quat);
RNA_def_property_ui_text(prop, "Delta Rotation (Quaternion)",
"Extra rotation added to the rotation of the object (when using Quaternion rotations)");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
-#if 0 // XXX not supported well yet...
- prop= RNA_def_property(srna, "delta_rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
- RNA_def_property_float_sdna(prop, NULL, "dquat"); // FIXME: this is not a single field any more! (drotAxis and drotAngle)
+#if 0 /* XXX not supported well yet... */
+ prop = RNA_def_property(srna, "delta_rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
+ RNA_def_property_float_sdna(prop, NULL, "dquat"); /* FIXME: this is not a single field any more! (drotAxis and drotAngle) */
RNA_def_property_float_array_default(prop, default_axisAngle);
RNA_def_property_ui_text(prop, "Delta Rotation (Axis Angle)",
"Extra rotation added to the rotation of the object (when using Axis-Angle rotations)");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
#endif
- prop= RNA_def_property(srna, "delta_scale", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "delta_scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "dscale");
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3);
RNA_def_property_float_array_default(prop, default_scale);
@@ -2077,33 +2077,33 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
/* transform locks */
- prop= RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_XYZ);
+ prop = RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location in the interface");
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_XYZ);
+ prop = RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface");
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
- // XXX this is sub-optimal - it really should be included above, but due to technical reasons we can't do this!
- prop= RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE);
+ /* XXX this is sub-optimal - it really should be included above, but due to technical reasons we can't do this! */
+ prop = RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTW);
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
RNA_def_property_ui_text(prop, "Lock Rotation (4D Angle)",
"Lock editing of 'angle' component of four-component rotations in the interface");
- // XXX this needs a better name
- prop= RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE);
+ /* XXX this needs a better name */
+ prop = RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROT4D);
RNA_def_property_ui_text(prop, "Lock Rotations (4D)",
"Lock editing of four component rotations by components (instead of as Eulers)");
- prop= RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_XYZ);
+ prop = RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_SCALEX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface");
@@ -2111,21 +2111,21 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
/* matrix */
- prop= RNA_def_property(srna, "matrix_world", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "matrix_world", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "obmat");
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Matrix World", "Worldspace transformation matrix");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_matrix_world_update");
- prop= RNA_def_property(srna, "matrix_local", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "matrix_local", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Local Matrix", "Parent relative transformation matrix");
RNA_def_property_float_funcs(prop, "rna_Object_matrix_local_get", "rna_Object_matrix_local_set", NULL);
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL);
- prop= RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Input Matrix",
@@ -2135,108 +2135,108 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
/*parent_inverse*/
- prop= RNA_def_property(srna, "matrix_parent_inverse", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "matrix_parent_inverse", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "parentinv");
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
RNA_def_property_ui_text(prop, "Matrix", "Inverse of object's parent matrix at time of parenting");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
/* modifiers */
- prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Modifier");
RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting the geometric data of the object");
rna_def_object_modifiers(brna, prop);
/* constraints */
- prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Constraint");
RNA_def_property_ui_text(prop, "Constraints", "Constraints affecting the transformation of the object");
-// RNA_def_property_collection_funcs(prop, 0, 0, 0, 0, 0, 0, 0, "constraints__add", "constraints__remove");
+/* RNA_def_property_collection_funcs(prop, 0, 0, 0, 0, 0, 0, 0, "constraints__add", "constraints__remove"); */
rna_def_object_constraints(brna, prop);
/* game engine */
- prop= RNA_def_property(srna, "game", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "game", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "GameObjectSettings");
RNA_def_property_pointer_funcs(prop, "rna_Object_game_settings_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Game Settings", "Game engine related settings for the object");
/* vertex groups */
- prop= RNA_def_property(srna, "vertex_groups", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_groups", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "defbase", NULL);
RNA_def_property_struct_type(prop, "VertexGroup");
RNA_def_property_ui_text(prop, "Vertex Groups", "Vertex groups of the object");
rna_def_object_vertex_groups(brna, prop);
/* empty */
- prop= RNA_def_property(srna, "empty_draw_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "empty_draw_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "empty_drawtype");
RNA_def_property_enum_items(prop, empty_drawtype_items);
RNA_def_property_ui_text(prop, "Empty Display Type", "Viewport display style for empties");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "empty_draw_size", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "empty_draw_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "empty_drawsize");
RNA_def_property_range(prop, 0.0001f, 1000.0f);
RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
RNA_def_property_ui_text(prop, "Empty Display Size", "Size of display for empties in the viewport");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "empty_image_offset", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "empty_image_offset", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "ima_ofs");
RNA_def_property_ui_text(prop, "Origin Offset", "Origin offset distance");
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 0.1f, 2);
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* render */
- prop= RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "index");
RNA_def_property_ui_text(prop, "Pass Index", "Index number for the IndexOB render pass");
RNA_def_property_update(prop, NC_OBJECT, NULL);
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "col");
RNA_def_property_ui_text(prop, "Color", "Object color and alpha, used when faces have the ObColor mode enabled");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* physics */
- prop= RNA_def_property(srna, "field", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "field", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pd");
RNA_def_property_struct_type(prop, "FieldSettings");
RNA_def_property_pointer_funcs(prop, "rna_Object_field_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Field Settings", "Settings for using the object as a field in physics simulation");
- prop= RNA_def_property(srna, "collision", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "collision", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pd");
RNA_def_property_struct_type(prop, "CollisionSettings");
RNA_def_property_pointer_funcs(prop, "rna_Object_collision_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Collision Settings", "Settings for using the object as a collider in physics simulation");
- prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "soft");
RNA_def_property_struct_type(prop, "SoftBodySettings");
RNA_def_property_ui_text(prop, "Soft Body Settings", "Settings for soft body simulation");
- prop= RNA_def_property(srna, "particle_systems", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "particle_systems", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "particlesystem", NULL);
RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object");
rna_def_object_particle_systems(brna, prop);
/* restrict */
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_VIEW);
RNA_def_property_ui_text(prop, "Restrict View", "Restrict visibility in the viewport");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1);
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_SELECT);
RNA_def_property_ui_text(prop, "Restrict Select", "Restrict selection in the viewport");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 1);
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_RENDER);
RNA_def_property_ui_text(prop, "Restrict Render", "Restrict renderability");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
@@ -2249,139 +2249,139 @@ static void rna_def_object(BlenderRNA *brna)
rna_def_motionpath_common(srna);
/* slow parenting */
- // XXX: evil old crap
- prop= RNA_def_property(srna, "use_slow_parent", PROP_BOOLEAN, PROP_NONE);
+ /* XXX: evil old crap */
+ prop = RNA_def_property(srna, "use_slow_parent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "partype", PARSLOW);
RNA_def_property_ui_text(prop, "Slow Parent", "Create a delay in the parent relationship (beware: this isn't renderfarm safe and may be invalid after jumping around the timeline)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "slow_parent_offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_TIME);
+ prop = RNA_def_property(srna, "slow_parent_offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_float_sdna(prop, NULL, "sf");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Slow Parent Offset", "Delay in the parent relationship");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
/* duplicates */
- prop= RNA_def_property(srna, "dupli_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "dupli_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "transflag");
RNA_def_property_enum_items(prop, dupli_items);
RNA_def_property_ui_text(prop, "Dupli Type", "If not None, object duplication method to use");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
- prop= RNA_def_property(srna, "use_dupli_frames_speed", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_dupli_frames_speed", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "transflag", OB_DUPLINOSPEED);
RNA_def_property_ui_text(prop, "Dupli Frames Speed", "Set dupliframes to use the current frame instead of parent curve's evaluation time");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "use_dupli_vertices_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_dupli_vertices_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIROT);
RNA_def_property_ui_text(prop, "Dupli Verts Rotation", "Rotate dupli according to vertex normal");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "use_dupli_faces_scale", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_dupli_faces_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIFACES_SCALE);
RNA_def_property_ui_text(prop, "Dupli Faces Inherit Scale", "Scale dupli based on face size");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "dupli_faces_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "dupli_faces_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dupfacesca");
RNA_def_property_range(prop, 0.001f, 10000.0f);
RNA_def_property_ui_text(prop, "Dupli Faces Scale", "Scale the DupliFace objects");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "dup_group");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_dup_group_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Dupli Group", "Instance an existing group");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
- prop= RNA_def_property(srna, "dupli_frames_start", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
+ prop = RNA_def_property(srna, "dupli_frames_start", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupsta");
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Dupli Frames Start", "Start frame for DupliFrames");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
+ prop = RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupend");
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Dupli Frames End", "End frame for DupliFrames");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
+ prop = RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupon");
RNA_def_property_range(prop, MINFRAME, MAXFRAME);
RNA_def_property_ui_range(prop, 1, 1500, 1, 0);
RNA_def_property_ui_text(prop, "Dupli Frames On", "Number of frames to use between DupOff frames");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
+ prop = RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupoff");
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_range(prop, 0, 1500, 1, 0);
RNA_def_property_ui_text(prop, "Dupli Frames Off", "Recurring frames to exclude from the Dupliframes");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
- prop= RNA_def_property(srna, "dupli_list", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "dupli_list", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "duplilist", NULL);
RNA_def_property_struct_type(prop, "DupliObject");
RNA_def_property_ui_text(prop, "Dupli list", "Object duplis");
- prop= RNA_def_property(srna, "is_duplicator", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_duplicator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLI);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* drawing */
- prop= RNA_def_property(srna, "draw_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "draw_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "dt");
RNA_def_property_enum_items(prop, drawtype_items);
RNA_def_property_ui_text(prop, "Maximum Draw Type", "Maximum draw type to display object with in viewport");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "show_bounds", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_bounds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_BOUNDBOX);
RNA_def_property_ui_text(prop, "Draw Bounds", "Display the object's bounds");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "draw_bounds_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "draw_bounds_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "boundtype");
RNA_def_property_enum_items(prop, boundtype_items);
RNA_def_property_ui_text(prop, "Draw Bounds Type", "Object boundary display type");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWNAME);
RNA_def_property_ui_text(prop, "Draw Name", "Display the object's name");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "show_axis", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_AXIS);
RNA_def_property_ui_text(prop, "Draw Axes", "Display the object's origin and axes");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "show_texture_space", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_texture_space", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_TEXSPACE);
RNA_def_property_ui_text(prop, "Draw Texture Space", "Display the object's texture space");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWWIRE);
RNA_def_property_ui_text(prop, "Draw Wire", "Add the object's wireframe over solid drawing");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "show_transparent", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_transparent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWTRANSP);
RNA_def_property_ui_text(prop, "Draw Transparent",
"Display material transparency in the object (unsupported for duplicator drawing)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWXRAY);
RNA_def_property_ui_text(prop, "X-Ray", "Make the object draw in front of others (unsupported for duplicator drawing)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* Grease Pencil */
- prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "gpd");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "GreasePencil");
@@ -2389,38 +2389,38 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* pose */
- prop= RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "poselib");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Action");
RNA_def_property_ui_text(prop, "Pose Library", "Action used as a pose library for armatures");
- prop= RNA_def_property(srna, "pose", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "pose", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pose");
RNA_def_property_struct_type(prop, "Pose");
RNA_def_property_ui_text(prop, "Pose", "Current pose for armatures");
/* shape keys */
- prop= RNA_def_property(srna, "show_only_shape_key", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_only_shape_key", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_LOCK);
RNA_def_property_ui_text(prop, "Shape Key Lock", "Always show the current Shape for this Object");
RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
RNA_def_property_update(prop, 0, "rna_Object_internal_update_data");
- prop= RNA_def_property(srna, "use_shape_key_edit_mode", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_shape_key_edit_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_EDIT_MODE);
RNA_def_property_ui_text(prop, "Shape Key Edit Mode", "Apply shape keys in edit mode (for Meshes only)");
RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0);
RNA_def_property_update(prop, 0, "rna_Object_internal_update_data");
- prop= RNA_def_property(srna, "active_shape_key", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active_shape_key", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ShapeKey");
RNA_def_property_pointer_funcs(prop, "rna_Object_active_shape_key_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Shape Key", "Current shape key");
- prop= RNA_def_property(srna, "active_shape_key_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "active_shape_key_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "shapenr");
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); // XXX this is really unpredictable...
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* XXX this is really unpredictable... */
RNA_def_property_int_funcs(prop, "rna_Object_active_shape_key_index_get", "rna_Object_active_shape_key_index_set", "rna_Object_active_shape_key_index_range");
RNA_def_property_ui_text(prop, "Active Shape Key Index", "Current shape key index");
RNA_def_property_update(prop, 0, "rna_Object_active_shape_update");
@@ -2433,29 +2433,29 @@ static void rna_def_dupli_object(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "DupliObject", NULL);
+ srna = RNA_def_struct(brna, "DupliObject", NULL);
RNA_def_struct_sdna(srna, "DupliObject");
RNA_def_struct_ui_text(srna, "Object Duplicate", "An object duplicate");
/* RNA_def_struct_ui_icon(srna, ICON_OBJECT_DATA); */
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob");
/* RNA_def_property_pointer_funcs(prop, "rna_DupliObject_object_get", NULL, NULL, NULL); */
RNA_def_property_ui_text(prop, "Object", "Object being duplicated");
- prop= RNA_def_property(srna, "matrix_original", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "matrix_original", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "omat");
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object Matrix", "The original matrix of this object before it was duplicated");
- prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "mat");
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object Duplicate Matrix", "Object duplicate transformation matrix");
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "no_draw", 0);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Hide", "Don't show dupli object in viewport or render");
@@ -2468,24 +2468,24 @@ static void rna_def_object_base(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ObjectBase", NULL);
+ srna = RNA_def_struct(brna, "ObjectBase", NULL);
RNA_def_struct_sdna(srna, "Base");
RNA_def_struct_ui_text(srna, "Object Base", "An object instance in a scene");
RNA_def_struct_ui_icon(srna, ICON_OBJECT_DATA);
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Object", "Object this base links to");
/* same as object layer */
- prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_ui_text(prop, "Layers", "Layers the object base is on");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Base_layer_set");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Base_layer_update");
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BA_SELECT);
RNA_def_property_ui_text(prop, "Select", "Object base selection state");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Base_select_update");
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 78c3c665797..f33cf1a3993 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -39,9 +39,9 @@
#include "DNA_object_types.h"
#include "DNA_modifier_types.h"
-// #include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */
+/* #include "BLO_sys_types.h" *//* needed for intptr_t used in ED_mesh.h */
-// #include "ED_mesh.h"
+/* #include "ED_mesh.h" */
#ifdef RNA_RUNTIME
@@ -92,20 +92,20 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
case OB_SURF:
/* copies object and modifiers (but not the data) */
- tmpobj= copy_object(ob);
+ tmpobj = copy_object(ob);
tmpcu = (Curve *)tmpobj->data;
tmpcu->id.us--;
/* if getting the original caged mesh, delete object modifiers */
- if( cage )
+ if ( cage )
object_free_modifiers(tmpobj);
/* copies the data */
copycu = tmpobj->data = copy_curve( (Curve *) ob->data );
/* temporarily set edit so we get updates from edit mode, but
- also because for text datablocks copying it while in edit
- mode gives invalid data structures */
+ * also because for text datablocks copying it while in edit
+ * mode gives invalid data structures */
copycu->editfont = tmpcu->editfont;
copycu->editnurb = tmpcu->editnurb;
@@ -133,12 +133,12 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
/* todo, re-generatre for render-res */
/* metaball_polygonize(scene, ob) */
- if(ob != basis_ob)
+ if (ob != basis_ob)
return NULL; /* only do basis metaball */
tmpmesh = add_mesh("Mesh");
- if(render) {
+ if (render) {
ListBase disp = {NULL, NULL};
makeDispListMBall_forRender(sce, ob, &disp);
mball_to_mesh(&disp, tmpmesh);
@@ -187,8 +187,8 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
tmpmesh->totcol = tmpcu->totcol;
/* free old material list (if it exists) and adjust user counts */
- if( tmpcu->mat ) {
- for( i = tmpcu->totcol; i-- > 0; ) {
+ if ( tmpcu->mat ) {
+ for ( i = tmpcu->totcol; i-- > 0; ) {
/* are we an object material or data based? */
tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : tmpcu->mat[i];
@@ -207,8 +207,8 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
tmpmesh->totcol = tmpmb->totcol;
/* free old material list (if it exists) and adjust user counts */
- if( tmpmb->mat ) {
- for( i = tmpmb->totcol; i-- > 0; ) {
+ if ( tmpmb->mat ) {
+ for ( i = tmpmb->totcol; i-- > 0; ) {
tmpmesh->mat[i] = tmpmb->mat[i]; /* CRASH HERE ??? */
if (tmpmesh->mat[i]) {
tmpmb->mat[i]->id.us++;
@@ -220,13 +220,13 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
case OB_MESH:
if (!cage) {
- Mesh *origmesh= ob->data;
- tmpmesh->flag= origmesh->flag;
+ Mesh *origmesh = ob->data;
+ tmpmesh->flag = origmesh->flag;
tmpmesh->mat = MEM_dupallocN(origmesh->mat);
tmpmesh->totcol = origmesh->totcol;
- tmpmesh->smoothresh= origmesh->smoothresh;
- if( origmesh->mat ) {
- for( i = origmesh->totcol; i-- > 0; ) {
+ tmpmesh->smoothresh = origmesh->smoothresh;
+ if ( origmesh->mat ) {
+ for ( i = origmesh->totcol; i-- > 0; ) {
/* are we an object material or data based? */
tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : origmesh->mat[i];
@@ -264,35 +264,35 @@ static void dupli_render_particle_set(Scene *scene, Object *ob, int level, int e
unit_m4(mat);
- if(level >= MAX_DUPLI_RECUR)
+ if (level >= MAX_DUPLI_RECUR)
return;
- if(ob->transflag & OB_DUPLIPARTS) {
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- if(ELEM(psys->part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
- if(enable)
+ if (ob->transflag & OB_DUPLIPARTS) {
+ for (psys = ob->particlesystem.first; psys; psys = psys->next) {
+ if (ELEM(psys->part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
+ if (enable)
psys_render_set(ob, psys, mat, mat, 1, 1, 0.f);
else
psys_render_restore(ob, psys);
}
}
- if(level == 0 && enable) {
+ if (level == 0 && enable) {
/* this is to make sure we get render level duplis in groups:
- * the derivedmesh must be created before init_render_mesh,
- * since object_duplilist does dupliparticles before that */
+ * the derivedmesh must be created before init_render_mesh,
+ * since object_duplilist does dupliparticles before that */
dm = mesh_create_derived_render(scene, ob, CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL);
dm->release(dm);
- for(psys=ob->particlesystem.first; psys; psys=psys->next)
+ for (psys = ob->particlesystem.first; psys; psys = psys->next)
psys_get_modifier(ob, psys)->flag &= ~eParticleSystemFlag_psys_updated;
}
}
- if(ob->dup_group==NULL) return;
- group= ob->dup_group;
+ if (ob->dup_group == NULL) return;
+ group = ob->dup_group;
- for(go= group->gobject.first; go; go= go->next)
+ for (go = group->gobject.first; go; go = go->next)
dupli_render_particle_set(scene, go->ob, level+1, enable);
}
/* When no longer needed, duplilist should be freed with Object.free_duplilist */
@@ -308,12 +308,12 @@ void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce)
BKE_reportf(reports, RPT_WARNING, "Object.dupli_list has not been freed");
free_object_duplilist(ob->duplilist);
- ob->duplilist= NULL;
+ ob->duplilist = NULL;
}
- if(G.rendering)
+ if (G.rendering)
dupli_render_particle_set(sce, ob, 0, 1);
- ob->duplilist= object_duplilist(sce, ob);
- if(G.rendering)
+ ob->duplilist = object_duplilist(sce, ob);
+ if (G.rendering)
dupli_render_particle_set(sce, ob, 0, 0);
/* ob->duplilist should now be freed with Object.free_duplilist */
}
@@ -322,16 +322,16 @@ void rna_Object_free_duplilist(Object *ob)
{
if (ob->duplilist) {
free_object_duplilist(ob->duplilist);
- ob->duplilist= NULL;
+ ob->duplilist = NULL;
}
}
static PointerRNA rna_Object_shape_key_add(Object *ob, bContext *C, ReportList *reports, const char *name, int from_mix)
{
- Scene *scene= CTX_data_scene(C);
- KeyBlock *kb= NULL;
+ Scene *scene = CTX_data_scene(C);
+ KeyBlock *kb = NULL;
- if((kb=object_insert_shape_key(scene, ob, name, from_mix))) {
+ if ((kb = object_insert_shape_key(scene, ob, name, from_mix))) {
PointerRNA keyptr;
RNA_pointer_create((ID *)ob->data, &RNA_ShapeKey, kb, &keyptr);
@@ -350,7 +350,7 @@ int rna_Object_is_visible(Object *ob, Scene *sce)
return !(ob->restrictflag & OB_RESTRICT_VIEW) && (ob->lay & sce->lay);
}
-/*
+#if 0
static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int *indices, int totindex, float weight, int assignmode)
{
if (ob->type != OB_MESH) {
@@ -370,13 +370,13 @@ static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int
return;
}
- // makes a set of dVerts corresponding to the mVerts
+ /* makes a set of dVerts corresponding to the mVerts */
if (!me->dvert)
create_dverts(&me->id);
- // loop list adding verts to group
- for (i= 0; i < totindex; i++) {
- if(i < 0 || i >= me->totvert) {
+ /* loop list adding verts to group */
+ for (i = 0; i < totindex; i++) {
+ if (i < 0 || i >= me->totvert) {
BKE_report(reports, RPT_ERROR, "Bad vertex index in list");
return;
}
@@ -384,13 +384,13 @@ static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int
add_vert_defnr(ob, group_index, i, weight, assignmode);
}
}
-*/
+#endif
void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], float ray_end[3], float r_location[3], float r_normal[3], int *index)
{
- BVHTreeFromMesh treeData= {NULL};
+ BVHTreeFromMesh treeData = {NULL};
- if(ob->derivedFinal==NULL) {
+ if (ob->derivedFinal == NULL) {
BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for ray casting", ob->id.name+2);
return;
}
@@ -398,7 +398,7 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl
/* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */
bvhtree_from_mesh_faces(&treeData, ob->derivedFinal, 0.0f, 4, 6);
- if(treeData.tree==NULL) {
+ if (treeData.tree == NULL) {
BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for ray casting", ob->id.name+2);
return;
}
@@ -407,14 +407,14 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl
float ray_nor[3], dist;
sub_v3_v3v3(ray_nor, ray_end, ray_start);
- dist= hit.dist = normalize_v3(ray_nor);
+ dist = hit.dist = normalize_v3(ray_nor);
hit.index = -1;
- if(BLI_bvhtree_ray_cast(treeData.tree, ray_start, ray_nor, 0.0f, &hit, treeData.raycast_callback, &treeData) != -1) {
- if(hit.dist<=dist) {
+ if (BLI_bvhtree_ray_cast(treeData.tree, ray_start, ray_nor, 0.0f, &hit, treeData.raycast_callback, &treeData) != -1) {
+ if (hit.dist <= dist) {
copy_v3_v3(r_location, hit.co);
copy_v3_v3(r_normal, hit.no);
- *index= hit.index;
+ *index = hit.index;
return;
}
}
@@ -422,14 +422,14 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl
zero_v3(r_location);
zero_v3(r_normal);
- *index= -1;
+ *index = -1;
}
void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float point_co[3], float max_dist, float n_location[3], float n_normal[3], int *index)
{
- BVHTreeFromMesh treeData= {NULL};
+ BVHTreeFromMesh treeData = {NULL};
- if(ob->derivedFinal==NULL) {
+ if (ob->derivedFinal == NULL) {
BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for finding nearest point", ob->id.name+2);
return;
}
@@ -437,7 +437,7 @@ void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float poi
/* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */
bvhtree_from_mesh_faces(&treeData, ob->derivedFinal, 0.0f, 4, 6);
- if(treeData.tree==NULL) {
+ if (treeData.tree == NULL) {
BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for finding nearest point", ob->id.name+2);
return;
}
@@ -447,24 +447,24 @@ void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float poi
nearest.index = -1;
nearest.dist = max_dist * max_dist;
- if(BLI_bvhtree_find_nearest(treeData.tree, point_co, &nearest, treeData.nearest_callback, &treeData) != -1) {
+ if (BLI_bvhtree_find_nearest(treeData.tree, point_co, &nearest, treeData.nearest_callback, &treeData) != -1) {
copy_v3_v3(n_location, nearest.co);
copy_v3_v3(n_normal, nearest.no);
- *index= nearest.index;
+ *index = nearest.index;
return;
}
}
zero_v3(n_location);
zero_v3(n_normal);
- *index= -1;
+ *index = -1;
}
/* ObjectBase */
void rna_ObjectBase_layers_from_view(Base *base, View3D *v3d)
{
- base->lay= base->object->lay= v3d->lay;
+ base->lay = base->object->lay = v3d->lay;
}
int rna_Object_is_modified(Object *ob, Scene *scene, int settings)
@@ -481,7 +481,7 @@ void rna_Object_dm_info(struct Object *ob, int type, char *result)
result[0] = '\0';
- switch(type) {
+ switch (type) {
case 0:
if (ob->type == OB_MESH) {
dm = CDDM_from_mesh(ob->data, ob);
@@ -533,118 +533,118 @@ void RNA_api_object(StructRNA *srna)
#endif
/* mesh */
- func= RNA_def_function(srna, "to_mesh", "rna_Object_to_mesh");
+ func = RNA_def_function(srna, "to_mesh", "rna_Object_to_mesh");
RNA_def_function_ui_description(func, "Create a Mesh datablock with modifiers applied");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate modifiers");
+ parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate modifiers");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers");
+ parm = RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
+ parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export");
+ parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export");
RNA_def_function_return(func, parm);
/* duplis */
- func= RNA_def_function(srna, "dupli_list_create", "rna_Object_create_duplilist");
+ func = RNA_def_function(srna, "dupli_list_create", "rna_Object_create_duplilist");
RNA_def_function_ui_description(func, "Create a list of dupli objects for this object, needs to "
"be freed manually with free_dupli_list to restore the "
"objects real matrix and layers");
- parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate duplis");
+ parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate duplis");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- func= RNA_def_function(srna, "dupli_list_clear", "rna_Object_free_duplilist");
+ func = RNA_def_function(srna, "dupli_list_clear", "rna_Object_free_duplilist");
RNA_def_function_ui_description(func, "Free the list of dupli objects");
/* Armature */
- func= RNA_def_function(srna, "find_armature", "modifiers_isDeformedByArmature");
+ func = RNA_def_function(srna, "find_armature", "modifiers_isDeformedByArmature");
RNA_def_function_ui_description(func, "Find armature influencing this object as a parent or via a modifier");
- parm= RNA_def_pointer(func, "ob_arm", "Object", "", "Armature object influencing this object or NULL");
+ parm = RNA_def_pointer(func, "ob_arm", "Object", "", "Armature object influencing this object or NULL");
RNA_def_function_return(func, parm);
/* Shape key */
- func= RNA_def_function(srna, "shape_key_add", "rna_Object_shape_key_add");
+ func = RNA_def_function(srna, "shape_key_add", "rna_Object_shape_key_add");
RNA_def_function_ui_description(func, "Add shape key to an object");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_string(func, "name", "Key", 0, "", "Unique name for the new keylock"); /* optional */
RNA_def_boolean(func, "from_mix", 1, "", "Create new shape from existing mix of shapes");
- parm= RNA_def_pointer(func, "key", "ShapeKey", "", "New shape keyblock");
+ parm = RNA_def_pointer(func, "key", "ShapeKey", "", "New shape keyblock");
RNA_def_property_flag(parm, PROP_RNAPTR);
RNA_def_function_return(func, parm);
/* Ray Cast */
- func= RNA_def_function(srna, "ray_cast", "rna_Object_ray_cast");
+ func = RNA_def_function(srna, "ray_cast", "rna_Object_ray_cast");
RNA_def_function_ui_description(func, "Cast a ray onto in object space");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* ray start and end */
- parm= RNA_def_float_vector(func, "start", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4);
+ parm = RNA_def_float_vector(func, "start", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_float_vector(func, "end", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4);
+ parm = RNA_def_float_vector(func, "end", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return location and normal */
- parm= RNA_def_float_vector(func, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "The hit location of this ray cast", -1e4, 1e4);
+ parm = RNA_def_float_vector(func, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "The hit location of this ray cast", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm);
- parm= RNA_def_float_vector(func, "normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "The face normal at the ray cast hit location", -1e4, 1e4);
+ parm = RNA_def_float_vector(func, "normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "The face normal at the ray cast hit location", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm);
- parm= RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no intersection is found", 0, 0);
+ parm = RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no intersection is found", 0, 0);
RNA_def_function_output(func, parm);
/* Nearest Point */
- func= RNA_def_function(srna, "closest_point_on_mesh", "rna_Object_closest_point_on_mesh");
+ func = RNA_def_function(srna, "closest_point_on_mesh", "rna_Object_closest_point_on_mesh");
RNA_def_function_ui_description(func, "Find the nearest point on the object");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* location of point for test and max distance */
- parm= RNA_def_float_vector(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4);
+ parm = RNA_def_float_vector(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_REQUIRED);
/* default is sqrt(FLT_MAX) */
RNA_def_float(func, "max_dist", 1.844674352395373e+19, 0.0, FLT_MAX, "", "", 0.0, FLT_MAX);
/* return location and normal */
- parm= RNA_def_float_vector(func, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "The location on the object closest to the point", -1e4, 1e4);
+ parm = RNA_def_float_vector(func, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "The location on the object closest to the point", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm);
- parm= RNA_def_float_vector(func, "normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "The face normal at the closest point", -1e4, 1e4);
+ parm = RNA_def_float_vector(func, "normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "The face normal at the closest point", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm);
- parm= RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no closest point is found", 0, 0);
+ parm = RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no closest point is found", 0, 0);
RNA_def_function_output(func, parm);
/* View */
- func= RNA_def_function(srna, "is_visible", "rna_Object_is_visible");
+ func = RNA_def_function(srna, "is_visible", "rna_Object_is_visible");
RNA_def_function_ui_description(func, "Determine if object is visible in a given scene");
- parm= RNA_def_pointer(func, "scene", "Scene", "", "");
+ parm = RNA_def_pointer(func, "scene", "Scene", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_boolean(func, "result", 0, "", "Object visibility");
+ parm = RNA_def_boolean(func, "result", 0, "", "Object visibility");
RNA_def_function_return(func, parm);
/* utility function for checking if the object is modified */
- func= RNA_def_function(srna, "is_modified", "rna_Object_is_modified");
+ func = RNA_def_function(srna, "is_modified", "rna_Object_is_modified");
RNA_def_function_ui_description(func, "Determine if this object is modified from the base mesh data");
- parm= RNA_def_pointer(func, "scene", "Scene", "", "");
+ parm = RNA_def_pointer(func, "scene", "Scene", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
+ parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_boolean(func, "result", 0, "", "Object visibility");
+ parm = RNA_def_boolean(func, "result", 0, "", "Object visibility");
RNA_def_function_return(func, parm);
#ifndef NDEBUG
/* mesh */
- func= RNA_def_function(srna, "dm_info", "rna_Object_dm_info");
+ func = RNA_def_function(srna, "dm_info", "rna_Object_dm_info");
RNA_def_function_ui_description(func, "Returns a string for derived mesh data");
- parm= RNA_def_enum(func, "type", mesh_dm_info_items, 0, "", "Modifier settings to apply");
+ parm = RNA_def_enum(func, "type", mesh_dm_info_items, 0, "", "Modifier settings to apply");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* weak!, no way to return dynamic string type */
- parm= RNA_def_string(func, "result", "", 16384, "result", "");
+ parm = RNA_def_string(func, "result", "", 16384, "result", "");
RNA_def_property_flag(parm, PROP_THICK_WRAP); /* needed for string return value */
RNA_def_function_output(func, parm);
#endif /* NDEBUG */
@@ -656,9 +656,9 @@ void RNA_api_object_base(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "layers_from_view", "rna_ObjectBase_layers_from_view");
+ func = RNA_def_function(srna, "layers_from_view", "rna_ObjectBase_layers_from_view");
RNA_def_function_ui_description(func, "Sets the object layers from a 3D View (use when adding an object in local view)");
- parm= RNA_def_pointer(func, "view", "SpaceView3D", "", "");
+ parm = RNA_def_pointer(func, "view", "SpaceView3D", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 2997acd2267..287303d4efe 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -105,7 +105,7 @@ static void rna_Cache_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
PTCacheID *pid = NULL;
ListBase pidlist;
- if(!ob)
+ if (!ob)
return;
cache->flag |= PTCACHE_OUTDATED;
@@ -114,14 +114,14 @@ static void rna_Cache_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->cache==cache)
+ for (pid = pidlist.first; pid; pid = pid->next) {
+ if (pid->cache == cache)
break;
}
- if(pid) {
+ if (pid) {
/* Just make sure this wasn't changed. */
- if(pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
+ if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
cache->step = 1;
BKE_ptcache_update_info(pid);
}
@@ -136,18 +136,18 @@ static void rna_Cache_toggle_disk_cache(Main *UNUSED(bmain), Scene *UNUSED(scene
PTCacheID *pid = NULL;
ListBase pidlist;
- if(!ob)
+ if (!ob)
return;
BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->cache==cache)
+ for (pid = pidlist.first; pid; pid = pid->next) {
+ if (pid->cache == cache)
break;
}
/* smoke can only use disk cache */
- if(pid && pid->type != PTCACHE_TYPE_SMOKE_DOMAIN)
+ if (pid && pid->type != PTCACHE_TYPE_SMOKE_DOMAIN)
BKE_ptcache_toggle_disk_cache(pid);
else
cache->flag ^= PTCACHE_DISK_CACHE;
@@ -159,24 +159,24 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P
{
Object *ob = (Object*)ptr->id.data;
PointCache *cache = (PointCache*)ptr->data;
- PTCacheID *pid = NULL, *pid2= NULL;
+ PTCacheID *pid = NULL, *pid2 = NULL;
ListBase pidlist;
int new_name = 1;
- if(!ob)
+ if (!ob)
return;
/* TODO: check for proper characters */
BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
- if(cache->flag & PTCACHE_EXTERNAL) {
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->cache==cache)
+ if (cache->flag & PTCACHE_EXTERNAL) {
+ for (pid = pidlist.first; pid; pid = pid->next) {
+ if (pid->cache == cache)
break;
}
- if(!pid)
+ if (!pid)
return;
BKE_ptcache_load_external(pid);
@@ -184,18 +184,18 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
else {
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->cache==cache)
+ for (pid = pidlist.first; pid; pid = pid->next) {
+ if (pid->cache == cache)
pid2 = pid;
- else if(cache->name[0] != '\0' && strcmp(cache->name,pid->cache->name)==0) {
+ else if (cache->name[0] != '\0' && strcmp(cache->name,pid->cache->name) == 0) {
/*TODO: report "name exists" to user */
BLI_strncpy(cache->name, cache->prev_name, sizeof(cache->name));
new_name = 0;
}
}
- if(new_name) {
- if(pid2 && cache->flag & PTCACHE_DISK_CACHE) {
+ if (new_name) {
+ if (pid2 && cache->flag & PTCACHE_DISK_CACHE) {
char old_name[80];
char new_name[80];
@@ -214,33 +214,33 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P
static void rna_Cache_list_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- PointCache *cache= ptr->data;
+ PointCache *cache = ptr->data;
ListBase lb;
- while(cache->prev)
- cache= cache->prev;
+ while (cache->prev)
+ cache = cache->prev;
- lb.first= cache;
- lb.last= NULL; /* not used by listbase_begin */
+ lb.first = cache;
+ lb.last = NULL; /* not used by listbase_begin */
rna_iterator_listbase_begin(iter, &lb, NULL);
}
static void rna_Cache_active_point_cache_index_range(PointerRNA *ptr, int *min, int *max)
{
Object *ob = ptr->id.data;
- PointCache *cache= ptr->data;
+ PointCache *cache = ptr->data;
PTCacheID *pid;
ListBase pidlist;
BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
- *min= 0;
- *max= 0;
+ *min = 0;
+ *max = 0;
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->cache == cache) {
- *max= BLI_countlist(pid->ptcaches)-1;
- *max= MAX2(0, *max);
+ for (pid = pidlist.first; pid; pid = pid->next) {
+ if (pid->cache == cache) {
+ *max = BLI_countlist(pid->ptcaches)-1;
+ *max = MAX2(0, *max);
break;
}
}
@@ -251,15 +251,15 @@ static void rna_Cache_active_point_cache_index_range(PointerRNA *ptr, int *min,
static int rna_Cache_active_point_cache_index_get(PointerRNA *ptr)
{
Object *ob = ptr->id.data;
- PointCache *cache= ptr->data;
+ PointCache *cache = ptr->data;
PTCacheID *pid;
ListBase pidlist;
int num = 0;
BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->cache == cache) {
+ for (pid = pidlist.first; pid; pid = pid->next) {
+ if (pid->cache == cache) {
num = BLI_findindex(pid->ptcaches, cache);
break;
}
@@ -273,14 +273,14 @@ static int rna_Cache_active_point_cache_index_get(PointerRNA *ptr)
static void rna_Cache_active_point_cache_index_set(struct PointerRNA *ptr, int value)
{
Object *ob = ptr->id.data;
- PointCache *cache= ptr->data;
+ PointCache *cache = ptr->data;
PTCacheID *pid;
ListBase pidlist;
BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->cache == cache) {
+ for (pid = pidlist.first; pid; pid = pid->next) {
+ if (pid->cache == cache) {
*(pid->cache_ptr) = BLI_findlink(pid->ptcaches, value);
break;
}
@@ -292,18 +292,18 @@ static void rna_Cache_active_point_cache_index_set(struct PointerRNA *ptr, int v
static void rna_PointCache_frame_step_range(PointerRNA *ptr, int *min, int *max)
{
Object *ob = ptr->id.data;
- PointCache *cache= ptr->data;
+ PointCache *cache = ptr->data;
PTCacheID *pid;
ListBase pidlist;
- *min= 1;
- *max= 20;
+ *min = 1;
+ *max = 20;
BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->cache == cache) {
- *max= pid->max_step;
+ for (pid = pidlist.first; pid; pid = pid->next) {
+ if (pid->cache == cache) {
+ *max = pid->max_step;
break;
}
}
@@ -315,10 +315,10 @@ static char *rna_CollisionSettings_path(PointerRNA *UNUSED(ptr))
{
/* both methods work ok, but return the shorter path */
#if 0
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
ModifierData *md = (ModifierData *)modifiers_findByType(ob, eModifierType_Collision);
- if(md) {
+ if (md) {
return BLI_sprintfN("modifiers[\"%s\"].settings", md->name);
}
else {
@@ -332,59 +332,59 @@ static char *rna_CollisionSettings_path(PointerRNA *UNUSED(ptr))
static int rna_SoftBodySettings_use_edges_get(PointerRNA *ptr)
{
- Object *data= (Object*)(ptr->id.data);
+ Object *data = (Object*)(ptr->id.data);
return (((data->softflag) & OB_SB_EDGES) != 0);
}
static void rna_SoftBodySettings_use_edges_set(PointerRNA *ptr, int value)
{
- Object *data= (Object*)(ptr->id.data);
- if(value) data->softflag |= OB_SB_EDGES;
+ Object *data = (Object*)(ptr->id.data);
+ if (value) data->softflag |= OB_SB_EDGES;
else data->softflag &= ~OB_SB_EDGES;
}
static int rna_SoftBodySettings_use_goal_get(PointerRNA *ptr)
{
- Object *data= (Object*)(ptr->id.data);
+ Object *data = (Object*)(ptr->id.data);
return (((data->softflag) & OB_SB_GOAL) != 0);
}
static void rna_SoftBodySettings_use_goal_set(PointerRNA *ptr, int value)
{
- Object *data= (Object*)(ptr->id.data);
- if(value) data->softflag |= OB_SB_GOAL;
+ Object *data = (Object*)(ptr->id.data);
+ if (value) data->softflag |= OB_SB_GOAL;
else data->softflag &= ~OB_SB_GOAL;
}
static int rna_SoftBodySettings_stiff_quads_get(PointerRNA *ptr)
{
- Object *data= (Object*)(ptr->id.data);
+ Object *data = (Object*)(ptr->id.data);
return (((data->softflag) & OB_SB_QUADS) != 0);
}
static void rna_SoftBodySettings_stiff_quads_set(PointerRNA *ptr, int value)
{
- Object *data= (Object*)(ptr->id.data);
- if(value) data->softflag |= OB_SB_QUADS;
+ Object *data = (Object*)(ptr->id.data);
+ if (value) data->softflag |= OB_SB_QUADS;
else data->softflag &= ~OB_SB_QUADS;
}
static int rna_SoftBodySettings_self_collision_get(PointerRNA *ptr)
{
- Object *data= (Object*)(ptr->id.data);
+ Object *data = (Object*)(ptr->id.data);
return (((data->softflag) & OB_SB_SELF) != 0);
}
static void rna_SoftBodySettings_self_collision_set(PointerRNA *ptr, int value)
{
- Object *data= (Object*)(ptr->id.data);
- if(value) data->softflag |= OB_SB_SELF;
+ Object *data = (Object*)(ptr->id.data);
+ if (value) data->softflag |= OB_SB_SELF;
else data->softflag &= ~OB_SB_SELF;
}
static int rna_SoftBodySettings_new_aero_get(PointerRNA *ptr)
{
- Object *data= (Object*)(ptr->id.data);
+ Object *data = (Object*)(ptr->id.data);
if (data->softflag & OB_SB_AERO_ANGLE)
return 1;
else
@@ -393,7 +393,7 @@ static int rna_SoftBodySettings_new_aero_get(PointerRNA *ptr)
static void rna_SoftBodySettings_new_aero_set(PointerRNA *ptr, int value)
{
- Object *data= (Object*)(ptr->id.data);
+ Object *data = (Object*)(ptr->id.data);
if (value == 1)
data->softflag |= OB_SB_AERO_ANGLE;
else /* value == 0 */
@@ -402,64 +402,64 @@ static void rna_SoftBodySettings_new_aero_set(PointerRNA *ptr, int value)
static int rna_SoftBodySettings_face_collision_get(PointerRNA *ptr)
{
- Object *data= (Object*)(ptr->id.data);
+ Object *data = (Object*)(ptr->id.data);
return (((data->softflag) & OB_SB_FACECOLL) != 0);
}
static void rna_SoftBodySettings_face_collision_set(PointerRNA *ptr, int value)
{
- Object *data= (Object*)(ptr->id.data);
- if(value) data->softflag |= OB_SB_FACECOLL;
+ Object *data = (Object*)(ptr->id.data);
+ if (value) data->softflag |= OB_SB_FACECOLL;
else data->softflag &= ~OB_SB_FACECOLL;
}
static int rna_SoftBodySettings_edge_collision_get(PointerRNA *ptr)
{
- Object *data= (Object*)(ptr->id.data);
+ Object *data = (Object*)(ptr->id.data);
return (((data->softflag) & OB_SB_EDGECOLL) != 0);
}
static void rna_SoftBodySettings_edge_collision_set(PointerRNA *ptr, int value)
{
- Object *data= (Object*)(ptr->id.data);
- if(value) data->softflag |= OB_SB_EDGECOLL;
+ Object *data = (Object*)(ptr->id.data);
+ if (value) data->softflag |= OB_SB_EDGECOLL;
else data->softflag &= ~OB_SB_EDGECOLL;
}
static void rna_SoftBodySettings_goal_vgroup_get(PointerRNA *ptr, char *value)
{
- SoftBody *sb= (SoftBody*)ptr->data;
+ SoftBody *sb = (SoftBody*)ptr->data;
rna_object_vgroup_name_index_get(ptr, value, sb->vertgroup);
}
static int rna_SoftBodySettings_goal_vgroup_length(PointerRNA *ptr)
{
- SoftBody *sb= (SoftBody*)ptr->data;
+ SoftBody *sb = (SoftBody*)ptr->data;
return rna_object_vgroup_name_index_length(ptr, sb->vertgroup);
}
static void rna_SoftBodySettings_goal_vgroup_set(PointerRNA *ptr, const char *value)
{
- SoftBody *sb= (SoftBody*)ptr->data;
+ SoftBody *sb = (SoftBody*)ptr->data;
rna_object_vgroup_name_index_set(ptr, value, &sb->vertgroup);
}
static void rna_SoftBodySettings_mass_vgroup_set(PointerRNA *ptr, const char *value)
{
- SoftBody *sb= (SoftBody*)ptr->data;
+ SoftBody *sb = (SoftBody*)ptr->data;
rna_object_vgroup_name_set(ptr, value, sb->namedVG_Mass, sizeof(sb->namedVG_Mass));
}
static void rna_SoftBodySettings_spring_vgroup_set(PointerRNA *ptr, const char *value)
{
- SoftBody *sb= (SoftBody*)ptr->data;
+ SoftBody *sb = (SoftBody*)ptr->data;
rna_object_vgroup_name_set(ptr, value, sb->namedVG_Spring_K, sizeof(sb->namedVG_Spring_K));
}
static char *rna_SoftBodySettings_path(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
ModifierData *md = (ModifierData *)modifiers_findByType(ob, eModifierType_Softbody);
return BLI_sprintfN("modifiers[\"%s\"].settings", md->name);
@@ -467,24 +467,24 @@ static char *rna_SoftBodySettings_path(PointerRNA *ptr)
static int particle_id_check(PointerRNA *ptr)
{
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
return (GS(id->name) == ID_PA);
}
static void rna_FieldSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- if(particle_id_check(ptr)) {
+ if (particle_id_check(ptr)) {
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
- if(part->pd->forcefield != PFIELD_TEXTURE && part->pd->tex) {
+ if (part->pd->forcefield != PFIELD_TEXTURE && part->pd->tex) {
part->pd->tex->id.us--;
- part->pd->tex= NULL;
+ part->pd->tex = NULL;
}
- if(part->pd2->forcefield != PFIELD_TEXTURE && part->pd2->tex) {
+ if (part->pd2->forcefield != PFIELD_TEXTURE && part->pd2->tex) {
part->pd2->tex->id.us--;
- part->pd2->tex= NULL;
+ part->pd2->tex = NULL;
}
DAG_id_tag_update(&part->id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME|PSYS_RECALC_RESET);
@@ -494,9 +494,9 @@ static void rna_FieldSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene),
else {
Object *ob = (Object*)ptr->id.data;
- if(ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex) {
+ if (ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex) {
ob->pd->tex->id.us--;
- ob->pd->tex= NULL;
+ ob->pd->tex = NULL;
}
DAG_id_tag_update(&ob->id, OB_RECALC_OB);
@@ -506,19 +506,19 @@ static void rna_FieldSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene),
static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- if(!particle_id_check(ptr)) {
- Object *ob= (Object*)ptr->id.data;
- PartDeflect *pd= ob->pd;
- ModifierData *md= modifiers_findByType(ob, eModifierType_Surface);
+ if (!particle_id_check(ptr)) {
+ Object *ob = (Object*)ptr->id.data;
+ PartDeflect *pd = ob->pd;
+ ModifierData *md = modifiers_findByType(ob, eModifierType_Surface);
/* add/remove modifier as needed */
- if(!md) {
- if(pd && (pd->shape == PFIELD_SHAPE_SURFACE) && ELEM(pd->forcefield,PFIELD_GUIDE,PFIELD_TEXTURE)==0)
- if(ELEM4(ob->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVE))
+ if (!md) {
+ if (pd && (pd->shape == PFIELD_SHAPE_SURFACE) && ELEM(pd->forcefield,PFIELD_GUIDE,PFIELD_TEXTURE) == 0)
+ if (ELEM4(ob->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVE))
ED_object_modifier_add(NULL, bmain, scene, ob, NULL, eModifierType_Surface);
}
else {
- if(!pd || pd->shape != PFIELD_SHAPE_SURFACE)
+ if (!pd || pd->shape != PFIELD_SHAPE_SURFACE)
ED_object_modifier_remove(NULL, bmain, scene, ob, md);
}
@@ -528,24 +528,26 @@ static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA
static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- if(particle_id_check(ptr)) {
+ if (particle_id_check(ptr)) {
DAG_id_tag_update((ID*)ptr->id.data, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME|PSYS_RECALC_RESET);
}
else {
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
/* do this before scene sort, that one checks for CU_PATH */
- /* XXX if(ob->type==OB_CURVE && ob->pd->forcefield==PFIELD_GUIDE) {
- Curve *cu= ob->data;
+#if 0 /* XXX */
+ if (ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE) {
+ Curve *cu = ob->data;
cu->flag |= (CU_PATH|CU_3D);
- do_curvebuts(B_CU3D); // all curves too
- }*/
+ do_curvebuts(B_CU3D); /* all curves too */
+ }
+#endif
rna_FieldSettings_shape_update(bmain, scene, ptr);
DAG_scene_sort(bmain, scene);
- if(ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE)
+ if (ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE)
DAG_id_tag_update(&ob->id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME);
else
DAG_id_tag_update(&ob->id, OB_RECALC_OB);
@@ -560,7 +562,7 @@ static char *rna_FieldSettings_path(PointerRNA *ptr)
/* Check through all possible places the settings can be to find the right one */
- if(particle_id_check(ptr)) {
+ if (particle_id_check(ptr)) {
/* particle system force field */
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
@@ -570,7 +572,7 @@ static char *rna_FieldSettings_path(PointerRNA *ptr)
return BLI_sprintfN("force_field_2");
} else {
/* object force field */
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
if (ob->pd == pd)
return BLI_sprintfN("field");
@@ -599,14 +601,14 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr)
EffectorWeights *ew = (EffectorWeights *)ptr->data;
/* Check through all possible places the settings can be to find the right one */
- if(particle_id_check(ptr)) {
+ if (particle_id_check(ptr)) {
/* particle effector weights */
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
if (part->effector_weights == ew)
return BLI_sprintfN("effector_weights");
} else {
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
ModifierData *md;
/* check softbody modifier */
@@ -643,7 +645,7 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr)
if (pmd->canvas) {
DynamicPaintSurface *surface = pmd->canvas->surfaces.first;
- for(; surface; surface=surface->next) {
+ for (; surface; surface = surface->next) {
if (surface->effector_weights == ew)
return BLI_sprintfN("modifiers[\"%s\"].canvas_settings.canvas_surfaces[\"%s\"].effector_weights",
md->name, surface->name);
@@ -656,13 +658,13 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr)
static void rna_CollisionSettings_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- ModifierData *md= modifiers_findByType(ob, eModifierType_Collision);
+ Object *ob = (Object*)ptr->id.data;
+ ModifierData *md = modifiers_findByType(ob, eModifierType_Collision);
/* add/remove modifier as needed */
- if(ob->pd->deflect && !md)
+ if (ob->pd->deflect && !md)
ED_object_modifier_add(NULL, bmain, scene, ob, NULL, eModifierType_Collision);
- else if(!ob->pd->deflect && md)
+ else if (!ob->pd->deflect && md)
ED_object_modifier_remove(NULL, bmain, scene, ob, md);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
@@ -670,7 +672,7 @@ static void rna_CollisionSettings_dependency_update(Main *bmain, Scene *scene, P
static void rna_CollisionSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
DAG_id_tag_update(&ob->id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
@@ -678,7 +680,7 @@ static void rna_CollisionSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scen
static void rna_softbody_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ Object *ob = (Object*)ptr->id.data;
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
@@ -688,27 +690,27 @@ static void rna_softbody_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Point
static EnumPropertyItem *rna_Effector_shape_itemf(bContext *UNUSED(C), PointerRNA *ptr,
PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
- Object *ob= NULL;
+ Object *ob = NULL;
- if(particle_id_check(ptr))
+ if (particle_id_check(ptr))
return empty_shape_items;
- ob= (Object*)ptr->id.data;
+ ob = (Object*)ptr->id.data;
- if(ob->type == OB_CURVE) {
- if(ob->pd->forcefield == PFIELD_VORTEX)
+ if (ob->type == OB_CURVE) {
+ if (ob->pd->forcefield == PFIELD_VORTEX)
return curve_vortex_shape_items;
return curve_shape_items;
}
- else if(ELEM3(ob->type, OB_MESH, OB_SURF, OB_FONT)) {
- if(ob->pd->forcefield == PFIELD_VORTEX)
+ else if (ELEM3(ob->type, OB_MESH, OB_SURF, OB_FONT)) {
+ if (ob->pd->forcefield == PFIELD_VORTEX)
return vortex_shape_items;
return effector_shape_items;
}
else {
- if(ob->pd->forcefield == PFIELD_VORTEX)
+ if (ob->pd->forcefield == PFIELD_VORTEX)
return empty_vortex_shape_items;
return empty_shape_items;
@@ -723,15 +725,15 @@ static void rna_def_ptcache_point_caches(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna;
PropertyRNA *prop;
- // FunctionRNA *func;
- // PropertyRNA *parm;
+ /* FunctionRNA *func; */
+ /* PropertyRNA *parm; */
RNA_def_property_srna(cprop, "PointCaches");
- srna= RNA_def_struct(brna, "PointCaches", NULL);
+ srna = RNA_def_struct(brna, "PointCaches", NULL);
RNA_def_struct_sdna(srna, "PointCache");
RNA_def_struct_ui_text(srna, "Point Caches", "Collection of point caches");
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", "rna_Cache_active_point_cache_index_set",
"rna_Cache_active_point_cache_index_range");
RNA_def_property_ui_text(prop, "Active Point Cache Index", "");
@@ -749,92 +751,92 @@ static void rna_def_pointcache(BlenderRNA *brna)
{PTCACHE_COMPRESS_LZMA, "HEAVY", 0, "Heavy", "Effective but slow compression"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "PointCache", NULL);
+ srna = RNA_def_struct(brna, "PointCache", NULL);
RNA_def_struct_ui_text(srna, "Point Cache", "Point cache for physics simulations");
RNA_def_struct_ui_icon(srna, ICON_PHYSICS);
- prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "startframe");
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_ui_text(prop, "Start", "Frame on which the simulation starts");
- prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "endframe");
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_ui_text(prop, "End", "Frame on which the simulation stops");
- prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "step");
RNA_def_property_range(prop, 1, 20);
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_PointCache_frame_step_range");
RNA_def_property_ui_text(prop, "Cache Step", "Number of frames between cached frames");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change");
- prop= RNA_def_property(srna, "index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "index");
RNA_def_property_range(prop, -1, 100);
RNA_def_property_ui_text(prop, "Cache Index", "Index number of cache files");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
- prop= RNA_def_property(srna, "compression", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "compression", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, point_cache_compress_items);
RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
/* flags */
- prop= RNA_def_property(srna, "is_baked", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_baked", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_BAKED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "is_baking", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_baking", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_BAKING);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_disk_cache", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_disk_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_DISK_CACHE);
RNA_def_property_ui_text(prop, "Disk Cache", "Save cache files to disk (.blend file must be saved first)");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_toggle_disk_cache");
- prop= RNA_def_property(srna, "is_outdated", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_outdated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_OUTDATED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Cache is outdated", "");
- prop= RNA_def_property(srna, "frames_skipped", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "frames_skipped", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_FRAMES_SKIPPED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Name", "Cache name");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "path");
RNA_def_property_ui_text(prop, "File Path", "Cache file path");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
- prop= RNA_def_property(srna, "use_quick_cache", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_quick_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_QUICK_CACHE);
RNA_def_property_ui_text(prop, "Quick Cache", "Update simulation with cache steps");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change");
- prop= RNA_def_property(srna, "info", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "info", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "info");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Cache Info", "Info on current cache status");
- prop= RNA_def_property(srna, "use_external", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_external", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_EXTERNAL);
RNA_def_property_ui_text(prop, "External", "Read cache from an external location");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
- prop= RNA_def_property(srna, "use_library_path", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_library_path", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PTCACHE_IGNORE_LIBPATH);
RNA_def_property_ui_text(prop, "Library Path", "Use this files path when library linked into another file");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
- prop= RNA_def_property(srna, "point_caches", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "point_caches", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next",
"rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "PointCache");
@@ -847,54 +849,54 @@ static void rna_def_collision(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "CollisionSettings", NULL);
+ srna = RNA_def_struct(brna, "CollisionSettings", NULL);
RNA_def_struct_sdna(srna, "PartDeflect");
RNA_def_struct_path_func(srna, "rna_CollisionSettings_path");
RNA_def_struct_ui_text(srna, "Collision Settings", "Collision settings for object in physics simulation");
- prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "deflect", 1);
RNA_def_property_ui_text(prop, "Enabled", "Enable this objects as a collider for physics systems");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_dependency_update");
/* Particle Interaction */
- prop= RNA_def_property(srna, "damping_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "damping_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pdef_damp");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Damping Factor", "Amount of damping during particle collision");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
- prop= RNA_def_property(srna, "damping_random", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "damping_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pdef_rdamp");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Damping", "Random variation of damping");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
- prop= RNA_def_property(srna, "friction_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "friction_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pdef_frict");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Friction Factor", "Amount of friction during particle collision");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
- prop= RNA_def_property(srna, "friction_random", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "friction_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pdef_rfrict");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Friction", "Random variation of friction");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
- prop= RNA_def_property(srna, "permeability", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "permeability", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pdef_perm");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Permeability", "Chance that the particle will pass through the mesh");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
- prop= RNA_def_property(srna, "use_particle_kill", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_particle_kill", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PDEFLE_KILL_PART);
RNA_def_property_ui_text(prop, "Kill Particles", "Kill collided particles");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
- prop= RNA_def_property(srna, "stickness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "stickness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pdef_stickness");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Stickness", "Amount of stickness to surface collision");
@@ -902,25 +904,25 @@ static void rna_def_collision(BlenderRNA *brna)
/* Soft Body and Cloth Interaction */
- prop= RNA_def_property(srna, "thickness_inner", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "thickness_inner", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pdef_sbift");
RNA_def_property_range(prop, 0.001f, 1.0f);
RNA_def_property_ui_text(prop, "Inner Thickness", "Inner face thickness");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
- prop= RNA_def_property(srna, "thickness_outer", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "thickness_outer", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pdef_sboft");
RNA_def_property_range(prop, 0.001f, 1.0f);
RNA_def_property_ui_text(prop, "Outer Thickness", "Outer face thickness");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
- prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pdef_sbdamp");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Damping", "Amount of damping during collision");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
- prop= RNA_def_property(srna, "absorption", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "absorption", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
RNA_def_property_ui_text(prop, "Absorption",
@@ -933,25 +935,25 @@ static void rna_def_effector_weight(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "EffectorWeights", NULL);
+ srna = RNA_def_struct(brna, "EffectorWeights", NULL);
RNA_def_struct_sdna(srna, "EffectorWeights");
RNA_def_struct_path_func(srna, "rna_EffectorWeight_path");
RNA_def_struct_ui_text(srna, "Effector Weights", "Effector weights for physics simulation");
RNA_def_struct_ui_icon(srna, ICON_PHYSICS);
/* Flags */
- prop= RNA_def_property(srna, "apply_to_hair_growing", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "apply_to_hair_growing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", EFF_WEIGHT_DO_HAIR);
RNA_def_property_ui_text(prop, "Use For Growing Hair", "Use force fields when growing hair");
RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
/* General */
- prop= RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this Group");
RNA_def_property_update(prop, 0, "rna_EffectorWeight_dependency_update");
- prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "global_gravity");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
@@ -959,91 +961,91 @@ static void rna_def_effector_weight(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
/* Effector weights */
- prop= RNA_def_property(srna, "all", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "all", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight[0]");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "All", "All effector's weight");
RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
- prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "force", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight[1]");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Force", "Force effector weight");
RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
- prop= RNA_def_property(srna, "vortex", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "vortex", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight[2]");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Vortex", "Vortex effector weight");
RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
- prop= RNA_def_property(srna, "magnetic", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "magnetic", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight[3]");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Magnetic", "Magnetic effector weight");
RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
- prop= RNA_def_property(srna, "wind", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "wind", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight[4]");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Wind", "Wind effector weight");
RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
- prop= RNA_def_property(srna, "curve_guide", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "curve_guide", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight[5]");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Curve Guide", "Curve guide effector weight");
RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
- prop= RNA_def_property(srna, "texture", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "texture", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight[6]");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Texture", "Texture effector weight");
RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
- prop= RNA_def_property(srna, "harmonic", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "harmonic", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight[7]");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Harmonic", "Harmonic effector weight");
RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
- prop= RNA_def_property(srna, "charge", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "charge", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight[8]");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Charge", "Charge effector weight");
RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
- prop= RNA_def_property(srna, "lennardjones", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "lennardjones", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight[9]");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Lennard-Jones", "Lennard-Jones effector weight");
RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
- prop= RNA_def_property(srna, "boid", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "boid", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight[10]");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Boid", "Boid effector weight");
RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
- prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight[11]");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Turbulence", "Turbulence effector weight");
RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
- prop= RNA_def_property(srna, "drag", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "drag", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "weight[12]");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
@@ -1109,7 +1111,7 @@ static void rna_def_field(BlenderRNA *brna)
{2, "Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "FieldSettings", NULL);
+ srna = RNA_def_struct(brna, "FieldSettings", NULL);
RNA_def_struct_sdna(srna, "PartDeflect");
RNA_def_struct_path_func(srna, "rna_FieldSettings_path");
RNA_def_struct_ui_text(srna, "Field Settings", "Field settings for an object in physics simulation");
@@ -1117,25 +1119,25 @@ static void rna_def_field(BlenderRNA *brna)
/* Enums */
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "forcefield");
RNA_def_property_enum_items(prop, field_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of field");
RNA_def_property_update(prop, 0, "rna_FieldSettings_dependency_update");
- prop= RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, effector_shape_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Effector_shape_itemf");
RNA_def_property_ui_text(prop, "Shape", "Which direction is used to calculate the effector force");
RNA_def_property_update(prop, 0, "rna_FieldSettings_shape_update");
- prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "falloff");
RNA_def_property_enum_items(prop, falloff_items);
RNA_def_property_ui_text(prop, "Fall-Off", "");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "texture_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "tex_mode");
RNA_def_property_enum_items(prop, texture_items);
RNA_def_property_ui_text(prop, "Texture Mode",
@@ -1143,7 +1145,7 @@ static void rna_def_field(BlenderRNA *brna)
"else Gradient will be used instead)");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "z_direction", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "z_direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "zdir");
RNA_def_property_enum_items(prop, zdirection_items);
RNA_def_property_ui_text(prop, "Z Direction", "Effect in full or only positive/negative Z direction");
@@ -1151,177 +1153,177 @@ static void rna_def_field(BlenderRNA *brna)
/* Float */
- prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f_strength");
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Strength", "Strength of force field");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
/* different ui range to above */
- prop= RNA_def_property(srna, "linear_drag", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "linear_drag", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f_strength");
RNA_def_property_range(prop, -2.0f, 2.0f);
RNA_def_property_ui_text(prop, "Linear Drag", "Drag component proportional to velocity");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "harmonic_damping", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "harmonic_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f_damp");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Harmonic Damping", "Damping of the harmonic force");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
/* different ui range to above */
- prop= RNA_def_property(srna, "quadratic_drag", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "quadratic_drag", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f_damp");
RNA_def_property_range(prop, -2.0f, 2.0f);
RNA_def_property_ui_text(prop, "Quadratic Drag", "Drag component proportional to the square of velocity");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "flow", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "flow", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f_flow");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Flow", "Convert effector force into air flow velocity");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
/* different ui range to above */
- prop= RNA_def_property(srna, "inflow", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "inflow", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f_flow");
RNA_def_property_range(prop, -10.0f, 10.0f);
RNA_def_property_ui_text(prop, "Inflow", "Inwards component of the vortex force");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f_size");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Size", "Size of the turbulence");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f_size");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Rest Length", "Rest length of the harmonic force");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "falloff_power", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff_power", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f_power");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Falloff Power", "Falloff power (real gravitational falloff = 2)");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mindist");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance for the field's fall-off");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "distance_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxdist");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance for the field to work");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "radial_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "radial_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minrad");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Minimum Radial Distance", "Minimum radial distance for the field's fall-off");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "radial_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "radial_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxrad");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Maximum Radial Distance", "Maximum radial distance for the field to work");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "radial_falloff", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "radial_falloff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f_power_r");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Radial Falloff Power", "Radial falloff power (real gravitational falloff = 2)");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "texture_nabla", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "tex_nabla");
RNA_def_property_range(prop, 0.0001f, 1.0f);
RNA_def_property_ui_text(prop, "Nabla", "Defines size of derivative offset used for calculating gradient and curl");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "noise", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "noise", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f_noise");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Noise", "Amount of noise for the force strength");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
RNA_def_property_range(prop, 1, 128);
RNA_def_property_ui_text(prop, "Seed", "Seed of the noise");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
/* Boolean */
- prop= RNA_def_property(srna, "use_min_distance", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_min_distance", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEMIN);
RNA_def_property_ui_text(prop, "Use Min", "Use a minimum distance for the field's fall-off");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "use_max_distance", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_max_distance", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEMAX);
RNA_def_property_ui_text(prop, "Use Max", "Use a maximum distance for the field to work");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "use_radial_min", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_radial_min", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEMINR);
RNA_def_property_ui_text(prop, "Use Min", "Use a minimum radial distance for the field's fall-off");
- // "Use a minimum angle for the field's fall-off"
+ /* "Use a minimum angle for the field's fall-off" */
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "use_radial_max", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_radial_max", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEMAXR);
RNA_def_property_ui_text(prop, "Use Max", "Use a maximum radial distance for the field to work");
- // "Use a maximum angle for the field to work"
+ /* "Use a maximum angle for the field to work" */
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "use_object_coords", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_object_coords", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_OBJECT);
RNA_def_property_ui_text(prop, "Use Coordinates", "Use object/global coordinates for texture");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "use_global_coords", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_global_coords", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GLOBAL_CO);
RNA_def_property_ui_text(prop, "Use Global Coordinates", "Use effector/global coordinates for turbulence");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "use_2d_force", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_2d_force", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_2D);
RNA_def_property_ui_text(prop, "2D", "Apply force only in 2d");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "use_root_coords", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_root_coords", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_ROOTCO);
RNA_def_property_ui_text(prop, "Root Texture Coordinates", "Texture coordinates from root particle locations");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "apply_to_location", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "apply_to_location", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_DO_LOCATION);
RNA_def_property_ui_text(prop, "Location", "Effect particles' location");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "apply_to_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "apply_to_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_DO_ROTATION);
RNA_def_property_ui_text(prop, "Rotation", "Effect particles' dynamic rotation");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "use_absorption", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_absorption", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_VISIBILITY);
RNA_def_property_ui_text(prop, "Absorption", "Force gets absorbed by collision objects");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "use_multiple_springs", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_multiple_springs", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_MULTIPLE_SPRINGS);
RNA_def_property_ui_text(prop, "Multiple Springs", "Every point is effected by multiple springs");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
/* Pointer */
- prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tex");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture", "Texture to use as force");
@@ -1329,37 +1331,37 @@ static void rna_def_field(BlenderRNA *brna)
/********** Curve Guide Field Settings **********/
- prop= RNA_def_property(srna, "guide_minimum", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "guide_minimum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f_strength");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Minimum Distance", "The distance from which particles are affected fully");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "guide_free", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "guide_free", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "free_end");
RNA_def_property_range(prop, 0.0f, 0.99f);
RNA_def_property_ui_text(prop, "Free", "Guide-free time from particle life's end");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "use_guide_path_add", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_guide_path_add", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GUIDE_PATH_ADD);
RNA_def_property_ui_text(prop, "Additive", "Based on distance/falloff it adds a portion of the entire path");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "use_guide_path_weight", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_guide_path_weight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GUIDE_PATH_WEIGHT);
RNA_def_property_ui_text(prop, "Weights", "Use curve weights to influence the particle influence along the curve");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
/* Clump Settings */
- prop= RNA_def_property(srna, "guide_clump_amount", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "guide_clump_amount", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clump_fac");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Amount", "Amount of clumping");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "guide_clump_shape", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "guide_clump_shape", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clump_pow");
RNA_def_property_range(prop, -0.999f, 0.999f);
RNA_def_property_ui_text(prop, "Shape", "Shape of clumping");
@@ -1367,38 +1369,38 @@ static void rna_def_field(BlenderRNA *brna)
/* Kink Settings */
- prop= RNA_def_property(srna, "guide_kink_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "guide_kink_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "kink");
RNA_def_property_enum_items(prop, guide_kink_items);
RNA_def_property_ui_text(prop, "Kink", "Type of periodic offset on the curve");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "guide_kink_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "guide_kink_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "kink_axis");
RNA_def_property_enum_items(prop, guide_kink_axis_items);
RNA_def_property_ui_text(prop, "Axis", "Which axis to use for offset");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "guide_kink_frequency", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "guide_kink_frequency", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "kink_freq");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Frequency", "The frequency of the offset (1/total length)");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "guide_kink_shape", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "guide_kink_shape", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "kink_shape");
RNA_def_property_range(prop, -0.999f, 0.999f);
RNA_def_property_ui_text(prop, "Shape", "Adjust the offset to the beginning/end");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
- prop= RNA_def_property(srna, "guide_kink_amplitude", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "guide_kink_amplitude", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "kink_amp");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Amplitude", "The amplitude of the offset");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
/* Variables used for Curve Guide, already wrapped, used for other fields too */
- // falloff_power, use_max_distance, maximum_distance
+ /* falloff_power, use_max_distance, maximum_distance */
}
static void rna_def_game_softbody(BlenderRNA *brna)
@@ -1406,33 +1408,33 @@ static void rna_def_game_softbody(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "GameSoftBodySettings", NULL);
+ srna = RNA_def_struct(brna, "GameSoftBodySettings", NULL);
RNA_def_struct_sdna(srna, "BulletSoftBody");
RNA_def_struct_ui_text(srna, "Game Soft Body Settings", "Soft body simulation settings for an object in the game engine");
/* Floats */
- prop= RNA_def_property(srna, "linear_stiffness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "linear_stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "linStiff");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Linear Stiffness", "Linear stiffness of the soft body links");
- prop= RNA_def_property(srna, "dynamic_friction", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "dynamic_friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "kDF");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Friction", "Dynamic Friction");
- prop= RNA_def_property(srna, "shape_threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shape_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "kMT");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Threshold", "Shape matching threshold");
- prop= RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "margin");
RNA_def_property_range(prop, 0.01f, 1.0f);
RNA_def_property_ui_text(prop, "Margin", "Collision margin for soft body. Small value makes the algorithm unstable");
- prop= RNA_def_property(srna, "weld_threshold", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "weld_threshold", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "welding");
RNA_def_property_range(prop, 0.0f, 0.01f);
RNA_def_property_ui_text(prop, "Welding",
@@ -1442,31 +1444,31 @@ static void rna_def_game_softbody(BlenderRNA *brna)
/* Integers */
- prop= RNA_def_property(srna, "location_iterations", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "location_iterations", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "piterations");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Position Iterations", "Position solver iterations");
- prop= RNA_def_property(srna, "cluster_iterations", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "cluster_iterations", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "numclusteriterations");
RNA_def_property_range(prop, 1, 128);
RNA_def_property_ui_text(prop, "Cluster Iterations", "Number of cluster iterations");
/* Booleans */
- prop= RNA_def_property(srna, "use_shape_match", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_shape_match", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_BSB_SHAPE_MATCHING);
RNA_def_property_ui_text(prop, "Shape Match", "Enable soft body shape matching goal");
- prop= RNA_def_property(srna, "use_bending_constraints", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_bending_constraints", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_BSB_BENDING_CONSTRAINTS);
RNA_def_property_ui_text(prop, "Bending Const", "Enable bending constraints");
- prop= RNA_def_property(srna, "use_cluster_rigid_to_softbody", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_cluster_rigid_to_softbody", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "collisionflags", OB_BSB_COL_CL_RS);
RNA_def_property_ui_text(prop, "Rigid to Soft Body", "Enable cluster collision between soft and rigid body");
- prop= RNA_def_property(srna, "use_cluster_soft_to_softbody", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_cluster_soft_to_softbody", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "collisionflags", OB_BSB_COL_CL_SS);
RNA_def_property_ui_text(prop, "Soft to Soft Body", "Enable cluster collision between soft and soft body");
}
@@ -1475,7 +1477,7 @@ static void rna_def_softbody(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- const int matrix_dimsize[]= {3, 3};
+ const int matrix_dimsize[] = {3, 3};
static EnumPropertyItem collision_type_items[] = {
@@ -1491,39 +1493,39 @@ static void rna_def_softbody(BlenderRNA *brna)
{1, "LIFT_FORCE", 0, "Lift Force", "Edges receive a lift force when passing through surrounding media"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SoftBodySettings", NULL);
+ srna = RNA_def_struct(brna, "SoftBodySettings", NULL);
RNA_def_struct_sdna(srna, "SoftBody");
RNA_def_struct_path_func(srna, "rna_SoftBodySettings_path");
RNA_def_struct_ui_text(srna, "Soft Body Settings", "Soft body simulation settings for an object");
/* General Settings */
- prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mediafrict");
RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Friction", "General media friction for point movements");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "nodemass");
RNA_def_property_range(prop, 0.0f, 50000.0f);
RNA_def_property_ui_text(prop, "Mass", "General Mass value");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "vertex_group_mass", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_mass", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "namedVG_Mass");
RNA_def_property_ui_text(prop, "Mass Vertex Group", "Control point mass values");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoftBodySettings_mass_vgroup_set");
RNA_def_property_update(prop, 0, "rna_softbody_update");
/* no longer used */
- prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
+ prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_float_sdna(prop, NULL, "grav");
RNA_def_property_range(prop, -10.0f, 10.0f);
RNA_def_property_ui_text(prop, "Gravitation", "Apply gravitation to point movement");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "physics_speed");
RNA_def_property_range(prop, 0.01f, 100.0f);
RNA_def_property_ui_text(prop, "Speed", "Tweak timing for physics to control frequency and speed");
@@ -1531,39 +1533,39 @@ static void rna_def_softbody(BlenderRNA *brna)
/* Goal */
- prop= RNA_def_property(srna, "vertex_group_goal", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_goal", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "vertgroup");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not impossible .. but not supported yet */
RNA_def_property_string_funcs(prop, "rna_SoftBodySettings_goal_vgroup_get", "rna_SoftBodySettings_goal_vgroup_length",
"rna_SoftBodySettings_goal_vgroup_set");
RNA_def_property_ui_text(prop, "Goal Vertex Group", "Control point weight values");
- prop= RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mingoal");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Goal Minimum", "Goal minimum, vertex weights are scaled to match this range");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxgoal");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Goal Maximum", "Goal maximum, vertex weights are scaled to match this range");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "defgoal");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value, when no Vertex Group used");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "goalspring");
RNA_def_property_range(prop, 0.0f, 0.999f);
RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "goalfrict");
RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Goal Damping", "Goal (vertex target position) friction");
@@ -1571,54 +1573,54 @@ static void rna_def_softbody(BlenderRNA *brna)
/* Edge Spring Settings */
- prop= RNA_def_property(srna, "pull", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "pull", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "inspring");
RNA_def_property_range(prop, 0.0f, 0.999f);
RNA_def_property_ui_text(prop, "Pull", "Edge spring stiffness when longer than rest length");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "push", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "push", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "inpush");
RNA_def_property_range(prop, 0.0f, 0.999f);
RNA_def_property_ui_text(prop, "Push", "Edge spring stiffness when shorter than rest length");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "infrict");
RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Damp", "Edge spring friction");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "spring_length", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "spring_length", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "springpreload");
RNA_def_property_range(prop, 0.0f, 200.0f);
RNA_def_property_ui_text(prop, "SL", "Alter spring length to shrink/blow up (unit %) 0 to disable");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "aero", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "aero", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "aeroedge");
RNA_def_property_range(prop, 0.0f, 30000.0f);
RNA_def_property_ui_text(prop, "Aero", "Make edges 'sail'");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "plastic", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "plastic", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "plastic");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Plastic", "Permanent deform");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "bend", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bend", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "secondspring");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Bending", "Bending Stiffness");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shearstiff");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Shear", "Shear Stiffness");
- prop= RNA_def_property(srna, "vertex_group_spring", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_spring", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "namedVG_Spring_K");
RNA_def_property_ui_text(prop, "Spring Vertex Group", "Control point spring strength values");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoftBodySettings_spring_vgroup_set");
@@ -1626,27 +1628,27 @@ static void rna_def_softbody(BlenderRNA *brna)
/* Collision */
- prop= RNA_def_property(srna, "collision_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "collision_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "sbc_mode");
RNA_def_property_enum_items(prop, collision_type_items);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Collision Type", "Choose Collision Type");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "ball_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ball_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colball");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* code is not ready for that yet */
RNA_def_property_range(prop, -10.0f, 10.0f);
RNA_def_property_ui_text(prop, "Ball Size", "Absolute ball size or factor if not manual adjusted");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "ball_stiff", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ball_stiff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ballstiff");
RNA_def_property_range(prop, 0.001f, 100.0f);
RNA_def_property_ui_text(prop, "Ball Size", "Ball inflating pressure");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "ball_damp", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ball_damp", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "balldamp");
RNA_def_property_range(prop, 0.001f, 1.0f);
RNA_def_property_ui_text(prop, "Ball Size", "Blending to inelastic collision");
@@ -1654,48 +1656,48 @@ static void rna_def_softbody(BlenderRNA *brna)
/* Solver */
- prop= RNA_def_property(srna, "error_threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "error_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rklimit");
RNA_def_property_range(prop, 0.001f, 10.0f);
RNA_def_property_ui_text(prop, "Error Limit",
"The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "step_min", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "step_min", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "minloops");
RNA_def_property_range(prop, 0, 30000);
RNA_def_property_ui_text(prop, "Min Step", "Minimal # solver steps/frame");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "step_max", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "step_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxloops");
RNA_def_property_range(prop, 0, 30000);
RNA_def_property_ui_text(prop, "Max Step", "Maximal # solver steps/frame");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "choke", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "choke", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "choke");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Choke", "'Viscosity' inside collision target");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "fuzzy", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "fuzzy", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "fuzzyness");
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Fuzzy",
"Fuzziness while on collision, high values make collision handling faster but less stable");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "use_auto_step", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_step", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_OLDERR);
RNA_def_property_ui_text(prop, "V", "Use velocities for automagic step sizes");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "use_diagnose", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_diagnose", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_MONITOR);
RNA_def_property_ui_text(prop, "Print Performance to Console", "Turn on SB diagnose console prints");
- prop= RNA_def_property(srna, "use_estimate_matrix", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_estimate_matrix", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_ESTIMATEIPO);
RNA_def_property_ui_text(prop, "Estimate matrix", "Estimate matrix... split to COM, ROT, SCALE");
@@ -1705,17 +1707,17 @@ static void rna_def_softbody(BlenderRNA *brna)
/* but i did not want to start a new property struct */
/* so rather rename this from SoftBodySettings to SoftBody */
/* translation */
- prop= RNA_def_property(srna, "location_mass_center", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "location_mass_center", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "lcom");
RNA_def_property_ui_text(prop, "Center of mass", "Location of Center of mass");
/* matrix */
- prop= RNA_def_property(srna, "rotation_estimate", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "rotation_estimate", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "lrot");
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_ui_text(prop, "Rot Matrix", "Estimated rotation matrix");
- prop= RNA_def_property(srna, "scale_estimate", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "scale_estimate", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "lscale");
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_ui_text(prop, "Scale Matrix", "Estimated scale matrix");
@@ -1724,47 +1726,47 @@ static void rna_def_softbody(BlenderRNA *brna)
/* Flags */
- prop= RNA_def_property(srna, "use_goal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_goal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_use_goal_get", "rna_SoftBodySettings_use_goal_set");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Use Goal", "Define forces for vertices to stick to animated position");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "use_edges", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_use_edges_get", "rna_SoftBodySettings_use_edges_set");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Use Edges", "Use Edges as springs");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "use_stiff_quads", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stiff_quads", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_stiff_quads_get", "rna_SoftBodySettings_stiff_quads_set");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Stiff Quads", "Add diagonal springs on 4-gons");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "use_edge_collision", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_edge_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_edge_collision_get", "rna_SoftBodySettings_edge_collision_set");
RNA_def_property_ui_text(prop, "Edge Collision", "Edges collide too");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "use_face_collision", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_face_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_face_collision_get", "rna_SoftBodySettings_face_collision_set");
RNA_def_property_ui_text(prop, "Face Collision", "Faces collide too, can be very slow");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "aerodynamics_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "aerodynamics_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, aerodynamics_type);
RNA_def_property_enum_funcs(prop, "rna_SoftBodySettings_new_aero_get", "rna_SoftBodySettings_new_aero_set", NULL);
RNA_def_property_ui_text(prop, "Aerodynamics Type", "Method of calculating aerodynamic interaction");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "use_self_collision", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_self_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_self_collision_get", "rna_SoftBodySettings_self_collision_set");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Self Collision", "Enable naive vertex ball self collision");
RNA_def_property_update(prop, 0, "rna_softbody_update");
- prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "effector_weights");
RNA_def_property_struct_type(prop, "EffectorWeights");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
diff --git a/source/blender/makesrna/intern/rna_packedfile.c b/source/blender/makesrna/intern/rna_packedfile.c
index 3d19cc352f1..1fed98b33eb 100644
--- a/source/blender/makesrna/intern/rna_packedfile.c
+++ b/source/blender/makesrna/intern/rna_packedfile.c
@@ -48,10 +48,10 @@ void RNA_def_packedfile(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "PackedFile", NULL);
+ srna = RNA_def_struct(brna, "PackedFile", NULL);
RNA_def_struct_ui_text(srna, "Packed File", "External file packed into the .blend file");
- prop= RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Size", "Size of packed file in bytes");
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 2c71fffb5b5..a4ed256b70c 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -134,16 +134,16 @@ EnumPropertyItem part_hair_ren_as_items[] = {
/* use for object space hair get/set */
static void rna_ParticleHairKey_location_object_info(PointerRNA *ptr, ParticleSystemModifierData **psmd_pt, ParticleData **pa_pt)
{
- HairKey *hkey= (HairKey *)ptr->data;
+ HairKey *hkey = (HairKey *)ptr->data;
Object *ob = (Object *)ptr->id.data;
ModifierData *md;
- ParticleSystemModifierData *psmd=NULL;
+ ParticleSystemModifierData *psmd = NULL;
ParticleSystem *psys;
ParticleData *pa;
int i;
- *psmd_pt= NULL;
- *pa_pt= NULL;
+ *psmd_pt = NULL;
+ *pa_pt = NULL;
/* given the pointer HairKey *hkey, we iterate over all particles in all
* particle systems in the object "ob" in order to find
@@ -159,12 +159,12 @@ static void rna_ParticleHairKey_location_object_info(PointerRNA *ptr, ParticleSy
* hairkey belongs.
*/
- for (md= ob->modifiers.first; md; md=md->next) {
+ for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_ParticleSystem) {
- psmd= (ParticleSystemModifierData *) md;
+ psmd = (ParticleSystemModifierData *) md;
if (psmd && psmd->dm && psmd->psys) {
psys = psmd->psys;
- for(i= 0, pa= psys->particles; i < psys->totpart; i++, pa++) {
+ for (i = 0, pa = psys->particles; i < psys->totpart; i++, pa++) {
/* hairkeys are stored sequentially in memory, so we can
* find if it's the same particle by comparing pointers,
* without having to iterate over them all */
@@ -181,17 +181,17 @@ static void rna_ParticleHairKey_location_object_info(PointerRNA *ptr, ParticleSy
static void rna_ParticleHairKey_location_object_get(PointerRNA *ptr, float *values)
{
- HairKey *hkey= (HairKey *)ptr->data;
+ HairKey *hkey = (HairKey *)ptr->data;
Object *ob = (Object *)ptr->id.data;
ParticleSystemModifierData *psmd;
ParticleData *pa;
rna_ParticleHairKey_location_object_info(ptr, &psmd, &pa);
- if(pa) {
+ if (pa) {
DerivedMesh *hairdm = (psmd->psys->flag & PSYS_HAIR_DYNAMICS) ? psmd->psys->hair_out_dm : NULL;
- if(hairdm) {
+ if (hairdm) {
MVert *mvert = CDDM_get_vert(hairdm, pa->hair_index + (hkey - pa->hair));
copy_v3_v3(values, mvert->co);
}
@@ -209,17 +209,17 @@ static void rna_ParticleHairKey_location_object_get(PointerRNA *ptr, float *valu
static void rna_ParticleHairKey_location_object_set(PointerRNA *ptr, const float *values)
{
- HairKey *hkey= (HairKey *)ptr->data;
+ HairKey *hkey = (HairKey *)ptr->data;
Object *ob = (Object *)ptr->id.data;
ParticleSystemModifierData *psmd;
ParticleData *pa;
rna_ParticleHairKey_location_object_info(ptr, &psmd, &pa);
- if(pa) {
+ if (pa) {
DerivedMesh *hairdm = (psmd->psys->flag & PSYS_HAIR_DYNAMICS) ? psmd->psys->hair_out_dm : NULL;
- if(hairdm) {
+ if (hairdm) {
MVert *mvert = CDDM_get_vert(hairdm, pa->hair_index + (hkey - pa->hair));
copy_v3_v3(mvert->co, values);
}
@@ -241,7 +241,7 @@ static void rna_ParticleHairKey_location_object_set(PointerRNA *ptr, const float
/* property update functions */
static void particle_recalc(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr, short flag)
{
- if(ptr->type==&RNA_ParticleSystem) {
+ if (ptr->type == &RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data;
psys->recalc = flag;
@@ -289,9 +289,9 @@ static ParticleSystem *rna_particle_system_for_target(Object *ob, ParticleTarget
ParticleSystem *psys;
ParticleTarget *pt;
- for(psys=ob->particlesystem.first; psys; psys=psys->next)
- for(pt=psys->targets.first; pt; pt=pt->next)
- if(pt == target)
+ for (psys = ob->particlesystem.first; psys; psys = psys->next)
+ for (pt = psys->targets.first; pt; pt = pt->next)
+ if (pt == target)
return psys;
return NULL;
@@ -299,24 +299,24 @@ static ParticleSystem *rna_particle_system_for_target(Object *ob, ParticleTarget
static void rna_Particle_target_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- if(ptr->type==&RNA_ParticleTarget) {
+ if (ptr->type == &RNA_ParticleTarget) {
Object *ob = (Object*)ptr->id.data;
ParticleTarget *pt = (ParticleTarget*)ptr->data;
- ParticleSystem *kpsys=NULL, *psys=rna_particle_system_for_target(ob, pt);
+ ParticleSystem *kpsys = NULL, *psys = rna_particle_system_for_target(ob, pt);
- if(pt->ob==ob || pt->ob==NULL) {
+ if (pt->ob == ob || pt->ob == NULL) {
kpsys = BLI_findlink(&ob->particlesystem, pt->psys-1);
- if(kpsys)
+ if (kpsys)
pt->flag |= PTARGET_VALID;
else
pt->flag &= ~PTARGET_VALID;
}
else {
- if(pt->ob)
+ if (pt->ob)
kpsys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1);
- if(kpsys)
+ if (kpsys)
pt->flag |= PTARGET_VALID;
else
pt->flag &= ~PTARGET_VALID;
@@ -333,7 +333,7 @@ static void rna_Particle_target_reset(Main *bmain, Scene *scene, PointerRNA *ptr
static void rna_Particle_target_redo(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- if(ptr->type==&RNA_ParticleTarget) {
+ if (ptr->type == &RNA_ParticleTarget) {
Object *ob = (Object*)ptr->id.data;
ParticleTarget *pt = (ParticleTarget*)ptr->data;
ParticleSystem *psys = rna_particle_system_for_target(ob, pt);
@@ -350,7 +350,7 @@ static void rna_Particle_hair_dynamics(Main *bmain, Scene *scene, PointerRNA *pt
Object *ob = (Object*)ptr->id.data;
ParticleSystem *psys = (ParticleSystem*)ptr->data;
- if(psys && !psys->clmd) {
+ if (psys && !psys->clmd) {
psys->clmd = (ClothModifierData*)modifier_new(eModifierType_Cloth);
psys->clmd->sim_parms->goalspring = 0.0f;
psys->clmd->sim_parms->flags |= CLOTH_SIMSETTINGS_FLAG_GOAL|CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS;
@@ -364,7 +364,7 @@ static void rna_Particle_hair_dynamics(Main *bmain, Scene *scene, PointerRNA *pt
}
static PointerRNA rna_particle_settings_get(PointerRNA *ptr)
{
- ParticleSystem *psys= (ParticleSystem*)ptr->data;
+ ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSettings *part = psys->part;
return rna_pointer_inherit_refine(ptr, &RNA_ParticleSettings, part);
@@ -372,21 +372,21 @@ static PointerRNA rna_particle_settings_get(PointerRNA *ptr)
static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value)
{
- ParticleSystem *psys= (ParticleSystem*)ptr->data;
+ ParticleSystem *psys = (ParticleSystem*)ptr->data;
int old_type = 0;
- if(psys->part) {
+ if (psys->part) {
old_type = psys->part->type;
psys->part->id.us--;
}
psys->part = (ParticleSettings *)value.data;
- if(psys->part) {
+ if (psys->part) {
psys->part->id.us++;
psys_check_boid_data(psys);
- if(old_type != psys->part->type)
+ if (old_type != psys->part->type)
psys->recalc |= PSYS_RECALC_TYPE;
}
}
@@ -394,7 +394,7 @@ static void rna_Particle_abspathtime_update(Main *bmain, Scene *scene, PointerRN
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
float delta = settings->end + settings->lifetime - settings->sta;
- if(settings->draw & PART_ABS_PATH_TIME) {
+ if (settings->draw & PART_ABS_PATH_TIME) {
settings->path_start = settings->sta + settings->path_start * delta;
settings->path_end = settings->sta + settings->path_end * delta;
}
@@ -409,12 +409,12 @@ static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value)
ParticleSettings *settings = (ParticleSettings*)ptr->data;
/* check for clipping */
- if(value > settings->end)
+ if (value > settings->end)
value = settings->end;
- //if(settings->type==PART_REACTOR && value < 1.0)
- // value = 1.0;
- //else
+ /*if(settings->type==PART_REACTOR && value < 1.0) */
+ /* value = 1.0; */
+ /*else */
if (value < MINAFRAMEF)
value = MINAFRAMEF;
@@ -426,7 +426,7 @@ static void rna_PartSettings_end_set(struct PointerRNA *ptr, float value)
ParticleSettings *settings = (ParticleSettings*)ptr->data;
/* check for clipping */
- if(value < settings->sta)
+ if (value < settings->sta)
value = settings->sta;
settings->end = value;
@@ -473,13 +473,13 @@ static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, floa
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
- if(settings->type==PART_HAIR) {
+ if (settings->type == PART_HAIR) {
*min = 0.0f;
*max = (settings->draw & PART_ABS_PATH_TIME) ? 100.0f : 1.0f;
}
else {
*min = (settings->draw & PART_ABS_PATH_TIME) ? settings->sta : 0.0f;
- *max= (settings->draw & PART_ABS_PATH_TIME) ? MAXFRAMEF : 1.0f;
+ *max = (settings->draw & PART_ABS_PATH_TIME) ? MAXFRAMEF : 1.0f;
}
}
static void rna_PartSetting_linelenhead_set(struct PointerRNA *ptr, float value)
@@ -497,15 +497,15 @@ static float rna_PartSetting_linelenhead_get(struct PointerRNA *ptr)
static int rna_PartSettings_is_fluid_get(PointerRNA *ptr)
{
- ParticleSettings *part= (ParticleSettings*)ptr->data;
+ ParticleSettings *part = (ParticleSettings*)ptr->data;
return part->type == PART_FLUID;
}
void rna_ParticleSystem_name_set(PointerRNA *ptr, const char *value)
{
- Object *ob= ptr->id.data;
- ParticleSystem *part= (ParticleSystem*)ptr->data;
+ Object *ob = ptr->id.data;
+ ParticleSystem *part = (ParticleSystem*)ptr->data;
/* copy the new name into the name slot */
BLI_strncpy_utf8(part->name, value, sizeof(part->name));
@@ -515,31 +515,31 @@ void rna_ParticleSystem_name_set(PointerRNA *ptr, const char *value)
static PointerRNA rna_ParticleSystem_active_particle_target_get(PointerRNA *ptr)
{
- ParticleSystem *psys= (ParticleSystem*)ptr->data;
+ ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleTarget *pt = psys->targets.first;
- for(; pt; pt=pt->next) {
- if(pt->flag & PTARGET_CURRENT)
+ for (; pt; pt = pt->next) {
+ if (pt->flag & PTARGET_CURRENT)
return rna_pointer_inherit_refine(ptr, &RNA_ParticleTarget, pt);
}
return rna_pointer_inherit_refine(ptr, &RNA_ParticleTarget, NULL);
}
static void rna_ParticleSystem_active_particle_target_index_range(PointerRNA *ptr, int *min, int *max)
{
- ParticleSystem *psys= (ParticleSystem*)ptr->data;
- *min= 0;
- *max= BLI_countlist(&psys->targets)-1;
- *max= MAX2(0, *max);
+ ParticleSystem *psys = (ParticleSystem*)ptr->data;
+ *min = 0;
+ *max = BLI_countlist(&psys->targets)-1;
+ *max = MAX2(0, *max);
}
static int rna_ParticleSystem_active_particle_target_index_get(PointerRNA *ptr)
{
- ParticleSystem *psys= (ParticleSystem*)ptr->data;
+ ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleTarget *pt = psys->targets.first;
- int i=0;
+ int i = 0;
- for(; pt; pt=pt->next, i++)
- if(pt->flag & PTARGET_CURRENT)
+ for (; pt; pt = pt->next, i++)
+ if (pt->flag & PTARGET_CURRENT)
return i;
return 0;
@@ -547,12 +547,12 @@ static int rna_ParticleSystem_active_particle_target_index_get(PointerRNA *ptr)
static void rna_ParticleSystem_active_particle_target_index_set(struct PointerRNA *ptr, int value)
{
- ParticleSystem *psys= (ParticleSystem*)ptr->data;
+ ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleTarget *pt = psys->targets.first;
- int i=0;
+ int i = 0;
- for(; pt; pt=pt->next, i++) {
- if(i==value)
+ for (; pt; pt = pt->next, i++) {
+ if (i == value)
pt->flag |= PTARGET_CURRENT;
else
pt->flag &= ~PTARGET_CURRENT;
@@ -560,20 +560,20 @@ static void rna_ParticleSystem_active_particle_target_index_set(struct PointerRN
}
static int rna_ParticleTarget_name_length(PointerRNA *ptr)
{
- ParticleTarget *pt= ptr->data;
+ ParticleTarget *pt = ptr->data;
- if(pt->flag & PTARGET_VALID) {
+ if (pt->flag & PTARGET_VALID) {
ParticleSystem *psys = NULL;
- if(pt->ob)
+ if (pt->ob)
psys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1);
else {
Object *ob = (Object*) ptr->id.data;
psys = BLI_findlink(&ob->particlesystem, pt->psys-1);
}
- if(psys) {
- if(pt->ob)
+ if (psys) {
+ if (pt->ob)
return strlen(pt->ob->id.name+2) + 2 + strlen(psys->name);
else
return strlen(psys->name);
@@ -587,20 +587,20 @@ static int rna_ParticleTarget_name_length(PointerRNA *ptr)
static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str)
{
- ParticleTarget *pt= ptr->data;
+ ParticleTarget *pt = ptr->data;
- if(pt->flag & PTARGET_VALID) {
+ if (pt->flag & PTARGET_VALID) {
ParticleSystem *psys = NULL;
- if(pt->ob)
+ if (pt->ob)
psys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1);
else {
Object *ob = (Object*) ptr->id.data;
psys = BLI_findlink(&ob->particlesystem, pt->psys-1);
}
- if(psys) {
- if(pt->ob)
+ if (psys) {
+ if (pt->ob)
sprintf(str, "%s: %s", pt->ob->id.name+2, psys->name);
else
strcpy(str, psys->name);
@@ -614,7 +614,7 @@ static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str)
static int particle_id_check(PointerRNA *ptr)
{
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
return (GS(id->name) == ID_PA);
}
@@ -623,7 +623,7 @@ static char *rna_SPHFluidSettings_path(PointerRNA *ptr)
{
SPHFluidSettings *fluid = (SPHFluidSettings *)ptr->data;
- if(particle_id_check(ptr)) {
+ if (particle_id_check(ptr)) {
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
if (part->fluid == fluid)
@@ -634,52 +634,52 @@ static char *rna_SPHFluidSettings_path(PointerRNA *ptr)
static int rna_ParticleSystem_multiple_caches_get(PointerRNA *ptr)
{
- ParticleSystem *psys= (ParticleSystem*)ptr->data;
+ ParticleSystem *psys = (ParticleSystem*)ptr->data;
return (psys->ptcaches.first != psys->ptcaches.last);
}
static int rna_ParticleSystem_editable_get(PointerRNA *ptr)
{
- ParticleSystem *psys= (ParticleSystem*)ptr->data;
+ ParticleSystem *psys = (ParticleSystem*)ptr->data;
return psys_check_edited(psys);
}
static int rna_ParticleSystem_edited_get(PointerRNA *ptr)
{
- ParticleSystem *psys= (ParticleSystem*)ptr->data;
+ ParticleSystem *psys = (ParticleSystem*)ptr->data;
- if(psys->part && psys->part->type==PART_HAIR)
+ if (psys->part && psys->part->type == PART_HAIR)
return (psys->flag & PSYS_EDITED || (psys->edit && psys->edit->edited));
else
return (psys->pointcache->edit && psys->pointcache->edit->edited);
}
static PointerRNA rna_ParticleDupliWeight_active_get(PointerRNA *ptr)
{
- ParticleSettings *part= (ParticleSettings*)ptr->id.data;
+ ParticleSettings *part = (ParticleSettings*)ptr->id.data;
ParticleDupliWeight *dw = part->dupliweights.first;
- for(; dw; dw=dw->next) {
- if(dw->flag & PART_DUPLIW_CURRENT)
+ for (; dw; dw = dw->next) {
+ if (dw->flag & PART_DUPLIW_CURRENT)
return rna_pointer_inherit_refine(ptr, &RNA_ParticleDupliWeight, dw);
}
return rna_pointer_inherit_refine(ptr, &RNA_ParticleTarget, NULL);
}
static void rna_ParticleDupliWeight_active_index_range(PointerRNA *ptr, int *min, int *max)
{
- ParticleSettings *part= (ParticleSettings*)ptr->id.data;
- *min= 0;
- *max= BLI_countlist(&part->dupliweights)-1;
- *max= MAX2(0, *max);
+ ParticleSettings *part = (ParticleSettings*)ptr->id.data;
+ *min = 0;
+ *max = BLI_countlist(&part->dupliweights)-1;
+ *max = MAX2(0, *max);
}
static int rna_ParticleDupliWeight_active_index_get(PointerRNA *ptr)
{
- ParticleSettings *part= (ParticleSettings*)ptr->id.data;
+ ParticleSettings *part = (ParticleSettings*)ptr->id.data;
ParticleDupliWeight *dw = part->dupliweights.first;
- int i=0;
+ int i = 0;
- for(; dw; dw=dw->next, i++)
- if(dw->flag & PART_DUPLIW_CURRENT)
+ for (; dw; dw = dw->next, i++)
+ if (dw->flag & PART_DUPLIW_CURRENT)
return i;
return 0;
@@ -687,12 +687,12 @@ static int rna_ParticleDupliWeight_active_index_get(PointerRNA *ptr)
static void rna_ParticleDupliWeight_active_index_set(struct PointerRNA *ptr, int value)
{
- ParticleSettings *part= (ParticleSettings*)ptr->id.data;
+ ParticleSettings *part = (ParticleSettings*)ptr->id.data;
ParticleDupliWeight *dw = part->dupliweights.first;
- int i=0;
+ int i = 0;
- for(; dw; dw=dw->next, i++) {
- if(i==value)
+ for (; dw; dw = dw->next, i++) {
+ if (i == value)
dw->flag |= PART_DUPLIW_CURRENT;
else
dw->flag &= ~PART_DUPLIW_CURRENT;
@@ -710,9 +710,9 @@ static int rna_ParticleDupliWeight_name_length(PointerRNA *ptr)
static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str)
{
- ParticleDupliWeight *dw= ptr->data;
+ ParticleDupliWeight *dw = ptr->data;
- if(dw->ob)
+ if (dw->ob)
sprintf(str, "%s: %i", dw->ob->id.name+2, dw->count);
else
strcpy(str, "No object");
@@ -720,9 +720,9 @@ static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str)
static EnumPropertyItem *rna_Particle_from_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
- //if(part->type==PART_REACTOR)
- // return part_reactor_from_items;
- //else
+ /*if(part->type==PART_REACTOR) */
+ /* return part_reactor_from_items; */
+ /*else */
return part_from_items;
}
@@ -730,7 +730,7 @@ static EnumPropertyItem *rna_Particle_dist_itemf(bContext *UNUSED(C), PointerRNA
{
ParticleSettings *part = ptr->id.data;
- if(part->type==PART_HAIR)
+ if (part->type == PART_HAIR)
return part_hair_dist_items;
else
return part_dist_items;
@@ -740,7 +740,7 @@ static EnumPropertyItem *rna_Particle_draw_as_itemf(bContext *UNUSED(C), Pointer
{
ParticleSettings *part = ptr->id.data;
- if(part->type==PART_HAIR)
+ if (part->type == PART_HAIR)
return part_hair_draw_as_items;
else
return part_draw_as_items;
@@ -750,7 +750,7 @@ static EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *UNUSED(C), PointerR
{
ParticleSettings *part = ptr->id.data;
- if(part->type==PART_HAIR)
+ if (part->type == PART_HAIR)
return part_hair_ren_as_items;
else
return part_ren_as_items;
@@ -758,51 +758,51 @@ static EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *UNUSED(C), PointerR
static PointerRNA rna_Particle_field1_get(PointerRNA *ptr)
{
- ParticleSettings *part= (ParticleSettings*)ptr->id.data;
+ ParticleSettings *part = (ParticleSettings*)ptr->id.data;
/* weak */
- if(!part->pd)
- part->pd= object_add_collision_fields(0);
+ if (!part->pd)
+ part->pd = object_add_collision_fields(0);
return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, part->pd);
}
static PointerRNA rna_Particle_field2_get(PointerRNA *ptr)
{
- ParticleSettings *part= (ParticleSettings*)ptr->id.data;
+ ParticleSettings *part = (ParticleSettings*)ptr->id.data;
/* weak */
- if(!part->pd2)
- part->pd2= object_add_collision_fields(0);
+ if (!part->pd2)
+ part->pd2 = object_add_collision_fields(0);
return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, part->pd2);
}
static void psys_vg_name_get__internal(PointerRNA *ptr, char *value, int index)
{
- Object *ob= ptr->id.data;
- ParticleSystem *psys= (ParticleSystem*)ptr->data;
+ Object *ob = ptr->id.data;
+ ParticleSystem *psys = (ParticleSystem*)ptr->data;
- if(psys->vgroup[index] > 0) {
- bDeformGroup *defGroup= BLI_findlink(&ob->defbase, psys->vgroup[index]-1);
+ if (psys->vgroup[index] > 0) {
+ bDeformGroup *defGroup = BLI_findlink(&ob->defbase, psys->vgroup[index]-1);
- if(defGroup) {
+ if (defGroup) {
strcpy(value, defGroup->name);
return;
}
}
- value[0]= '\0';
+ value[0] = '\0';
}
static int psys_vg_name_len__internal(PointerRNA *ptr, int index)
{
- Object *ob= ptr->id.data;
- ParticleSystem *psys= (ParticleSystem*)ptr->data;
+ Object *ob = ptr->id.data;
+ ParticleSystem *psys = (ParticleSystem*)ptr->data;
- if(psys->vgroup[index] > 0) {
- bDeformGroup *defGroup= BLI_findlink(&ob->defbase, psys->vgroup[index]-1);
+ if (psys->vgroup[index] > 0) {
+ bDeformGroup *defGroup = BLI_findlink(&ob->defbase, psys->vgroup[index]-1);
- if(defGroup) {
+ if (defGroup) {
return strlen(defGroup->name);
}
}
@@ -810,46 +810,46 @@ static int psys_vg_name_len__internal(PointerRNA *ptr, int index)
}
static void psys_vg_name_set__internal(PointerRNA *ptr, const char *value, int index)
{
- Object *ob= ptr->id.data;
- ParticleSystem *psys= (ParticleSystem*)ptr->data;
+ Object *ob = ptr->id.data;
+ ParticleSystem *psys = (ParticleSystem*)ptr->data;
- if(value[0]=='\0') {
- psys->vgroup[index]= 0;
+ if (value[0] =='\0') {
+ psys->vgroup[index] = 0;
}
else {
int vgroup_num = defgroup_name_index(ob, value);
- if(vgroup_num == -1)
+ if (vgroup_num == -1)
return;
- psys->vgroup[index]= vgroup_num + 1;
+ psys->vgroup[index] = vgroup_num + 1;
}
}
static char *rna_ParticleSystem_path(PointerRNA *ptr)
{
- ParticleSystem *psys= (ParticleSystem*)ptr->data;
+ ParticleSystem *psys = (ParticleSystem*)ptr->data;
return BLI_sprintfN("particle_systems[\"%s\"]", psys->name);
}
static void rna_ParticleSettings_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- ParticleSettings *part= (ParticleSettings*)ptr->data;
+ ParticleSettings *part = (ParticleSettings*)ptr->data;
rna_iterator_array_begin(iter, (void*)part->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL);
}
static PointerRNA rna_ParticleSettings_active_texture_get(PointerRNA *ptr)
{
- ParticleSettings *part= (ParticleSettings*)ptr->data;
+ ParticleSettings *part = (ParticleSettings*)ptr->data;
Tex *tex;
- tex= give_current_particle_texture(part);
+ tex = give_current_particle_texture(part);
return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
}
static void rna_ParticleSettings_active_texture_set(PointerRNA *ptr, PointerRNA value)
{
- ParticleSettings *part= (ParticleSettings*)ptr->data;
+ ParticleSettings *part = (ParticleSettings*)ptr->data;
set_current_particle_texture(part, value.data);
}
@@ -906,19 +906,19 @@ static void rna_def_particle_hair_key(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "HairKey");
RNA_def_struct_ui_text(srna, "Particle Hair Key", "Particle key for hair particle system");
- prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_ui_text(prop, "Time", "Relative time of key over hair length");
- prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Weight", "Weight for cloth simulation");
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Location (Object Space)", "Location of the hair key in object space");
RNA_def_property_float_funcs(prop, "rna_ParticleHairKey_location_object_get", "rna_ParticleHairKey_location_object_set", NULL);
- prop= RNA_def_property(srna, "co_hair_space", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "co_hair_space", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "co");
RNA_def_property_ui_text(prop, "Location", "Location of the hair key in its internal coordinate system, relative to the emitting face");
}
@@ -931,40 +931,40 @@ static void rna_def_particle_key(BlenderRNA *brna)
srna = RNA_def_struct(brna, "ParticleKey", NULL);
RNA_def_struct_ui_text(srna, "Particle Key", "Key location for a particle over time");
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "co");
RNA_def_property_ui_text(prop, "Location", "Key location");
- prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
+ prop = RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "vel");
RNA_def_property_ui_text(prop, "Velocity", "Key velocity");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
+ prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Rotation", "Key rotation quaternion");
- prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_VELOCITY);
+ prop = RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "ave");
RNA_def_property_ui_text(prop, "Angular Velocity", "Key angular velocity");
- prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_ui_text(prop, "Time", "Time of key over the simulation");
}
static void rna_def_child_particle(BlenderRNA *brna)
{
StructRNA *srna;
- //PropertyRNA *prop;
+ /*PropertyRNA *prop; */
srna = RNA_def_struct(brna, "ChildParticle", NULL);
RNA_def_struct_ui_text(srna, "Child Particle", "Child particle interpolated from simulated or edited particles");
-// int num, parent; /* num is face index on the final derived mesh */
+/* int num, parent; *//* num is face index on the final derived mesh */
-// int pa[4]; /* nearest particles to the child, used for the interpolation */
-// float w[4]; /* interpolation weights for the above particles */
-// float fuv[4], foffset; /* face vertex weights and offset */
-// float rand[3];
+/* int pa[4]; *//* nearest particles to the child, used for the interpolation */
+/* float w[4]; *//* interpolation weights for the above particles */
+/* float fuv[4], foffset; *//* face vertex weights and offset */
+/* float rand[3]; */
}
static void rna_def_particle(BlenderRNA *brna)
@@ -973,7 +973,7 @@ static void rna_def_particle(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem alive_items[] = {
- //{PARS_KILLED, "KILLED", 0, "Killed", ""},
+ /*{PARS_KILLED, "KILLED", 0, "Killed", ""}, */
{PARS_DEAD, "DEAD", 0, "Dead", ""},
{PARS_UNBORN, "UNBORN", 0, "Unborn", ""},
{PARS_ALIVE, "ALIVE", 0, "Alive", ""},
@@ -986,95 +986,95 @@ static void rna_def_particle(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Particle", "Particle in a particle system");
/* Particle State & Previous State */
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "state.co");
RNA_def_property_ui_text(prop, "Particle Location", "");
- prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
+ prop = RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "state.vel");
RNA_def_property_ui_text(prop, "Particle Velocity", "");
- prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_VELOCITY);
+ prop = RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "state.ave");
RNA_def_property_ui_text(prop, "Angular Velocity", "");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
+ prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "state.rot");
RNA_def_property_ui_text(prop, "Rotation", "");
- prop= RNA_def_property(srna, "prev_location", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "prev_location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "prev_state.co");
RNA_def_property_ui_text(prop, "Previous Particle Location", "");
- prop= RNA_def_property(srna, "prev_velocity", PROP_FLOAT, PROP_VELOCITY);
+ prop = RNA_def_property(srna, "prev_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "prev_state.vel");
RNA_def_property_ui_text(prop, "Previous Particle Velocity", "");
- prop= RNA_def_property(srna, "prev_angular_velocity", PROP_FLOAT, PROP_VELOCITY);
+ prop = RNA_def_property(srna, "prev_angular_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "prev_state.ave");
RNA_def_property_ui_text(prop, "Previous Angular Velocity", "");
- prop= RNA_def_property(srna, "prev_rotation", PROP_FLOAT, PROP_QUATERNION);
+ prop = RNA_def_property(srna, "prev_rotation", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "prev_state.rot");
RNA_def_property_ui_text(prop, "Previous Rotation", "");
/* Hair & Keyed Keys */
- prop= RNA_def_property(srna, "hair_keys", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "hair_keys", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "hair", "totkey");
RNA_def_property_struct_type(prop, "ParticleHairKey");
RNA_def_property_ui_text(prop, "Hair", "");
- prop= RNA_def_property(srna, "particle_keys", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "particle_keys", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "keys", "totkey");
RNA_def_property_struct_type(prop, "ParticleKey");
RNA_def_property_ui_text(prop, "Keyed States", "");
-//
-// float fuv[4], foffset; /* coordinates on face/edge number "num" and depth along*/
-// /* face normal for volume emission */
+/* */
+/* float fuv[4], foffset; *//* coordinates on face/edge number "num" and depth along*/
+/* *//* face normal for volume emission */
- prop= RNA_def_property(srna, "birth_time", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "birth_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "time");
-// RNA_def_property_range(prop, lowerLimitf, upperLimitf);
+/* RNA_def_property_range(prop, lowerLimitf, upperLimitf); */
RNA_def_property_ui_text(prop, "Birth Time", "");
- prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
-// RNA_def_property_range(prop, lowerLimitf, upperLimitf);
+ prop = RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
+/* RNA_def_property_range(prop, lowerLimitf, upperLimitf); */
RNA_def_property_ui_text(prop, "Lifetime", "");
- prop= RNA_def_property(srna, "die_time", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "die_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "dietime");
-// RNA_def_property_range(prop, lowerLimitf, upperLimitf);
+/* RNA_def_property_range(prop, lowerLimitf, upperLimitf); */
RNA_def_property_ui_text(prop, "Die Time", "");
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
-// RNA_def_property_range(prop, lowerLimitf, upperLimitf);
+ prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+/* RNA_def_property_range(prop, lowerLimitf, upperLimitf); */
RNA_def_property_ui_text(prop, "Size", "");
-//
-// int num; /* index to vert/edge/face */
-// int num_dmcache; /* index to derived mesh data (face) to avoid slow lookups */
-// int pad;
-//
-// int totkey;
+/* */
+/* int num; *//* index to vert/edge/face */
+/* int num_dmcache; *//* index to derived mesh data (face) to avoid slow lookups */
+/* int pad; */
+/* */
+/* int totkey; */
/* flag */
- prop= RNA_def_property(srna, "is_exist", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_exist", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PARS_UNEXIST);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Exists", "");
- prop= RNA_def_property(srna, "is_visible", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_visible", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PARS_NO_DISP);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Visible", "");
- prop= RNA_def_property(srna, "alive_state", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "alive_state", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "alive");
RNA_def_property_enum_items(prop, alive_items);
RNA_def_property_ui_text(prop, "Alive State", "");
-// short rt2;
+/* short rt2; */
}
static void rna_def_particle_dupliweight(BlenderRNA *brna)
@@ -1086,13 +1086,13 @@ static void rna_def_particle_dupliweight(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Particle Dupliobject Weight", "Weight of a particle dupliobject in a group");
RNA_def_struct_sdna(srna, "ParticleDupliWeight");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleDupliWeight_name_get", "rna_ParticleDupliWeight_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "Particle dupliobject name");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "count", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "count", PROP_INT, PROP_UNSIGNED);
RNA_def_property_range(prop, 0, SHRT_MAX);
RNA_def_property_ui_text(prop, "Count", "The number of times this object is repeated with respect to other objects");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
@@ -1108,61 +1108,61 @@ static void rna_def_fluid_settings(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "SPH Fluid Settings", "Settings for particle fluids physics");
/* Fluid settings */
- prop= RNA_def_property(srna, "spring_force", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "spring_force", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spring_k");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_ui_text(prop, "Spring Force", "Spring force");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "fluid_radius", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "fluid_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "radius");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
RNA_def_property_ui_text(prop, "Interaction Radius", "Fluid interaction radius");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Rest Length", "Spring rest length (factor of particle radius)");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_viscoelastic_springs", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_viscoelastic_springs", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_VISCOELASTIC_SPRINGS);
RNA_def_property_ui_text(prop, "Viscoelastic Springs", "Use viscoelastic springs instead of Hooke's springs");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_initial_rest_length", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_initial_rest_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_CURRENT_REST_LENGTH);
RNA_def_property_ui_text(prop, "Initial Rest Length", "Use the initial length as spring rest length instead of 2 * particle size");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "plasticity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "plasticity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "plasticity_constant");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Plasticity", "How much the spring rest length can change after the elastic limit is crossed");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "yield_ratio", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "yield_ratio", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yield_ratio");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Elastic Limit", "How much the spring has to be stretched/compressed in order to change it's rest length");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "spring_frames", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "spring_frames", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Spring Frames", "Create springs for this number of frames since particles birth (0 is always)");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* Viscosity */
- prop= RNA_def_property(srna, "linear_viscosity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "linear_viscosity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "viscosity_omega");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_ui_text(prop, "Viscosity", "Linear viscosity");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "stiff_viscosity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "stiff_viscosity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "viscosity_beta");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
@@ -1170,21 +1170,21 @@ static void rna_def_fluid_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* Double density relaxation */
- prop= RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness_k");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_ui_text(prop, "Stiffness", "How incompressible the fluid is");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "repulsion", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "repulsion", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness_knear");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
RNA_def_property_ui_text(prop, "Repulsion Factor", "How strongly the fluid tries to keep from clustering (factor of stiffness)");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "rest_density", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "rest_density", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rest_density");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
@@ -1192,7 +1192,7 @@ static void rna_def_fluid_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* Buoyancy */
- prop= RNA_def_property(srna, "buoyancy", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "buoyancy", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "buoyancy");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
@@ -1201,27 +1201,27 @@ static void rna_def_fluid_settings(BlenderRNA *brna)
/* Factor flags */
- prop= RNA_def_property(srna, "factor_repulsion", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "factor_repulsion", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_FAC_REPULSION);
RNA_def_property_ui_text(prop, "Factor Repulsion", "Repulsion is a factor of stiffness");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "factor_density", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "factor_density", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_FAC_DENSITY);
RNA_def_property_ui_text(prop, "Factor Density", "Density is calculated as a factor of default density (depends on particle size)");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "factor_radius", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "factor_radius", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_FAC_RADIUS);
RNA_def_property_ui_text(prop, "Factor Radius", "Interaction radius is a factor of 4 * particle size");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "factor_stiff_viscosity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "factor_stiff_viscosity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_FAC_VISCOSITY);
RNA_def_property_ui_text(prop, "Factor Stiff Viscosity", "Stiff viscosity is a factor of normal viscosity");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "factor_rest_length", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "factor_rest_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_FAC_REST_LENGTH);
RNA_def_property_ui_text(prop, "Factor Rest Length", "Spring rest length is a factor of 2 * particle size");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
@@ -1268,183 +1268,183 @@ static void rna_def_particle_settings_mtex(BlenderRNA *brna)
{3, "Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ParticleSettingsTextureSlot", "TextureSlot");
+ srna = RNA_def_struct(brna, "ParticleSettingsTextureSlot", "TextureSlot");
RNA_def_struct_sdna(srna, "MTex");
RNA_def_struct_ui_text(srna, "Particle Settings Texture Slot", "Texture slot for textures in a Particle Settings datablock");
- prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texco");
RNA_def_property_enum_items(prop, texco_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", "Texture coordinates used to map the texture onto the background");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvname");
RNA_def_property_ui_text(prop, "UV Map", "UV map to use for mapping with UV texture coordinates");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "mapping_x", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping_x", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projx");
RNA_def_property_enum_items(prop, prop_x_mapping_items);
RNA_def_property_ui_text(prop, "X Mapping", "");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projy");
RNA_def_property_enum_items(prop, prop_y_mapping_items);
RNA_def_property_ui_text(prop, "Y Mapping", "");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projz");
RNA_def_property_enum_items(prop, prop_z_mapping_items);
RNA_def_property_ui_text(prop, "Z Mapping", "");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_mapping_items);
RNA_def_property_ui_text(prop, "Mapping", "");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* map to */
- prop= RNA_def_property(srna, "use_map_time", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_TIME);
RNA_def_property_ui_text(prop, "Emission Time", "Affect the emission time of the particles");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_map_life", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_life", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_LIFE);
RNA_def_property_ui_text(prop, "Life Time", "Affect the life time of the particles");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_map_density", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_density", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_DENS);
RNA_def_property_ui_text(prop, "Density", "Affect the density of the particles");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_map_size", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_SIZE);
RNA_def_property_ui_text(prop, "Size", "Affect the particle size");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_map_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_IVEL);
RNA_def_property_ui_text(prop, "Initial Velocity", "Affect the particle initial velocity");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_map_field", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_field", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_FIELD);
RNA_def_property_ui_text(prop, "Force Field", "Affect the particle force fields");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_map_gravity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_gravity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_GRAVITY);
RNA_def_property_ui_text(prop, "Gravity", "Affect the particle gravity");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_map_damp", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_damp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_DAMP);
RNA_def_property_ui_text(prop, "Damp", "Affect the particle velocity damping");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "use_map_clump", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_clump", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_CLUMP);
RNA_def_property_ui_text(prop, "Clump", "Affect the child clumping");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_map_kink", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_kink", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_KINK);
RNA_def_property_ui_text(prop, "Kink", "Affect the child kink");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "use_map_rough", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_rough", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_ROUGH);
RNA_def_property_ui_text(prop, "Rough", "Affect the child rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "use_map_length", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_LENGTH);
RNA_def_property_ui_text(prop, "Length", "Affect the child hair length");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
/* influence factors */
- prop= RNA_def_property(srna, "time_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "time_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "timefac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Emission Time Factor", "Amount texture affects particle emission time");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "life_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "life_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "lifefac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Life Time Factor", "Amount texture affects particle life time");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "density_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "density_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "padensfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Density Factor", "Amount texture affects particle density");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "size_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "size_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sizefac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Size Factor", "Amount texture affects physical particle size");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ivelfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Velocity Factor", "Amount texture affects particle initial velocity");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "field_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "field_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fieldfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Field Factor", "Amount texture affects particle force fields");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "gravity_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "gravity_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "gravityfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Gravity Factor", "Amount texture affects particle gravity");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "damp_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "damp_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dampfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Damp Factor", "Amount texture affects particle damping");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "length_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "length_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "lengthfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Length Factor", "Amount texture affects child hair length");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "clump_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "clump_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clumpfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Clump Factor", "Amount texture affects child clump");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "kink_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "kink_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "kinkfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Kink Factor", "Amount texture affects child kink");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "rough_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "rough_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "roughfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Rough Factor", "Amount texture affects child roughness");
@@ -1458,7 +1458,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
static EnumPropertyItem type_items[] = {
{PART_EMITTER, "EMITTER", 0, "Emitter", ""},
- //{PART_REACTOR, "REACTOR", 0, "Reactor", ""},
+ /*{PART_REACTOR, "REACTOR", 0, "Reactor", ""}, */
{PART_HAIR, "HAIR", 0, "Hair", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -1506,7 +1506,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- //TODO: names, tooltips
+ /*TODO: names, tooltips */
#if 0
static EnumPropertyItem rot_from_items[] = {
{PART_ROT_KEYS, "KEYS", 0, "keys", ""},
@@ -1571,7 +1571,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- srna= RNA_def_struct(brna, "ParticleSettings", "ID");
+ srna = RNA_def_struct(brna, "ParticleSettings", "ID");
RNA_def_struct_ui_text(srna, "Particle Settings", "Particle settings, reusable by multiple particle systems");
RNA_def_struct_ui_icon(srna, ICON_PARTICLE_DATA);
@@ -1579,129 +1579,129 @@ static void rna_def_particle_settings(BlenderRNA *brna)
"rna_ParticleSettings_active_texture_set", NULL, "ParticleSettingsTextureSlot", "ParticleSettingsTextureSlots", "rna_Particle_reset");
/* fluid particle type can't be checked from the type value in rna as it's not shown in the menu */
- prop= RNA_def_property(srna, "is_fluid", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_fluid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_PartSettings_is_fluid_get", NULL);
RNA_def_property_ui_text(prop, "Fluid", "Particles were created by a fluid simulation");
/* flag */
- prop= RNA_def_property(srna, "use_react_start_end", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_react_start_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_STA_END);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Start/End", "Give birth to unreacted particles eventually");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_react_multiple", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_react_multiple", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_MULTIPLE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Multi React", "React multiple times");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "regrow_hair", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "regrow_hair", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_HAIR_REGROW);
RNA_def_property_ui_text(prop, "Regrow", "Regrow hair for each frame");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_UNBORN);
RNA_def_property_ui_text(prop, "Unborn", "Show particles before they are emitted");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "use_dead", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_dead", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIED);
RNA_def_property_ui_text(prop, "Died", "Show particles after they have died");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "use_emit_random", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_emit_random", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_TRAND);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Random", "Emit in random order of elements");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_even_distribution", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_even_distribution", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_EDISTR);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Even Distribution", "Use even distribution from faces based on face areas or edge lengths");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_die_on_collision", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_die_on_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIE_ON_COL);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Die on hit", "Particles die when they collide with a deflector object");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_size_deflect", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_size_deflect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZE_DEFL);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Size Deflect", "Use particle's size in deflection");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_dynamic_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_dynamic_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ROT_DYN);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Dynamic", "Set rotation to dynamic/constant");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_multiply_size_mass", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_multiply_size_mass", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZEMASS);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Mass from Size", "Multiply mass by particle size");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_advanced_hair", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_advanced_hair", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PART_HIDE_ADVANCED_HAIR);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Advanced", "Use full physics calculations for growing hair");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "lock_boids_to_surface", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_boids_to_surface", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BOIDS_2D);
RNA_def_property_ui_text(prop, "Boids 2D", "Constrain boids to a surface");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "use_hair_bspline", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_hair_bspline", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_HAIR_BSPLINE);
RNA_def_property_ui_text(prop, "B-Spline", "Interpolate hair using B-Splines");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "invert_grid", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_grid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GRID_INVERT);
RNA_def_property_ui_text(prop, "Invert Grid", "Invert what is considered object and what is not");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "hexagonal_grid", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hexagonal_grid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GRID_HEXAGONAL);
RNA_def_property_ui_text(prop, "Hexagonal Grid", "Create the grid in a hexagonal pattern");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "apply_effector_to_children", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "apply_effector_to_children", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_EFFECT);
RNA_def_property_ui_text(prop, "Effect Children", "Apply effectors to children");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "create_long_hair_children", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "create_long_hair_children", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_LONG_HAIR);
RNA_def_property_ui_text(prop, "Long Hair", "Calculate children that suit long hair well");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "apply_guide_to_children", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "apply_guide_to_children", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_GUIDE);
RNA_def_property_ui_text(prop, "apply_guide_to_children", "");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "use_self_effect", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_self_effect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SELF_EFFECT);
RNA_def_property_ui_text(prop, "Self Effect", "Particle effectors effect themselves");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Type", "Particle Type");
RNA_def_property_update(prop, 0, "rna_Particle_change_type");
- prop= RNA_def_property(srna, "emit_from", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "emit_from", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "from");
RNA_def_property_enum_items(prop, part_reactor_from_items);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -1709,7 +1709,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Emit From", "Where to emit particles from");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "distr");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, part_dist_items);
@@ -1719,28 +1719,28 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* physics modes */
- prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "phystype");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, phys_type_items);
RNA_def_property_ui_text(prop, "Physics Type", "Particle physics type");
RNA_def_property_update(prop, 0, "rna_Particle_change_physics");
- prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rotmode");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, rot_mode_items);
RNA_def_property_ui_text(prop, "Rotation", "Particle rotation axis");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "angular_velocity_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "angular_velocity_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "avemode");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, ave_mode_items);
RNA_def_property_ui_text(prop, "Angular Velocity Mode", "Particle angular velocity mode");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "react_event", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "react_event", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "reactevent");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, react_event_items);
@@ -1748,232 +1748,232 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/*draw flag*/
- prop= RNA_def_property(srna, "show_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL);
RNA_def_property_ui_text(prop, "Velocity", "Show particle velocity");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "show_size", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_SIZE);
RNA_def_property_ui_text(prop, "Size", "Show particle size");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "use_render_emitter", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_render_emitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_EMITTER);
RNA_def_property_ui_text(prop, "Emitter", "Render emitter Object also");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "show_health", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_health", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_HEALTH);
RNA_def_property_ui_text(prop, "Health", "Draw boid health");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "use_absolute_path_time", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_absolute_path_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_ABS_PATH_TIME);
RNA_def_property_ui_text(prop, "Absolute Path Time", "Path timing is in absolute frames");
RNA_def_property_update(prop, 0, "rna_Particle_abspathtime_update");
- prop= RNA_def_property(srna, "use_parent_particles", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_parent_particles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_PARENT);
RNA_def_property_ui_text(prop, "Parents", "Render parent particles");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "show_number", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_number", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_NUM);
RNA_def_property_ui_text(prop, "Number", "Show particle number");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "use_group_pick_random", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_group_pick_random", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_RAND_GR);
RNA_def_property_ui_text(prop, "Pick Random", "Pick objects from group randomly");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "use_group_count", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_group_count", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_COUNT_GR);
RNA_def_property_ui_text(prop, "Use Count", "Use object multiple times in the same group");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "use_global_dupli", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_global_dupli", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_GLOBAL_OB);
RNA_def_property_ui_text(prop, "Global", "Use object's global coordinates for duplication");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "use_rotation_dupli", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_rotation_dupli", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_ROTATE_OB);
RNA_def_property_ui_text(prop, "Rotation", "Use object's rotation for duplication (global x-axis is aligned particle rotation axis)");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "use_render_adaptive", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_render_adaptive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_ADAPT);
RNA_def_property_ui_text(prop, "Adaptive render", "Draw steps of the particle path");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "use_velocity_length", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_velocity_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL_LENGTH);
RNA_def_property_ui_text(prop, "Speed", "Multiply line length by particle speed");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "use_whole_group", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_whole_group", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_WHOLE_GR);
RNA_def_property_ui_text(prop, "Whole Group", "Use whole group at once");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "use_strand_primitive", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_strand_primitive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_STRAND);
RNA_def_property_ui_text(prop, "Strand render", "Use the strand primitive for rendering");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "draw_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "draw_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "draw_as");
RNA_def_property_enum_items(prop, part_draw_as_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_draw_as_itemf");
RNA_def_property_ui_text(prop, "Particle Drawing", "How particles are drawn in viewport");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "render_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "render_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ren_as");
RNA_def_property_enum_items(prop, part_ren_as_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_ren_as_itemf");
RNA_def_property_ui_text(prop, "Particle Rendering", "How particles are rendered");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "draw_color", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "draw_color", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "draw_col");
RNA_def_property_enum_items(prop, draw_col_items);
RNA_def_property_ui_text(prop, "Draw Color", "Draw additional particle data as a color");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "draw_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "draw_size", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_range(prop, 0, 100, 1, 0);
RNA_def_property_ui_text(prop, "Draw Size", "Size of particles on viewport in pixels (0=default)");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "child_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "child_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "childtype");
RNA_def_property_enum_items(prop, child_type_items);
RNA_def_property_ui_text(prop, "Children From", "Create child particles");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_range(prop, 0, 7, 1, 0);
RNA_def_property_ui_text(prop, "Steps", "How many steps paths are drawn with (power of 2)");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "render_step", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "render_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ren_step");
RNA_def_property_range(prop, 0, 20);
RNA_def_property_ui_range(prop, 0, 9, 1, 0);
RNA_def_property_ui_text(prop, "Render", "How many steps paths are rendered with (power of 2)");
- prop= RNA_def_property(srna, "hair_step", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "hair_step", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 2, 50);
RNA_def_property_ui_text(prop, "Segments", "Number of hair segments");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- //TODO: not found in UI, readonly?
- prop= RNA_def_property(srna, "keys_step", PROP_INT, PROP_NONE);
- RNA_def_property_range(prop, 0, SHRT_MAX);//TODO:min,max
+ /*TODO: not found in UI, readonly? */
+ prop = RNA_def_property(srna, "keys_step", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, 0, SHRT_MAX);/*TODO:min,max */
RNA_def_property_ui_text(prop, "Keys Step", "");
/* adaptive path rendering */
- prop= RNA_def_property(srna, "adaptive_angle", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "adaptive_angle", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "adapt_angle");
RNA_def_property_range(prop, 0, 45);
RNA_def_property_ui_text(prop, "Degrees", "How many degrees path has to curve to make another render segment");
- prop= RNA_def_property(srna, "adaptive_pixel", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "adaptive_pixel", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "adapt_pix");
RNA_def_property_range(prop, 0, 50);
RNA_def_property_ui_text(prop, "Pixel", "How many pixels path has to cover to make another render segment");
- prop= RNA_def_property(srna, "draw_percentage", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "draw_percentage", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "disp");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Display", "Percentage of particles to display in 3D view");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "material", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "material", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "omat");
RNA_def_property_range(prop, 1, 32767);
RNA_def_property_ui_text(prop, "Material", "Material used for the particles");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- // not used anywhere, why is this in DNA???
+ /* not used anywhere, why is this in DNA??? */
#if 0
- prop= RNA_def_property(srna, "rotate_from", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "rotate_from", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rotfrom");
RNA_def_property_enum_items(prop, rot_from_items);
RNA_def_property_ui_text(prop, "Rotate From", "");
#endif
- prop= RNA_def_property(srna, "integrator", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "integrator", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, integrator_type_items);
RNA_def_property_ui_text(prop, "Integration",
"Algorithm used to calculate physics, from the fastest to the "
"most stable/accurate: Midpoint, Euler, Verlet, RK4 (Old)");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "kink", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "kink", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, kink_type_items);
RNA_def_property_ui_text(prop, "Kink", "Type of periodic offset on the path");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "kink_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "kink_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, kink_axis_items);
RNA_def_property_ui_text(prop, "Axis", "Which axis to use for offset");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
/* billboards */
- prop= RNA_def_property(srna, "lock_billboard", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_billboard", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_BB_LOCK);
RNA_def_property_ui_text(prop, "Lock Billboard", "Lock the billboards align axis");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "billboard_align", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "billboard_align", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "bb_align");
RNA_def_property_enum_items(prop, bb_align_items);
RNA_def_property_ui_text(prop, "Align to", "In respect to what the billboards are aligned");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "billboard_uv_split", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "billboard_uv_split", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "bb_uv_split");
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_range(prop, 1, 10, 1, 0);
RNA_def_property_ui_text(prop, "UV Split", "Number of rows/columns to split UV coordinates for billboards");
- prop= RNA_def_property(srna, "billboard_animation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "billboard_animation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "bb_anim");
RNA_def_property_enum_items(prop, bb_anim_items);
RNA_def_property_ui_text(prop, "Animate", "How to animate billboard textures");
- prop= RNA_def_property(srna, "billboard_offset_split", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "billboard_offset_split", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "bb_split_offset");
RNA_def_property_enum_items(prop, bb_split_offset_items);
RNA_def_property_ui_text(prop, "Offset", "How to offset billboard textures");
- prop= RNA_def_property(srna, "billboard_tilt", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "billboard_tilt", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bb_tilt");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Tilt", "Tilt of the billboards");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "color_maximum", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "color_maximum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "color_vec_max");
RNA_def_property_range(prop, 0.01f, 100.0f);
RNA_def_property_ui_text(prop, "Color Maximum", "Maximum length of the particle color vector");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "billboard_tilt_random", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "billboard_tilt_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bb_rand_tilt");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Tilt", "Random tilt of the billboards");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "billboard_offset", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "billboard_offset", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "bb_offset");
RNA_def_property_array(prop, 2);
RNA_def_property_range(prop, -100.0f, 100.0f);
@@ -1981,61 +1981,61 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Billboard Offset", "");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "billboard_size", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "billboard_size", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "bb_size");
RNA_def_property_array(prop, 2);
RNA_def_property_range(prop, 0.001f, 10.0f);
RNA_def_property_ui_text(prop, "Billboard Scale", "Scale billboards relative to particle size");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "billboard_velocity_head", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "billboard_velocity_head", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "bb_vel_head");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Billboard Velocity Head", "Scale billboards by velocity");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "billboard_velocity_tail", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "billboard_velocity_tail", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "bb_vel_tail");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Billboard Velocity Tail", "Scale billboards by velocity");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
/* simplification */
- prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", PART_SIMPLIFY_ENABLE);
RNA_def_property_ui_text(prop, "Child Simplification", "Remove child strands as the object becomes smaller on the screen");
- prop= RNA_def_property(srna, "use_simplify_viewport", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_simplify_viewport", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", PART_SIMPLIFY_VIEWPORT);
RNA_def_property_ui_text(prop, "Viewport", "");
- prop= RNA_def_property(srna, "simplify_refsize", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "simplify_refsize", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "simplify_refsize");
RNA_def_property_range(prop, 1, 32768);
RNA_def_property_ui_text(prop, "Reference Size", "Reference size in pixels, after which simplification begins");
- prop= RNA_def_property(srna, "simplify_rate", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "simplify_rate", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Rate", "Speed of simplification");
- prop= RNA_def_property(srna, "simplify_transition", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "simplify_transition", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Transition", "Transition period for fading out strands");
- prop= RNA_def_property(srna, "simplify_viewport", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "simplify_viewport", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 0.999f);
RNA_def_property_ui_text(prop, "Rate", "Speed of Simplification");
/* general values */
- prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "sta");//optional if prop names are the same
+ prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "sta");/*optional if prop names are the same */
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_start_set", NULL);
RNA_def_property_ui_text(prop, "Start", "Frame number to start emitting particles");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "end");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
@@ -2044,61 +2044,61 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "End", "Frame number to stop emitting particles");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
RNA_def_property_range(prop, 1.0f, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Lifetime", "Life span of the particles");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "lifetime_random", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "lifetime_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "randlife");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random", "Give the particle life a random variation");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "time_tweak", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "time_tweak", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "timetweak");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_range(prop, 0, 10, 1, 3);
RNA_def_property_ui_text(prop, "Tweak", "A multiplier for physics timestep (1.0 means one frame = 1/25 seconds)");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "timestep", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "timestep", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_PartSettings_timestep_get", "rna_PartSetings_timestep_set", NULL);
RNA_def_property_range(prop, 0.0001, 100.0);
RNA_def_property_ui_range(prop, 0.01, 10, 1, 3);
RNA_def_property_ui_text(prop, "Timestep", "The simulation timestep per frame (seconds per frame)");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "adaptive_subframes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "adaptive_subframes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "time_flag", PART_TIME_AUTOSF);
RNA_def_property_ui_text(prop, "Automatic Subframes", "Automatically set the number of subframes");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "subframes", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "subframes", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop, "Subframes", "Subframes to simulate for improved stability and finer granularity simulations (dt = timestep / (subframes + 1))");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "courant_target", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "courant_target", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 10);
RNA_def_property_float_default(prop, 0.2);
RNA_def_property_ui_text(prop, "Adaptive Subframe Threshold", "The relative distance a particle can move before requiring more subframes (target Courant number); 0.1-0.3 is the recommended range");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "jitter_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "jitter_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_float_sdna(prop, NULL, "jitfac");
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Amount", "Amount of jitter applied to the sampling");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "effect_hair", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "effect_hair", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "eff_hair");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Stiffness", "Hair stiffness for effectors");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "count", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "count", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "totpart");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
/* This limit is for those freaks who have the machine power to handle it. */
@@ -2109,14 +2109,14 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Number", "Total number of particles");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED);//TODO: can we get a better name for userjit?
+ prop = RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED);/*TODO: can we get a better name for userjit? */
RNA_def_property_int_sdna(prop, NULL, "userjit");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop, "P/F", "Emission locations / face (0 = automatic)");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "grid_resolution", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "grid_resolution", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "grid_res");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1, 250); /* ~15M particles in a cube (ouch!), but could be very usable in a plane */
@@ -2124,13 +2124,13 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Resolution", "The resolution of the particle grid");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "grid_random", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "grid_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "grid_rand");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Grid Randomness", "Add random offset to the grid locations");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "effector_amount", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "effector_amount", PROP_INT, PROP_UNSIGNED);
/* in theory PROP_ANIMATABLE perhaps should be cleared, but animating this can give some interesting results! */
RNA_def_property_range(prop, 0, 10000); /* 10000 effectors will bel SLOW, but who knows */
RNA_def_property_ui_range(prop, 0, 100, 1, 0);
@@ -2138,54 +2138,54 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* initial velocity factors */
- prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "normfac");//optional if prop names are the same
+ prop = RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "normfac");/*optional if prop names are the same */
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_range(prop, 0, 100, 1, 3);
RNA_def_property_ui_text(prop, "Normal", "Let the surface normal give the particle a starting speed");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "object_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "object_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "obfac");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Object", "Let the object give the particle a starting speed");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "factor_random", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "randfac");//optional if prop names are the same
+ prop = RNA_def_property(srna, "factor_random", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "randfac");/*optional if prop names are the same */
RNA_def_property_range(prop, 0.0f, 200.0f);
RNA_def_property_ui_range(prop, 0, 100, 1, 3);
RNA_def_property_ui_text(prop, "Random", "Give the starting speed a random variation");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "particle_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "particle_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "partfac");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Particle", "Let the target particle give the particle a starting speed");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "tangent_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "tangent_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "tanfac");
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_range(prop, -100, 100, 1, 2);
RNA_def_property_ui_text(prop, "Tangent", "Let the surface tangent give the particle a starting speed");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "tangent_phase", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "tangent_phase", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "tanphase");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Rot", "Rotate the surface tangent");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "reactor_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "reactor_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "reactfac");
RNA_def_property_range(prop, -10.0f, 10.0f);
RNA_def_property_ui_text(prop, "Reactor", "Let the vector away from the target particle's location give the particle a starting speed");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "object_align_factor", PROP_FLOAT, PROP_VELOCITY);
+ prop = RNA_def_property(srna, "object_align_factor", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "ob_vel");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -200.0f, 200.0f);
@@ -2193,32 +2193,32 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Object Aligned", "Let the emitter object orientation give the particle a starting speed");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "angular_velocity_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "angular_velocity_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "avefac");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, -100, 100, 10, 3);
RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity amount");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "phase_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "phase_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "phasefac");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Phase", "Initial rotation phase");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "rotation_factor_random", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "rotation_factor_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "randrotfac");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Rotation", "Randomize rotation");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "phase_factor_random", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "phase_factor_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "randphasefac");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Phase", "Randomize rotation phase");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "hair_length", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "hair_length", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_PartSetting_hairlength_get", "rna_PartSetting_hairlength_set", NULL);
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
@@ -2226,20 +2226,20 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* physical properties */
- prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001f, 100000.0f);
RNA_def_property_ui_range(prop, 0.01, 100, 1, 3);
RNA_def_property_ui_text(prop, "Mass", "Mass of the particles");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "particle_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "particle_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_range(prop, 0.001f, 100000.0f);
RNA_def_property_ui_range(prop, 0.01, 100, 1, 3);
RNA_def_property_ui_text(prop, "Size", "The size of the particles");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "size_random", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "size_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "randsize");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Size", "Give the particle size a random variation");
@@ -2247,85 +2247,85 @@ static void rna_def_particle_settings(BlenderRNA *brna)
/* global physical properties */
- prop= RNA_def_property(srna, "drag_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "drag_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dragfac");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Drag", "Amount of air-drag");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "brownian_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "brownian_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "brownfac");
RNA_def_property_range(prop, 0.0f, 200.0f);
RNA_def_property_ui_range(prop, 0, 20, 1, 3);
RNA_def_property_ui_text(prop, "Brownian", "Amount of Brownian motion");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dampfac");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Damp", "Amount of damping");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* random length */
- prop= RNA_def_property(srna, "length_random", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "length_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "randlength");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Length", "Give path length a random variation");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
/* children */
- prop= RNA_def_property(srna, "child_nbr", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "child_nbr");//optional if prop names are the same
+ prop = RNA_def_property(srna, "child_nbr", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "child_nbr");/*optional if prop names are the same */
RNA_def_property_range(prop, 0, 100000);
RNA_def_property_ui_range(prop, 0, 1000, 1, 0);
RNA_def_property_ui_text(prop, "Children Per Parent", "Number of children/parent");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "rendered_child_count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "rendered_child_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ren_child_nbr");
RNA_def_property_range(prop, 0, 100000);
RNA_def_property_ui_range(prop, 0, 10000, 1, 0);
RNA_def_property_ui_text(prop, "Rendered Children", "Number of children/parent for rendering");
- prop= RNA_def_property(srna, "virtual_parents", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "virtual_parents", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "parents");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Virtual Parents", "Relative amount of virtual parents");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "child_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "child_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "childsize");
RNA_def_property_range(prop, 0.001f, 100000.0f);
RNA_def_property_ui_range(prop, 0.01f, 100.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Child Size", "A multiplier for the child particle size");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "child_size_random", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "child_size_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "childrandsize");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Random Child Size", "Random variation to the size of the child particles");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "child_radius", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "child_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "childrad");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Child Radius", "Radius of children around parent");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "child_roundness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "child_roundness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "childflat");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Child Roundness", "Roundness of children around parent");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
/* clumping */
- prop= RNA_def_property(srna, "clump_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "clump_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clumpfac");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Clump", "Amount of clumping");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "clump_shape", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "clump_shape", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clumppow");
RNA_def_property_range(prop, -0.999f, 0.999f);
RNA_def_property_ui_text(prop, "Shape", "Shape of clumping");
@@ -2333,150 +2333,150 @@ static void rna_def_particle_settings(BlenderRNA *brna)
/* kink */
- prop= RNA_def_property(srna, "kink_amplitude", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "kink_amplitude", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "kink_amp");
RNA_def_property_range(prop, -100000.0f, 100000.0f);
RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Amplitude", "The amplitude of the offset");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "kink_amplitude_clump", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "kink_amplitude_clump", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "kink_amp_clump");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Amplitude Clump", "How much clump affects kink amplitude");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "kink_frequency", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "kink_frequency", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "kink_freq");
RNA_def_property_range(prop, -100000.0f, 100000.0f);
RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Frequency", "The frequency of the offset (1/total length)");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "kink_shape", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "kink_shape", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -0.999f, 0.999f);
RNA_def_property_ui_text(prop, "Shape", "Adjust the offset to the beginning/end");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "kink_flat", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "kink_flat", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Flatness", "How flat the hairs are");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
/* rough */
- prop= RNA_def_property(srna, "roughness_1", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "roughness_1", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rough1");
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Rough1", "Amount of location dependent rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "roughness_1_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "roughness_1_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rough1_size");
RNA_def_property_range(prop, 0.01f, 100000.0f);
RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Size1", "Size of location dependent rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "roughness_2", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "roughness_2", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rough2");
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Rough2", "Amount of random rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "roughness_2_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "roughness_2_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rough2_size");
RNA_def_property_range(prop, 0.01f, 100000.0f);
RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Size2", "Size of random rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "roughness_2_threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "roughness_2_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rough2_thres");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by random rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "roughness_endpoint", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "roughness_endpoint", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rough_end");
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Rough Endpoint", "Amount of end point rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "roughness_end_shape", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "roughness_end_shape", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rough_end_shape");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Shape", "Shape of end point rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "child_length", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "child_length", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clength");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Length", "Length of child paths");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "child_length_threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "child_length_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clength_thres");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by child path length");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
/* parting */
- prop= RNA_def_property(srna, "child_parting_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "child_parting_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "parting_fac");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Parting Factor", "Create parting in the children based on parent strands");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "child_parting_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "child_parting_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "parting_min");
RNA_def_property_range(prop, 0.0f, 180.0f);
RNA_def_property_ui_text(prop, "Parting Minimum", "Minimum root to tip angle (tip distance/root distance for long hair)");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "child_parting_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "child_parting_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "parting_max");
RNA_def_property_range(prop, 0.0f, 180.0f);
RNA_def_property_ui_text(prop, "Parting Maximum", "Maximum root to tip angle (tip distance/root distance for long hair)");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
/* branching */
- prop= RNA_def_property(srna, "branch_threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "branch_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "branch_thres");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Threshold", "Threshold of branching");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
/* drawing stuff */
- prop= RNA_def_property(srna, "line_length_tail", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "line_length_tail", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_PartSetting_linelentail_get", "rna_PartSetting_linelentail_set", NULL);
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Back", "Length of the line's tail");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "line_length_head", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "line_length_head", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_PartSetting_linelenhead_get", "rna_PartSetting_linelenhead_set", NULL);
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Head", "Length of the line's head");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "path_start", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "path_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "path_start");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range");
RNA_def_property_ui_text(prop, "Path Start", "Starting time of drawn path");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "path_end", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "path_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "path_end");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range");
RNA_def_property_ui_text(prop, "Path End", "End time of drawn path");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "trail_count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "trail_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "trail_count");
RNA_def_property_range(prop, 1, 100000);
RNA_def_property_ui_range(prop, 1, 100, 1, 0);
@@ -2484,7 +2484,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_redo");
/* keyed particles */
- prop= RNA_def_property(srna, "keyed_loops", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "keyed_loops", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "keyed_loops");
RNA_def_property_range(prop, 1.0f, 10000.0f);
RNA_def_property_ui_range(prop, 1.0f, 100.0f, 0.1, 3);
@@ -2492,35 +2492,35 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_redo");
/* draw objects & groups */
- prop= RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "dup_group");
RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Dupli Group", "Show Objects in this Group in place of particles");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "dupli_weights", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "dupli_weights", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "dupliweights", NULL);
RNA_def_property_struct_type(prop, "ParticleDupliWeight");
RNA_def_property_ui_text(prop, "Dupli Group Weights", "Weights for all of the objects in the dupli group");
- prop= RNA_def_property(srna, "active_dupliweight", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active_dupliweight", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ParticleDupliWeight");
RNA_def_property_pointer_funcs(prop, "rna_ParticleDupliWeight_active_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Dupli Object", "");
- prop= RNA_def_property(srna, "active_dupliweight_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "active_dupliweight_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_ParticleDupliWeight_active_index_get", "rna_ParticleDupliWeight_active_index_set", "rna_ParticleDupliWeight_active_index_range");
RNA_def_property_ui_text(prop, "Active Dupli Object Index", "");
- prop= RNA_def_property(srna, "dupli_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "dupli_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "dup_ob");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Dupli Object", "Show this Object in place of particles");
RNA_def_property_update(prop, 0, "rna_Particle_redo_dependency");
- prop= RNA_def_property(srna, "billboard_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "billboard_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "bb_ob");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -2528,19 +2528,19 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_redo");
/* boids */
- prop= RNA_def_property(srna, "boids", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "boids", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoidSettings");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Boid Settings", "");
/* Fluid particles */
- prop= RNA_def_property(srna, "fluid", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "fluid", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "SPHFluidSettings");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "SPH Fluid Settings", "");
/* Effector weights */
- prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EffectorWeights");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Effector Weights", "");
@@ -2548,13 +2548,13 @@ static void rna_def_particle_settings(BlenderRNA *brna)
/* animation here? */
rna_def_animdata_common(srna);
- prop= RNA_def_property(srna, "force_field_1", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "force_field_1", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pd");
RNA_def_property_struct_type(prop, "FieldSettings");
RNA_def_property_pointer_funcs(prop, "rna_Particle_field1_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Force Field 1", "");
- prop= RNA_def_property(srna, "force_field_2", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "force_field_2", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pd2");
RNA_def_property_struct_type(prop, "FieldSettings");
RNA_def_property_pointer_funcs(prop, "rna_Particle_field2_get", NULL, NULL, NULL);
@@ -2577,42 +2577,42 @@ static void rna_def_particle_target(BlenderRNA *brna)
srna = RNA_def_struct(brna, "ParticleTarget", NULL);
RNA_def_struct_ui_text(srna, "Particle Target", "Target particle system");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleTarget_name_get", "rna_ParticleTarget_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "Particle target name");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Target Object", "The object that has the target particle system (empty if same object)");
RNA_def_property_update(prop, 0, "rna_Particle_target_reset");
- prop= RNA_def_property(srna, "system", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "system", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "psys");
RNA_def_property_range(prop, 1, INT_MAX);
RNA_def_property_ui_text(prop, "Target Particle System", "The index of particle system on the target object");
RNA_def_property_update(prop, 0, "rna_Particle_target_reset");
- prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "time");
- RNA_def_property_range(prop, 0.0, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5
+ RNA_def_property_range(prop, 0.0, 30000.0f); /*TODO: replace 30000 with MAXFRAMEF when available in 2.5 */
RNA_def_property_ui_text(prop, "Time", "");
RNA_def_property_update(prop, 0, "rna_Particle_target_redo");
- prop= RNA_def_property(srna, "duration", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "duration", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "duration");
- RNA_def_property_range(prop, 0.0, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5
+ RNA_def_property_range(prop, 0.0, 30000.0f); /*TODO: replace 30000 with MAXFRAMEF when available in 2.5 */
RNA_def_property_ui_text(prop, "Duration", "");
RNA_def_property_update(prop, 0, "rna_Particle_target_redo");
- prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTARGET_VALID);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Valid", "Keyed particles target is valid");
- prop= RNA_def_property(srna, "alliance", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "alliance", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, mode_items);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -2625,11 +2625,11 @@ static void rna_def_particle_system(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ParticleSystem", NULL);
+ srna = RNA_def_struct(brna, "ParticleSystem", NULL);
RNA_def_struct_ui_text(srna, "Particle System", "Particle system in an object");
RNA_def_struct_ui_icon(srna, ICON_PARTICLE_DATA);
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Particle system name");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER|NA_RENAME, NULL);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ParticleSystem_name_set");
@@ -2637,44 +2637,44 @@ static void rna_def_particle_system(BlenderRNA *brna)
/* access to particle settings is redirected through functions */
/* to allow proper id-buttons functionality */
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
- //RNA_def_property_pointer_sdna(prop, NULL, "part");
+ prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ /*RNA_def_property_pointer_sdna(prop, NULL, "part"); */
RNA_def_property_struct_type(prop, "ParticleSettings");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
RNA_def_property_pointer_funcs(prop, "rna_particle_settings_get", "rna_particle_settings_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Settings", "Particle system settings");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "particles", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "particles", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "particles", "totpart");
RNA_def_property_struct_type(prop, "Particle");
RNA_def_property_ui_text(prop, "Particles", "Particles generated by the particle system");
- prop= RNA_def_property(srna, "child_particles", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "child_particles", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "child", "totchild");
RNA_def_property_struct_type(prop, "ChildParticle");
RNA_def_property_ui_text(prop, "Child Particles", "Child particles generated by the particle system");
- prop= RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
RNA_def_property_ui_text(prop, "Seed", "Offset in the random number table, to get a different randomized result");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "child_seed", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "child_seed", PROP_INT, PROP_UNSIGNED);
RNA_def_property_ui_text(prop, "Child Seed", "Offset in the random number table for child particles, to get a different randomized result");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
/* hair */
- prop= RNA_def_property(srna, "is_global_hair", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_global_hair", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_GLOBAL_HAIR);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Global Hair", "Hair keys are in global coordinate space");
- prop= RNA_def_property(srna, "use_hair_dynamics", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_hair_dynamics", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_HAIR_DYNAMICS);
RNA_def_property_ui_text(prop, "Hair Dynamics", "Enable hair dynamics using cloth simulation");
RNA_def_property_update(prop, 0, "rna_Particle_hair_dynamics");
- prop= RNA_def_property(srna, "cloth", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "cloth", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clmd");
RNA_def_property_struct_type(prop, "ClothModifier");
RNA_def_property_flag(prop, PROP_NEVER_NULL);
@@ -2682,51 +2682,51 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Cloth", "Cloth dynamics for hair");
/* reactor */
- prop= RNA_def_property(srna, "reactor_target_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "reactor_target_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "target_ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Reactor Target Object", "For reactor systems, the object that has the target particle system (empty if same object)");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "reactor_target_particle_system", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "reactor_target_particle_system", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "target_psys");
RNA_def_property_range(prop, 1, SHRT_MAX);
RNA_def_property_ui_text(prop, "Reactor Target Particle System", "For reactor systems, index of particle system on the target object");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* keyed */
- prop= RNA_def_property(srna, "use_keyed_timing", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_keyed_timing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_KEYED_TIMING);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Keyed timing", "Use key times");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "ParticleTarget");
RNA_def_property_ui_text(prop, "Targets", "Target particle systems");
- prop= RNA_def_property(srna, "active_particle_target", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active_particle_target", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ParticleTarget");
RNA_def_property_pointer_funcs(prop, "rna_ParticleSystem_active_particle_target_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Particle Target", "");
- prop= RNA_def_property(srna, "active_particle_target_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "active_particle_target_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_ParticleSystem_active_particle_target_index_get", "rna_ParticleSystem_active_particle_target_index_set", "rna_ParticleSystem_active_particle_target_index_range");
RNA_def_property_ui_text(prop, "Active Particle Target Index", "");
/* billboard */
- prop= RNA_def_property(srna, "billboard_normal_uv", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "billboard_normal_uv", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "bb_uvname[0]");
RNA_def_property_string_maxlength(prop, 32);
RNA_def_property_ui_text(prop, "Billboard Normal UV", "UV map to control billboard normals");
- prop= RNA_def_property(srna, "billboard_time_index_uv", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "billboard_time_index_uv", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "bb_uvname[1]");
RNA_def_property_string_maxlength(prop, 32);
RNA_def_property_ui_text(prop, "Billboard Time Index UV", "UV map to control billboard time index (X-Y)");
- prop= RNA_def_property(srna, "billboard_split_uv", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "billboard_split_uv", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "bb_uvname[2]");
RNA_def_property_string_maxlength(prop, 32);
RNA_def_property_ui_text(prop, "Billboard Split UV", "UV map to control billboard splitting");
@@ -2734,159 +2734,159 @@ static void rna_def_particle_system(BlenderRNA *brna)
/* vertex groups */
/* note, internally store as ints, access as strings */
-#if 0 // int access. works ok but isnt useful for the UI
- prop= RNA_def_property(srna, "vertex_group_density", PROP_INT, PROP_NONE);
+#if 0 /* int access. works ok but isnt useful for the UI */
+ prop = RNA_def_property(srna, "vertex_group_density", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "vgroup[0]");
RNA_def_property_ui_text(prop, "Vertex Group Density", "Vertex group to control density");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
#endif
- prop= RNA_def_property(srna, "vertex_group_density", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_density", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_0", "rna_ParticleVGroup_name_len_0", "rna_ParticleVGroup_name_set_0");
RNA_def_property_ui_text(prop, "Vertex Group Density", "Vertex group to control density");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "invert_vertex_group_density", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group_density", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_DENSITY));
RNA_def_property_ui_text(prop, "Vertex Group Density Negate", "Negate the effect of the density vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "vertex_group_velocity", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_velocity", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_1", "rna_ParticleVGroup_name_len_1", "rna_ParticleVGroup_name_set_1");
RNA_def_property_ui_text(prop, "Vertex Group Velocity", "Vertex group to control velocity");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "invert_vertex_group_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_VEL));
RNA_def_property_ui_text(prop, "Vertex Group Velocity Negate", "Negate the effect of the velocity vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "vertex_group_length", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_length", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_2", "rna_ParticleVGroup_name_len_2", "rna_ParticleVGroup_name_set_2");
RNA_def_property_ui_text(prop, "Vertex Group Length", "Vertex group to control length");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "invert_vertex_group_length", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_LENGTH));
RNA_def_property_ui_text(prop, "Vertex Group Length Negate", "Negate the effect of the length vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "vertex_group_clump", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_clump", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_3", "rna_ParticleVGroup_name_len_3", "rna_ParticleVGroup_name_set_3");
RNA_def_property_ui_text(prop, "Vertex Group Clump", "Vertex group to control clump");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "invert_vertex_group_clump", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group_clump", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_CLUMP));
RNA_def_property_ui_text(prop, "Vertex Group Clump Negate", "Negate the effect of the clump vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "vertex_group_kink", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_kink", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_4", "rna_ParticleVGroup_name_len_4", "rna_ParticleVGroup_name_set_4");
RNA_def_property_ui_text(prop, "Vertex Group Kink", "Vertex group to control kink");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "invert_vertex_group_kink", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group_kink", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_KINK));
RNA_def_property_ui_text(prop, "Vertex Group Kink Negate", "Negate the effect of the kink vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "vertex_group_roughness_1", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_roughness_1", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_5", "rna_ParticleVGroup_name_len_5", "rna_ParticleVGroup_name_set_5");
RNA_def_property_ui_text(prop, "Vertex Group Roughness 1", "Vertex group to control roughness 1");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "invert_vertex_group_roughness_1", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group_roughness_1", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH1));
RNA_def_property_ui_text(prop, "Vertex Group Roughness 1 Negate", "Negate the effect of the roughness 1 vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "vertex_group_roughness_2", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_roughness_2", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_6", "rna_ParticleVGroup_name_len_6", "rna_ParticleVGroup_name_set_6");
RNA_def_property_ui_text(prop, "Vertex Group Roughness 2", "Vertex group to control roughness 2");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "invert_vertex_group_roughness_2", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group_roughness_2", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH2));
RNA_def_property_ui_text(prop, "Vertex Group Roughness 2 Negate", "Negate the effect of the roughness 2 vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "vertex_group_roughness_end", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_roughness_end", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_7", "rna_ParticleVGroup_name_len_7", "rna_ParticleVGroup_name_set_7");
RNA_def_property_ui_text(prop, "Vertex Group Roughness End", "Vertex group to control roughness end");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "invert_vertex_group_roughness_end", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group_roughness_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGHE));
RNA_def_property_ui_text(prop, "Vertex Group Roughness End Negate", "Negate the effect of the roughness end vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
- prop= RNA_def_property(srna, "vertex_group_size", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_size", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_8", "rna_ParticleVGroup_name_len_8", "rna_ParticleVGroup_name_set_8");
RNA_def_property_ui_text(prop, "Vertex Group Size", "Vertex group to control size");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "invert_vertex_group_size", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_SIZE));
RNA_def_property_ui_text(prop, "Vertex Group Size Negate", "Negate the effect of the size vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "vertex_group_tangent", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_tangent", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_9", "rna_ParticleVGroup_name_len_9", "rna_ParticleVGroup_name_set_9");
RNA_def_property_ui_text(prop, "Vertex Group Tangent", "Vertex group to control tangent");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "invert_vertex_group_tangent", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group_tangent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_TAN));
RNA_def_property_ui_text(prop, "Vertex Group Tangent Negate", "Negate the effect of the tangent vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "vertex_group_rotation", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_rotation", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_10", "rna_ParticleVGroup_name_len_10", "rna_ParticleVGroup_name_set_10");
RNA_def_property_ui_text(prop, "Vertex Group Rotation", "Vertex group to control rotation");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "invert_vertex_group_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROT));
RNA_def_property_ui_text(prop, "Vertex Group Rotation Negate", "Negate the effect of the rotation vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "vertex_group_field", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_group_field", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_11", "rna_ParticleVGroup_name_len_11", "rna_ParticleVGroup_name_set_11");
RNA_def_property_ui_text(prop, "Vertex Group Field", "Vertex group to control field");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
- prop= RNA_def_property(srna, "invert_vertex_group_field", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_vertex_group_field", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_EFFECTOR));
RNA_def_property_ui_text(prop, "Vertex Group Field Negate", "Negate the effect of the field vertex group");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* pointcache */
- prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "pointcache");
RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_ui_text(prop, "Point Cache", "");
- prop= RNA_def_property(srna, "has_multiple_caches", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "has_multiple_caches", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_multiple_caches_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Multiple Caches", "Particle system has multiple point caches");
/* offset ob */
- prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "parent");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Parent", "Use this object's coordinate system instead of global coordinate system");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
/* hair or cache editing */
- prop= RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_editable_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Editable", "Particle system can be edited in particle mode");
- prop= RNA_def_property(srna, "is_edited", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_edited", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_edited_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Edited", "Particle system has been edited in particle mode");
@@ -2894,7 +2894,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
/* Read-only: this is calculated internally. Changing it would only affect
* the next time-step. The user should change ParticlSettings.subframes or
* ParticleSettings.courant_target instead. */
- prop= RNA_def_property(srna, "dt_frac", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "dt_frac", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 1.0f/101.0f, 1.0f);
RNA_def_property_ui_text(prop, "Timestep", "The current simulation time step size, as a fraction of a frame");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -2914,7 +2914,7 @@ void RNA_def_particle(BlenderRNA *brna)
rna_def_particle_dupliweight(brna);
rna_def_particle_system(brna);
rna_def_particle_settings_mtex(brna);
- rna_def_particle_settings(brna);
+ rna_def_particle_settings(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 9ed3f8f186f..e1abcb052be 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -45,7 +45,7 @@
-// XXX: this RNA enum define is currently duplicated for objects, since there is some text here which is not applicable
+/* XXX: this RNA enum define is currently duplicated for objects, since there is some text here which is not applicable */
EnumPropertyItem posebone_rotmode_items[] = {
{ROT_MODE_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock (default)"},
{ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order (prone to Gimbal Lock)"},
@@ -86,15 +86,15 @@ EnumPropertyItem posebone_rotmode_items[] = {
static void rna_Pose_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- // XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
+ /* XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); */
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
}
static void rna_Pose_IK_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- // XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
- Object *ob= ptr->id.data;
+ /* XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); */
+ Object *ob = ptr->id.data;
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
BIK_clear_data(ob->pose);
@@ -107,11 +107,11 @@ static char *rna_PoseBone_path(PointerRNA *ptr)
static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value)
{
- bActionGroup *grp= ptr->data;
+ bActionGroup *grp = ptr->data;
/* if valid value, set the new enum value, then copy the relevant colors? */
if ((value >= -1) && (value < 21))
- grp->customCol= value;
+ grp->customCol = value;
else
return;
@@ -119,8 +119,8 @@ static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value)
if (grp->customCol) {
if (grp->customCol > 0) {
/* copy theme colors on-to group's custom color in case user tries to edit color */
- bTheme *btheme= U.themes.first;
- ThemeWireColor *col_set= &btheme->tarm[(grp->customCol - 1)];
+ bTheme *btheme = U.themes.first;
+ ThemeWireColor *col_set = &btheme->tarm[(grp->customCol - 1)];
memcpy(&grp->cs, col_set, sizeof(ThemeWireColor));
}
@@ -128,7 +128,7 @@ static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value)
/* init custom colors with a generic multi-color rgb set, if not initialised already (for custom color set) */
if (grp->cs.solid[0] == 0) {
/* define for setting colors in theme below */
- #define SETCOL(col, r, g, b, a) col[0]=r; col[1]=g; col[2]= b; col[3]= a;
+ #define SETCOL(col, r, g, b, a) col[0] = r; col[1] = g; col[2] = b; col[3] = a;
SETCOL(grp->cs.solid, 0xff, 0x00, 0x00, 255);
SETCOL(grp->cs.select, 0x81, 0xe6, 0x14, 255);
@@ -142,8 +142,8 @@ static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value)
void rna_BoneGroup_name_set(PointerRNA *ptr, const char *value)
{
- Object *ob= ptr->id.data;
- bActionGroup *agrp= ptr->data;
+ Object *ob = ptr->id.data;
+ bActionGroup *agrp = ptr->data;
/* copy the new name into the name slot */
BLI_strncpy_utf8(agrp->name, value, sizeof(agrp->name));
@@ -153,11 +153,11 @@ void rna_BoneGroup_name_set(PointerRNA *ptr, const char *value)
static IDProperty *rna_PoseBone_idprops(PointerRNA *ptr, int create)
{
- bPoseChannel *pchan= ptr->data;
+ bPoseChannel *pchan = ptr->data;
- if(create && !pchan->prop) {
+ if (create && !pchan->prop) {
IDPropertyTemplate val = {0};
- pchan->prop= IDP_New(IDP_GROUP, &val, "RNA_PoseBone group");
+ pchan->prop = IDP_New(IDP_GROUP, &val, "RNA_PoseBone group");
}
return pchan->prop;
@@ -165,10 +165,10 @@ static IDProperty *rna_PoseBone_idprops(PointerRNA *ptr, int create)
static void rna_Pose_ik_solver_set(struct PointerRNA *ptr, int value)
{
- bPose *pose= (bPose*)ptr->data;
+ bPose *pose = (bPose*)ptr->data;
if (pose->iksolver != value) {
- // the solver has changed, must clean any temporary structures
+ /* the solver has changed, must clean any temporary structures */
BIK_clear_data(pose);
if (pose->ikparam) {
MEM_freeN(pose->ikparam);
@@ -181,10 +181,10 @@ static void rna_Pose_ik_solver_set(struct PointerRNA *ptr, int value)
static void rna_Pose_ik_solver_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Object *ob= ptr->id.data;
+ Object *ob = ptr->id.data;
bPose *pose = ptr->data;
- pose->flag |= POSE_RECALC; // checks & sorts pose channels
+ pose->flag |= POSE_RECALC; /* checks & sorts pose channels */
DAG_scene_sort(bmain, scene);
update_pose_constraint_flags(pose);
@@ -197,40 +197,40 @@ static void rna_Pose_ik_solver_update(Main *bmain, Scene *scene, PointerRNA *ptr
/* rotation - axis-angle */
static void rna_PoseChannel_rotation_axis_angle_get(PointerRNA *ptr, float *value)
{
- bPoseChannel *pchan= ptr->data;
+ bPoseChannel *pchan = ptr->data;
/* for now, assume that rotation mode is axis-angle */
- value[0]= pchan->rotAngle;
+ value[0] = pchan->rotAngle;
copy_v3_v3(&value[1], pchan->rotAxis);
}
/* rotation - axis-angle */
static void rna_PoseChannel_rotation_axis_angle_set(PointerRNA *ptr, const float *value)
{
- bPoseChannel *pchan= ptr->data;
+ bPoseChannel *pchan = ptr->data;
/* for now, assume that rotation mode is axis-angle */
- pchan->rotAngle= value[0];
+ pchan->rotAngle = value[0];
copy_v3_v3(pchan->rotAxis, (float *)&value[1]);
- // TODO: validate axis?
+ /* TODO: validate axis? */
}
static void rna_PoseChannel_rotation_mode_set(PointerRNA *ptr, int value)
{
- bPoseChannel *pchan= ptr->data;
+ bPoseChannel *pchan = ptr->data;
/* use API Method for conversions... */
BKE_rotMode_change_values(pchan->quat, pchan->eul, pchan->rotAxis, &pchan->rotAngle, pchan->rotmode, (short)value);
/* finally, set the new rotation type */
- pchan->rotmode= value;
+ pchan->rotmode = value;
}
static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value)
{
- Object *ob= (Object*)ptr->id.data;
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ Object *ob = (Object*)ptr->id.data;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
char oldname[sizeof(pchan->name)], newname[sizeof(pchan->name)];
/* need to be on the stack */
@@ -242,8 +242,8 @@ static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value)
static int rna_PoseChannel_has_ik_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ Object *ob = (Object*)ptr->id.data;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
return ED_pose_channel_in_IK_chain(ob, pchan);
}
@@ -262,13 +262,13 @@ StructRNA *rna_IKParam_refine(PointerRNA *ptr)
PointerRNA rna_Pose_ikparam_get(struct PointerRNA *ptr)
{
- bPose *pose= (bPose*)ptr->data;
+ bPose *pose = (bPose*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_IKParam, pose->ikparam);
}
static StructRNA *rna_Pose_ikparam_typef(PointerRNA *ptr)
{
- bPose *pose= (bPose*)ptr->data;
+ bPose *pose = (bPose*)ptr->data;
switch (pose->iksolver) {
case IKSOLVER_ITASC:
@@ -305,10 +305,10 @@ static void rna_Itasc_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
static void rna_Itasc_update_rebuild(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Object *ob= ptr->id.data;
+ Object *ob = ptr->id.data;
bPose *pose = ob->pose;
- pose->flag |= POSE_RECALC; // checks & sorts pose channels
+ pose->flag |= POSE_RECALC; /* checks & sorts pose channels */
rna_Itasc_update(bmain, scene, ptr);
}
@@ -329,174 +329,174 @@ static void rna_PoseChannel_bone_custom_set(PointerRNA *ptr, PointerRNA value)
static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- bPose *pose= (ob) ? ob->pose : NULL;
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ Object *ob = (Object*)ptr->id.data;
+ bPose *pose = (ob) ? ob->pose : NULL;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
bActionGroup *grp;
if (pose)
- grp= BLI_findlink(&pose->agroups, pchan->agrp_index-1);
+ grp = BLI_findlink(&pose->agroups, pchan->agrp_index-1);
else
- grp= NULL;
+ grp = NULL;
return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, grp);
}
static void rna_PoseChannel_bone_group_set(PointerRNA *ptr, PointerRNA value)
{
- Object *ob= (Object*)ptr->id.data;
- bPose *pose= (ob) ? ob->pose : NULL;
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ Object *ob = (Object*)ptr->id.data;
+ bPose *pose = (ob) ? ob->pose : NULL;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
if (pose)
- pchan->agrp_index= BLI_findindex(&pose->agroups, value.data) + 1;
+ pchan->agrp_index = BLI_findindex(&pose->agroups, value.data) + 1;
else
- pchan->agrp_index= 0;
+ pchan->agrp_index = 0;
}
static int rna_PoseChannel_bone_group_index_get(PointerRNA *ptr)
{
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
return MAX2(pchan->agrp_index-1, 0);
}
static void rna_PoseChannel_bone_group_index_set(PointerRNA *ptr, int value)
{
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
- pchan->agrp_index= value+1;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
+ pchan->agrp_index = value+1;
}
static void rna_PoseChannel_bone_group_index_range(PointerRNA *ptr, int *min, int *max)
{
- Object *ob= (Object*)ptr->id.data;
- bPose *pose= (ob) ? ob->pose : NULL;
+ Object *ob = (Object*)ptr->id.data;
+ bPose *pose = (ob) ? ob->pose : NULL;
- *min= 0;
+ *min = 0;
if (pose) {
- *max= BLI_countlist(&pose->agroups)-1;
- *max= MAX2(0, *max);
+ *max = BLI_countlist(&pose->agroups)-1;
+ *max = MAX2(0, *max);
}
else
- *max= 0;
+ *max = 0;
}
static PointerRNA rna_Pose_active_bone_group_get(PointerRNA *ptr)
{
- bPose *pose= (bPose*)ptr->data;
+ bPose *pose = (bPose*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, BLI_findlink(&pose->agroups, pose->active_group-1));
}
static void rna_Pose_active_bone_group_set(PointerRNA *ptr, PointerRNA value)
{
- bPose *pose= (bPose*)ptr->data;
- pose->active_group= BLI_findindex(&pose->agroups, value.data) + 1;
+ bPose *pose = (bPose*)ptr->data;
+ pose->active_group = BLI_findindex(&pose->agroups, value.data) + 1;
}
static int rna_Pose_active_bone_group_index_get(PointerRNA *ptr)
{
- bPose *pose= (bPose*)ptr->data;
+ bPose *pose = (bPose*)ptr->data;
return MAX2(pose->active_group-1, 0);
}
static void rna_Pose_active_bone_group_index_set(PointerRNA *ptr, int value)
{
- bPose *pose= (bPose*)ptr->data;
- pose->active_group= value+1;
+ bPose *pose = (bPose*)ptr->data;
+ pose->active_group = value+1;
}
static void rna_Pose_active_bone_group_index_range(PointerRNA *ptr, int *min, int *max)
{
- bPose *pose= (bPose*)ptr->data;
+ bPose *pose = (bPose*)ptr->data;
- *min= 0;
- *max= BLI_countlist(&pose->agroups)-1;
- *max= MAX2(0, *max);
+ *min = 0;
+ *max = BLI_countlist(&pose->agroups)-1;
+ *max = MAX2(0, *max);
}
#if 0
static void rna_pose_bgroup_name_index_get(PointerRNA *ptr, char *value, int index)
{
- bPose *pose= (bPose*)ptr->data;
+ bPose *pose = (bPose*)ptr->data;
bActionGroup *grp;
- grp= BLI_findlink(&pose->agroups, index-1);
+ grp = BLI_findlink(&pose->agroups, index-1);
- if(grp) BLI_strncpy(value, grp->name, sizeof(grp->name));
- else value[0]= '\0';
+ if (grp) BLI_strncpy(value, grp->name, sizeof(grp->name));
+ else value[0] = '\0';
}
static int rna_pose_bgroup_name_index_length(PointerRNA *ptr, int index)
{
- bPose *pose= (bPose*)ptr->data;
+ bPose *pose = (bPose*)ptr->data;
bActionGroup *grp;
- grp= BLI_findlink(&pose->agroups, index-1);
+ grp = BLI_findlink(&pose->agroups, index-1);
return (grp)? strlen(grp->name): 0;
}
static void rna_pose_bgroup_name_index_set(PointerRNA *ptr, const char *value, short *index)
{
- bPose *pose= (bPose*)ptr->data;
+ bPose *pose = (bPose*)ptr->data;
bActionGroup *grp;
int a;
- for (a=1, grp=pose->agroups.first; grp; grp=grp->next, a++) {
+ for (a = 1, grp = pose->agroups.first; grp; grp = grp->next, a++) {
if (strcmp(grp->name, value) == 0) {
- *index= a;
+ *index = a;
return;
}
}
- *index= 0;
+ *index = 0;
}
static void rna_pose_pgroup_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
{
- bPose *pose= (bPose*)ptr->data;
+ bPose *pose = (bPose*)ptr->data;
bActionGroup *grp;
- for (grp= pose->agroups.first; grp; grp= grp->next) {
+ for (grp = pose->agroups.first; grp; grp = grp->next) {
if (strcmp(grp->name, value) == 0) {
BLI_strncpy(result, value, maxlen);
return;
}
}
- result[0]= '\0';
+ result[0] = '\0';
}
#endif
static PointerRNA rna_PoseChannel_active_constraint_get(PointerRNA *ptr)
{
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
- bConstraint *con= constraints_get_active(&pchan->constraints);
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
+ bConstraint *con = constraints_get_active(&pchan->constraints);
return rna_pointer_inherit_refine(ptr, &RNA_Constraint, con);
}
static void rna_PoseChannel_active_constraint_set(PointerRNA *ptr, PointerRNA value)
{
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
constraints_set_active(&pchan->constraints, (bConstraint *)value.data);
}
static bConstraint *rna_PoseChannel_constraints_new(bPoseChannel *pchan, int type)
{
- //WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object);
- // TODO, pass object also
- // TODO, new pose bones don't have updated draw flags
+ /*WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object); */
+ /* TODO, pass object also */
+ /* TODO, new pose bones don't have updated draw flags */
return add_pose_constraint(NULL, pchan, NULL, type);
}
static void rna_PoseChannel_constraints_remove(ID *id, bPoseChannel *pchan, ReportList *reports, bConstraint *con)
{
- if(BLI_findindex(&pchan->constraints, con) == -1) {
+ if (BLI_findindex(&pchan->constraints, con) == -1) {
BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in pose bone '%s'", con->name, pchan->name);
return;
}
else {
- Object *ob= (Object *)id;
- const short is_ik= ELEM(con->type, CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_SPLINEIK);
+ Object *ob = (Object *)id;
+ const short is_ik = ELEM(con->type, CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_SPLINEIK);
remove_constraint(&pchan->constraints, con);
ED_object_constraint_update(ob);
@@ -511,16 +511,16 @@ static void rna_PoseChannel_constraints_remove(ID *id, bPoseChannel *pchan, Repo
static int rna_PoseChannel_proxy_editable(PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- bArmature *arm= ob->data;
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ Object *ob = (Object*)ptr->id.data;
+ bArmature *arm = ob->data;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
return (ob->proxy && pchan->bone && (pchan->bone->layer & arm->layer_protected))? 0: PROP_EDITABLE;
}
static int rna_PoseChannel_location_editable(PointerRNA *ptr, int index)
{
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
/* only if the axis in question is locked, not editable... */
if ((index == 0) && (pchan->protectflag & OB_LOCK_LOCX))
@@ -535,7 +535,7 @@ static int rna_PoseChannel_location_editable(PointerRNA *ptr, int index)
static int rna_PoseChannel_scale_editable(PointerRNA *ptr, int index)
{
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
/* only if the axis in question is locked, not editable... */
if ((index == 0) && (pchan->protectflag & OB_LOCK_SCALEX))
@@ -550,7 +550,7 @@ static int rna_PoseChannel_scale_editable(PointerRNA *ptr, int index)
static int rna_PoseChannel_rotation_euler_editable(PointerRNA *ptr, int index)
{
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
/* only if the axis in question is locked, not editable... */
if ((index == 0) && (pchan->protectflag & OB_LOCK_ROTX))
@@ -565,7 +565,7 @@ static int rna_PoseChannel_rotation_euler_editable(PointerRNA *ptr, int index)
static int rna_PoseChannel_rotation_4d_editable(PointerRNA *ptr, int index)
{
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
/* only consider locks if locking components individually... */
if (pchan->protectflag & OB_LOCK_ROT4D) {
@@ -586,9 +586,9 @@ static int rna_PoseChannel_rotation_4d_editable(PointerRNA *ptr, int index)
/* not essential, but much faster then the default lookup function */
int rna_PoseBones_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
{
- bPose *pose= (bPose*)ptr->data;
- bPoseChannel *pchan= get_pose_channel(pose, key);
- if(pchan) {
+ bPose *pose = (bPose*)ptr->data;
+ bPoseChannel *pchan = get_pose_channel(pose, key);
+ if (pchan) {
RNA_pointer_create(ptr->id.data, &RNA_PoseBone, pchan, r_ptr);
return TRUE;
}
@@ -599,20 +599,20 @@ int rna_PoseBones_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_
static void rna_PoseChannel_matrix_basis_get(PointerRNA *ptr, float *values)
{
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
pchan_to_mat4(pchan, (float (*)[4])values);
}
static void rna_PoseChannel_matrix_basis_set(PointerRNA *ptr, const float *values)
{
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
pchan_apply_mat4(pchan, (float (*)[4])values, FALSE); /* no compat for predictable result */
}
static void rna_PoseChannel_matrix_set(PointerRNA *ptr, const float *values)
{
- bPoseChannel *pchan= (bPoseChannel*)ptr->data;
- Object *ob= (Object*)ptr->id.data;
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
+ Object *ob = (Object*)ptr->id.data;
float tmat[4][4];
armature_mat_pose_to_bone_ex(ob, pchan, (float (*)[4])values, tmat);
@@ -653,29 +653,29 @@ static void rna_def_bone_group(BlenderRNA *brna)
PropertyRNA *prop;
/* struct */
- srna= RNA_def_struct(brna, "BoneGroup", NULL);
+ srna = RNA_def_struct(brna, "BoneGroup", NULL);
RNA_def_struct_sdna(srna, "bActionGroup");
RNA_def_struct_ui_text(srna, "Bone Group", "Groups of Pose Channels (Bones)");
RNA_def_struct_ui_icon(srna, ICON_GROUP_BONE);
/* name */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_BoneGroup_name_set");
RNA_def_struct_name_property(srna, prop);
- // TODO: add some runtime-collections stuff to access grouped bones
+ /* TODO: add some runtime-collections stuff to access grouped bones */
/* color set + colors */
- prop= RNA_def_property(srna, "color_set", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "color_set", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "customCol");
RNA_def_property_enum_items(prop, prop_colorSets_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_BoneGroup_color_set_set", NULL);
RNA_def_property_ui_text(prop, "Color Set", "Custom color set to use");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
- // TODO: editing the colors for this should result in changes to the color type...
- prop= RNA_def_property(srna, "colors", PROP_POINTER, PROP_NONE);
+ /* TODO: editing the colors for this should result in changes to the color type... */
+ prop = RNA_def_property(srna, "colors", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
RNA_def_property_pointer_sdna(prop, NULL, "cs"); /* NOTE: the DNA data is not really a pointer, but this code works :) */
@@ -703,12 +703,12 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro
PropertyRNA *parm;
RNA_def_property_srna(cprop, "PoseBoneConstraints");
- srna= RNA_def_struct(brna, "PoseBoneConstraints", NULL);
+ srna = RNA_def_struct(brna, "PoseBoneConstraints", NULL);
RNA_def_struct_sdna(srna, "bPoseChannel");
RNA_def_struct_ui_text(srna, "PoseBone Constraints", "Collection of pose bone constraints");
/* Collection active property */
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Constraint");
RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_active_constraint_get",
"rna_PoseChannel_active_constraint_set", NULL, NULL);
@@ -717,49 +717,49 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro
/* Constraint collection */
- func= RNA_def_function(srna, "new", "rna_PoseChannel_constraints_new");
+ func = RNA_def_function(srna, "new", "rna_PoseChannel_constraints_new");
RNA_def_function_ui_description(func, "Add a constraint to this object");
/* return type */
- parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint");
+ parm = RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint");
RNA_def_function_return(func, parm);
/* constraint to add */
- parm= RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add");
+ parm = RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "remove", "rna_PoseChannel_constraints_remove");
+ func = RNA_def_function(srna, "remove", "rna_PoseChannel_constraints_remove");
RNA_def_function_ui_description(func, "Remove a constraint from this object");
RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID); /* ID needed for refresh */
/* constraint to remove */
- parm= RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint");
+ parm = RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
static void rna_def_pose_channel(BlenderRNA *brna)
-{
+{
static float default_quat[4] = {1,0,0,0}; /* default quaternion values */
static float default_axisAngle[4] = {0,0,1,0}; /* default axis-angle rotation values */
static float default_scale[3] = {1,1,1}; /* default scale values */
- const int matrix_dimsize[]= {4, 4};
+ const int matrix_dimsize[] = {4, 4};
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "PoseBone", NULL);
+ srna = RNA_def_struct(brna, "PoseBone", NULL);
RNA_def_struct_sdna(srna, "bPoseChannel");
RNA_def_struct_ui_text(srna, "Pose Bone", "Channel defining pose data for a bone in a Pose");
RNA_def_struct_path_func(srna, "rna_PoseBone_path");
RNA_def_struct_idprops_func(srna, "rna_PoseBone_idprops");
/* Bone Constraints */
- prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Constraint");
RNA_def_property_ui_text(prop, "Constraints", "Constraints that act on this PoseChannel");
rna_def_pose_channel_constraints(brna, prop);
/* Name + Selection Status */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_PoseChannel_name_set");
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
@@ -769,83 +769,83 @@ static void rna_def_pose_channel(BlenderRNA *brna)
rna_def_motionpath_common(srna);
/* Relationships to other bones */
- prop= RNA_def_property(srna, "bone", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "bone", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "Bone");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bone", "Bone associated with this PoseBone");
- prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "PoseBone");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Parent", "Parent of this pose bone");
- prop= RNA_def_property(srna, "child", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "child", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "PoseBone");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Child", "Child of this pose bone");
/* Transformation settings */
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_location_editable");
RNA_def_property_ui_text(prop, "Location", "");
- RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); // XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too
+ RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); /* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
- prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_scale_editable");
RNA_def_property_float_array_default(prop, default_scale);
RNA_def_property_ui_text(prop, "Scale", "");
- RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); // XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too
+ RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); /* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
- prop= RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
+ prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "quat");
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable");
RNA_def_property_float_array_default(prop, default_quat);
RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions");
- RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); // XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too
+ RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); /* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
/* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but
* having a single one is better for Keyframing and other property-management situations...
*/
- prop= RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
+ prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
RNA_def_property_array(prop, 4);
RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_angle_get",
"rna_PoseChannel_rotation_axis_angle_set", NULL);
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable");
RNA_def_property_float_array_default(prop, default_axisAngle);
RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation");
- RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); // XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too
+ RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); /* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
- prop= RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
+ prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "eul");
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_euler_editable");
- RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); // XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too
+ RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); /* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
- prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rotmode");
- RNA_def_property_enum_items(prop, posebone_rotmode_items); // XXX move to using a single define of this someday
+ RNA_def_property_enum_items(prop, posebone_rotmode_items); /* XXX move to using a single define of this someday */
RNA_def_property_enum_funcs(prop, NULL, "rna_PoseChannel_rotation_mode_set", NULL);
- RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); // XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too
+ RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); /* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
RNA_def_property_ui_text(prop, "Rotation Mode", "");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
/* transform matrices - should be read-only since these are set directly by AnimSys evaluation */
- prop= RNA_def_property(srna, "matrix_channel", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "matrix_channel", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "chan_mat");
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Channel Matrix", "4x4 matrix, before constraints");
/* writable because it touches loc/scale/rot directly */
- prop= RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_ui_text(prop, "Basis Matrix",
"Alternative access to location/scale/rotation relative to the parent and own rest bone");
@@ -854,7 +854,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
/* final matrix */
- prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "pose_mat");
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_float_funcs(prop, NULL, "rna_PoseChannel_matrix_set", NULL);
@@ -862,149 +862,149 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
/* Head/Tail Coordinates (in Pose Space) - Automatically calculated... */
- prop= RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "pose_head");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Pose Head Position", "Location of head of the channel's bone");
- prop= RNA_def_property(srna, "tail", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "tail", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "pose_tail");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Pose Tail Position", "Location of tail of the channel's bone");
/* IK Settings */
- prop= RNA_def_property(srna, "is_in_ik_chain", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_in_ik_chain", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "lock_ik_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_ik_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF);
RNA_def_property_ui_text(prop, "IK X Lock", "Disallow movement around the X axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "lock_ik_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_ik_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF);
RNA_def_property_ui_text(prop, "IK Y Lock", "Disallow movement around the Y axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "lock_ik_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_ik_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF);
RNA_def_property_ui_text(prop, "IK Z Lock", "Disallow movement around the Z axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "use_ik_limit_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_ik_limit_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_XLIMIT);
RNA_def_property_ui_text(prop, "IK X Limit", "Limit movement around the X axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "use_ik_limit_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_ik_limit_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_YLIMIT);
RNA_def_property_ui_text(prop, "IK Y Limit", "Limit movement around the Y axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "use_ik_limit_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_ik_limit_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ZLIMIT);
RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "use_ik_rotation_control", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_ik_rotation_control", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ROTCTL);
RNA_def_property_ui_text(prop, "IK rot control", "Apply channel rotation as IK constraint");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "use_ik_linear_control", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_ik_linear_control", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_LINCTL);
RNA_def_property_ui_text(prop, "IK rot control", "Apply channel size as IK constraint if stretching is enabled");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[0]");
RNA_def_property_range(prop, -M_PI, 0.0f);
RNA_def_property_ui_text(prop, "IK X Minimum", "Minimum angles for IK Limit");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "ik_max_x", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "ik_max_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[0]");
RNA_def_property_range(prop, 0.0f, M_PI);
RNA_def_property_ui_text(prop, "IK X Maximum", "Maximum angles for IK Limit");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "ik_min_y", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "ik_min_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[1]");
RNA_def_property_range(prop, -M_PI, 0.0f);
RNA_def_property_ui_text(prop, "IK Y Minimum", "Minimum angles for IK Limit");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "ik_max_y", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "ik_max_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[1]");
RNA_def_property_range(prop, 0.0f, M_PI);
RNA_def_property_ui_text(prop, "IK Y Maximum", "Maximum angles for IK Limit");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "ik_min_z", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "ik_min_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[2]");
RNA_def_property_range(prop, -M_PI, 0.0f);
RNA_def_property_ui_text(prop, "IK Z Minimum", "Minimum angles for IK Limit");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "ik_max_z", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "ik_max_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[2]");
RNA_def_property_range(prop, 0.0f, M_PI);
RNA_def_property_ui_text(prop, "IK Z Maximum", "Maximum angles for IK Limit");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "ik_stiffness_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ik_stiffness_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness[0]");
RNA_def_property_range(prop, 0.0f, 0.99f);
RNA_def_property_ui_text(prop, "IK X Stiffness", "IK stiffness around the X axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "ik_stiffness_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ik_stiffness_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness[1]");
RNA_def_property_range(prop, 0.0f, 0.99f);
RNA_def_property_ui_text(prop, "IK Y Stiffness", "IK stiffness around the Y axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "ik_stiffness_z", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ik_stiffness_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness[2]");
RNA_def_property_range(prop, 0.0f, 0.99f);
RNA_def_property_ui_text(prop, "IK Z Stiffness", "IK stiffness around the Z axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "ik_stretch", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ik_stretch", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ikstretch");
RNA_def_property_range(prop, 0.0f,1.0f);
RNA_def_property_ui_text(prop, "IK Stretch", "Allow scaling of the bone for IK");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
- prop= RNA_def_property(srna, "ik_rotation_weight", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ik_rotation_weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ikrotweight");
RNA_def_property_range(prop, 0.0f,1.0f);
RNA_def_property_ui_text(prop, "IK Rot Weight", "Weight of rotation constraint for IK");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
- prop= RNA_def_property(srna, "ik_linear_weight", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ik_linear_weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "iklinweight");
RNA_def_property_range(prop, 0.0f,1.0f);
RNA_def_property_ui_text(prop, "IK Lin Weight", "Weight of scale constraint for IK");
@@ -1012,7 +1012,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
/* custom bone shapes */
- prop= RNA_def_property(srna, "custom_shape", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "custom_shape", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "custom");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -1021,7 +1021,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
- prop= RNA_def_property(srna, "custom_shape_transform", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "custom_shape_transform", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "custom_tx");
RNA_def_property_struct_type(prop, "PoseBone");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -1030,7 +1030,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
/* bone groups */
- prop= RNA_def_property(srna, "bone_group_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "bone_group_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "agrp_index");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -1040,7 +1040,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
- prop= RNA_def_property(srna, "bone_group", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "bone_group", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoneGroup");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_bone_group_get", "rna_PoseChannel_bone_group_set", NULL, NULL);
@@ -1049,7 +1049,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
/* transform locks */
- prop= RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_XYZ);
+ prop = RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location in the interface");
@@ -1057,7 +1057,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
- prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_XYZ);
+ prop = RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface");
@@ -1065,8 +1065,8 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
- // XXX this is sub-optimal - it really should be included above, but due to technical reasons we can't do this!
- prop= RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE);
+ /* XXX this is sub-optimal - it really should be included above, but due to technical reasons we can't do this! */
+ prop = RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTW);
RNA_def_property_ui_text(prop, "Lock Rotation (4D Angle)",
"Lock editing of 'angle' component of four-component rotations in the interface");
@@ -1074,15 +1074,15 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
- // XXX this needs a better name
- prop= RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE);
+ /* XXX this needs a better name */
+ prop = RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROT4D);
RNA_def_property_ui_text(prop, "Lock Rotations (4D)",
"Lock editing of four component rotations by components (instead of as Eulers)");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
- prop= RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_XYZ);
+ prop = RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_SCALEX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface");
@@ -1095,13 +1095,13 @@ static void rna_def_pose_channel(BlenderRNA *brna)
static void rna_def_pose_itasc(BlenderRNA *brna)
{
- static const EnumPropertyItem prop_itasc_mode_items[]= {
+ static const EnumPropertyItem prop_itasc_mode_items[] = {
{0, "ANIMATION", 0, "Animation",
"Stateless solver computing pose starting from current action and non-IK constraints"},
{ITASC_SIMULATION, "SIMULATION", 0, "Simulation",
"Statefull solver running in real-time context and ignoring actions and non-IK constraints"},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem prop_itasc_reiteration_items[]= {
+ static const EnumPropertyItem prop_itasc_reiteration_items[] = {
{0, "NEVER", 0, "Never", "The solver does not reiterate, not even on first frame (starts from rest pose)"},
{ITASC_INITIAL_REITERATION, "INITIAL", 0, "Initial",
"The solver reiterates (converges) on the first frame but not on subsequent frame"},
@@ -1112,35 +1112,35 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Itasc", "IKParam");
+ srna = RNA_def_struct(brna, "Itasc", "IKParam");
RNA_def_struct_sdna(srna, "bItasc");
RNA_def_struct_ui_text(srna, "bItasc", "Parameters for the iTaSC IK solver");
- prop= RNA_def_property(srna, "precision", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "precision", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "precision");
RNA_def_property_range(prop, 0.0f,0.1f);
RNA_def_property_ui_text(prop, "Precision", "Precision of convergence in case of reiteration");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
- prop= RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "numiter");
RNA_def_property_range(prop, 1.f,1000.f);
RNA_def_property_ui_text(prop, "Iterations", "Maximum number of iterations for convergence in case of reiteration");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
- prop= RNA_def_property(srna, "step_count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "step_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "numstep");
RNA_def_property_range(prop, 1.f, 50.f);
RNA_def_property_ui_text(prop, "Num steps", "Divide the frame interval into this many steps");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_itasc_mode_items);
RNA_def_property_ui_text(prop, "Mode", NULL);
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update_rebuild");
- prop= RNA_def_property(srna, "reiteration_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "reiteration_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_itasc_reiteration_items);
RNA_def_property_ui_text(prop, "Reiteration",
@@ -1148,44 +1148,44 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
"precision is met) on none, first or all frames");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
- prop= RNA_def_property(srna, "use_auto_step", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_step", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ITASC_AUTO_STEP);
RNA_def_property_ui_text(prop, "Auto step",
"Automatically determine the optimal number of steps for best performance/accuracy trade off");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
- prop= RNA_def_property(srna, "step_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "step_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minstep");
RNA_def_property_range(prop, 0.0f,0.1f);
RNA_def_property_ui_text(prop, "Min step", "Lower bound for timestep in second in case of automatic substeps");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
- prop= RNA_def_property(srna, "step_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "step_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxstep");
RNA_def_property_range(prop, 0.0f,1.0f);
RNA_def_property_ui_text(prop, "Max step", "Higher bound for timestep in second in case of automatic substeps");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
- prop= RNA_def_property(srna, "feedback", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "feedback", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "feedback");
RNA_def_property_range(prop, 0.0f,100.0f);
RNA_def_property_ui_text(prop, "Feedback",
"Feedback coefficient for error correction, average response time is 1/feedback (default=20)");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
- prop= RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxvel");
RNA_def_property_range(prop, 0.0f,100.0f);
RNA_def_property_ui_text(prop, "Max Velocity", "Maximum joint velocity in rad/s (default=50)");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
- prop= RNA_def_property(srna, "solver", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "solver", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "solver");
RNA_def_property_enum_items(prop, prop_solver_items);
RNA_def_property_ui_text(prop, "Solver", "Solving method selection: automatic damping or manual damping");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update_rebuild");
- prop= RNA_def_property(srna, "damping_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "damping_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dampmax");
RNA_def_property_range(prop, 0.0f,1.0f);
RNA_def_property_ui_text(prop, "Damp",
@@ -1193,7 +1193,7 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
"(higher values=more stability, less reactivity - default=0.5)");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
- prop= RNA_def_property(srna, "damping_epsilon", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "damping_epsilon", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dampeps");
RNA_def_property_range(prop, 0.0f,1.0f);
RNA_def_property_ui_text(prop, "Epsilon",
@@ -1207,12 +1207,12 @@ static void rna_def_pose_ikparam(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "IKParam", NULL);
+ srna = RNA_def_struct(brna, "IKParam", NULL);
RNA_def_struct_sdna(srna, "bIKParam");
RNA_def_struct_ui_text(srna, "IKParam", "Base type for IK solver parameters");
RNA_def_struct_refine_func(srna, "rna_IKParam_refine");
- prop= RNA_def_property(srna, "ik_solver", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "ik_solver", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "iksolver");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, prop_iksolver_items);
@@ -1225,22 +1225,22 @@ static void rna_def_bone_groups(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna;
PropertyRNA *prop;
-// FunctionRNA *func;
-// PropertyRNA *parm;
+/* FunctionRNA *func; */
+/* PropertyRNA *parm; */
RNA_def_property_srna(cprop, "BoneGroups");
- srna= RNA_def_struct(brna, "BoneGroups", NULL);
+ srna = RNA_def_struct(brna, "BoneGroups", NULL);
RNA_def_struct_sdna(srna, "bPose");
RNA_def_struct_ui_text(srna, "Bone Groups", "Collection of bone groups");
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoneGroup");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, "rna_Pose_active_bone_group_get", "rna_Pose_active_bone_group_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Active Bone Group", "Active bone group for this pose");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "active_group");
RNA_def_property_int_funcs(prop, "rna_Pose_active_bone_group_index_get", "rna_Pose_active_bone_group_index_set",
"rna_Pose_active_bone_group_index_range");
@@ -1254,25 +1254,25 @@ static void rna_def_pose(BlenderRNA *brna)
PropertyRNA *prop;
/* struct definition */
- srna= RNA_def_struct(brna, "Pose", NULL);
+ srna = RNA_def_struct(brna, "Pose", NULL);
RNA_def_struct_sdna(srna, "bPose");
RNA_def_struct_ui_text(srna, "Pose", "A collection of pose channels, including settings for animating bones");
/* pose channels */
- prop= RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "chanbase", NULL);
RNA_def_property_struct_type(prop, "PoseBone");
RNA_def_property_ui_text(prop, "Pose Bones", "Individual pose bones for the armature");
RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, "rna_PoseBones_lookup_string", NULL); /* can be removed, only for fast lookup */
/* bone groups */
- prop= RNA_def_property(srna, "bone_groups", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "bone_groups", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "agroups", NULL);
RNA_def_property_struct_type(prop, "BoneGroup");
RNA_def_property_ui_text(prop, "Bone Groups", "Groups of the bones");
rna_def_bone_groups(brna, prop);
/* ik solvers */
- prop= RNA_def_property(srna, "ik_solver", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "ik_solver", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "iksolver");
RNA_def_property_enum_funcs(prop, NULL, "rna_Pose_ik_solver_set", NULL);
RNA_def_property_enum_items(prop, prop_iksolver_items);
@@ -1280,7 +1280,7 @@ static void rna_def_pose(BlenderRNA *brna)
"Selection of IK solver for IK chain, current choice is 0 for Legacy, 1 for iTaSC");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_ik_solver_update");
- prop= RNA_def_property(srna, "ik_param", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "ik_param", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "IKParam");
RNA_def_property_pointer_funcs(prop, "rna_Pose_ikparam_get", NULL, "rna_Pose_ikparam_typef", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
diff --git a/source/blender/makesrna/intern/rna_pose_api.c b/source/blender/makesrna/intern/rna_pose_api.c
index b8eda7828d5..2720b992874 100644
--- a/source/blender/makesrna/intern/rna_pose_api.c
+++ b/source/blender/makesrna/intern/rna_pose_api.c
@@ -68,13 +68,13 @@ void RNA_api_pose_channel(StructRNA *srna)
PropertyRNA *parm;
FunctionRNA *func;
- func= RNA_def_function(srna, "evaluate_envelope", "rna_PoseBone_do_envelope");
+ func = RNA_def_function(srna, "evaluate_envelope", "rna_PoseBone_do_envelope");
RNA_def_function_ui_description(func, "Calculate bone envelope at given point");
- parm= RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point",
+ parm = RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point",
"Position in 3d space to evaluate", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return value */
- parm= RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX);
+ parm = RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX);
RNA_def_function_return(func, parm);
}
diff --git a/source/blender/makesrna/intern/rna_property.c b/source/blender/makesrna/intern/rna_property.c
index dfdc175d18b..fd6c45c2828 100644
--- a/source/blender/makesrna/intern/rna_property.c
+++ b/source/blender/makesrna/intern/rna_property.c
@@ -35,7 +35,7 @@
#include "WM_types.h"
-EnumPropertyItem gameproperty_type_items[] ={
+EnumPropertyItem gameproperty_type_items[] = {
{GPROP_BOOL, "BOOL", 0, "Boolean", "Boolean Property"},
{GPROP_INT, "INT", 0, "Integer", "Integer Property"},
{GPROP_FLOAT, "FLOAT", 0, "Float", "Floating-Point Property"},
@@ -50,9 +50,9 @@ EnumPropertyItem gameproperty_type_items[] ={
static StructRNA* rna_GameProperty_refine(struct PointerRNA *ptr)
{
- bProperty *property= (bProperty*)ptr->data;
+ bProperty *property = (bProperty*)ptr->data;
- switch(property->type){
+ switch (property->type){
case GPROP_BOOL:
return &RNA_GameBooleanProperty;
case GPROP_INT:
@@ -71,30 +71,30 @@ static StructRNA* rna_GameProperty_refine(struct PointerRNA *ptr)
/* for both float and timer */
static float rna_GameFloatProperty_value_get(PointerRNA *ptr)
{
- bProperty *prop= (bProperty*)(ptr->data);
+ bProperty *prop = (bProperty*)(ptr->data);
return *(float*)(&prop->data);
}
static void rna_GameFloatProperty_value_set(PointerRNA *ptr, float value)
{
- bProperty *prop= (bProperty*)(ptr->data);
+ bProperty *prop = (bProperty*)(ptr->data);
CLAMP(value, -10000.0f, 10000.0f);
- *(float*)(&prop->data)= value;
+ *(float*)(&prop->data) = value;
}
static void rna_GameProperty_type_set(PointerRNA *ptr, int value)
{
- bProperty *prop= (bProperty*)(ptr->data);
+ bProperty *prop = (bProperty*)(ptr->data);
- if(prop->type != value) {
- prop->type= value;
+ if (prop->type != value) {
+ prop->type = value;
init_property(prop);
}
}
static void rna_GameProperty_name_set(PointerRNA *ptr, const char *value)
{
- bProperty *prop= (bProperty*)(ptr->data);
+ bProperty *prop = (bProperty*)(ptr->data);
BLI_strncpy_utf8(prop->name, value, sizeof(prop->name));
unique_property(NULL, prop, 1);
}
@@ -108,80 +108,80 @@ void RNA_def_gameproperty(BlenderRNA *brna)
PropertyRNA *prop;
/* Base Struct for GameProperty */
- srna= RNA_def_struct(brna, "GameProperty", NULL);
+ srna = RNA_def_struct(brna, "GameProperty", NULL);
RNA_def_struct_ui_text(srna , "Game Property", "Game engine user defined object property");
RNA_def_struct_sdna(srna, "bProperty");
RNA_def_struct_refine_func(srna, "rna_GameProperty_refine");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Available as GameObject attributes in the game engine's python API");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GameProperty_name_set");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, gameproperty_type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_enum_funcs(prop, NULL, "rna_GameProperty_type_set", NULL);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "show_debug", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_debug", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PROP_DEBUG);
RNA_def_property_ui_text(prop, "Debug", "Print debug information for this property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameBooleanProperty */
- srna= RNA_def_struct(brna, "GameBooleanProperty", "GameProperty");
+ srna = RNA_def_struct(brna, "GameBooleanProperty", "GameProperty");
RNA_def_struct_ui_text(srna , "Game Boolean Property", "Game engine user defined Boolean property");
RNA_def_struct_sdna(srna, "bProperty");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "value", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "value", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "data", 1);
RNA_def_property_ui_text(prop, "Value", "Property value");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameIntProperty */
- srna= RNA_def_struct(brna, "GameIntProperty", "GameProperty");
+ srna = RNA_def_struct(brna, "GameIntProperty", "GameProperty");
RNA_def_struct_ui_text(srna , "Game Integer Property", "Game engine user defined integer number property");
RNA_def_struct_sdna(srna, "bProperty");
- prop= RNA_def_property(srna, "value", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "value", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "data");
RNA_def_property_ui_text(prop, "Value", "Property value");
RNA_def_property_range(prop, -10000, 10000);
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameFloatProperty */
- srna= RNA_def_struct(brna, "GameFloatProperty", "GameProperty");
+ srna = RNA_def_struct(brna, "GameFloatProperty", "GameProperty");
RNA_def_struct_ui_text(srna, "Game Float Property", "Game engine user defined floating point number property");
RNA_def_struct_sdna(srna, "bProperty");
- prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
- // RNA_def_property_float_sdna(prop, NULL, "data");
+ prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
+ /* RNA_def_property_float_sdna(prop, NULL, "data"); */
RNA_def_property_ui_text(prop, "Value", "Property value");
RNA_def_property_range(prop, -10000, 10000);
RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL);
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameTimerProperty */
- srna= RNA_def_struct(brna, "GameTimerProperty", "GameProperty");
+ srna = RNA_def_struct(brna, "GameTimerProperty", "GameProperty");
RNA_def_struct_ui_text(srna, "Game Timer Property", "Game engine user defined timer property");
RNA_def_struct_sdna(srna, "bProperty");
- prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
- // RNA_def_property_float_sdna(prop, NULL, "data");
+ prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
+ /* RNA_def_property_float_sdna(prop, NULL, "data"); */
RNA_def_property_ui_text(prop, "Value", "Property value");
RNA_def_property_range(prop, -10000, 10000);
RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL);
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameStringProperty */
- srna= RNA_def_struct(brna, "GameStringProperty", "GameProperty");
+ srna = RNA_def_struct(brna, "GameStringProperty", "GameProperty");
RNA_def_struct_ui_text(srna, "Game String Property", "Game engine user defined text string property");
RNA_def_struct_sdna(srna, "bProperty");
- prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "poin");
RNA_def_property_string_maxlength(prop, MAX_PROPSTRING);
RNA_def_property_ui_text(prop, "Value", "Property value");
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c
index b88e452588e..30cb80ef617 100644
--- a/source/blender/makesrna/intern/rna_render.c
+++ b/source/blender/makesrna/intern/rna_render.c
@@ -68,7 +68,7 @@ static void engine_update(RenderEngine *engine, Main *bmain, Scene *scene)
FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
- func= &rna_RenderEngine_update_func;
+ func = &rna_RenderEngine_update_func;
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "data", &bmain);
@@ -86,7 +86,7 @@ static void engine_render(RenderEngine *engine, struct Scene *scene)
FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
- func= &rna_RenderEngine_render_func;
+ func = &rna_RenderEngine_render_func;
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "scene", &scene);
@@ -103,7 +103,7 @@ static void engine_view_update(RenderEngine *engine, const struct bContext *cont
FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
- func= &rna_RenderEngine_view_update_func;
+ func = &rna_RenderEngine_view_update_func;
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &context);
@@ -120,7 +120,7 @@ static void engine_view_draw(RenderEngine *engine, const struct bContext *contex
FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
- func= &rna_RenderEngine_view_draw_func;
+ func = &rna_RenderEngine_view_draw_func;
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &context);
@@ -133,9 +133,9 @@ static void engine_view_draw(RenderEngine *engine, const struct bContext *contex
static void rna_RenderEngine_unregister(Main *UNUSED(bmain), StructRNA *type)
{
- RenderEngineType *et= RNA_struct_blender_type_get(type);
+ RenderEngineType *et = RNA_struct_blender_type_get(type);
- if(!et)
+ if (!et)
return;
RNA_struct_free_extension(type, &et->ext);
@@ -146,47 +146,47 @@ static void rna_RenderEngine_unregister(Main *UNUSED(bmain), StructRNA *type)
static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
RenderEngineType *et, dummyet = {NULL};
- RenderEngine dummyengine= {NULL};
+ RenderEngine dummyengine = {NULL};
PointerRNA dummyptr;
int have_function[4];
/* setup dummy engine & engine type to store static properties in */
- dummyengine.type= &dummyet;
+ dummyengine.type = &dummyet;
RNA_pointer_create(NULL, &RNA_RenderEngine, &dummyengine, &dummyptr);
/* validate the python class */
- if(validate(&dummyptr, data, have_function) != 0)
+ if (validate(&dummyptr, data, have_function) != 0)
return NULL;
- if(strlen(identifier) >= sizeof(dummyet.idname)) {
+ if (strlen(identifier) >= sizeof(dummyet.idname)) {
BKE_reportf(reports, RPT_ERROR, "registering render engine class: '%s' is too long, maximum length is %d",
identifier, (int)sizeof(dummyet.idname));
return NULL;
}
/* check if we have registered this engine type before, and remove it */
- for(et=R_engines.first; et; et=et->next) {
- if(strcmp(et->idname, dummyet.idname) == 0) {
- if(et->ext.srna)
+ for (et = R_engines.first; et; et = et->next) {
+ if (strcmp(et->idname, dummyet.idname) == 0) {
+ if (et->ext.srna)
rna_RenderEngine_unregister(bmain, et->ext.srna);
break;
}
}
/* create a new engine type */
- et= MEM_callocN(sizeof(RenderEngineType), "python render engine");
+ et = MEM_callocN(sizeof(RenderEngineType), "python render engine");
memcpy(et, &dummyet, sizeof(dummyet));
- et->ext.srna= RNA_def_struct(&BLENDER_RNA, et->idname, "RenderEngine");
- et->ext.data= data;
- et->ext.call= call;
- et->ext.free= free;
+ et->ext.srna = RNA_def_struct(&BLENDER_RNA, et->idname, "RenderEngine");
+ et->ext.data = data;
+ et->ext.call = call;
+ et->ext.free = free;
RNA_struct_blender_type_set(et->ext.srna, et);
- et->update= (have_function[0])? engine_update: NULL;
- et->render= (have_function[1])? engine_render: NULL;
- et->view_update= (have_function[2])? engine_view_update: NULL;
- et->view_draw= (have_function[3])? engine_view_draw: NULL;
+ et->update = (have_function[0])? engine_update: NULL;
+ et->render = (have_function[1])? engine_render: NULL;
+ et->view_update = (have_function[2])? engine_view_update: NULL;
+ et->view_draw = (have_function[3])? engine_view_draw: NULL;
BLI_addtail(&R_engines, et);
@@ -201,67 +201,67 @@ static void **rna_RenderEngine_instance(PointerRNA *ptr)
static StructRNA* rna_RenderEngine_refine(PointerRNA *ptr)
{
- RenderEngine *engine= (RenderEngine*)ptr->data;
+ RenderEngine *engine = (RenderEngine*)ptr->data;
return (engine->type && engine->type->ext.srna)? engine->type->ext.srna: &RNA_RenderEngine;
}
static void rna_RenderResult_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- RenderResult *rr= (RenderResult*)ptr->data;
+ RenderResult *rr = (RenderResult*)ptr->data;
rna_iterator_listbase_begin(iter, &rr->layers, NULL);
}
static void rna_RenderLayer_passes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- RenderLayer *rl= (RenderLayer*)ptr->data;
+ RenderLayer *rl = (RenderLayer*)ptr->data;
rna_iterator_listbase_begin(iter, &rl->passes, NULL);
}
static int rna_RenderLayer_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
- RenderLayer *rl= (RenderLayer*)ptr->data;
+ RenderLayer *rl = (RenderLayer*)ptr->data;
- length[0]= rl->rectx*rl->recty;
- length[1]= 4;
+ length[0] = rl->rectx*rl->recty;
+ length[1] = 4;
return length[0]*length[1];
}
static void rna_RenderLayer_rect_get(PointerRNA *ptr, float *values)
{
- RenderLayer *rl= (RenderLayer*)ptr->data;
+ RenderLayer *rl = (RenderLayer*)ptr->data;
memcpy(values, rl->rectf, sizeof(float)*rl->rectx*rl->recty*4);
}
void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values)
{
- RenderLayer *rl= (RenderLayer*)ptr->data;
+ RenderLayer *rl = (RenderLayer*)ptr->data;
memcpy(rl->rectf, values, sizeof(float)*rl->rectx*rl->recty*4);
}
static int rna_RenderPass_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
- RenderPass *rpass= (RenderPass*)ptr->data;
+ RenderPass *rpass = (RenderPass*)ptr->data;
- length[0]= rpass->rectx*rpass->recty;
- length[1]= rpass->channels;
+ length[0] = rpass->rectx*rpass->recty;
+ length[1] = rpass->channels;
return length[0]*length[1];
}
static void rna_RenderPass_rect_get(PointerRNA *ptr, float *values)
{
- RenderPass *rpass= (RenderPass*)ptr->data;
+ RenderPass *rpass = (RenderPass*)ptr->data;
memcpy(values, rpass->rect, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels);
}
void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values)
{
- RenderPass *rpass= (RenderPass*)ptr->data;
+ RenderPass *rpass = (RenderPass*)ptr->data;
memcpy(rpass->rect, values, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels);
}
-#else // RNA_RUNTIME
+#else /* RNA_RUNTIME */
static void rna_def_render_engine(BlenderRNA *brna)
{
@@ -269,31 +269,31 @@ static void rna_def_render_engine(BlenderRNA *brna)
PropertyRNA *prop;
FunctionRNA *func;
- srna= RNA_def_struct(brna, "RenderEngine", NULL);
+ srna = RNA_def_struct(brna, "RenderEngine", NULL);
RNA_def_struct_sdna(srna, "RenderEngine");
RNA_def_struct_ui_text(srna, "Render Engine", "Render engine");
RNA_def_struct_refine_func(srna, "rna_RenderEngine_refine");
RNA_def_struct_register_funcs(srna, "rna_RenderEngine_register", "rna_RenderEngine_unregister", "rna_RenderEngine_instance");
/* final render callbacks */
- func= RNA_def_function(srna, "update", NULL);
+ func = RNA_def_function(srna, "update", NULL);
RNA_def_function_ui_description(func, "Export scene data for render");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
RNA_def_pointer(func, "data", "BlendData", "", "");
RNA_def_pointer(func, "scene", "Scene", "", "");
- func= RNA_def_function(srna, "render", NULL);
+ func = RNA_def_function(srna, "render", NULL);
RNA_def_function_ui_description(func, "Render scene into an image");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
RNA_def_pointer(func, "scene", "Scene", "", "");
/* viewport render callbacks */
- func= RNA_def_function(srna, "view_update", NULL);
+ func = RNA_def_function(srna, "view_update", NULL);
RNA_def_function_ui_description(func, "Update on data changes for viewport render");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
RNA_def_pointer(func, "context", "Context", "", "");
- func= RNA_def_function(srna, "view_draw", NULL);
+ func = RNA_def_function(srna, "view_draw", NULL);
RNA_def_function_ui_description(func, "Draw viewport render");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
RNA_def_pointer(func, "context", "Context", "", "");
@@ -306,73 +306,73 @@ static void rna_def_render_engine(BlenderRNA *brna)
RNA_def_function(srna, "tag_update", "engine_tag_update");
RNA_def_function_ui_description(func, "Request update call for viewport rendering");
- func= RNA_def_function(srna, "begin_result", "RE_engine_begin_result");
- prop= RNA_def_int(func, "x", 0, 0, INT_MAX, "X", "", 0, INT_MAX);
+ func = RNA_def_function(srna, "begin_result", "RE_engine_begin_result");
+ prop = RNA_def_int(func, "x", 0, 0, INT_MAX, "X", "", 0, INT_MAX);
RNA_def_property_flag(prop, PROP_REQUIRED);
- prop= RNA_def_int(func, "y", 0, 0, INT_MAX, "Y", "", 0, INT_MAX);
+ prop = RNA_def_int(func, "y", 0, 0, INT_MAX, "Y", "", 0, INT_MAX);
RNA_def_property_flag(prop, PROP_REQUIRED);
- prop= RNA_def_int(func, "w", 0, 0, INT_MAX, "Width", "", 0, INT_MAX);
+ prop = RNA_def_int(func, "w", 0, 0, INT_MAX, "Width", "", 0, INT_MAX);
RNA_def_property_flag(prop, PROP_REQUIRED);
- prop= RNA_def_int(func, "h", 0, 0, INT_MAX, "Height", "", 0, INT_MAX);
+ prop = RNA_def_int(func, "h", 0, 0, INT_MAX, "Height", "", 0, INT_MAX);
RNA_def_property_flag(prop, PROP_REQUIRED);
- prop= RNA_def_pointer(func, "result", "RenderResult", "Result", "");
+ prop = RNA_def_pointer(func, "result", "RenderResult", "Result", "");
RNA_def_function_return(func, prop);
- func= RNA_def_function(srna, "update_result", "RE_engine_update_result");
- prop= RNA_def_pointer(func, "result", "RenderResult", "Result", "");
+ func = RNA_def_function(srna, "update_result", "RE_engine_update_result");
+ prop = RNA_def_pointer(func, "result", "RenderResult", "Result", "");
RNA_def_property_flag(prop, PROP_REQUIRED);
- func= RNA_def_function(srna, "end_result", "RE_engine_end_result");
- prop= RNA_def_pointer(func, "result", "RenderResult", "Result", "");
+ func = RNA_def_function(srna, "end_result", "RE_engine_end_result");
+ prop = RNA_def_pointer(func, "result", "RenderResult", "Result", "");
RNA_def_property_flag(prop, PROP_REQUIRED);
- func= RNA_def_function(srna, "test_break", "RE_engine_test_break");
- prop= RNA_def_boolean(func, "do_break", 0, "Break", "");
+ func = RNA_def_function(srna, "test_break", "RE_engine_test_break");
+ prop = RNA_def_boolean(func, "do_break", 0, "Break", "");
RNA_def_function_return(func, prop);
- func= RNA_def_function(srna, "update_stats", "RE_engine_update_stats");
- prop= RNA_def_string(func, "stats", "", 0, "Stats", "");
+ func = RNA_def_function(srna, "update_stats", "RE_engine_update_stats");
+ prop = RNA_def_string(func, "stats", "", 0, "Stats", "");
RNA_def_property_flag(prop, PROP_REQUIRED);
- prop= RNA_def_string(func, "info", "", 0, "Info", "");
+ prop = RNA_def_string(func, "info", "", 0, "Info", "");
RNA_def_property_flag(prop, PROP_REQUIRED);
- func= RNA_def_function(srna, "update_progress", "RE_engine_update_progress");
- prop= RNA_def_float(func, "progress", 0, 0.0f, 1.0f, "", "Percentage of render that's done", 0.0f, 1.0f);
+ func = RNA_def_function(srna, "update_progress", "RE_engine_update_progress");
+ prop = RNA_def_float(func, "progress", 0, 0.0f, 1.0f, "", "Percentage of render that's done", 0.0f, 1.0f);
RNA_def_property_flag(prop, PROP_REQUIRED);
- func= RNA_def_function(srna, "report", "RE_engine_report");
- prop= RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", "");
+ func = RNA_def_function(srna, "report", "RE_engine_report");
+ prop = RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", "");
RNA_def_property_flag(prop, PROP_REQUIRED);
- prop= RNA_def_string(func, "message", "", 0, "Report Message", "");
+ prop = RNA_def_string(func, "message", "", 0, "Report Message", "");
RNA_def_property_flag(prop, PROP_REQUIRED);
RNA_define_verify_sdna(0);
- prop= RNA_def_property(srna, "is_animation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_animation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_ANIMATION);
- prop= RNA_def_property(srna, "is_preview", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_PREVIEW);
/* registration */
- prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
- prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE);
+ prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
RNA_def_property_flag(prop, PROP_REGISTER);
- prop= RNA_def_property(srna, "bl_use_preview", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_use_preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_PREVIEW);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
- prop= RNA_def_property(srna, "bl_use_postprocess", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_use_postprocess", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", RE_USE_POSTPROCESS);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
- prop= RNA_def_property(srna, "bl_use_shading_nodes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_use_shading_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_SHADING_NODES);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
@@ -385,27 +385,27 @@ static void rna_def_render_result(BlenderRNA *brna)
FunctionRNA *func;
PropertyRNA *parm;
- srna= RNA_def_struct(brna, "RenderResult", NULL);
+ srna = RNA_def_struct(brna, "RenderResult", NULL);
RNA_def_struct_ui_text(srna, "Render Result", "Result of rendering, including all layers and passes");
- func= RNA_def_function(srna, "load_from_file", "RE_result_load_from_file");
+ func = RNA_def_function(srna, "load_from_file", "RE_result_load_from_file");
RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_string_file_name(func, "filename", "", FILE_MAX, "File Name",
+ parm = RNA_def_string_file_name(func, "filename", "", FILE_MAX, "File Name",
"Filename to load into this render tile, must be no smaller than the render result");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_define_verify_sdna(0);
- parm= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
+ parm = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(parm, NULL, "rectx");
RNA_def_property_clear_flag(parm, PROP_EDITABLE);
- parm= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
+ parm = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(parm, NULL, "recty");
RNA_def_property_clear_flag(parm, PROP_EDITABLE);
- parm= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
+ parm = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(parm, "RenderLayer");
RNA_def_property_collection_funcs(parm, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
@@ -418,13 +418,13 @@ static void rna_def_render_layer(BlenderRNA *brna)
PropertyRNA *prop;
FunctionRNA *func;
- srna= RNA_def_struct(brna, "RenderLayer", NULL);
+ srna = RNA_def_struct(brna, "RenderLayer", NULL);
RNA_def_struct_ui_text(srna, "Render Layer", "");
- func= RNA_def_function(srna, "load_from_file", "RE_layer_load_from_file");
+ func = RNA_def_function(srna, "load_from_file", "RE_layer_load_from_file");
RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- prop= RNA_def_string(func, "filename", "", 0, "Filename",
+ prop = RNA_def_string(func, "filename", "", 0, "Filename",
"Filename to load into this render tile, must be no smaller than the renderlayer");
RNA_def_property_flag(prop, PROP_REQUIRED);
RNA_def_int(func, "x", 0, 0, INT_MAX, "Offset X",
@@ -436,11 +436,11 @@ static void rna_def_render_layer(BlenderRNA *brna)
rna_def_render_layer_common(srna, 0);
- prop= RNA_def_property(srna, "passes", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "passes", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "RenderPass");
RNA_def_property_collection_funcs(prop, "rna_RenderLayer_passes_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
- prop= RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_multi_array(prop, 2, NULL);
RNA_def_property_dynamic_array_funcs(prop, "rna_RenderLayer_rect_get_length");
@@ -454,7 +454,7 @@ static void rna_def_render_pass(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem pass_type_items[]= {
+ static EnumPropertyItem pass_type_items[] = {
{SCE_PASS_COMBINED, "COMBINED", 0, "Combined", ""},
{SCE_PASS_Z, "Z", 0, "Z", ""},
{SCE_PASS_RGBA, "COLOR", 0, "Color", ""},
@@ -483,30 +483,30 @@ static void rna_def_render_pass(BlenderRNA *brna)
{SCE_PASS_TRANSM_COLOR, "TRANSMISSION_COLOR", 0, "Transmission Color", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "RenderPass", NULL);
+ srna = RNA_def_struct(brna, "RenderPass", NULL);
RNA_def_struct_ui_text(srna, "Render Pass", "");
RNA_define_verify_sdna(0);
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "channel_id", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "channel_id", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "chan_id");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "channels", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "channels", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "channels");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "passtype");
RNA_def_property_enum_items(prop, pass_type_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_multi_array(prop, 2, NULL);
RNA_def_property_dynamic_array_funcs(prop, "rna_RenderPass_rect_get_length");
@@ -523,5 +523,5 @@ void RNA_def_render(BlenderRNA *brna)
rna_def_render_pass(brna);
}
-#endif // RNA_RUNTIME
+#endif /* RNA_RUNTIME */
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 676d5f2c44f..153e9288375 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -150,24 +150,24 @@ static PointerRNA rna_Struct_name_property_get(PointerRNA *ptr)
static int rna_idproperty_known(CollectionPropertyIterator *iter, void *data)
{
- IDProperty *idprop= (IDProperty*)data;
+ IDProperty *idprop = (IDProperty*)data;
PropertyRNA *prop;
- StructRNA *ptype= iter->builtin_parent.type;
+ StructRNA *ptype = iter->builtin_parent.type;
/* function to skip any id properties that are already known by RNA,
* for the second loop where we go over unknown id properties */
do {
- for(prop= ptype->cont.properties.first; prop; prop=prop->next)
- if((prop->flag & PROP_BUILTIN) == 0 && strcmp(prop->identifier, idprop->name) == 0)
+ for (prop = ptype->cont.properties.first; prop; prop = prop->next)
+ if ((prop->flag & PROP_BUILTIN) == 0 && strcmp(prop->identifier, idprop->name) == 0)
return 1;
- } while((ptype=ptype->base));
+ } while ((ptype = ptype->base));
return 0;
}
static int rna_property_builtin(CollectionPropertyIterator *UNUSED(iter), void *data)
{
- PropertyRNA *prop= (PropertyRNA*)data;
+ PropertyRNA *prop = (PropertyRNA*)data;
/* function to skip builtin rna properties */
@@ -176,7 +176,7 @@ static int rna_property_builtin(CollectionPropertyIterator *UNUSED(iter), void *
static int rna_function_builtin(CollectionPropertyIterator *UNUSED(iter), void *data)
{
- FunctionRNA *func= (FunctionRNA*)data;
+ FunctionRNA *func = (FunctionRNA*)data;
/* function to skip builtin rna functions */
@@ -186,14 +186,14 @@ static int rna_function_builtin(CollectionPropertyIterator *UNUSED(iter), void *
static void rna_inheritance_next_level_restart(CollectionPropertyIterator *iter, IteratorSkipFunc skip, int funcs)
{
/* RNA struct inheritance */
- while(!iter->valid && iter->level > 0) {
+ while (!iter->valid && iter->level > 0) {
StructRNA *srna;
int i;
- srna= (StructRNA*)iter->parent.data;
+ srna = (StructRNA*)iter->parent.data;
iter->level--;
- for(i=iter->level; i>0; i--)
- srna= srna->base;
+ for (i = iter->level; i>0; i--)
+ srna = srna->base;
rna_iterator_listbase_end(iter);
@@ -230,10 +230,10 @@ static void rna_inheritance_functions_listbase_next(CollectionPropertyIterator *
static void rna_Struct_properties_next(CollectionPropertyIterator *iter)
{
- ListBaseIterator *internal= iter->internal;
+ ListBaseIterator *internal = iter->internal;
IDProperty *group;
- if(internal->flag) {
+ if (internal->flag) {
/* id properties */
rna_iterator_listbase_next(iter);
}
@@ -242,14 +242,14 @@ static void rna_Struct_properties_next(CollectionPropertyIterator *iter)
rna_inheritance_properties_listbase_next(iter, rna_property_builtin);
/* try id properties */
- if(!iter->valid) {
- group= RNA_struct_idprops(&iter->builtin_parent, 0);
+ if (!iter->valid) {
+ group = RNA_struct_idprops(&iter->builtin_parent, 0);
- if(group) {
+ if (group) {
rna_iterator_listbase_end(iter);
rna_iterator_listbase_begin(iter, &group->data.group, rna_idproperty_known);
- internal= iter->internal;
- internal->flag= 1;
+ internal = iter->internal;
+ internal->flag = 1;
}
}
}
@@ -260,11 +260,11 @@ static void rna_Struct_properties_begin(CollectionPropertyIterator *iter, Pointe
StructRNA *srna;
/* here ptr->data should always be the same as iter->parent.type */
- srna= (StructRNA *)ptr->data;
+ srna = (StructRNA *)ptr->data;
- while(srna->base) {
+ while (srna->base) {
iter->level++;
- srna= srna->base;
+ srna = srna->base;
}
rna_inheritance_properties_listbase_begin(iter, &srna->cont.properties, rna_property_builtin);
@@ -272,7 +272,7 @@ static void rna_Struct_properties_begin(CollectionPropertyIterator *iter, Pointe
static PointerRNA rna_Struct_properties_get(CollectionPropertyIterator *iter)
{
- ListBaseIterator *internal= iter->internal;
+ ListBaseIterator *internal = iter->internal;
/* we return either PropertyRNA* or IDProperty*, the rna_access.c
* functions can handle both as PropertyRNA* with some tricks */
@@ -289,11 +289,11 @@ static void rna_Struct_functions_begin(CollectionPropertyIterator *iter, Pointer
StructRNA *srna;
/* here ptr->data should always be the same as iter->parent.type */
- srna= (StructRNA *)ptr->data;
+ srna = (StructRNA *)ptr->data;
- while(srna->base) {
+ while (srna->base) {
iter->level++;
- srna= srna->base;
+ srna = srna->base;
}
rna_inheritance_functions_listbase_begin(iter, &srna->functions, rna_function_builtin);
@@ -301,7 +301,7 @@ static void rna_Struct_functions_begin(CollectionPropertyIterator *iter, Pointer
static PointerRNA rna_Struct_functions_get(CollectionPropertyIterator *iter)
{
- ListBaseIterator *internal= iter->internal;
+ ListBaseIterator *internal = iter->internal;
/* we return either PropertyRNA* or IDProperty*, the rna_access.c
* functions can handle both as PropertyRNA* with some tricks */
@@ -317,15 +317,15 @@ void rna_builtin_properties_begin(CollectionPropertyIterator *iter, PointerRNA *
PointerRNA newptr;
/* we create a new pointer with the type as the data */
- newptr.type= &RNA_Struct;
- newptr.data= ptr->type;
+ newptr.type = &RNA_Struct;
+ newptr.data = ptr->type;
- if(ptr->type->flag & STRUCT_ID)
- newptr.id.data= ptr->data;
+ if (ptr->type->flag & STRUCT_ID)
+ newptr.id.data = ptr->data;
else
- newptr.id.data= NULL;
+ newptr.id.data = NULL;
- iter->parent= newptr;
+ iter->parent = newptr;
iter->builtin_parent = *ptr;
rna_Struct_properties_begin(iter, &newptr);
@@ -345,51 +345,51 @@ int rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key, Point
{
StructRNA *srna;
PropertyRNA *prop;
- PointerRNA propptr= {{NULL}};
+ PointerRNA propptr = {{NULL}};
- srna= ptr->type;
+ srna = ptr->type;
do {
- if(srna->cont.prophash) {
- prop= BLI_ghash_lookup(srna->cont.prophash, (void*)key);
+ if (srna->cont.prophash) {
+ prop = BLI_ghash_lookup(srna->cont.prophash, (void*)key);
- if(prop) {
- propptr.type= &RNA_Property;
- propptr.data= prop;
+ if (prop) {
+ propptr.type = &RNA_Property;
+ propptr.data = prop;
- *r_ptr= propptr;
+ *r_ptr = propptr;
return TRUE;
}
}
else {
- for(prop=srna->cont.properties.first; prop; prop=prop->next) {
- if(!(prop->flag & PROP_BUILTIN) && strcmp(prop->identifier, key)==0) {
- propptr.type= &RNA_Property;
- propptr.data= prop;
+ for (prop = srna->cont.properties.first; prop; prop = prop->next) {
+ if (!(prop->flag & PROP_BUILTIN) && strcmp(prop->identifier, key) == 0) {
+ propptr.type = &RNA_Property;
+ propptr.data = prop;
- *r_ptr= propptr;
+ *r_ptr = propptr;
return TRUE;
}
}
}
- } while((srna=srna->base));
+ } while ((srna = srna->base));
/* this was used pre 2.5beta0, now ID property access uses python's
* getitem style access
* - ob["foo"] rather than ob.foo */
#if 0
- if(ptr->data) {
+ if (ptr->data) {
IDProperty *group, *idp;
- group= RNA_struct_idprops(ptr, 0);
+ group = RNA_struct_idprops(ptr, 0);
- if(group) {
- for(idp=group->data.group.first; idp; idp=idp->next) {
- if(strcmp(idp->name, key) == 0) {
- propptr.type= &RNA_Property;
- propptr.data= idp;
+ if (group) {
+ for (idp = group->data.group.first; idp; idp = idp->next) {
+ if (strcmp(idp->name, key) == 0) {
+ propptr.type = &RNA_Property;
+ propptr.data = idp;
- *r_ptr= propptr;
+ *r_ptr = propptr;
return TRUE;
}
}
@@ -408,11 +408,11 @@ PointerRNA rna_builtin_type_get(PointerRNA *ptr)
static StructRNA *rna_Property_refine(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr); /* XXX ptr? */
- switch(prop->type) {
+ switch (prop->type) {
case PROP_BOOLEAN: return &RNA_BoolProperty;
case PROP_INT: return &RNA_IntProperty;
case PROP_FLOAT: return &RNA_FloatProperty;
@@ -426,354 +426,354 @@ static StructRNA *rna_Property_refine(PointerRNA *ptr)
static void rna_Property_identifier_get(PointerRNA *ptr, char *value)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
strcpy(value, ((PropertyRNA*)prop)->identifier);
}
static int rna_Property_identifier_length(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return strlen(prop->identifier);
}
static void rna_Property_name_get(PointerRNA *ptr, char *value)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
strcpy(value, prop->name);
}
static int rna_Property_name_length(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return strlen(prop->name);
}
static void rna_Property_description_get(PointerRNA *ptr, char *value)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
strcpy(value, prop->description ? prop->description:"");
}
static int rna_Property_description_length(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return prop->description ? strlen(prop->description) : 0;
}
static void rna_Property_translation_context_get(PointerRNA *ptr, char *value)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
strcpy(value, prop->translation_context ? prop->translation_context:"");
}
static int rna_Property_translation_context_length(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return prop->translation_context ? strlen(prop->translation_context) : 0;
}
static int rna_Property_type_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return prop->type;
}
static int rna_Property_subtype_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return prop->subtype;
}
static PointerRNA rna_Property_srna_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return rna_pointer_inherit_refine(ptr, &RNA_Struct, prop->srna);
}
static int rna_Property_unit_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return RNA_SUBTYPE_UNIT(prop->subtype);
}
static int rna_Property_readonly_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
/* dont use this becaure it will call functions that check the internal
* data for introspection we only need to know if it can be edited so the
* flag is better for this */
-// return RNA_property_editable(ptr, prop);
+/* return RNA_property_editable(ptr, prop); */
return prop->flag & PROP_EDITABLE ? 0:1;
}
static int rna_Property_animatable_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
return (prop->flag & PROP_ANIMATABLE) != 0;
}
static int rna_Property_use_output_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_OUTPUT ? 1:0;
}
static int rna_Property_is_required_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_REQUIRED ? 1:0;
}
static int rna_Property_is_never_none_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_NEVER_NULL ? 1:0;
}
static int rna_Property_is_hidden_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_HIDDEN ? 1:0;
}
static int rna_Property_is_skip_save_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_SKIP_SAVE ? 1:0;
}
static int rna_Property_is_enum_flag_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_ENUM_FLAG ? 1:0;
}
static int rna_Property_array_length_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return prop->totarraylength;
}
static int rna_Property_registered_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_REGISTER;
}
static int rna_Property_registered_optional_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_REGISTER_OPTIONAL;
}
static int rna_Property_runtime_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_RUNTIME;
}
static int rna_BoolProperty_default_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((BoolPropertyRNA*)prop)->defaultvalue;
}
static int rna_IntProperty_default_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((IntPropertyRNA*)prop)->defaultvalue;
}
/* int/float/bool */
static int rna_NumberProperty_default_array_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
- length[0]= prop->totarraylength;
+ length[0] = prop->totarraylength;
return length[0];
}
static void rna_IntProperty_default_array_get(PointerRNA *ptr, int *values)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
- IntPropertyRNA *nprop= (IntPropertyRNA*)prop;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
+ IntPropertyRNA *nprop = (IntPropertyRNA*)prop;
rna_idproperty_check(&prop, ptr);
- if(nprop->defaultarray) {
+ if (nprop->defaultarray) {
memcpy(values, nprop->defaultarray, prop->totarraylength * sizeof(int));
}
else {
int i;
- for(i=0; i < prop->totarraylength; i++)
- values[i]= nprop->defaultvalue;
+ for (i = 0; i < prop->totarraylength; i++)
+ values[i] = nprop->defaultvalue;
}
}
static void rna_BoolProperty_default_array_get(PointerRNA *ptr, int *values)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
- BoolPropertyRNA *nprop= (BoolPropertyRNA*)prop;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
+ BoolPropertyRNA *nprop = (BoolPropertyRNA*)prop;
rna_idproperty_check(&prop, ptr);
- if(nprop->defaultarray) {
+ if (nprop->defaultarray) {
memcpy(values, nprop->defaultarray, prop->totarraylength * sizeof(int));
}
else {
int i;
- for(i=0; i < prop->totarraylength; i++)
- values[i]= nprop->defaultvalue;
+ for (i = 0; i < prop->totarraylength; i++)
+ values[i] = nprop->defaultvalue;
}
}
static void rna_FloatProperty_default_array_get(PointerRNA *ptr, float *values)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
- FloatPropertyRNA *nprop= (FloatPropertyRNA*)prop;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
+ FloatPropertyRNA *nprop = (FloatPropertyRNA*)prop;
rna_idproperty_check(&prop, ptr);
- if(nprop->defaultarray) {
+ if (nprop->defaultarray) {
memcpy(values, nprop->defaultarray, prop->totarraylength * sizeof(float));
}
else {
int i;
- for(i=0; i < prop->totarraylength; i++)
- values[i]= nprop->defaultvalue;
+ for (i = 0; i < prop->totarraylength; i++)
+ values[i] = nprop->defaultvalue;
}
}
static int rna_IntProperty_hard_min_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((IntPropertyRNA*)prop)->hardmin;
}
static int rna_IntProperty_hard_max_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((IntPropertyRNA*)prop)->hardmax;
}
static int rna_IntProperty_soft_min_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((IntPropertyRNA*)prop)->softmin;
}
static int rna_IntProperty_soft_max_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((IntPropertyRNA*)prop)->softmax;
}
static int rna_IntProperty_step_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((IntPropertyRNA*)prop)->step;
}
static float rna_FloatProperty_default_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((FloatPropertyRNA*)prop)->defaultvalue;
}
static float rna_FloatProperty_hard_min_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((FloatPropertyRNA*)prop)->hardmin;
}
static float rna_FloatProperty_hard_max_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((FloatPropertyRNA*)prop)->hardmax;
}
static float rna_FloatProperty_soft_min_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((FloatPropertyRNA*)prop)->softmin;
}
static float rna_FloatProperty_soft_max_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((FloatPropertyRNA*)prop)->softmax;
}
static float rna_FloatProperty_step_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((FloatPropertyRNA*)prop)->step;
}
static int rna_FloatProperty_precision_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((FloatPropertyRNA*)prop)->precision;
}
static void rna_StringProperty_default_get(PointerRNA *ptr, char *value)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
strcpy(value, ((StringPropertyRNA*)prop)->defaultvalue);
}
static int rna_StringProperty_default_length(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return strlen(((StringPropertyRNA*)prop)->defaultvalue);
}
static int rna_StringProperty_max_length_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((StringPropertyRNA*)prop)->maxlength;
}
static EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop_parent, int *free)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
EnumPropertyRNA *eprop;
rna_idproperty_check(&prop, ptr);
- eprop= (EnumPropertyRNA*)prop;
+ eprop = (EnumPropertyRNA*)prop;
/* incompatible default attributes */
if ((prop_parent->flag & PROP_ENUM_FLAG) != (prop->flag & PROP_ENUM_FLAG)) {
return NULL;
}
- if( (eprop->itemf == NULL) ||
+ if ( (eprop->itemf == NULL) ||
(eprop->itemf == rna_EnumProperty_default_itemf) ||
(ptr->type == &RNA_EnumProperty) ||
(C == NULL))
@@ -787,27 +787,27 @@ static EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, PointerRNA
/* XXX - not sure this is needed? */
static int rna_EnumProperty_default_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((EnumPropertyRNA*)prop)->defaultvalue;
}
static int rna_enum_check_separator(CollectionPropertyIterator *UNUSED(iter), void *data)
{
- EnumPropertyItem *item= (EnumPropertyItem*)data;
+ EnumPropertyItem *item = (EnumPropertyItem*)data;
return (item->identifier[0] == 0);
}
static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
- // EnumPropertyRNA *eprop; // UNUSED
- EnumPropertyItem *item= NULL;
- int totitem, free= 0;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
+ /* EnumPropertyRNA *eprop; *//* UNUSED */
+ EnumPropertyItem *item = NULL;
+ int totitem, free = 0;
rna_idproperty_check(&prop, ptr);
- // eprop= (EnumPropertyRNA*)prop;
+ /* eprop= (EnumPropertyRNA*)prop; */
RNA_property_enum_items(NULL, ptr, prop, &item, &totitem, &free);
rna_iterator_array_begin(iter, (void*)item, sizeof(EnumPropertyItem), totitem, free, rna_enum_check_separator);
@@ -835,19 +835,19 @@ static int rna_EnumPropertyItem_name_length(PointerRNA *ptr)
static void rna_EnumPropertyItem_description_get(PointerRNA *ptr, char *value)
{
- EnumPropertyItem *eprop= (EnumPropertyItem*)ptr->data;
+ EnumPropertyItem *eprop = (EnumPropertyItem*)ptr->data;
- if(eprop->description)
+ if (eprop->description)
strcpy(value, eprop->description);
else
- value[0]= '\0';
+ value[0] = '\0';
}
static int rna_EnumPropertyItem_description_length(PointerRNA *ptr)
{
- EnumPropertyItem *eprop= (EnumPropertyItem*)ptr->data;
+ EnumPropertyItem *eprop = (EnumPropertyItem*)ptr->data;
- if(eprop->description)
+ if (eprop->description)
return strlen(eprop->description);
else
return 0;
@@ -860,14 +860,14 @@ static int rna_EnumPropertyItem_value_get(PointerRNA *ptr)
static PointerRNA rna_PointerProperty_fixed_type_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((PointerPropertyRNA*)prop)->type);
}
static PointerRNA rna_CollectionProperty_fixed_type_get(PointerRNA *ptr)
{
- PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ PropertyRNA *prop = (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((CollectionPropertyRNA*)prop)->item_type);
}
@@ -901,19 +901,19 @@ static void rna_Function_parameters_begin(CollectionPropertyIterator *iter, Poin
static int rna_Function_registered_get(PointerRNA *ptr)
{
- FunctionRNA *func= (FunctionRNA*)ptr->data;
+ FunctionRNA *func = (FunctionRNA*)ptr->data;
return func->flag & FUNC_REGISTER;
}
static int rna_Function_registered_optional_get(PointerRNA *ptr)
{
- FunctionRNA *func= (FunctionRNA*)ptr->data;
+ FunctionRNA *func = (FunctionRNA*)ptr->data;
return func->flag & FUNC_REGISTER_OPTIONAL;
}
static int rna_Function_no_self_get(PointerRNA *ptr)
{
- FunctionRNA *func= (FunctionRNA*)ptr->data;
+ FunctionRNA *func = (FunctionRNA*)ptr->data;
return !(func->flag & FUNC_NO_SELF);
}
@@ -931,9 +931,9 @@ static int rna_BlenderRNA_structs_length(PointerRNA *ptr)
}
static int rna_BlenderRNA_structs_lookup_int(PointerRNA *ptr, int index, PointerRNA *r_ptr)
{
- StructRNA *srna= BLI_findlink(&((BlenderRNA*)ptr->data)->structs, index);
+ StructRNA *srna = BLI_findlink(&((BlenderRNA*)ptr->data)->structs, index);
- if(srna) {
+ if (srna) {
RNA_pointer_create(NULL, &RNA_Struct, srna, r_ptr);
return TRUE;
}
@@ -943,9 +943,9 @@ static int rna_BlenderRNA_structs_lookup_int(PointerRNA *ptr, int index, Pointer
}
static int rna_BlenderRNA_structs_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
{
- StructRNA *srna= ((BlenderRNA*)ptr->data)->structs.first;
- for(; srna; srna=srna->cont.next) {
- if(key[0] == srna->identifier[0] && strcmp(key, srna->identifier)==0) {
+ StructRNA *srna = ((BlenderRNA*)ptr->data)->structs.first;
+ for (; srna; srna = srna->cont.next) {
+ if (key[0] == srna->identifier[0] && strcmp(key, srna->identifier) == 0) {
RNA_pointer_create(NULL, &RNA_Struct, srna, r_ptr);
return TRUE;
}
@@ -962,51 +962,51 @@ static void rna_def_struct(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Struct", NULL);
+ srna = RNA_def_struct(brna, "Struct", NULL);
RNA_def_struct_ui_text(srna, "Struct Definition", "RNA structure definition");
RNA_def_struct_ui_icon(srna, ICON_RNA);
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Struct_name_get", "rna_Struct_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "Human readable name");
- prop= RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Struct_identifier_get", "rna_Struct_identifier_length", NULL);
RNA_def_property_ui_text(prop, "Identifier", "Unique name used in the code and scripting");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "description", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "description", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Struct_description_get", "rna_Struct_description_length", NULL);
RNA_def_property_ui_text(prop, "Description", "Description of the Struct's purpose");
- prop= RNA_def_property(srna, "base", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "base", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Struct");
RNA_def_property_pointer_funcs(prop, "rna_Struct_base_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Base", "Struct definition this is derived from");
- prop= RNA_def_property(srna, "nested", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "nested", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Struct");
RNA_def_property_pointer_funcs(prop, "rna_Struct_nested_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Nested", "Struct in which this struct is always nested, and to which it logically belongs");
- prop= RNA_def_property(srna, "name_property", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "name_property", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "StringProperty");
RNA_def_property_pointer_funcs(prop, "rna_Struct_name_property_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Name Property", "Property that gives the name of the struct");
- prop= RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Property");
RNA_def_property_collection_funcs(prop, "rna_Struct_properties_begin", "rna_Struct_properties_next", "rna_iterator_listbase_end", "rna_Struct_properties_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Properties", "Properties in the struct");
- prop= RNA_def_property(srna, "functions", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "functions", PROP_COLLECTION, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Function");
RNA_def_property_collection_funcs(prop, "rna_Struct_functions_begin", "rna_Struct_functions_next", "rna_iterator_listbase_end", "rna_Struct_functions_get", NULL, NULL, NULL, NULL);
@@ -1040,107 +1040,107 @@ static void rna_def_property(BlenderRNA *brna)
{PROP_LAYER_MEMBER, "LAYER_MEMBERSHIP", 0, "Layer Membership", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Property", NULL);
+ srna = RNA_def_struct(brna, "Property", NULL);
RNA_def_struct_ui_text(srna, "Property Definition", "RNA property definition");
RNA_def_struct_refine_func(srna, "rna_Property_refine");
RNA_def_struct_ui_icon(srna, ICON_RNA);
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Property_name_get", "rna_Property_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "Human readable name");
- prop= RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Property_identifier_get", "rna_Property_identifier_length", NULL);
RNA_def_property_ui_text(prop, "Identifier", "Unique name used in the code and scripting");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "description", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "description", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Property_description_get", "rna_Property_description_length", NULL);
RNA_def_property_ui_text(prop, "Description", "Description of the property for tooltips");
- prop= RNA_def_property(srna, "translation_context", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "translation_context", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Property_translation_context_get", "rna_Property_translation_context_length", NULL);
RNA_def_property_ui_text(prop, "Translation Context", "Translation context of the property");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, property_type_items);
RNA_def_property_enum_funcs(prop, "rna_Property_type_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Type", "Data type of the property");
- prop= RNA_def_property(srna, "subtype", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "subtype", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, subtype_items);
RNA_def_property_enum_funcs(prop, "rna_Property_subtype_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Subtype", "Semantic interpretation of the property");
- prop= RNA_def_property(srna, "srna", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "srna", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Struct");
RNA_def_property_pointer_funcs(prop, "rna_Property_srna_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Base", "Struct definition used for properties assigned to this item");
- prop= RNA_def_property(srna, "unit", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "unit", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, property_unit_items);
RNA_def_property_enum_funcs(prop, "rna_Property_unit_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Unit", "Type of units for this property");
- prop= RNA_def_property(srna, "is_readonly", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_readonly", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_readonly_get", NULL);
RNA_def_property_ui_text(prop, "Read Only", "Property is editable through RNA");
- prop= RNA_def_property(srna, "is_animatable", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_animatable", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_animatable_get", NULL);
RNA_def_property_ui_text(prop, "Animatable", "Property is animatable through RNA");
- prop= RNA_def_property(srna, "is_required", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_required", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_is_required_get", NULL);
RNA_def_property_ui_text(prop, "Required", "False when this property is an optional argument in an RNA function");
- prop= RNA_def_property(srna, "is_never_none", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_never_none", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_is_never_none_get", NULL);
RNA_def_property_ui_text(prop, "Never None", "True when this value can't be set to None");
- prop= RNA_def_property(srna, "is_hidden", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_hidden", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_is_hidden_get", NULL);
RNA_def_property_ui_text(prop, "Hidden", "True when the property is hidden");
- prop= RNA_def_property(srna, "is_skip_save", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_skip_save", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_is_skip_save_get", NULL);
RNA_def_property_ui_text(prop, "Skip Save", "True when the property is not saved in presets");
- prop= RNA_def_property(srna, "is_output", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_output", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_use_output_get", NULL);
RNA_def_property_ui_text(prop, "Return", "True when this property is an output value from an RNA function");
- prop= RNA_def_property(srna, "is_registered", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_registered", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_registered_get", NULL);
RNA_def_property_ui_text(prop, "Registered", "Property is registered as part of type registration");
- prop= RNA_def_property(srna, "is_registered_optional", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_registered_optional", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_registered_optional_get", NULL);
RNA_def_property_ui_text(prop, "Registered Optionally", "Property is optionally registered as part of type registration");
- prop= RNA_def_property(srna, "is_runtime", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_runtime", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_runtime_get", NULL);
RNA_def_property_ui_text(prop, "Runtime", "Property has been dynamically created at runtime");
- prop= RNA_def_property(srna, "is_enum_flag", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_enum_flag", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_is_enum_flag_get", NULL);
RNA_def_property_ui_text(prop, "Enum Flag", "True when multiple enums ");
@@ -1151,38 +1151,38 @@ static void rna_def_function(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Function", NULL);
+ srna = RNA_def_struct(brna, "Function", NULL);
RNA_def_struct_ui_text(srna, "Function Definition", "RNA function definition");
RNA_def_struct_ui_icon(srna, ICON_RNA);
- prop= RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Function_identifier_get", "rna_Function_identifier_length", NULL);
RNA_def_property_ui_text(prop, "Identifier", "Unique name used in the code and scripting");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "description", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "description", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Function_description_get", "rna_Function_description_length", NULL);
RNA_def_property_ui_text(prop, "Description", "Description of the Function's purpose");
- prop= RNA_def_property(srna, "parameters", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "parameters", PROP_COLLECTION, PROP_NONE);
/*RNA_def_property_clear_flag(prop, PROP_EDITABLE);*/
RNA_def_property_struct_type(prop, "Property");
RNA_def_property_collection_funcs(prop, "rna_Function_parameters_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Parameters", "Parameters for the function");
- prop= RNA_def_property(srna, "is_registered", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_registered", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Function_registered_get", NULL);
RNA_def_property_ui_text(prop, "Registered", "Function is registered as callback as part of type registration");
- prop= RNA_def_property(srna, "is_registered_optional", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_registered_optional", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Function_registered_optional_get", NULL);
RNA_def_property_ui_text(prop, "Registered Optionally", "Function is optionally registered as callback part of type registration");
- prop= RNA_def_property(srna, "use_self", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_self", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Function_no_self_get", NULL);
RNA_def_property_ui_text(prop, "No Self", "Function does not pass its self as an argument (becomes a class method in python)");
@@ -1192,11 +1192,11 @@ static void rna_def_number_property(StructRNA *srna, PropertyType type)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "default", type, PROP_NONE);
+ prop = RNA_def_property(srna, "default", type, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Default", "Default value for this number");
- switch(type) {
+ switch (type) {
case PROP_BOOLEAN:
RNA_def_property_boolean_funcs(prop, "rna_BoolProperty_default_get", NULL);
break;
@@ -1211,13 +1211,13 @@ static void rna_def_number_property(StructRNA *srna, PropertyType type)
}
- prop= RNA_def_property(srna, "default_array", type, PROP_NONE);
+ prop = RNA_def_property(srna, "default_array", type, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_array(prop, RNA_MAX_ARRAY_DIMENSION); /* no fixed default length, important its not 0 though */
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_NumberProperty_default_array_get_length"); /* same for all types */
- switch(type) {
+ switch (type) {
case PROP_BOOLEAN:
RNA_def_property_boolean_funcs(prop, "rna_BoolProperty_default_array_get", NULL);
break;
@@ -1233,46 +1233,46 @@ static void rna_def_number_property(StructRNA *srna, PropertyType type)
RNA_def_property_ui_text(prop, "Default Array", "Default value for this array");
- prop= RNA_def_property(srna, "array_length", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "array_length", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_Property_array_length_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Array Length", "Maximum length of the array, 0 means unlimited");
- if(type == PROP_BOOLEAN)
+ if (type == PROP_BOOLEAN)
return;
- prop= RNA_def_property(srna, "hard_min", type, PROP_NONE);
+ prop = RNA_def_property(srna, "hard_min", type, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_hard_min_get", NULL, NULL);
+ if (type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_hard_min_get", NULL, NULL);
else RNA_def_property_float_funcs(prop, "rna_FloatProperty_hard_min_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Hard Minimum", "Minimum value used by buttons");
- prop= RNA_def_property(srna, "hard_max", type, PROP_NONE);
+ prop = RNA_def_property(srna, "hard_max", type, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_hard_max_get", NULL, NULL);
+ if (type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_hard_max_get", NULL, NULL);
else RNA_def_property_float_funcs(prop, "rna_FloatProperty_hard_max_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Hard Maximum", "Maximum value used by buttons");
- prop= RNA_def_property(srna, "soft_min", type, PROP_NONE);
+ prop = RNA_def_property(srna, "soft_min", type, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_soft_min_get", NULL, NULL);
+ if (type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_soft_min_get", NULL, NULL);
else RNA_def_property_float_funcs(prop, "rna_FloatProperty_soft_min_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Soft Minimum", "Minimum value used by buttons");
- prop= RNA_def_property(srna, "soft_max", type, PROP_NONE);
+ prop = RNA_def_property(srna, "soft_max", type, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_soft_max_get", NULL, NULL);
+ if (type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_soft_max_get", NULL, NULL);
else RNA_def_property_float_funcs(prop, "rna_FloatProperty_soft_max_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Soft Maximum", "Maximum value used by buttons");
- prop= RNA_def_property(srna, "step", type, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "step", type, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_step_get", NULL, NULL);
+ if (type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_step_get", NULL, NULL);
else RNA_def_property_float_funcs(prop, "rna_FloatProperty_step_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Step", "Step size used by number buttons, for floats 1/100th of the step size");
- if(type == PROP_FLOAT) {
- prop= RNA_def_property(srna, "precision", PROP_INT, PROP_UNSIGNED);
+ if (type == PROP_FLOAT) {
+ prop = RNA_def_property(srna, "precision", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_FloatProperty_precision_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Precision", "Number of digits after the dot used by buttons");
@@ -1283,12 +1283,12 @@ static void rna_def_string_property(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "default", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "default", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_StringProperty_default_get", "rna_StringProperty_default_length", NULL);
RNA_def_property_ui_text(prop, "Default", "string default value");
- prop= RNA_def_property(srna, "length_max", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "length_max", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_StringProperty_max_length_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Maximum Length", "Maximum length of the string, 0 means unlimited");
@@ -1303,47 +1303,47 @@ static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna)
{PROP_NONE, "DUMMY", 0, "Dummy", ""},
{0, NULL, 0, NULL, NULL}};
- prop= RNA_def_property(srna, "default", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "default", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, default_dummy_items);
RNA_def_property_enum_funcs(prop, "rna_EnumProperty_default_get", NULL, "rna_EnumProperty_default_itemf");
RNA_def_property_ui_text(prop, "Default", "Default value for this enum");
/* same 'default' but uses 'PROP_ENUM_FLAG' */
- prop= RNA_def_property(srna, "default_flag", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "default_flag", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_ENUM_FLAG);
RNA_def_property_enum_items(prop, default_dummy_items);
RNA_def_property_enum_funcs(prop, "rna_EnumProperty_default_get", NULL, "rna_EnumProperty_default_itemf");
RNA_def_property_ui_text(prop, "Default", "Default value for this enum");
- prop= RNA_def_property(srna, "enum_items", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "enum_items", PROP_COLLECTION, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "EnumPropertyItem");
RNA_def_property_collection_funcs(prop, "rna_EnumProperty_items_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Items", "Possible values for the property");
- srna= RNA_def_struct(brna, "EnumPropertyItem", NULL);
+ srna = RNA_def_struct(brna, "EnumPropertyItem", NULL);
RNA_def_struct_ui_text(srna, "Enum Item Definition", "Definition of a choice in an RNA enum property");
RNA_def_struct_ui_icon(srna, ICON_RNA);
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_name_get", "rna_EnumPropertyItem_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "Human readable name");
- prop= RNA_def_property(srna, "description", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "description", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_description_get", "rna_EnumPropertyItem_description_length", NULL);
RNA_def_property_ui_text(prop, "Description", "Description of the item's purpose");
- prop= RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_identifier_get", "rna_EnumPropertyItem_identifier_length", NULL);
RNA_def_property_ui_text(prop, "Identifier", "Unique name used in the code and scripting");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "value", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "value", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_EnumPropertyItem_value_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Value", "Value of the item");
@@ -1353,10 +1353,10 @@ static void rna_def_pointer_property(StructRNA *srna, PropertyType type)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "fixed_type", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "fixed_type", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Struct");
- if(type == PROP_POINTER)
+ if (type == PROP_POINTER)
RNA_def_property_pointer_funcs(prop, "rna_PointerProperty_fixed_type_get", NULL, NULL, NULL);
else
RNA_def_property_pointer_funcs(prop, "rna_CollectionProperty_fixed_type_get", NULL, NULL, NULL);
@@ -1375,37 +1375,37 @@ void RNA_def_rna(BlenderRNA *brna)
rna_def_property(brna);
/* BoolProperty */
- srna= RNA_def_struct(brna, "BoolProperty", "Property");
+ srna = RNA_def_struct(brna, "BoolProperty", "Property");
RNA_def_struct_ui_text(srna, "Boolean Definition", "RNA boolean property definition");
rna_def_number_property(srna, PROP_BOOLEAN);
/* IntProperty */
- srna= RNA_def_struct(brna, "IntProperty", "Property");
+ srna = RNA_def_struct(brna, "IntProperty", "Property");
RNA_def_struct_ui_text(srna, "Int Definition", "RNA integer number property definition");
rna_def_number_property(srna, PROP_INT);
/* FloatProperty */
- srna= RNA_def_struct(brna, "FloatProperty", "Property");
+ srna = RNA_def_struct(brna, "FloatProperty", "Property");
RNA_def_struct_ui_text(srna, "Float Definition", "RNA floating pointer number property definition");
rna_def_number_property(srna, PROP_FLOAT);
/* StringProperty */
- srna= RNA_def_struct(brna, "StringProperty", "Property");
+ srna = RNA_def_struct(brna, "StringProperty", "Property");
RNA_def_struct_ui_text(srna, "String Definition", "RNA text string property definition");
rna_def_string_property(srna);
/* EnumProperty */
- srna= RNA_def_struct(brna, "EnumProperty", "Property");
+ srna = RNA_def_struct(brna, "EnumProperty", "Property");
RNA_def_struct_ui_text(srna, "Enum Definition", "RNA enumeration property definition, to choose from a number of predefined options");
rna_def_enum_property(brna, srna);
/* PointerProperty */
- srna= RNA_def_struct(brna, "PointerProperty", "Property");
+ srna = RNA_def_struct(brna, "PointerProperty", "Property");
RNA_def_struct_ui_text(srna, "Pointer Definition", "RNA pointer property to point to another RNA struct");
rna_def_pointer_property(srna, PROP_POINTER);
/* CollectionProperty */
- srna= RNA_def_struct(brna, "CollectionProperty", "Property");
+ srna = RNA_def_struct(brna, "CollectionProperty", "Property");
RNA_def_struct_ui_text(srna, "Collection Definition", "RNA collection property to define lists, arrays and mappings");
rna_def_pointer_property(srna, PROP_COLLECTION);
@@ -1413,11 +1413,11 @@ void RNA_def_rna(BlenderRNA *brna)
rna_def_function(brna);
/* Blender RNA */
- srna= RNA_def_struct(brna, "BlenderRNA", NULL);
+ srna = RNA_def_struct(brna, "BlenderRNA", NULL);
RNA_def_struct_ui_text(srna, "Blender RNA", "Blender RNA structure definitions");
RNA_def_struct_ui_icon(srna, ICON_RNA);
- prop= RNA_def_property(srna, "structs", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "structs", PROP_COLLECTION, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Struct");
RNA_def_property_collection_funcs(prop, "rna_BlenderRNA_structs_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get",
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index d6783edda42..d3bab1a3a0b 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -85,7 +85,7 @@ EnumPropertyItem snap_target_items[] = {
{SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"},
{0, NULL, 0, NULL, NULL}};
-EnumPropertyItem proportional_falloff_items[] ={
+EnumPropertyItem proportional_falloff_items[] = {
{PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"},
{PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"},
{PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"},
@@ -202,7 +202,7 @@ EnumPropertyItem image_type_items[] = {
{0, "", 0, "Movie", NULL},
#ifdef _WIN32
- {R_IMF_IMTYPE_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", "Output video in AVI format"}, // XXX Missing codec menu
+ {R_IMF_IMTYPE_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", "Output video in AVI format"}, /* XXX Missing codec menu */
#endif
{R_IMF_IMTYPE_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", "Output video in AVI JPEG format"},
{R_IMF_IMTYPE_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", "Output video in AVI Raw format"},
@@ -226,7 +226,7 @@ EnumPropertyItem image_type_items[] = {
#endif
{0, NULL, 0, NULL, NULL}};
-EnumPropertyItem image_color_mode_items[] ={
+EnumPropertyItem image_color_mode_items[] = {
{R_IMF_PLANES_BW, "BW", 0, "BW", "Images get saved in 8 bits grayscale (only PNG, JPEG, TGA, TIF)"},
{R_IMF_PLANES_RGB, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
{R_IMF_PLANES_RGBA, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"},
@@ -294,12 +294,12 @@ static void rna_SpaceImageEditor_uv_sculpt_update(Main *bmain, Scene *scene, Poi
static int rna_Scene_object_bases_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
{
- Scene *scene= (Scene*)ptr->data;
+ Scene *scene = (Scene*)ptr->data;
Base *base;
- for(base= scene->base.first; base; base= base->next) {
- if(strncmp(base->object->id.name+2, key, sizeof(base->object->id.name)-2)==0) {
- *r_ptr= rna_pointer_inherit_refine(ptr, &RNA_ObjectBase, base);
+ for (base = scene->base.first; base; base = base->next) {
+ if (strncmp(base->object->id.name+2, key, sizeof(base->object->id.name)-2) == 0) {
+ *r_ptr = rna_pointer_inherit_refine(ptr, &RNA_ObjectBase, base);
return TRUE;
}
}
@@ -309,7 +309,7 @@ static int rna_Scene_object_bases_lookup_string(PointerRNA *ptr, const char *key
static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
{
- ListBaseIterator *internal= iter->internal;
+ ListBaseIterator *internal = iter->internal;
/* we are actually iterating a Base list, so override get */
return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
@@ -317,7 +317,7 @@ static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *reports, Object *ob)
{
- Scene *scene_act= CTX_data_scene(C);
+ Scene *scene_act = CTX_data_scene(C);
Base *base;
if (object_in_scene(ob, scene)) {
@@ -325,15 +325,15 @@ static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *report
return NULL;
}
- base= scene_add_base(scene, ob);
+ base = scene_add_base(scene, ob);
id_us_plus(&ob->id);
/* this is similar to what object_add_type and add_object do */
- base->lay= scene->lay;
+ base->lay = scene->lay;
/* when linking to an inactive scene dont touch the layer */
- if(scene == scene_act)
- ob->lay= base->lay;
+ if (scene == scene_act)
+ ob->lay = base->lay;
ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
@@ -347,17 +347,17 @@ static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *report
static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *ob)
{
- Base *base= object_in_scene(ob, scene);
+ Base *base = object_in_scene(ob, scene);
if (!base) {
BKE_reportf(reports, RPT_ERROR, "Object '%s' is not in this scene '%s'", ob->id.name+2, scene->id.name+2);
return;
}
- if (base==scene->basact && ob->mode != OB_MODE_OBJECT) {
+ if (base == scene->basact && ob->mode != OB_MODE_OBJECT) {
BKE_reportf(reports, RPT_ERROR, "Object '%s' must be in 'Object Mode' to unlink", ob->id.name+2);
return;
}
- if(scene->basact==base) {
- scene->basact= NULL;
+ if (scene->basact == base) {
+ scene->basact = NULL;
}
BLI_remlink(&scene->base, base);
@@ -365,7 +365,7 @@ static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *o
ob->id.us--;
- /* needed otherwise the depgraph will contain free'd objects which can crash, see [#20958] */
+ /* needed otherwise the depgraph will contain freed objects which can crash, see [#20958] */
DAG_scene_sort(G.main, scene);
DAG_ids_flush_update(G.main, 0);
@@ -375,7 +375,7 @@ static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *o
static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
{
ToolSettings *ts = (ToolSettings*)ptr->data;
- if(value.data && ((Object*)value.data)->type == OB_ARMATURE)
+ if (value.data && ((Object*)value.data)->type == OB_ARMATURE)
ts->skgen_template = value.data;
else
ts->skgen_template = NULL;
@@ -383,43 +383,50 @@ static void rna_Scene_skgen_etch_template_set(PointerRNA *ptr, PointerRNA value)
static PointerRNA rna_Scene_active_object_get(PointerRNA *ptr)
{
- Scene *scene= (Scene*)ptr->data;
+ Scene *scene = (Scene*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_Object, scene->basact ? scene->basact->object : NULL);
}
static void rna_Scene_active_object_set(PointerRNA *ptr, PointerRNA value)
{
- Scene *scene= (Scene*)ptr->data;
- if(value.data)
- scene->basact= object_in_scene((Object*)value.data, scene);
+ Scene *scene = (Scene*)ptr->data;
+ if (value.data)
+ scene->basact = object_in_scene((Object*)value.data, scene);
else
- scene->basact= NULL;
+ scene->basact = NULL;
}
static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
{
- Scene *scene= (Scene*)ptr->data;
- Scene *set= (Scene*)value.data;
+ Scene *scene = (Scene*)ptr->data;
+ Scene *set = (Scene*)value.data;
Scene *nested_set;
- for(nested_set= set; nested_set; nested_set= nested_set->set) {
- if(nested_set==scene)
+ for (nested_set = set; nested_set; nested_set = nested_set->set) {
+ if (nested_set == scene)
return;
}
- scene->set= set;
+ scene->set = set;
}
static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
{
- Scene *scene= (Scene*)ptr->data;
+ Scene *scene = (Scene*)ptr->data;
- scene->lay= ED_view3d_scene_layer_set(scene->lay, values, &scene->layact);
+ scene->lay = ED_view3d_scene_layer_set(scene->lay, values, &scene->layact);
+}
+
+static int rna_Scene_active_layer_get(PointerRNA *ptr)
+{
+ Scene *scene = (Scene*)ptr->data;
+
+ return (int)(log(scene->layact)/M_LN2);
}
static void rna_Scene_view3d_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr)
{
- Scene *scene= (Scene*)ptr->data;
+ Scene *scene = (Scene*)ptr->data;
BKE_screen_view3d_main_sync(&bmain->screen, scene);
}
@@ -443,52 +450,60 @@ static void rna_Scene_listener_update(Main *UNUSED(bmain), Scene *scene, Pointer
static void rna_Scene_volume_set(PointerRNA *ptr, float value)
{
- Scene *scene= (Scene*)(ptr->data);
+ Scene *scene = (Scene*)(ptr->data);
scene->audio.volume = value;
- if(scene->sound_scene)
+ if (scene->sound_scene)
sound_set_scene_volume(scene, value);
}
static void rna_Scene_framelen_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
-{
- scene->r.framelen= (float)scene->r.framapto/(float)scene->r.images;
+{
+ scene->r.framelen = (float)scene->r.framapto/(float)scene->r.images;
}
static void rna_Scene_current_frame_set(PointerRNA *ptr, int value)
{
- Scene *data= (Scene*)ptr->data;
+ Scene *data = (Scene*)ptr->data;
/* if negative frames aren't allowed, then we can't use them */
FRAMENUMBER_MIN_CLAMP(value);
- data->r.cfra= value;
+ data->r.cfra = value;
}
static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
{
- Scene *data= (Scene*)ptr->data;
+ Scene *data = (Scene*)ptr->data;
/* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
- CLAMP(value, MINFRAME, data->r.efra);
- data->r.sfra= value;
+ CLAMP(value, MINFRAME, MAXFRAME);
+ data->r.sfra = value;
+
+ if (data->r.sfra >= data->r.efra) {
+ data->r.efra = MIN2(data->r.sfra + 1, MAXFRAME);
+ }
}
static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
{
- Scene *data= (Scene*)ptr->data;
- CLAMP(value, data->r.sfra, MAXFRAME);
- data->r.efra= value;
+ Scene *data = (Scene*)ptr->data;
+ CLAMP(value, MINFRAME, MAXFRAME);
+ data->r.efra = value;
+
+ if (data->r.sfra >= data->r.efra) {
+ data->r.sfra = MAX2(data->r.efra - 1, MINFRAME);
+ }
}
static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value)
{
- Scene *data= (Scene*)ptr->data;
+ Scene *data = (Scene*)ptr->data;
if (value) {
/* copy range from scene if not set before */
if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
- data->r.psfra= data->r.sfra;
- data->r.pefra= data->r.efra;
+ data->r.psfra = data->r.sfra;
+ data->r.pefra = data->r.efra;
}
data->r.flag |= SCER_PRV_RANGE;
@@ -500,54 +515,54 @@ static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value)
static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
{
- Scene *data= (Scene*)ptr->data;
+ Scene *data = (Scene*)ptr->data;
/* check if enabled already */
if ((data->r.flag & SCER_PRV_RANGE) == 0) {
/* set end of preview range to end frame, then clamp as per normal */
- // TODO: or just refuse to set instead?
- data->r.pefra= data->r.efra;
+ /* TODO: or just refuse to set instead? */
+ data->r.pefra = data->r.efra;
}
/* now set normally */
CLAMP(value, MINAFRAME, data->r.pefra);
- data->r.psfra= value;
+ data->r.psfra = value;
}
static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
{
- Scene *data= (Scene*)ptr->data;
+ Scene *data = (Scene*)ptr->data;
/* check if enabled already */
if ((data->r.flag & SCER_PRV_RANGE) == 0) {
/* set start of preview range to start frame, then clamp as per normal */
- // TODO: or just refuse to set instead?
- data->r.psfra= data->r.sfra;
+ /* TODO: or just refuse to set instead? */
+ data->r.psfra = data->r.sfra;
}
/* now set normally */
CLAMP(value, data->r.psfra, MAXFRAME);
- data->r.pefra= value;
+ data->r.pefra = value;
}
static void rna_Scene_frame_update(Main *bmain, Scene *UNUSED(current_scene), PointerRNA *ptr)
{
- Scene *scene= (Scene*)ptr->id.data;
+ Scene *scene = (Scene*)ptr->id.data;
sound_seek_scene(bmain, scene);
}
static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
{
- Scene *scene= (Scene *)ptr->data;
+ Scene *scene = (Scene *)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, ANIM_scene_get_active_keyingset(scene));
}
static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
{
- Scene *scene= (Scene *)ptr->data;
- KeyingSet *ks= (KeyingSet*)value.data;
+ Scene *scene = (Scene *)ptr->data;
+ KeyingSet *ks = (KeyingSet*)value.data;
- scene->active_keyingset= ANIM_scene_get_keyingset_index(scene, ks);
+ scene->active_keyingset = ANIM_scene_get_keyingset_index(scene, ks);
}
/* get KeyingSet index stuff for list of Keying Sets editing UI
@@ -556,7 +571,7 @@ static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
*/
static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
{
- Scene *scene= (Scene *)ptr->data;
+ Scene *scene = (Scene *)ptr->data;
return scene->active_keyingset-1;
}
@@ -565,17 +580,17 @@ static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
*/
static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
{
- Scene *scene= (Scene *)ptr->data;
- scene->active_keyingset= value+1;
+ Scene *scene = (Scene *)ptr->data;
+ scene->active_keyingset = value+1;
}
-// XXX: evil... builtin_keyingsets is defined in keyingsets.c!
-// TODO: make API function to retrieve this...
+/* XXX: evil... builtin_keyingsets is defined in keyingsets.c! */
+/* TODO: make API function to retrieve this... */
extern ListBase builtin_keyingsets;
static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Scene *scene= (Scene*)ptr->data;
+ Scene *scene = (Scene*)ptr->data;
/* start going over the scene KeyingSets first, while we still have pointer to it
* but only if we have any Keying Sets to use...
@@ -588,16 +603,16 @@ static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, Poi
static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
{
- ListBaseIterator *internal= iter->internal;
- KeyingSet *ks= (KeyingSet*)internal->link;
+ ListBaseIterator *internal = iter->internal;
+ KeyingSet *ks = (KeyingSet*)internal->link;
/* if we've run out of links in Scene list, jump over to the builtins list unless we're there already */
if ((ks->next == NULL) && (ks != builtin_keyingsets.last))
- internal->link= (Link*)builtin_keyingsets.first;
+ internal->link = (Link*)builtin_keyingsets.first;
else
- internal->link= (Link*)ks->next;
+ internal->link = (Link*)ks->next;
- iter->valid= (internal->link != NULL);
+ iter->valid = (internal->link != NULL);
}
@@ -608,9 +623,9 @@ static char *rna_RenderSettings_path(PointerRNA *UNUSED(ptr))
static int rna_RenderSettings_threads_get(PointerRNA *ptr)
{
- RenderData *rd= (RenderData*)ptr->data;
+ RenderData *rd = (RenderData*)ptr->data;
- if(rd->mode & R_FIXED_THREADS)
+ if (rd->mode & R_FIXED_THREADS)
return rd->threads;
else
return BLI_system_thread_count();
@@ -618,14 +633,14 @@ static int rna_RenderSettings_threads_get(PointerRNA *ptr)
static int rna_RenderSettings_is_movie_fomat_get(PointerRNA *ptr)
{
- RenderData *rd= (RenderData*)ptr->data;
+ RenderData *rd = (RenderData*)ptr->data;
return BKE_imtype_is_movie(rd->im_format.imtype);
}
static int rna_RenderSettings_save_buffers_get(PointerRNA *ptr)
{
- RenderData *rd= (RenderData*)ptr->data;
- if(rd->mode & R_BORDER)
+ RenderData *rd = (RenderData*)ptr->data;
+ if (rd->mode & R_BORDER)
return 0;
else
return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
@@ -633,34 +648,34 @@ static int rna_RenderSettings_save_buffers_get(PointerRNA *ptr)
static int rna_RenderSettings_full_sample_get(PointerRNA *ptr)
{
- RenderData *rd= (RenderData*)ptr->data;
+ RenderData *rd = (RenderData*)ptr->data;
return (rd->scemode & R_FULL_SAMPLE) && !(rd->mode & R_BORDER);
}
static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value)
{
- ImageFormatData *imf= (ImageFormatData *)ptr->data;
- ID *id= ptr->id.data;
- const char is_render= (id && GS(id->name) == ID_SCE);
+ ImageFormatData *imf = (ImageFormatData *)ptr->data;
+ ID *id = ptr->id.data;
+ const char is_render = (id && GS(id->name) == ID_SCE);
/* see note below on why this is */
- const char chan_flag= BKE_imtype_valid_channels(imf->imtype) | (is_render ? IMA_CHAN_FLAG_BW : 0);
+ const char chan_flag = BKE_imtype_valid_channels(imf->imtype) | (is_render ? IMA_CHAN_FLAG_BW : 0);
- imf->imtype= value;
+ imf->imtype = value;
/* ensure depth and color settings match */
if ( ((imf->planes == R_IMF_PLANES_BW) && !(chan_flag & IMA_CHAN_FLAG_BW)) ||
((imf->planes == R_IMF_PLANES_RGBA) && !(chan_flag & IMA_CHAN_FLAG_ALPHA)))
{
- imf->planes= R_IMF_PLANES_RGB;
+ imf->planes = R_IMF_PLANES_RGB;
}
/* ensure usable depth */
{
- const int depth_ok= BKE_imtype_valid_depths(imf->imtype);
+ const int depth_ok = BKE_imtype_valid_depths(imf->imtype);
if ((imf->depth & depth_ok) == 0) {
/* set first available depth */
- char depth_ls[]= {R_IMF_CHAN_DEPTH_32,
+ char depth_ls[] = {R_IMF_CHAN_DEPTH_32,
R_IMF_CHAN_DEPTH_24,
R_IMF_CHAN_DEPTH_16,
R_IMF_CHAN_DEPTH_12,
@@ -669,9 +684,9 @@ static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value)
0};
int i;
- for (i= 0; depth_ls[i]; i++) {
+ for (i = 0; depth_ls[i]; i++) {
if (depth_ok & depth_ls[i]) {
- imf->depth= depth_ls[i];
+ imf->depth = depth_ls[i];
break;
}
}
@@ -679,8 +694,8 @@ static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value)
}
if (id && GS(id->name) == ID_SCE) {
- Scene *scene= ptr->id.data;
- RenderData *rd= &scene->r;
+ Scene *scene = ptr->id.data;
+ RenderData *rd = &scene->r;
#ifdef WITH_FFMPEG
ffmpeg_verify_image_type(rd, imf);
#endif
@@ -694,7 +709,7 @@ static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value)
static EnumPropertyItem *rna_ImageFormatSettings_file_format_itemf(bContext *C, PointerRNA *ptr,
PropertyRNA *UNUSED(prop), int *free)
{
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
if (id && GS(id->name) == ID_SCE) {
return image_type_items;
}
@@ -706,22 +721,22 @@ static EnumPropertyItem *rna_ImageFormatSettings_file_format_itemf(bContext *C,
static EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext *C, PointerRNA *ptr,
PropertyRNA *UNUSED(prop), int *free)
{
- ImageFormatData *imf= (ImageFormatData *)ptr->data;
- ID *id= ptr->id.data;
- const char is_render= (id && GS(id->name) == ID_SCE);
+ ImageFormatData *imf = (ImageFormatData *)ptr->data;
+ ID *id = ptr->id.data;
+ const char is_render = (id && GS(id->name) == ID_SCE);
/* note, we need to act differently for render
* where 'BW' will force greyscale even if the output format writes
* as RGBA, this is age old blender convention and not sure how useful
* it really is but keep it for now - campbell */
- char chan_flag= BKE_imtype_valid_channels(imf->imtype) | (is_render ? IMA_CHAN_FLAG_BW : 0);
+ char chan_flag = BKE_imtype_valid_channels(imf->imtype) | (is_render ? IMA_CHAN_FLAG_BW : 0);
#ifdef WITH_FFMPEG
/* a WAY more crappy case than B&W flag: depending on codec, file format MIGHT support
* alpha channel. for example MPEG format with h264 codec can't do alpha channel, but
* the same MPEG format with QTRLE codec can easily handle alpga channel.
* not sure how to deal with such cases in a nicer way (sergey) */
- if(is_render) {
+ if (is_render) {
Scene *scene = ptr->id.data;
RenderData *rd = &scene->r;
@@ -734,15 +749,15 @@ static EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext *C, P
return image_color_mode_items;
}
else {
- int totitem= 0;
- EnumPropertyItem *item= NULL;
+ int totitem = 0;
+ EnumPropertyItem *item = NULL;
if (chan_flag & IMA_CHAN_FLAG_BW) RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_BW);
if (chan_flag & IMA_CHAN_FLAG_RGB) RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGB);
if (chan_flag & IMA_CHAN_FLAG_ALPHA) RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGBA);
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
@@ -751,22 +766,22 @@ static EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext *C, P
static EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf(bContext *C, PointerRNA *ptr,
PropertyRNA *UNUSED(prop), int *free)
{
- ImageFormatData *imf= (ImageFormatData *)ptr->data;
+ ImageFormatData *imf = (ImageFormatData *)ptr->data;
if (imf == NULL) {
return image_color_depth_items;
}
else {
- const int depth_ok= BKE_imtype_valid_depths(imf->imtype);
- const int is_float= ELEM3(imf->imtype, R_IMF_IMTYPE_RADHDR, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER);
+ const int depth_ok = BKE_imtype_valid_depths(imf->imtype);
+ const int is_float = ELEM3(imf->imtype, R_IMF_IMTYPE_RADHDR, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER);
- EnumPropertyItem *item_8bit= &image_color_depth_items[0];
- EnumPropertyItem *item_12bit= &image_color_depth_items[1];
- EnumPropertyItem *item_16bit= &image_color_depth_items[2];
- EnumPropertyItem *item_32bit= &image_color_depth_items[3];
+ EnumPropertyItem *item_8bit = &image_color_depth_items[0];
+ EnumPropertyItem *item_12bit = &image_color_depth_items[1];
+ EnumPropertyItem *item_16bit = &image_color_depth_items[2];
+ EnumPropertyItem *item_32bit = &image_color_depth_items[3];
- int totitem= 0;
- EnumPropertyItem *item= NULL;
+ int totitem = 0;
+ EnumPropertyItem *item = NULL;
EnumPropertyItem tmp = {0, "", 0, "", ""};
if (depth_ok & R_IMF_CHAN_DEPTH_8) {
@@ -779,8 +794,8 @@ static EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf(bContext *C,
if (depth_ok & R_IMF_CHAN_DEPTH_16) {
if (is_float) {
- tmp= *item_16bit;
- tmp.name= "Float (Half)";
+ tmp = *item_16bit;
+ tmp.name = "Float (Half)";
RNA_enum_item_add(&item, &totitem, &tmp);
}
else {
@@ -790,8 +805,8 @@ static EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf(bContext *C,
if (depth_ok & R_IMF_CHAN_DEPTH_32) {
if (is_float) {
- tmp= *item_32bit;
- tmp.name= "Float (Full)";
+ tmp = *item_32bit;
+ tmp.name = "Float (Full)";
RNA_enum_item_add(&item, &totitem, &tmp);
}
else {
@@ -800,7 +815,7 @@ static EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf(bContext *C,
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
@@ -808,17 +823,17 @@ static EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf(bContext *C,
static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
{
- RenderData *rd= (RenderData*)ptr->data;
+ RenderData *rd = (RenderData*)ptr->data;
char ext[8];
- ext[0]= '\0';
+ ext[0] = '\0';
BKE_add_image_extension(ext, rd->im_format.imtype);
return strlen(ext);
}
static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
{
- RenderData *rd= (RenderData*)ptr->data;
- str[0]= '\0';
+ RenderData *rd = (RenderData*)ptr->data;
+ str[0] = '\0';
BKE_add_image_extension(str, rd->im_format.imtype);
}
@@ -840,26 +855,26 @@ static void rna_RenderSettings_qtcodecsettings_codecType_set(PointerRNA *ptr, in
static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr,
PropertyRNA *UNUSED(prop), int *free)
{
- EnumPropertyItem *item= NULL;
+ EnumPropertyItem *item = NULL;
EnumPropertyItem tmp = {0, "", 0, "", ""};
QuicktimeCodecTypeDesc *codecTypeDesc;
- int i=1, totitem= 0;
+ int i = 1, totitem = 0;
char id[5];
- for(i=0;i<quicktime_get_num_videocodecs();i++) {
+ for (i = 0;i<quicktime_get_num_videocodecs();i++) {
codecTypeDesc = quicktime_get_videocodecType_desc(i);
if (!codecTypeDesc) break;
- tmp.value= codecTypeDesc->rnatmpvalue;
+ tmp.value = codecTypeDesc->rnatmpvalue;
*((int*)id) = codecTypeDesc->codecType;
id[4] = 0;
- tmp.identifier= id;
- tmp.name= codecTypeDesc->codecName;
+ tmp.identifier = id;
+ tmp.name = codecTypeDesc->codecName;
RNA_enum_item_add(&item, &totitem, &tmp);
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
@@ -882,26 +897,26 @@ static void rna_RenderSettings_qtcodecsettings_audiocodecType_set(PointerRNA *pt
static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf(bContext *C, PointerRNA *ptr,
PropertyRNA *UNUSED(prop), int *free)
{
- EnumPropertyItem *item= NULL;
+ EnumPropertyItem *item = NULL;
EnumPropertyItem tmp = {0, "", 0, "", ""};
QuicktimeCodecTypeDesc *codecTypeDesc;
- int i=1, totitem= 0;
+ int i = 1, totitem = 0;
- for(i=0;i<quicktime_get_num_audiocodecs();i++) {
+ for (i = 0;i<quicktime_get_num_audiocodecs();i++) {
codecTypeDesc = quicktime_get_audiocodecType_desc(i);
if (!codecTypeDesc) break;
- tmp.value= codecTypeDesc->rnatmpvalue;
- tmp.identifier= codecTypeDesc->codecName;
- tmp.name= codecTypeDesc->codecName;
+ tmp.value = codecTypeDesc->rnatmpvalue;
+ tmp.identifier = codecTypeDesc->codecName;
+ tmp.name = codecTypeDesc->codecName;
RNA_enum_item_add(&item, &totitem, &tmp);
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
-}
+}
#endif
#endif
@@ -930,28 +945,28 @@ static void rna_FFmpegSettings_codec_settings_update(Main *UNUSED(bmain), Scene
static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr)
{
- RenderData *rd= (RenderData*)ptr->data;
+ RenderData *rd = (RenderData*)ptr->data;
return rd->actlay;
}
static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value)
{
- RenderData *rd= (RenderData*)ptr->data;
- rd->actlay= value;
+ RenderData *rd = (RenderData*)ptr->data;
+ rd->actlay = value;
}
static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max)
{
- RenderData *rd= (RenderData*)ptr->data;
+ RenderData *rd = (RenderData*)ptr->data;
- *min= 0;
- *max= BLI_countlist(&rd->layers)-1;
- *max= MAX2(0, *max);
+ *min = 0;
+ *max = BLI_countlist(&rd->layers)-1;
+ *max = MAX2(0, *max);
}
static PointerRNA rna_RenderSettings_active_layer_get(PointerRNA *ptr)
{
- RenderData *rd= (RenderData*)ptr->data;
+ RenderData *rd = (RenderData*)ptr->data;
SceneRenderLayer *srl = BLI_findlink(&rd->layers, rd->actlay);
return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderLayer, srl);
@@ -959,16 +974,16 @@ static PointerRNA rna_RenderSettings_active_layer_get(PointerRNA *ptr)
static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA value)
{
- RenderData *rd= (RenderData*)ptr->data;
- SceneRenderLayer *srl= (SceneRenderLayer*)value.data;
- const int index= BLI_findindex(&rd->layers, srl);
- if (index != -1) rd->actlay= index;
+ RenderData *rd = (RenderData*)ptr->data;
+ SceneRenderLayer *srl = (SceneRenderLayer*)value.data;
+ const int index = BLI_findindex(&rd->layers, srl);
+ if (index != -1) rd->actlay = index;
}
static SceneRenderLayer *rna_RenderLayer_new(ID *id, RenderData *UNUSED(rd), const char *name)
{
- Scene *scene= (Scene *)id;
- SceneRenderLayer *srl= scene_add_render_layer(scene, name);
+ Scene *scene = (Scene *)id;
+ SceneRenderLayer *srl = scene_add_render_layer(scene, name);
WM_main_add_notifier(NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -977,7 +992,7 @@ static SceneRenderLayer *rna_RenderLayer_new(ID *id, RenderData *UNUSED(rd), con
static void rna_RenderLayer_remove(ID *id, RenderData *UNUSED(rd), Main *bmain, ReportList *reports, SceneRenderLayer *srl)
{
- Scene *scene= (Scene *)id;
+ Scene *scene = (Scene *)id;
if (!scene_remove_render_layer(bmain, scene, srl)) {
BKE_reportf(reports, RPT_ERROR, "RenderLayer '%s' could not be removed from scene '%s'", srl->name, scene->id.name+2);
@@ -989,10 +1004,10 @@ static void rna_RenderLayer_remove(ID *id, RenderData *UNUSED(rd), Main *bmain,
static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
{
- RenderData *rd= (RenderData*)ptr->data;
- RenderEngineType *type= BLI_findlink(&R_engines, value);
+ RenderData *rd = (RenderData*)ptr->data;
+ RenderEngineType *type = BLI_findlink(&R_engines, value);
- if(type)
+ if (type)
BLI_strncpy_utf8(rd->engine, type->idname, sizeof(rd->engine));
}
@@ -1000,31 +1015,31 @@ static EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext *UNUSED(C), Po
PropertyRNA *UNUSED(prop), int *free)
{
RenderEngineType *type;
- EnumPropertyItem *item= NULL;
+ EnumPropertyItem *item = NULL;
EnumPropertyItem tmp = {0, "", 0, "", ""};
- int a=0, totitem= 0;
+ int a = 0, totitem = 0;
- for(type=R_engines.first; type; type=type->next, a++) {
- tmp.value= a;
- tmp.identifier= type->idname;
- tmp.name= type->name;
+ for (type = R_engines.first; type; type = type->next, a++) {
+ tmp.value = a;
+ tmp.identifier = type->idname;
+ tmp.name = type->name;
RNA_enum_item_add(&item, &totitem, &tmp);
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
static int rna_RenderSettings_engine_get(PointerRNA *ptr)
{
- RenderData *rd= (RenderData*)ptr->data;
+ RenderData *rd = (RenderData*)ptr->data;
RenderEngineType *type;
- int a= 0;
+ int a = 0;
- for(type=R_engines.first; type; type=type->next, a++)
- if(strcmp(type->idname, rd->engine) == 0)
+ for (type = R_engines.first; type; type = type->next, a++)
+ if (strcmp(type->idname, rd->engine) == 0)
return a;
return 0;
@@ -1037,7 +1052,7 @@ static void rna_RenderSettings_engine_update(Main *bmain, Scene *UNUSED(unused),
static void rna_Scene_glsl_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Scene *scene= (Scene*)ptr->id.data;
+ Scene *scene = (Scene*)ptr->id.data;
DAG_id_tag_update(&scene->id, 0);
}
@@ -1045,15 +1060,15 @@ static void rna_Scene_glsl_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi
static void rna_RenderSettings_color_management_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
/* reset image nodes */
- Scene *scene= (Scene*)ptr->id.data;
- bNodeTree *ntree=scene->nodetree;
+ Scene *scene = (Scene*)ptr->id.data;
+ bNodeTree *ntree = scene->nodetree;
bNode *node;
- if(ntree && scene->use_nodes) {
+ if (ntree && scene->use_nodes) {
/* XXX images are freed here, stop render and preview threads, until Image is threadsafe */
WM_jobs_stop_all(bmain->wm.first);
- for (node=ntree->nodes.first; node; node=node->next) {
+ for (node = ntree->nodes.first; node; node = node->next) {
if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_IMAGE)) {
ED_node_changed_update(&scene->id, node);
WM_main_add_notifier(NC_NODE|NA_EDITED, node);
@@ -1069,18 +1084,18 @@ static void rna_RenderSettings_color_management_update(Main *bmain, Scene *UNUSE
static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
{
- Scene *scene= (Scene*)ptr->id.data;
- SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
+ Scene *scene = (Scene*)ptr->id.data;
+ SceneRenderLayer *rl = (SceneRenderLayer*)ptr->data;
BLI_strncpy_utf8(rl->name, value, sizeof(rl->name));
BLI_uniquename(&scene->r.layers, rl, "RenderLayer", '.', offsetof(SceneRenderLayer, name), sizeof(rl->name));
- if(scene->nodetree) {
+ if (scene->nodetree) {
bNode *node;
- int index= BLI_findindex(&scene->r.layers, rl);
+ int index = BLI_findindex(&scene->r.layers, rl);
- for(node= scene->nodetree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
- if(node->custom1==index)
+ for (node = scene->nodetree->nodes.first; node; node = node->next) {
+ if (node->type == CMP_NODE_R_LAYERS && node->id == NULL) {
+ if (node->custom1 == index)
BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
}
}
@@ -1094,17 +1109,17 @@ static int rna_RenderSettings_multiple_engines_get(PointerRNA *UNUSED(ptr))
static int rna_RenderSettings_use_shading_nodes_get(PointerRNA *ptr)
{
- Scene *scene= (Scene*)ptr->id.data;
+ Scene *scene = (Scene*)ptr->id.data;
return scene_use_new_shading_nodes(scene);
}
static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
{
- RenderData *rd= (RenderData*)ptr->data;
+ RenderData *rd = (RenderData*)ptr->data;
RenderEngineType *type;
- for(type=R_engines.first; type; type=type->next)
- if(strcmp(type->idname, rd->engine) == 0)
+ for (type = R_engines.first; type; type = type->next)
+ if (strcmp(type->idname, rd->engine) == 0)
return (type->flag & RE_GAME);
return 0;
@@ -1112,49 +1127,49 @@ static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
{
- SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
- rl->lay= ED_view3d_scene_layer_set(rl->lay, values, NULL);
+ SceneRenderLayer *rl = (SceneRenderLayer*)ptr->data;
+ rl->lay = ED_view3d_scene_layer_set(rl->lay, values, NULL);
}
static void rna_SceneRenderLayer_pass_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Scene *scene= (Scene*)ptr->id.data;
+ Scene *scene = (Scene*)ptr->id.data;
- if(scene->nodetree)
+ if (scene->nodetree)
ntreeCompositForceHidden(scene->nodetree, scene);
}
static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
{
- Scene *scene= (Scene*)ptr->data;
+ Scene *scene = (Scene*)ptr->data;
- scene->use_nodes= value;
- if(scene->use_nodes && scene->nodetree==NULL)
+ scene->use_nodes = value;
+ if (scene->use_nodes && scene->nodetree == NULL)
ED_node_composit_default(scene);
}
static void rna_Physics_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Scene *scene= (Scene*)ptr->id.data;
+ Scene *scene = (Scene*)ptr->id.data;
Base *base;
- for(base = scene->base.first; base; base=base->next)
+ for (base = scene->base.first; base; base = base->next)
BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
}
static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const int *value)
{
- Scene *scene= (Scene*)ptr->id.data;
+ Scene *scene = (Scene*)ptr->id.data;
ToolSettings *ts = (ToolSettings*)ptr->data;
int flag = (value[0] ? SCE_SELECT_VERTEX:0) | (value[1] ? SCE_SELECT_EDGE:0) | (value[2] ? SCE_SELECT_FACE:0);
- if(flag) {
+ if (flag) {
ts->selectmode = flag;
- if(scene->basact) {
- Mesh *me= get_mesh(scene->basact->object);
- if(me && me->edit_btmesh && me->edit_btmesh->selectmode != flag) {
- me->edit_btmesh->selectmode= flag;
+ if (scene->basact) {
+ Mesh *me = get_mesh(scene->basact->object);
+ if (me && me->edit_btmesh && me->edit_btmesh->selectmode != flag) {
+ me->edit_btmesh->selectmode = flag;
EDBM_selectmode_set(me->edit_btmesh);
}
}
@@ -1163,12 +1178,12 @@ static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const int *value
static void rna_Scene_editmesh_select_mode_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
- Mesh *me= NULL;
+ Mesh *me = NULL;
- if(scene->basact) {
- me= get_mesh(scene->basact->object);
- if(me && me->edit_btmesh==NULL)
- me= NULL;
+ if (scene->basact) {
+ me = get_mesh(scene->basact->object);
+ if (me && me->edit_btmesh == NULL)
+ me = NULL;
}
WM_main_add_notifier(NC_GEOM|ND_SELECT, me);
@@ -1180,17 +1195,17 @@ static void object_simplify_update(Object *ob)
ModifierData *md;
ParticleSystem *psys;
- for(md=ob->modifiers.first; md; md=md->next)
- if(ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
+ for (md = ob->modifiers.first; md; md = md->next)
+ if (ELEM3(md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
ob->recalc |= OB_RECALC_DATA|PSYS_RECALC_CHILD;
- for(psys=ob->particlesystem.first; psys; psys=psys->next)
+ for (psys = ob->particlesystem.first; psys; psys = psys->next)
psys->recalc |= PSYS_RECALC_CHILD;
- if(ob->dup_group) {
+ if (ob->dup_group) {
GroupObject *gob;
- for(gob=ob->dup_group->gobject.first; gob; gob=gob->next)
+ for (gob = ob->dup_group->gobject.first; gob; gob = gob->next)
object_simplify_update(gob->ob);
}
}
@@ -1200,7 +1215,7 @@ static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA
Scene *sce_iter;
Base *base;
- for(SETLOOPER(scene, sce_iter, base))
+ for (SETLOOPER(scene, sce_iter, base))
object_simplify_update(base->object);
DAG_ids_flush_update(bmain, 0);
@@ -1209,21 +1224,21 @@ static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA
static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- if(scene->r.mode & R_SIMPLIFY)
+ if (scene->r.mode & R_SIMPLIFY)
rna_Scene_use_simplify_update(bmain, scene, ptr);
}
static int rna_Scene_use_audio_get(PointerRNA *ptr)
{
- Scene *scene= (Scene*)ptr->data;
+ Scene *scene = (Scene*)ptr->data;
return scene->audio.flag & AUDIO_MUTE;
}
static void rna_Scene_use_audio_set(PointerRNA *ptr, int value)
{
- Scene *scene= (Scene*)ptr->data;
+ Scene *scene = (Scene*)ptr->data;
- if(value)
+ if (value)
scene->audio.flag |= AUDIO_MUTE;
else
scene->audio.flag &= ~AUDIO_MUTE;
@@ -1233,25 +1248,24 @@ static void rna_Scene_use_audio_set(PointerRNA *ptr, int value)
static int rna_Scene_sync_mode_get(PointerRNA *ptr)
{
- Scene *scene= (Scene*)ptr->data;
- if(scene->audio.flag & AUDIO_SYNC)
+ Scene *scene = (Scene*)ptr->data;
+ if (scene->audio.flag & AUDIO_SYNC)
return AUDIO_SYNC;
return scene->flag & SCE_FRAME_DROP;
}
static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
{
- Scene *scene= (Scene*)ptr->data;
+ Scene *scene = (Scene*)ptr->data;
- if(value == AUDIO_SYNC)
+ if (value == AUDIO_SYNC) {
scene->audio.flag |= AUDIO_SYNC;
- else if(value == SCE_FRAME_DROP)
- {
+ }
+ else if (value == SCE_FRAME_DROP) {
scene->audio.flag &= ~AUDIO_SYNC;
scene->flag |= SCE_FRAME_DROP;
}
- else
- {
+ else {
scene->audio.flag &= ~AUDIO_SYNC;
scene->flag &= ~SCE_FRAME_DROP;
}
@@ -1267,7 +1281,7 @@ static int rna_GameSettings_auto_start_get(PointerRNA *UNUSED(ptr))
static void rna_GameSettings_auto_start_set(PointerRNA *UNUSED(ptr), int value)
{
- if(value)
+ if (value)
G.fileflags |= G_FILE_AUTOPLAY;
else
G.fileflags &= ~G_FILE_AUTOPLAY;
@@ -1277,15 +1291,15 @@ static void rna_GameSettings_exit_key_set(PointerRNA *ptr, int value)
{
GameData *gm = (GameData*)ptr->data;
- if(ISKEYBOARD(value))
- gm->exitkey=value;
+ if (ISKEYBOARD(value))
+ gm->exitkey = value;
}
static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[])
{
TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
- marker->flag= SELECT;
- marker->frame= 1;
+ marker->flag = SELECT;
+ marker->frame = 1;
BLI_strncpy_utf8(marker->name, name, sizeof(marker->name));
BLI_addtail(&scene->markers, marker);
@@ -1317,15 +1331,15 @@ static void rna_TimeLine_clear(Scene *scene)
WM_main_add_notifier(NC_ANIMATION|ND_MARKERS, NULL);
}
-static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, const char name[])
+static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, const char idname[], const char name[])
{
- KeyingSet *ks= NULL;
+ KeyingSet *ks = NULL;
/* call the API func, and set the active keyingset index */
- ks= BKE_keyingset_add(&sce->keyingsets, name, KEYINGSET_ABSOLUTE, 0);
+ ks = BKE_keyingset_add(&sce->keyingsets, idname, name, KEYINGSET_ABSOLUTE, 0);
if (ks) {
- sce->active_keyingset= BLI_countlist(&sce->keyingsets);
+ sce->active_keyingset = BLI_countlist(&sce->keyingsets);
return ks;
}
else {
@@ -1341,7 +1355,7 @@ static void rna_UnifiedPaintSettings_size_set(PointerRNA *ptr, int value)
/* scale unprojected radius so it stays consistent with brush size */
brush_scale_unprojected_radius(&ups->unprojected_radius,
value, ups->size);
- ups->size= value;
+ ups->size = value;
}
static void rna_UnifiedPaintSettings_unprojected_radius_set(PointerRNA *ptr, float value)
@@ -1350,7 +1364,7 @@ static void rna_UnifiedPaintSettings_unprojected_radius_set(PointerRNA *ptr, flo
/* scale brush size so it stays consistent with unprojected_radius */
brush_scale_size(&ups->size, value, ups->unprojected_radius);
- ups->unprojected_radius= value;
+ ups->unprojected_radius = value;
}
/* note: without this, when Multi-Paint is activated/deactivated, the colors
@@ -1360,8 +1374,8 @@ static void rna_UnifiedPaintSettings_unprojected_radius_set(PointerRNA *ptr, flo
* given its own notifier. */
static void rna_Scene_update_active_object_data(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
- Object *ob= OBACT;
- if(ob) {
+ Object *ob = OBACT;
+ if (ob) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, &ob->id);
}
@@ -1369,10 +1383,10 @@ static void rna_Scene_update_active_object_data(Main *UNUSED(bmain), Scene *scen
static void rna_SceneCamera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Scene *scene= (Scene*)ptr->id.data;
- Object *camera= scene->camera;
+ Scene *scene = (Scene*)ptr->id.data;
+ Object *camera = scene->camera;
- if(camera)
+ if (camera)
DAG_id_tag_update(&camera->id, 0);
}
@@ -1426,16 +1440,16 @@ static void rna_def_transform_orientation(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- const int matrix_dimsize[]= {3, 3};
+ const int matrix_dimsize[] = {3, 3};
- srna= RNA_def_struct(brna, "TransformOrientation", NULL);
+ srna = RNA_def_struct(brna, "TransformOrientation", NULL);
- prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "mat");
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_struct_name_property(srna, prop);
RNA_def_property_ui_text(prop, "Name", "Name of the custom transform orientation");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
@@ -1485,10 +1499,10 @@ static void rna_def_tool_settings(BlenderRNA *brna)
{EDGE_MODE_TAG_FREESTYLE, "FREESTYLE", 0, "Tag Freestyle Edge Mark", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ToolSettings", NULL);
+ srna = RNA_def_struct(brna, "ToolSettings", NULL);
RNA_def_struct_ui_text(srna, "Tool Settings", "");
- prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Sculpt");
RNA_def_property_ui_text(prop, "Sculpt", "");
@@ -1506,124 +1520,124 @@ static void rna_def_tool_settings(BlenderRNA *brna)
"weight painting");
RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
- prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
RNA_def_property_ui_text(prop, "Vertex Paint", "");
- prop= RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "wpaint");
RNA_def_property_ui_text(prop, "Weight Paint", "");
- prop= RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "imapaint");
RNA_def_property_ui_text(prop, "Image Paint", "");
- prop= RNA_def_property(srna, "uv_sculpt", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_sculpt", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "uvsculpt");
RNA_def_property_ui_text(prop, "UV Sculpt", "");
- prop= RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "particle");
RNA_def_property_ui_text(prop, "Particle Edit", "");
- prop= RNA_def_property(srna, "use_uv_sculpt", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_uv_sculpt", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_uv_sculpt", 1);
RNA_def_property_ui_text(prop, "UV Sculpt", "Enable brush for UV sculpting");
RNA_def_property_ui_icon(prop, ICON_TPAINT_HLT, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_uv_sculpt_update");
- prop= RNA_def_property(srna, "uv_sculpt_lock_borders", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_sculpt_lock_borders", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uv_sculpt_settings", UV_SCULPT_LOCK_BORDERS);
RNA_def_property_ui_text(prop, "Lock Borders", "Disable editing of boundary edges");
- prop= RNA_def_property(srna, "uv_sculpt_all_islands", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_sculpt_all_islands", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uv_sculpt_settings", UV_SCULPT_ALL_ISLANDS);
RNA_def_property_ui_text(prop, "Sculpt All Islands", "Brush operates on all islands");
- prop= RNA_def_property(srna, "uv_sculpt_tool", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_sculpt_tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "uv_sculpt_tool");
RNA_def_property_enum_items(prop, uv_sculpt_tool_items);
RNA_def_property_ui_text(prop, "UV Sculpt Tools", "Select Tools for the UV sculpt brushes");
- prop= RNA_def_property(srna, "uv_relax_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_relax_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "uv_relax_method");
RNA_def_property_enum_items(prop, uv_sculpt_relaxation_items);
RNA_def_property_ui_text(prop, "Relaxation Method", "Algorithm used for UV relaxation");
/* Transform */
- prop= RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "proportional");
RNA_def_property_enum_items(prop, proportional_editing_items);
RNA_def_property_ui_text(prop, "Proportional Editing",
"Proportional Editing mode, allows transforms with distance fall-off");
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "proportional_objects", 0);
RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing object mode");
RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
RNA_def_property_enum_items(prop, proportional_falloff_items);
RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "proportional_size");
RNA_def_property_ui_text(prop, "Proportional Size", "Display size for proportional editing circle");
RNA_def_property_range(prop, 0.00001, 5000.0);
- prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "normalsize");
RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
RNA_def_property_range(prop, 0.00001, 1000.0);
RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2);
RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
- prop= RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location");
- prop= RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target");
RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "snap_mode");
RNA_def_property_enum_items(prop, snap_element_items);
RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "snap_target");
RNA_def_property_enum_items(prop, snap_target_items);
RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "use_snap_project", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_snap_project", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
RNA_def_property_ui_text(prop, "Project Individual Elements",
"Project individual elements on the surface of other objects");
RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_NO_SELF);
RNA_def_property_ui_text(prop, "Project to Self", "Snap onto itself (editmode)");
RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
@@ -1633,137 +1647,137 @@ static void rna_def_tool_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_grease_pencil_sessions", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_PAINTSESSIONS_ON);
RNA_def_property_ui_text(prop, "Use Sketching Sessions", "Allow drawing multiple strokes at a time with Grease Pencil");
- RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); // xxx: need toolbar to be redrawn...
+ RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* xxx: need toolbar to be redrawn... */
/* Auto Keying */
- prop= RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
RNA_def_property_ui_icon(prop, ICON_REC, 0);
- prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "autokey_mode");
RNA_def_property_enum_items(prop, auto_key_items);
RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
- prop= RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
RNA_def_property_ui_text(prop, "Layered",
"Add a new NLA Track + Strip for every loop/pass made over the animation "
"to allow non-destructive tweaking");
- prop= RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set",
"Automatic keyframe insertion using active Keying Set only");
RNA_def_property_ui_icon(prop, ICON_KEYINGSET, 0);
/* UV */
- prop= RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
RNA_def_property_enum_items(prop, uv_select_mode_items);
RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION);
RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE);
RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
/* Mesh */
- prop= RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "selectmode", 1);
RNA_def_property_array(prop, 3);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_select_mode_set");
RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
- prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
/* use with MESH_OT_select_shortest_path */
- prop= RNA_def_property(srna, "edge_path_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "edge_path_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "edge_mode");
RNA_def_property_enum_items(prop, edge_tag_items);
RNA_def_property_ui_text(prop, "Edge Tag Mode", "The edge flag to tag when selecting the shortest path");
- prop= RNA_def_property(srna, "edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "edge_mode_live_unwrap", 1);
RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edges seam re-calculates UV unwrap");
/* etch-a-ton */
- prop= RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
-// RNA_def_property_ui_icon(prop, ICON_EDIT, 0);
+/* RNA_def_property_ui_icon(prop, ICON_EDIT, 0); */
- prop= RNA_def_property(srna, "use_etch_quick", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_etch_quick", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
- prop= RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
- prop= RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
- prop= RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
- prop= RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
- prop= RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke");
- prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "skgen_subdivision_number");
RNA_def_property_range(prop, 1, 255);
RNA_def_property_ui_text(prop, "Subdivisions", "Number of bones in the subdivided stroke");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "etch_adaptive_limit", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
RNA_def_property_range(prop, 0.00001, 1.0);
RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
RNA_def_property_range(prop, 0.00001, 100000.0);
RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll");
RNA_def_property_enum_items(prop, retarget_roll_items);
RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting");
- prop= RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert");
RNA_def_property_enum_items(prop, sketch_convert_items);
RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
/* Unified Paint Settings */
- prop= RNA_def_property(srna, "unified_paint_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "unified_paint_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UnifiedPaintSettings");
RNA_def_property_ui_text(prop, "Unified Paint Settings", NULL);
@@ -1774,52 +1788,52 @@ static void rna_def_unified_paint_settings(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "UnifiedPaintSettings", NULL);
+ srna = RNA_def_struct(brna, "UnifiedPaintSettings", NULL);
RNA_def_struct_ui_text(srna, "Unified Paint Settings", "Overrides for some of the active brush's settings");
/* high-level flags to enable or disable unified paint settings */
- prop= RNA_def_property(srna, "use_unified_size", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_unified_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_SIZE);
RNA_def_property_ui_text(prop, "Use Unified Radius",
"Instead of per-brush radius, the radius is shared across brushes");
- prop= RNA_def_property(srna, "use_unified_strength", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_unified_strength", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_ALPHA);
RNA_def_property_ui_text(prop, "Use Unified Strength",
"Instead of per-brush strength, the strength is shared across brushes");
/* unified paint settings that override the equivalent settings
from the active brush */
- prop= RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
RNA_def_property_int_funcs(prop, NULL, "rna_UnifiedPaintSettings_size_set", NULL);
RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS*10);
RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, 0);
RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
- prop= RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_funcs(prop, NULL, "rna_UnifiedPaintSettings_unprojected_radius_set", NULL);
RNA_def_property_range(prop, 0.001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001, 1, 0, 0);
RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
- prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 0.001);
RNA_def_property_ui_text(prop, "Strength", "How powerful the effect of the brush is when applied");
- prop= RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_BRUSH_SIZE_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size");
- prop= RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength");
- prop= RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_BRUSH_LOCK_SIZE);
RNA_def_property_ui_text(prop, "Use Blender Units", "When locked brush stays same size relative to object; when unlocked brush size is given in pixels");
}
@@ -1840,27 +1854,27 @@ static void rna_def_unit_settings(BlenderRNA *brna)
{USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "UnitSettings", NULL);
+ srna = RNA_def_struct(brna, "UnitSettings", NULL);
RNA_def_struct_ui_text(srna, "Unit Settings", "");
/* Units */
- prop= RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, unit_systems);
RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display");
RNA_def_property_update(prop, NC_WINDOW, NULL);
- prop= RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, rotation_units);
RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
RNA_def_property_update(prop, NC_WINDOW, NULL);
- prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions");
RNA_def_property_range(prop, 0.00001, 100000.0);
RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
RNA_def_property_update(prop, NC_WINDOW, NULL);
- prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
+ 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 (e.g. 1m 0cm)");
RNA_def_property_update(prop, NC_WINDOW, NULL);
@@ -1870,106 +1884,106 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
- if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ if (scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
else RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Name", "Render layer name");
RNA_def_struct_name_property(srna, prop);
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "light_override");
RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* layers */
- prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer");
- if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
+ if (scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "layers_zmask", PROP_BOOLEAN, PROP_LAYER);
+ prop = RNA_def_property(srna, "layers_zmask", PROP_BOOLEAN, PROP_LAYER);
RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers for solid faces");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* layer options */
- prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "invert_zmask", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_zmask", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_all_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_all_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (on top of Solid and Halos)");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE);
@@ -1979,222 +1993,222 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* passes */
- prop= RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXMA);
RNA_def_property_ui_text(prop, "Material Index", "Deliver material index pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "exclude_shadow", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "exclude_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "exclude_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "exclude_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "exclude_reflection", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "exclude_reflection", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "exclude_refraction", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "exclude_refraction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "exclude_emit", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "exclude_emit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "exclude_environment", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "exclude_environment", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "exclude_indirect", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "exclude_indirect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_diffuse_direct", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_diffuse_direct", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE_DIRECT);
RNA_def_property_ui_text(prop, "Diffuse Direct", "Deliver diffuse direct pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_diffuse_indirect", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_diffuse_indirect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE_INDIRECT);
RNA_def_property_ui_text(prop, "Diffuse Indirect", "Deliver diffuse indirect pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_diffuse_color", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_diffuse_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE_COLOR);
RNA_def_property_ui_text(prop, "Diffuse Color", "Deliver diffuse color pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_glossy_direct", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_glossy_direct", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_GLOSSY_DIRECT);
RNA_def_property_ui_text(prop, "Glossy Direct", "Deliver glossy direct pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_glossy_indirect", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_glossy_indirect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_GLOSSY_INDIRECT);
RNA_def_property_ui_text(prop, "Glossy Indirect", "Deliver glossy indirect pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_glossy_color", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_glossy_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_GLOSSY_COLOR);
RNA_def_property_ui_text(prop, "Glossy Color", "Deliver glossy color pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_transmission_direct", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_transmission_direct", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_TRANSM_DIRECT);
RNA_def_property_ui_text(prop, "Transmission Direct", "Deliver transmission direct pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_transmission_indirect", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_transmission_indirect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_TRANSM_INDIRECT);
RNA_def_property_ui_text(prop, "Transmission Indirect", "Deliver transmission indirect pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "use_pass_transmission_color", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pass_transmission_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_TRANSM_COLOR);
RNA_def_property_ui_text(prop, "Transmission Color", "Deliver transmission color pass");
- if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
+ if (scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
}
@@ -2571,85 +2585,85 @@ static void rna_def_scene_game_recast_data(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SceneGameRecastData", NULL);
+ srna = RNA_def_struct(brna, "SceneGameRecastData", NULL);
RNA_def_struct_sdna(srna, "RecastData");
RNA_def_struct_nested(brna, srna, "Scene");
RNA_def_struct_ui_text(srna, "Recast Data", "Recast data for a Game datablock");
- prop= RNA_def_property(srna, "cell_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "cell_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cellsize");
RNA_def_property_ui_range(prop, 0.1, 1, 1, 2);
RNA_def_property_ui_text(prop, "Cell Size", "Rasterized cell size");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "cell_height", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "cell_height", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cellheight");
RNA_def_property_ui_range(prop, 0.1, 1, 1, 2);
RNA_def_property_ui_text(prop, "Cell Height", "Rasterized cell height");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "agent_height", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "agent_height", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "agentheight");
RNA_def_property_ui_range(prop, 0.1, 5, 1, 2);
RNA_def_property_ui_text(prop, "Agent Height", "Minimum height where the agent can still walk");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "agent_radius", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "agent_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "agentradius");
RNA_def_property_ui_range(prop, 0.1, 5, 1, 2);
RNA_def_property_ui_text(prop, "Agent Radius", "Radius of the agent");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "climb_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "climb_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "agentmaxclimb");
RNA_def_property_ui_range(prop, 0.1, 5, 1, 2);
RNA_def_property_ui_text(prop, "Max Climb", "Maximum height between grid cells the agent can climb");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "slope_max", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "slope_max", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "agentmaxslope");
RNA_def_property_range(prop, 0, M_PI/2);
RNA_def_property_ui_text(prop, "Max Slope", "Maximum walkable slope angle in degrees");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "region_min_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "region_min_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "regionminsize");
RNA_def_property_ui_range(prop, 0, 150, 1, 2);
RNA_def_property_ui_text(prop, "Min Region Size", "Minimum regions size (smaller regions will be deleted)");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "region_merge_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "region_merge_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "regionmergesize");
RNA_def_property_ui_range(prop, 0, 150, 1, 2);
RNA_def_property_ui_text(prop, "Merged Region Size", "Minimum regions size (smaller regions will be merged)");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "edge_max_len", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "edge_max_len", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "edgemaxlen");
RNA_def_property_ui_range(prop, 0, 50, 1, 2);
RNA_def_property_ui_text(prop, "Max Edge Length", "Maximum contour edge length");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "edge_max_error", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "edge_max_error", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "edgemaxerror");
RNA_def_property_ui_range(prop, 0.1, 3.0, 1, 2);
RNA_def_property_ui_text(prop, "Max Edge Error", "Maximum distance error from contour to cells");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "verts_per_poly", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "verts_per_poly", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "vertsperpoly");
RNA_def_property_ui_range(prop, 3, 12, 1, 0);
RNA_def_property_ui_text(prop, "Verts Per Poly", "Max number of vertices per polygon");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "sample_dist", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "sample_dist", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "detailsampledist");
RNA_def_property_ui_range(prop, 0.0, 16.0, 1, 2);
RNA_def_property_ui_text(prop, "Sample Distance", "Detail mesh sample spacing");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "sample_max_error", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "sample_max_error", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "detailsamplemaxerror");
RNA_def_property_ui_range(prop, 0.0, 16.0, 1, 2);
RNA_def_property_ui_text(prop, "Max Sample Error", "Detail mesh simplification max sample error");
@@ -2661,7 +2675,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem aasamples_items[] ={
+ static EnumPropertyItem aasamples_items[] = {
{0, "SAMPLES_0", 0, "Off", ""},
{2, "SAMPLES_2", 0, "2x", ""},
{4, "SAMPLES_4", 0, "4x", ""},
@@ -2669,7 +2683,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
{16, "SAMPLES_16", 0, "16x", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem framing_types_items[] ={
+ static EnumPropertyItem framing_types_items[] = {
{SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox",
"Show the entire viewport in the display window, using bar horizontally or vertically"},
{SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend",
@@ -2677,7 +2691,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
{SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem dome_modes_items[] ={
+ static EnumPropertyItem dome_modes_items[] = {
{DOME_FISHEYE, "FISHEYE", 0, "Fisheye", ""},
{DOME_TRUNCATED_FRONT, "TRUNCATED_FRONT", 0, "Front-Truncated", ""},
{DOME_TRUNCATED_REAR, "TRUNCATED_REAR", 0, "Rear-Truncated", ""},
@@ -2685,7 +2699,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
{DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem stereo_modes_items[] ={
+ static EnumPropertyItem stereo_modes_items[] = {
{STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
{STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
{STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
@@ -2694,7 +2708,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
{STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem stereo_items[] ={
+ static EnumPropertyItem stereo_items[] = {
{STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"},
{STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"},
{STEREO_DOME, "DOME", 0, "Dome", "Enable Dome environment"},
@@ -2702,14 +2716,14 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
static EnumPropertyItem physics_engine_items[] = {
{WOPHY_NONE, "NONE", 0, "None", "Don't use a physics engine"},
- //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
- //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
- //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
- //{WOPHY_ODE, "ODE", 0, "ODE", ""},
+ /*{WOPHY_ENJI, "ENJI", 0, "Enji", ""}, */
+ /*{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""}, */
+ /*{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""}, */
+ /*{WOPHY_ODE, "ODE", 0, "ODE", ""}, */
{WOPHY_BULLET, "BULLET", 0, "Bullet", "Use the Bullet physics engine"},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem material_items[] ={
+ static EnumPropertyItem material_items[] = {
{GAME_MAT_TEXFACE, "SINGLETEXTURE", 0, "Singletexture", "Singletexture face materials"},
{GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials"},
{GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders"},
@@ -2721,66 +2735,66 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
{OBSTSIMULATION_TOI_cells, "RVO_CELLS", 0, "RVO (cells)", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SceneGameData", NULL);
+ srna = RNA_def_struct(brna, "SceneGameData", NULL);
RNA_def_struct_sdna(srna, "GameData");
RNA_def_struct_nested(brna, srna, "Scene");
RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene datablock");
- prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xplay");
RNA_def_property_range(prop, 4, 10000);
RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "yplay");
RNA_def_property_range(prop, 4, 10000);
RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "samples", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "samples", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "aasamples");
RNA_def_property_enum_items(prop, aasamples_items);
RNA_def_property_ui_text(prop, "AA Samples", "The number of AA Samples to use for MSAA");
- prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "depth");
RNA_def_property_range(prop, 8, 32);
RNA_def_property_ui_text(prop, "Bits", "Display bit depth of full screen display");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "exit_key", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "exit_key", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "exitkey");
RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_GameSettings_exit_key_set", NULL);
RNA_def_property_ui_text(prop, "Exit Key", "The key that exits the Game Engine");
RNA_def_property_update(prop, NC_SCENE, NULL);
- // Do we need it here ? (since we already have it in World
- prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
+ /* Do we need it here ? (since we already have it in World */
+ prop = RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "freqplay");
RNA_def_property_range(prop, 4, 2000);
RNA_def_property_ui_text(prop, "Freq", "Display clock frequency of fullscreen display");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "playerflag", GAME_PLAYER_FULLSCREEN);
RNA_def_property_ui_text(prop, "Fullscreen", "Start player in a new fullscreen display");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "use_desktop", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_desktop", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "playerflag", GAME_PLAYER_DESKTOP_RESOLUTION);
RNA_def_property_ui_text(prop, "Desktop", "Uses the current desktop resultion in fullscreen mode");
RNA_def_property_update(prop, NC_SCENE, NULL);
/* Framing */
- prop= RNA_def_property(srna, "frame_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "framing.type");
RNA_def_property_enum_items(prop, framing_types_items);
RNA_def_property_ui_text(prop, "Framing Types", "Select the type of Framing you want");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "frame_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "frame_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "framing.col");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_array(prop, 3);
@@ -2788,19 +2802,19 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE, NULL);
/* Stereo */
- prop= RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stereoflag");
RNA_def_property_enum_items(prop, stereo_items);
RNA_def_property_ui_text(prop, "Stereo Options", "");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "stereo_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stereomode");
RNA_def_property_enum_items(prop, stereo_modes_items);
RNA_def_property_ui_text(prop, "Stereo Mode", "Stereographic techniques");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "stereo_eye_separation", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "stereo_eye_separation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
RNA_def_property_range(prop, 0.01, 5.0);
RNA_def_property_ui_text(prop, "Eye Separation",
@@ -2808,37 +2822,37 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE, NULL);
/* Dome */
- prop= RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "dome.mode");
RNA_def_property_enum_items(prop, dome_modes_items);
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_tessellation", 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");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dome.resbuf");
RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 0.1);
RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dome.angle");
RNA_def_property_ui_range(prop, 90, 250, 1, 1);
RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dome.tilt");
RNA_def_property_ui_range(prop, -180, 180, 1, 1);
RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext");
RNA_def_property_struct_type(prop, "Text");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -2846,27 +2860,27 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE, NULL);
/* physics */
- prop= RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "physicsEngine");
RNA_def_property_enum_items(prop, physics_engine_items);
RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
+ prop = RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_float_sdna(prop, NULL, "gravity");
RNA_def_property_ui_range(prop, 0.0, 25.0, 1, 2);
RNA_def_property_range(prop, 0.0, 10000.0);
RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "occlusion_culling_resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "occlusionRes");
RNA_def_property_range(prop, 128.0, 1024.0);
RNA_def_property_ui_text(prop, "Occlusion Resolution",
"Size of the occlusion buffer in pixel, use higher value for better precision (slower)");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ticrate");
RNA_def_property_ui_range(prop, 1, 60, 1, 1);
RNA_def_property_range(prop, 1, 250);
@@ -2875,7 +2889,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
"(physics fixed timestep = 1/fps, independently of actual frame rate)");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
RNA_def_property_ui_range(prop, 1, 5, 1, 1);
RNA_def_property_range(prop, 1, 5);
@@ -2884,7 +2898,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
"higher value allows better synchronization with physics");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxphystep");
RNA_def_property_ui_range(prop, 1, 5, 1, 1);
RNA_def_property_range(prop, 1, 5);
@@ -2893,7 +2907,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
"higher value allows physics to keep up with realtime");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "physubstep");
RNA_def_property_ui_range(prop, 1, 5, 1, 1);
RNA_def_property_range(prop, 1, 5);
@@ -2903,17 +2917,17 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE, NULL);
/* mode */
- prop= RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); //XXX mode hardcoded // WO_DBVT_CULLING
+ prop = RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); /*XXX mode hardcoded *//* WO_DBVT_CULLING */
RNA_def_property_ui_text(prop, "DBVT culling", "Use optimized Bullet DBVT tree for view frustum and occlusion culling");
- // not used // deprecated !!!!!!!!!!!!!
- prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); //XXX mode hardcoded
+ /* not used *//* deprecated !!!!!!!!!!!!! */
+ prop = RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 3)); /*XXX mode hardcoded */
RNA_def_property_ui_text(prop, "Activity Culling", "Activity culling is enabled");
- // not used // deprecated !!!!!!!!!!!!!
- prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
+ /* not used *//* deprecated !!!!!!!!!!!!! */
+ prop = RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Box Radius",
@@ -2921,110 +2935,110 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
"(objects outside the box are activity-culled)");
/* booleans */
- prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs");
- prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
RNA_def_property_ui_text(prop, "Show Framerate and Profile",
"Show framerate and profiling information while the game runs");
- prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions");
- prop= RNA_def_property(srna, "show_mouse", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_mouse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_MOUSE);
RNA_def_property_ui_text(prop, "Show Mouse", "Start player with a visible mouse cursor");
- prop= RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_frame_rate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
RNA_def_property_ui_text(prop, "Use Frame Rate", "Respect the frame rate rather than rendering as many frames as possible");
- prop= RNA_def_property(srna, "use_display_lists", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_display_lists", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU");
- prop= RNA_def_property(srna, "use_deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API");
- prop= RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
RNA_def_property_ui_text(prop, "Record Animation", "Record animation to F-Curves");
- prop= RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set");
RNA_def_property_ui_text(prop, "Auto Start", "Automatically start game at load time");
- prop= RNA_def_property(srna, "restrict_animation_updates", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "restrict_animation_updates", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_RESTRICT_ANIM_UPDATES);
RNA_def_property_ui_text(prop, "Restrict Animation Updates",
"Restrict the number of animation updates to the animation FPS (this is "
"better for performance, but can cause issues with smooth playback)");
/* materials */
- prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "matmode");
RNA_def_property_enum_items(prop, material_items);
RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering");
RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "use_glsl_lights", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_glsl_lights", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering");
RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
- prop= RNA_def_property(srna, "use_glsl_shaders", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_glsl_shaders", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering");
RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
- prop= RNA_def_property(srna, "use_glsl_shadows", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_glsl_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering");
RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
- prop= RNA_def_property(srna, "use_glsl_ramps", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_glsl_ramps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering");
RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
- prop= RNA_def_property(srna, "use_glsl_nodes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_glsl_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering");
RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
- prop= RNA_def_property(srna, "use_glsl_color_management", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_glsl_color_management", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_COLOR_MANAGEMENT);
RNA_def_property_ui_text(prop, "GLSL Color Management", "Use color management for GLSL rendering");
RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
- prop= RNA_def_property(srna, "use_glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering");
RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update");
/* obstacle simulation */
- prop= RNA_def_property(srna, "obstacle_simulation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "obstacle_simulation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "obstacleSimulation");
RNA_def_property_enum_items(prop, obstacle_simulation_items);
RNA_def_property_ui_text(prop, "Obstacle simulation", "Simulation used for obstacle avoidance in the game engine");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "level_height", PROP_FLOAT, PROP_ACCELERATION);
+ prop = RNA_def_property(srna, "level_height", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_float_sdna(prop, NULL, "levelHeight");
RNA_def_property_range(prop, 0.0f, 200.0f);
RNA_def_property_ui_text(prop, "Level height", "Max difference in heights of obstacles to enable their interaction");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "show_obstacle_simulation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_obstacle_simulation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_OBSTACLE_SIMULATION);
RNA_def_property_ui_text(prop, "Visualization", "Enable debug visualization for obstacle simulation");
/* Recast Settings */
- prop= RNA_def_property(srna, "recast_data", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "recast_data", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "recastData");
RNA_def_property_struct_type(prop, "SceneGameRecastData");
@@ -3039,7 +3053,7 @@ static void rna_def_scene_render_layer(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
+ srna = RNA_def_struct(brna, "SceneRenderLayer", NULL);
RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer");
RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
@@ -3066,18 +3080,18 @@ static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "RenderLayers");
- srna= RNA_def_struct(brna, "RenderLayers", NULL);
+ srna = RNA_def_struct(brna, "RenderLayers", NULL);
RNA_def_struct_sdna(srna, "RenderData");
RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "actlay");
RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set",
"rna_RenderSettings_active_layer_index_range");
RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "SceneRenderLayer");
RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get",
"rna_RenderSettings_active_layer_set", NULL, NULL);
@@ -3085,18 +3099,18 @@ static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- func= RNA_def_function(srna, "new", "rna_RenderLayer_new");
+ func = RNA_def_function(srna, "new", "rna_RenderLayer_new");
RNA_def_function_ui_description(func, "Add a render layer to scene");
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
- parm= RNA_def_string(func, "name", "RenderLayer", 0, "", "New name for the marker (not unique)");
+ parm = RNA_def_string(func, "name", "RenderLayer", 0, "", "New name for the marker (not unique)");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "result", "SceneRenderLayer", "", "Newly created render layer");
+ parm = RNA_def_pointer(func, "result", "SceneRenderLayer", "", "Newly created render layer");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_RenderLayer_remove");
+ func = RNA_def_function(srna, "remove", "rna_RenderLayer_remove");
RNA_def_function_ui_description(func, "Remove a render layer");
RNA_def_function_flag(func, FUNC_USE_MAIN|FUNC_USE_REPORTS|FUNC_USE_SELF_ID);
- parm= RNA_def_pointer(func, "layer", "SceneRenderLayer", "", "Timeline marker to remove");
+ parm = RNA_def_pointer(func, "layer", "SceneRenderLayer", "", "Timeline marker to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -3120,20 +3134,20 @@ static void rna_def_scene_image_format_data(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ImageFormatSettings", NULL);
+ srna = RNA_def_struct(brna, "ImageFormatSettings", NULL);
RNA_def_struct_sdna(srna, "ImageFormatData");
RNA_def_struct_nested(brna, srna, "Scene");
- // RNA_def_struct_path_func(srna, "rna_RenderSettings_path"); // no need for the path, its not animated!
+ /* RNA_def_struct_path_func(srna, "rna_RenderSettings_path"); *//* no need for the path, its not animated! */
RNA_def_struct_ui_text(srna, "Image Format", "Settings for image formats");
- prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "imtype");
RNA_def_property_enum_items(prop, image_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_ImageFormatSettings_file_format_set", "rna_ImageFormatSettings_file_format_itemf");
RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
RNA_def_property_enum_items(prop, image_color_mode_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageFormatSettings_color_mode_itemf");
@@ -3142,7 +3156,7 @@ static void rna_def_scene_image_format_data(BlenderRNA *brna)
"and RGBA for saving red, green, blue and alpha channels");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "color_depth", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "color_depth", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "depth");
RNA_def_property_enum_items(prop, image_color_depth_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageFormatSettings_color_depth_itemf");
@@ -3150,26 +3164,26 @@ static void rna_def_scene_image_format_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* was 'file_quality' */
- prop= RNA_def_property(srna, "quality", PROP_INT, PROP_PERCENTAGE);
+ prop = RNA_def_property(srna, "quality", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "quality");
RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
RNA_def_property_ui_text(prop, "Quality", "Quality for image formats that support lossy compression");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* was shared with file_quality */
- prop= RNA_def_property(srna, "compression", PROP_INT, PROP_PERCENTAGE);
+ prop = RNA_def_property(srna, "compression", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "compress");
RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
RNA_def_property_ui_text(prop, "Compression", "Compression level for formats that support lossless compression");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* flag */
- prop= RNA_def_property(srna, "use_zbuffer", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_zbuffer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", R_IMF_FLAG_ZBUF);
RNA_def_property_ui_text(prop, "Z Buffer", "Save the z-depth per pixel (32 bit unsigned int z-buffer)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_preview", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", R_IMF_FLAG_PREVIEW_JPG);
RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -3179,7 +3193,7 @@ static void rna_def_scene_image_format_data(BlenderRNA *brna)
#ifdef WITH_OPENEXR
/* OpenEXR */
- prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "exr_codec");
RNA_def_property_enum_items(prop, exr_codec_items);
RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
@@ -3190,17 +3204,17 @@ static void rna_def_scene_image_format_data(BlenderRNA *brna)
#ifdef WITH_OPENJPEG
/* Jpeg 2000 */
- prop= RNA_def_property(srna, "use_jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "jp2_flag", R_IMF_JP2_FLAG_YCC);
RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_jpeg2k_cinema_preset", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_jpeg2k_cinema_preset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "jp2_flag", R_IMF_JP2_FLAG_CINE_PRESET);
RNA_def_property_ui_text(prop, "Cinema", "Use Openjpeg Cinema Preset");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_jpeg2k_cinema_48", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_jpeg2k_cinema_48", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "jp2_flag", R_IMF_JP2_FLAG_CINE_48);
RNA_def_property_ui_text(prop, "Cinema (48)", "Use Openjpeg Cinema Preset (48fps)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -3208,24 +3222,24 @@ static void rna_def_scene_image_format_data(BlenderRNA *brna)
/* Cineon and DPX */
- prop= RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cineon_flag", R_CINEON_LOG);
RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "cineon_black");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "cineon_white");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cineon_gamma");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
@@ -3329,7 +3343,7 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate (kb/s)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "muxrate", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "muxrate", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "mux_rate");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0, 100000000);
@@ -3357,7 +3371,7 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_autosplit", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_autosplit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", FFMPEG_AUTOSPLIT_OUTPUT);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
@@ -3385,7 +3399,7 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate (kb/s)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "audio_volume");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 1.0f);
@@ -3393,15 +3407,15 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
#endif
- // the following two "ffmpeg" settings are general audio settings
- prop= RNA_def_property(srna, "audio_mixrate", PROP_INT, PROP_NONE);
+ /* the following two "ffmpeg" settings are general audio settings */
+ prop = RNA_def_property(srna, "audio_mixrate", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "audio_mixrate");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 8000, 192000);
RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "audio_channels");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, audio_channel_items);
@@ -3494,12 +3508,12 @@ static void rna_def_scene_quicktime_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "HQ", "Use High Quality resampling algorithm");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "audioCodecFlags", QTAUDIO_FLAG_CODEC_ISCBR);
RNA_def_property_ui_text(prop, "VBR", "Use Variable Bit Rate compression (improves quality at same bitrate)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "audio_bitrate", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "audio_bitrate", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "audioBitRate");
RNA_def_property_enum_items(prop, quicktime_audio_bitrate_items);
RNA_def_property_ui_text(prop, "Bitrate", "Compressed audio bitrate");
@@ -3513,7 +3527,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem pixel_filter_items[] ={
+ static EnumPropertyItem pixel_filter_items[] = {
{R_FILTER_BOX, "BOX", 0, "Box", "Use a box filter for anti-aliasing"},
{R_FILTER_TENT, "TENT", 0, "Tent", "Use a tent filter for anti-aliasing"},
{R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", "Use a quadratic filter for anti-aliasing"},
@@ -3523,13 +3537,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
{R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", "Use a Mitchell-Netravali filter for anti-aliasing"},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem alpha_mode_items[] ={
+ static EnumPropertyItem alpha_mode_items[] = {
{R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"},
{R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
{R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem display_mode_items[] ={
+ static EnumPropertyItem display_mode_items[] = {
{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"},
@@ -3537,7 +3551,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
/* Bake */
- static EnumPropertyItem bake_mode_items[] ={
+ static EnumPropertyItem bake_mode_items[] = {
{RE_BAKE_ALL, "FULL", 0, "Full Render", "Bake everything"},
{RE_BAKE_AO, "AO", 0, "Ambient Occlusion", "Bake ambient occlusion"},
{RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", "Bake shadows"},
@@ -3552,14 +3566,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
{RE_BAKE_SPEC_COLOR, "SPEC_COLOR", 0, "Specular Colors", "Bake Specular colors"},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem bake_normal_space_items[] ={
+ static EnumPropertyItem bake_normal_space_items[] = {
{R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", "Bake the normals in camera space"},
{R_BAKE_SPACE_WORLD, "WORLD", 0, "World", "Bake the normals in world space"},
{R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", "Bake the normals in object space"},
{R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", "Bake the normals in tangent space"},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem bake_qyad_split_items[] ={
+ static EnumPropertyItem bake_qyad_split_items[] = {
{0, "AUTO", 0, "Automatic", "Split quads to give the least distortion while baking"},
{1, "FIXED", 0, "Fixed", "Split quads predictably (0,1,2) (0,2,3)"},
{2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads predictably (1,2,3) (1,3,0)"},
@@ -3608,34 +3622,34 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
rna_def_scene_quicktime_settings(brna);
#endif
- srna= RNA_def_struct(brna, "RenderSettings", NULL);
+ srna = RNA_def_struct(brna, "RenderSettings", NULL);
RNA_def_struct_sdna(srna, "RenderData");
RNA_def_struct_nested(brna, srna, "Scene");
RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock");
/* Render Data */
- prop= RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE);
+ 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, "resolution_x", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xsch");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 4, 10000);
RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update");
- prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ysch");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 4, 10000);
RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update");
- prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
+ prop = RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "size");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1, SHRT_MAX);
@@ -3643,26 +3657,26 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xparts");
RNA_def_property_range(prop, 1, 512);
RNA_def_property_ui_text(prop, "Parts X", "Number of horizontal tiles to use while rendering");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "parts_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "yparts");
RNA_def_property_range(prop, 1, 512);
RNA_def_property_ui_text(prop, "Parts Y", "Number of vertical tiles to use while rendering");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xasp");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1.0f, 200.0f);
RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update");
- prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yasp");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1.0f, 200.0f);
@@ -3670,27 +3684,27 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update");
#ifdef WITH_QUICKTIME
- prop= RNA_def_property(srna, "quicktime", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "quicktime", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "QuickTimeSettings");
RNA_def_property_pointer_sdna(prop, NULL, "qtcodecsettings");
RNA_def_property_flag(prop, PROP_NEVER_UNLINK);
RNA_def_property_ui_text(prop, "QuickTime Settings", "QuickTime related settings for the scene");
#endif
- prop= RNA_def_property(srna, "ffmpeg", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "ffmpeg", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "FFmpegSettings");
RNA_def_property_pointer_sdna(prop, NULL, "ffcodecdata");
RNA_def_property_flag(prop, PROP_NEVER_UNLINK);
RNA_def_property_ui_text(prop, "FFmpeg Settings", "FFmpeg related settings for the scene");
- prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "frs_sec");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1, 120);
RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_Scene_fps_update");
- prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.1f, 120.0f);
@@ -3698,14 +3712,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_Scene_fps_update");
/* frame mapping */
- prop= RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "framapto");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1, 900);
RNA_def_property_ui_text(prop, "Frame Map Old", "Old mapping value in frames");
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
- prop= RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "images");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1, 900);
@@ -3713,74 +3727,74 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
- prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Dither Intensity",
"Amount of dithering noise added to the rendered image to break up banding");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "pixel_filter_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "pixel_filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "filtertype");
RNA_def_property_enum_items(prop, pixel_filter_items);
RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "gauss");
RNA_def_property_range(prop, 0.5f, 1.5f);
RNA_def_property_ui_text(prop, "Filter Size", "Pixel width over which the reconstruction filter combines samples");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "alphamode");
RNA_def_property_enum_items(prop, alpha_mode_items);
RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ocres");
RNA_def_property_enum_items(prop, octree_resolution_items);
RNA_def_property_ui_text(prop, "Octree Resolution",
"Resolution of raytrace accelerator, use higher resolutions for larger scenes");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "raytrace_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "raytrace_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
RNA_def_property_enum_items(prop, raytrace_structure_items);
RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
RNA_def_property_ui_text(prop, "Use Instances",
"Instance support leads to effective memory reduction when using duplicates");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
+ 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 locally on each primitive "
"(increases memory usage, but may have impact on speed)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "osa");
RNA_def_property_enum_items(prop, fixed_oversample_items);
RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS);
RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, field_order_items);
RNA_def_property_ui_text(prop, "Field Order",
@@ -3788,54 +3802,54 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
"to create smooth motion for TV output)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_fields_still", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_fields_still", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* rendering features */
- prop= RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
RNA_def_property_ui_text(prop, "Shadows", "Calculate shadows while rendering");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_envmaps", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_envmaps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP);
RNA_def_property_ui_text(prop, "Environment Maps", "Calculate environment maps while rendering");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_radiosity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_radiosity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RADIO);
RNA_def_property_ui_text(prop, "Radiosity", "Calculate radiosity in a pre-process before rendering");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS);
RNA_def_property_ui_text(prop, "Subsurface Scattering", "Calculate sub-surface scattering in materials rendering");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE);
RNA_def_property_ui_text(prop, "Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
RNA_def_property_ui_text(prop, "Textures", "Use textures to affect material properties");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE);
RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "edgeint");
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "edgeR");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Edge Color", "Edge color");
@@ -3847,7 +3861,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* threads */
- prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "threads");
RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", NULL, NULL);
@@ -3855,27 +3869,27 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
"Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, threads_mode_items);
RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* motion blur */
- prop= RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "mblur_samples");
RNA_def_property_range(prop, 1, 32);
RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "blurfac");
RNA_def_property_range(prop, 0.01f, 10.0f);
RNA_def_property_ui_range(prop, 0.01, 2.0f, 1, 0);
@@ -3883,7 +3897,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* border */
- prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Border",
@@ -3891,78 +3905,78 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
"(note that this disables save_buffers and full_sample)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "border.xmin");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Border Minimum X", "Minimum X value to for the render border");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "border.ymin");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Border Minimum Y", "Minimum Y value for the render border");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "border.xmax");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Border Maximum X", "Maximum X value for the render border");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "border.ymax");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Border Maximum Y", "Maximum Y value for the render border");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
RNA_def_property_ui_text(prop, "Placeholders",
"Create empty placeholder files while rendering frames (similar to Unix 'touch')");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
RNA_def_property_ui_text(prop, "Compositing",
"Process the render result through the compositing pipeline, if compositing nodes are enabled");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
RNA_def_property_ui_text(prop, "Sequencer",
"Process the render (and composited) result through the video sequence "
"editor pipeline, if sequencer strips exist");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_color_management", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_color_management", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT);
RNA_def_property_ui_text(prop, "Color Management", "Use linear workflow - gamma corrected imaging pipeline");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_RenderSettings_color_management_update");
- prop= RNA_def_property(srna, "use_color_unpremultiply", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_color_unpremultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "color_mgt_flag", R_COLOR_MANAGEMENT_PREDIVIDE);
RNA_def_property_ui_text(prop, "Color Unpremultipy", "For premultiplied alpha render output, do color space conversion on colors without alpha, to avoid fringing on light backgrounds");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
RNA_def_property_ui_text(prop, "File Extensions",
"Add the file format extensions to the rendered file name (eg: filename + .jpg)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
#if 0 /* moved */
- prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "imtype");
RNA_def_property_enum_items(prop, image_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_file_format_set", NULL);
@@ -3970,29 +3984,29 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
#endif
- prop= RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_fomat_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
- prop= RNA_def_property(srna, "use_free_image_textures", PROP_BOOLEAN, PROP_NONE);
+ 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 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);
+ 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_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_save_buffers", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_save_buffers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_save_buffers_get", NULL);
RNA_def_property_ui_text(prop, "Save Buffers",
@@ -4000,7 +4014,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
"(saves memory, required for Full Sample)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_full_sample", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_full_sample", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
RNA_def_property_ui_text(prop, "Full Sample",
@@ -4008,13 +4022,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
"(this solves anti-aliasing issues with compositing)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
RNA_def_property_enum_items(prop, display_mode_items);
RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "pic");
RNA_def_property_ui_text(prop, "Output Path",
"Directory/name to save animations, # characters defines the position "
@@ -4023,149 +4037,149 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
/* Bake */
- prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
RNA_def_property_enum_items(prop, bake_mode_items);
RNA_def_property_ui_text(prop, "Bake Mode", "Choose shading information to bake into the image");
- prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
RNA_def_property_enum_items(prop, bake_normal_space_items);
RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
- prop= RNA_def_property(srna, "bake_quad_split", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "bake_quad_split", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, bake_qyad_split_items);
RNA_def_property_ui_text(prop, "Quad Split", "Choose the method used to split a quad into 2 triangles for baking");
- prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
RNA_def_property_enum_items(prop, fixed_oversample_items);
RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
- prop= RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
RNA_def_property_ui_text(prop, "Selected to Active",
"Bake shading on the surface of selected objects to the active object");
- prop= RNA_def_property(srna, "use_bake_normalize", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_bake_normalize", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
RNA_def_property_ui_text(prop, "Normalized",
"With displacement normalize to the distance, with ambient occlusion "
"normalize without using material settings");
- prop= RNA_def_property(srna, "use_bake_clear", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_bake_clear", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
- prop= RNA_def_property(srna, "use_bake_antialiasing", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_bake_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA);
RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing");
- prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "bake_filter");
RNA_def_property_range(prop, 0, 64);
RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter");
- prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bake_maxdist");
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units)");
- prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)");
- prop= RNA_def_property(srna, "use_bake_multires", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_bake_multires", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_MULTIRES);
RNA_def_property_ui_text(prop, "Bake from Multires", "Bake directly from multires object");
- prop= RNA_def_property(srna, "use_bake_lores_mesh", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_bake_lores_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_LORES_MESH);
RNA_def_property_ui_text(prop, "Low Resolution Mesh", "Calculate heights against unsubdivided low resolution mesh");
/* stamp */
- prop= RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
RNA_def_property_ui_text(prop, "Stamp Time", "Include the rendered frame timecode as HH:MM:SS.FF in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DATE);
RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME);
RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_stamp_camera", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stamp_camera", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERA);
RNA_def_property_ui_text(prop, "Stamp Camera", "Include the name of the active camera in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_stamp_lens", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stamp_lens", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERALENS);
RNA_def_property_ui_text(prop, "Stamp Lens", "Include the active camera's lens in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SCENE);
RNA_def_property_ui_text(prop, "Stamp Scene", "Include the name of the active scene in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_NOTE);
RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_MARKER);
RNA_def_property_ui_text(prop, "Stamp Marker", "Include the name of the last marker in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME);
RNA_def_property_ui_text(prop, "Stamp Filename", "Include the .blend filename in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
RNA_def_property_ui_text(prop, "Stamp Sequence Strip",
"Include the name of the foreground sequence strip in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME);
RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_stamp", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stamp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DRAW);
RNA_def_property_ui_text(prop, "Render Stamp", "Render the stamp info text in the rendered image");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "stamp_font_id");
RNA_def_property_range(prop, 8, 64);
RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
RNA_def_property_array(prop, 4);
RNA_def_property_range(prop,0.0,1.0);
RNA_def_property_ui_text(prop, "Text Color", "Color to use for stamp text");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
RNA_def_property_array(prop, 4);
RNA_def_property_range(prop,0.0,1.0);
@@ -4174,91 +4188,91 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
/* sequencer draw options */
- prop= RNA_def_property(srna, "use_sequencer_gl_preview", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_sequencer_gl_preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_PREV);
RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
- prop= RNA_def_property(srna, "use_sequencer_gl_render", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_sequencer_gl_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_REND);
RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
- prop= RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "seq_prev_type");
RNA_def_property_enum_items(prop, viewport_shade_items);
RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
- prop= RNA_def_property(srna, "sequencer_gl_render", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "sequencer_gl_render", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "seq_rend_type");
RNA_def_property_enum_items(prop, viewport_shade_items);
RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
/* layers */
- prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
RNA_def_property_struct_type(prop, "SceneRenderLayer");
RNA_def_property_ui_text(prop, "Render Layers", "");
rna_def_render_layers(brna, prop);
- prop= RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer");
RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* engine */
- prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, engine_items);
RNA_def_property_enum_funcs(prop, "rna_RenderSettings_engine_get", "rna_RenderSettings_engine_set",
"rna_RenderSettings_engine_itemf");
RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
RNA_def_property_update(prop, NC_WINDOW, "rna_RenderSettings_engine_update");
- prop= RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available");
- prop= RNA_def_property(srna, "use_shading_nodes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_shading_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_shading_nodes_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Use Shading Nodes", "Active render engine uses new shading nodes system");
- prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_game_engine_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine");
/* simplify */
- prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SIMPLIFY);
RNA_def_property_ui_text(prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
- prop= RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf");
RNA_def_property_ui_range(prop, 0, 6, 1, 0);
RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
- prop= RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "simplify_particles");
RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage");
RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
- prop= RNA_def_property(srna, "simplify_shadow_samples", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "simplify_shadow_samples", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "simplify_shadowsamples");
RNA_def_property_ui_range(prop, 1, 16, 1, 0);
RNA_def_property_ui_text(prop, "Simplify Shadow Samples", "Global maximum shadow samples");
RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
- prop= RNA_def_property(srna, "simplify_ao_sss", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "simplify_ao_sss", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "simplify_aosss");
RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AO and SSS quality factor");
RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
- prop= RNA_def_property(srna, "use_simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE);
RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disable non-planar quads being triangulated");
@@ -4276,25 +4290,25 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "SceneObjects");
- srna= RNA_def_struct(brna, "SceneObjects", NULL);
+ srna = RNA_def_struct(brna, "SceneObjects", NULL);
RNA_def_struct_sdna(srna, "Scene");
RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects");
- func= RNA_def_function(srna, "link", "rna_Scene_object_link");
+ func = RNA_def_function(srna, "link", "rna_Scene_object_link");
RNA_def_function_ui_description(func, "Link object to scene, run scene.update() after");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene");
+ parm = RNA_def_pointer(func, "object", "Object", "", "Object to add to scene");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base");
+ parm = RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink");
+ func = RNA_def_function(srna, "unlink", "rna_Scene_object_unlink");
RNA_def_function_ui_description(func, "Unlink object from scene");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene");
+ parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK);
@@ -4311,15 +4325,15 @@ static void rna_def_scene_bases(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna;
PropertyRNA *prop;
-// FunctionRNA *func;
-// PropertyRNA *parm;
+/* FunctionRNA *func; */
+/* PropertyRNA *parm; */
RNA_def_property_srna(cprop, "SceneBases");
- srna= RNA_def_struct(brna, "SceneBases", NULL);
+ srna = RNA_def_struct(brna, "SceneBases", NULL);
RNA_def_struct_sdna(srna, "Scene");
RNA_def_struct_ui_text(srna, "Scene Bases", "Collection of scene bases");
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ObjectBase");
RNA_def_property_pointer_sdna(prop, NULL, "basact");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -4336,26 +4350,26 @@ static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "TimelineMarkers");
- srna= RNA_def_struct(brna, "TimelineMarkers", NULL);
+ srna = RNA_def_struct(brna, "TimelineMarkers", NULL);
RNA_def_struct_sdna(srna, "Scene");
RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
- func= RNA_def_function(srna, "new", "rna_TimeLine_add");
+ func = RNA_def_function(srna, "new", "rna_TimeLine_add");
RNA_def_function_ui_description(func, "Add a keyframe to the curve");
- parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)");
+ parm = RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
+ parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_TimeLine_remove");
+ func = RNA_def_function(srna, "remove", "rna_TimeLine_remove");
RNA_def_function_ui_description(func, "Remove a timeline marker");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove");
+ parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "clear", "rna_TimeLine_clear");
+ func = RNA_def_function(srna, "clear", "rna_TimeLine_clear");
RNA_def_function_ui_description(func, "Remove all timeline markers");
}
@@ -4369,29 +4383,30 @@ static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "KeyingSets");
- srna= RNA_def_struct(brna, "KeyingSets", NULL);
+ srna = RNA_def_struct(brna, "KeyingSets", NULL);
RNA_def_struct_sdna(srna, "Scene");
RNA_def_struct_ui_text(srna, "Keying Sets", "Scene keying sets");
/* Add Keying Set */
- func= RNA_def_function(srna, "new", "rna_Scene_keying_set_new");
+ func = RNA_def_function(srna, "new", "rna_Scene_keying_set_new");
RNA_def_function_ui_description(func, "Add a new Keying Set to Scene");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* name */
- RNA_def_string(func, "name", "KeyingSet", 64, "Name", "Name of Keying Set");
+ RNA_def_string(func, "idname", "KeyingSet", 64, "IDName", "Internal identifier of Keying Set");
+ RNA_def_string(func, "name", "KeyingSet", 64, "Name", "User visible name of Keying Set");
/* returns the new KeyingSet */
- parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set");
+ parm = RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set");
RNA_def_function_return(func, parm);
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyingSet");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
RNA_def_property_ui_text(prop, "Active Keying Set Index",
@@ -4405,20 +4420,20 @@ static void rna_def_scene_keying_sets_all(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "KeyingSetsAll");
- srna= RNA_def_struct(brna, "KeyingSetsAll", NULL);
+ srna = RNA_def_struct(brna, "KeyingSetsAll", NULL);
RNA_def_struct_sdna(srna, "Scene");
RNA_def_struct_ui_text(srna, "Keying Sets All", "All available keying sets");
/* NOTE: no add/remove available here, without screwing up this amalgamated list... */
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyingSet");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
- prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
RNA_def_property_ui_text(prop, "Active Keying Set Index",
@@ -4433,15 +4448,15 @@ static void rna_def_selected_uv_element(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SelectedUvElement", "PropertyGroup");
+ srna = RNA_def_struct(brna, "SelectedUvElement", "PropertyGroup");
RNA_def_struct_ui_text(srna, "Selected UV Element", "");
/* store the index to the UV element selected */
- prop= RNA_def_property(srna, "element_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "element_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_ui_text(prop, "Element Index", "");
- prop= RNA_def_property(srna, "face_index", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "face_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_ui_text(prop, "Face Index", "");
}
@@ -4471,20 +4486,20 @@ void RNA_def_scene(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
/* Struct definition */
- srna= RNA_def_struct(brna, "Scene", "ID");
+ srna = RNA_def_struct(brna, "Scene", "ID");
RNA_def_struct_ui_text(srna, "Scene",
"Scene data block, consisting in objects and defining time and render related settings");
RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
/* Global Settings */
- prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
RNA_def_property_ui_text(prop, "Camera", "Active camera, used for rendering the scene");
RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_view3d_update");
- prop= RNA_def_property(srna, "background_set", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "background_set", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "set");
RNA_def_property_struct_type(prop, "Scene");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
@@ -4492,26 +4507,26 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Background Scene", "Background set scene");
RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
RNA_def_property_update(prop, NC_SCENE|ND_WORLD, "rna_Scene_glsl_update");
- prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
+ prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "cursor");
RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location");
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
RNA_def_property_update(prop, NC_WINDOW, NULL);
/* Bases/Objects */
- prop= RNA_def_property(srna, "object_bases", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "object_bases", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
RNA_def_property_struct_type(prop, "ObjectBase");
RNA_def_property_ui_text(prop, "Bases", "");
RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, "rna_Scene_object_bases_lookup_string", NULL);
rna_def_scene_bases(brna, prop);
- prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Objects", "");
@@ -4519,16 +4534,22 @@ void RNA_def_scene(BlenderRNA *brna)
rna_def_scene_objects(brna, prop);
/* Layers */
- prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); // this seems to be too much trouble with depsgraph updates/etc. currently (20110420)
+ prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* this seems to be too much trouble with depsgraph updates/etc. currently (20110420) */
RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
RNA_def_property_ui_text(prop, "Layers", "Layers visible when rendering the scene");
RNA_def_property_update(prop, NC_SCENE|ND_LAYER, "rna_Scene_layer_update");
-
+
+ /* active layer */
+ prop = RNA_def_property(srna, "active_layer", PROP_INT, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_Scene_active_layer_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Active Layer", "Active scene layer index");
+
/* Frame Range Stuff */
- prop= RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "r.cfra");
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
@@ -4536,12 +4557,12 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Current Frame", "Current Frame, to update animation data from python frame_set() instead");
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
- prop= RNA_def_property(srna, "frame_subframe", PROP_FLOAT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_subframe", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "r.subframe");
RNA_def_property_ui_text(prop, "Current Sub-Frame", "");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE);
- prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "r.sfra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
@@ -4549,7 +4570,7 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Start Frame", "First frame of the playback/rendering range");
RNA_def_property_update(prop, NC_SCENE|ND_FRAME_RANGE, NULL);
- prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "r.efra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
@@ -4557,7 +4578,7 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "End Frame", "Final frame of the playback/rendering range");
RNA_def_property_update(prop, NC_SCENE|ND_FRAME_RANGE, NULL);
- prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "r.frame_step");
RNA_def_property_range(prop, 0, MAXFRAME);
@@ -4566,7 +4587,7 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
/* Preview Range (frame-range for UI playback) */
- prop=RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "r.flag", SCER_PRV_RANGE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_preview_range_set");
@@ -4575,14 +4596,14 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
RNA_def_property_ui_icon(prop, ICON_PREVIEW_RANGE, 0);
- prop= RNA_def_property(srna, "frame_preview_start", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_preview_start", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "r.psfra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Preview Range Start Frame", "Alternative start frame for UI playback");
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
- prop= RNA_def_property(srna, "frame_preview_end", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_preview_end", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "r.pefra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_end_frame_set", NULL);
@@ -4590,7 +4611,7 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
/* Stamp */
- prop= RNA_def_property(srna, "use_stamp_note", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stamp_note", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
RNA_def_property_ui_text(prop, "Stamp Note", "User defined note for the render stamping");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -4599,7 +4620,7 @@ void RNA_def_scene(BlenderRNA *brna)
rna_def_animdata_common(srna);
/* Readonly Properties */
- prop= RNA_def_property(srna, "is_nla_tweakmode", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_nla_tweakmode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_NLA_EDIT_ON);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* DO NOT MAKE THIS EDITABLE, OR NLA EDITOR BREAKS */
RNA_def_property_ui_text(prop, "NLA TweakMode",
@@ -4607,12 +4628,12 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
/* Frame dropping flag for playback and sync enum */
- prop= RNA_def_property(srna, "use_frame_drop", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_frame_drop", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_FRAME_DROP);
RNA_def_property_ui_text(prop, "Frame Dropping", "Play back dropping frames if frame display is too slow");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "sync_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "sync_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_funcs(prop, "rna_Scene_sync_mode_get", "rna_Scene_sync_mode_set", NULL);
RNA_def_property_enum_items(prop, sync_mode_items);
RNA_def_property_ui_text(prop, "Sync Mode", "How to sync playback");
@@ -4620,31 +4641,31 @@ void RNA_def_scene(BlenderRNA *brna)
/* Nodes (Compositing) */
- prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree");
- prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_nodes_set");
RNA_def_property_ui_text(prop, "Use Nodes", "Enable the compositing node tree");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* Sequencer */
- prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ed");
RNA_def_property_struct_type(prop, "SequenceEditor");
RNA_def_property_ui_text(prop, "Sequence Editor", "");
/* Keying Sets */
- prop= RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "keyingsets", NULL);
RNA_def_property_struct_type(prop, "KeyingSet");
RNA_def_property_ui_text(prop, "Absolute Keying Sets", "Absolute Keying Sets for this Scene");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
rna_def_scene_keying_sets(brna, prop);
- prop= RNA_def_property(srna, "keying_sets_all", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "keying_sets_all", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_Scene_all_keyingsets_begin", "rna_Scene_all_keyingsets_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "KeyingSet");
RNA_def_property_ui_text(prop, "All Keying Sets",
@@ -4653,85 +4674,85 @@ void RNA_def_scene(BlenderRNA *brna)
rna_def_scene_keying_sets_all(brna, prop);
/* Tool Settings */
- prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "toolsettings");
RNA_def_property_struct_type(prop, "ToolSettings");
RNA_def_property_ui_text(prop, "Tool Settings", "");
/* Unit Settings */
- prop= RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "unit");
RNA_def_property_struct_type(prop, "UnitSettings");
RNA_def_property_ui_text(prop, "Unit Settings", "Unit editing settings");
/* Physics Settings */
- prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
+ prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_float_sdna(prop, NULL, "physics_settings.gravity");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in a given direction");
RNA_def_property_update(prop, 0, "rna_Physics_update");
- prop= RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "physics_settings.flag", PHYS_GLOBAL_GRAVITY);
RNA_def_property_ui_text(prop, "Global Gravity", "Use global gravity for all dynamics");
RNA_def_property_update(prop, 0, "rna_Physics_update");
/* Render Data */
- prop= RNA_def_property(srna, "render", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "render", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "r");
RNA_def_property_struct_type(prop, "RenderSettings");
RNA_def_property_ui_text(prop, "Render Data", "");
/* Markers */
- prop= RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
RNA_def_property_struct_type(prop, "TimelineMarker");
RNA_def_property_ui_text(prop, "Timeline Markers", "Markers used in all timelines for the current scene");
rna_def_timeline_markers(brna, prop);
/* Audio Settings */
- prop= RNA_def_property(srna, "use_audio", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_audio", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_Scene_use_audio_get", "rna_Scene_use_audio_set");
RNA_def_property_ui_text(prop, "Audio Muted", "Play back of audio from Sequence Editor will be muted");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "use_audio_sync", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_audio_sync", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
RNA_def_property_ui_text(prop, "Audio Sync",
"Play back and sync with audio clock, dropping frames if frame display is too slow");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "use_audio_scrub", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_audio_scrub", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SCRUB);
RNA_def_property_ui_text(prop, "Audio Scrubbing", "Play audio from Sequence Editor while scrubbing");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "audio_doppler_speed", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "audio_doppler_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "audio.speed_of_sound");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.01f, FLT_MAX);
RNA_def_property_ui_text(prop, "Speed of Sound", "Speed of sound for Doppler effect calculation");
RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
- prop= RNA_def_property(srna, "audio_doppler_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "audio_doppler_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "audio.doppler_factor");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0, FLT_MAX);
RNA_def_property_ui_text(prop, "Doppler Factor", "Pitch factor for Doppler effect calculation");
RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
- prop= RNA_def_property(srna, "audio_distance_model", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "audio_distance_model", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "audio.distance_model");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, audio_distance_model_items);
RNA_def_property_ui_text(prop, "Distance Model", "Distance model for distance attenuation calculation");
RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
- prop= RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "audio.volume");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Volume", "Audio volume");
@@ -4739,19 +4760,19 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_float_funcs(prop, NULL, "rna_Scene_volume_set", NULL);
/* Game Settings */
- prop= RNA_def_property(srna, "game_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "game_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "gm");
RNA_def_property_struct_type(prop, "SceneGameData");
RNA_def_property_ui_text(prop, "Game Data", "");
/* Statistics */
- func= RNA_def_function(srna, "statistics", "ED_info_stats_string");
- prop= RNA_def_string(func, "statistics", "", 0, "Statistics", "");
+ func = RNA_def_function(srna, "statistics", "ED_info_stats_string");
+ prop = RNA_def_string(func, "statistics", "", 0, "Statistics", "");
RNA_def_function_return(func, prop);
/* Grease Pencil */
- prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "gpd");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "GreasePencil");
@@ -4759,13 +4780,13 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE, NULL);
/* Transform Orientations */
- prop= RNA_def_property(srna, "orientations", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "orientations", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "transform_spaces", NULL);
RNA_def_property_struct_type(prop, "TransformOrientation");
RNA_def_property_ui_text(prop, "Transform Orientations", "");
/* active MovieClip */
- prop= RNA_def_property(srna, "active_clip", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active_clip", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clip");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "MovieClip");
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index 6d588632c95..11659df3586 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -52,8 +52,8 @@
static void rna_Scene_frame_set(Scene *scene, int frame, float subframe)
{
- scene->r.cfra= frame;
- scene->r.subframe= subframe;
+ scene->r.cfra = frame;
+ scene->r.subframe = subframe;
CLAMP(scene->r.cfra, MINAFRAME, MAXFRAME);
scene_update_for_newframe(G.main, scene, (1<<20) - 1);
@@ -74,10 +74,10 @@ static void rna_Scene_update_tagged(Scene *scene)
static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name)
{
- if(BKE_imtype_is_movie(rd->im_format.imtype))
+ if (BKE_imtype_is_movie(rd->im_format.imtype))
BKE_makeanimstring(name, rd);
else
- BKE_makepicstring(name, rd->pic, G.main->name, (frame==INT_MIN) ? rd->cfra : frame, rd->im_format.imtype, rd->scemode & R_EXTENSION, TRUE);
+ BKE_makepicstring(name, rd->pic, G.main->name, (frame == INT_MIN) ? rd->cfra : frame, rd->im_format.imtype, rd->scemode & R_EXTENSION, TRUE);
}
#ifdef WITH_COLLADA
@@ -98,23 +98,23 @@ void RNA_api_scene(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "frame_set", "rna_Scene_frame_set");
+ func = RNA_def_function(srna, "frame_set", "rna_Scene_frame_set");
RNA_def_function_ui_description(func, "Set scene frame updating all objects immediately");
- parm= RNA_def_int(func, "frame", 0, MINAFRAME, MAXFRAME, "", "Frame number to set", MINAFRAME, MAXFRAME);
+ parm = RNA_def_int(func, "frame", 0, MINAFRAME, MAXFRAME, "", "Frame number to set", MINAFRAME, MAXFRAME);
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_float(func, "subframe", 0.0, 0.0, 1.0, "", "Sub-frame time, between 0.0 and 1.0", 0.0, 1.0);
- func= RNA_def_function(srna, "update", "rna_Scene_update_tagged");
+ func = RNA_def_function(srna, "update", "rna_Scene_update_tagged");
RNA_def_function_ui_description(func, "Update data tagged to be updated from previous access to data or operators");
#ifdef WITH_COLLADA
/* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */
- func= RNA_def_function(srna, "collada_export", "rna_Scene_collada_export");
- parm= RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file");
+ func = RNA_def_function(srna, "collada_export", "rna_Scene_collada_export");
+ parm = RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */
- parm= RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements");
- parm= RNA_def_boolean(func, "second_life", 0, "Export for Second Life", "Compatibility mode for Second Life");
+ parm = RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements");
+ parm = RNA_def_boolean(func, "second_life", 0, "Export for Second Life", "Compatibility mode for Second Life");
RNA_def_function_ui_description(func, "Export to collada file");
#endif
}
@@ -125,11 +125,11 @@ void RNA_api_scene_render(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "frame_path", "rna_SceneRender_get_frame_path");
+ func = RNA_def_function(srna, "frame_path", "rna_SceneRender_get_frame_path");
RNA_def_function_ui_description(func, "Return the absolute path to the filename to be written for a given frame");
RNA_def_int(func, "frame", INT_MIN, INT_MIN, INT_MAX, "",
"Frame number to use, if unset the current frame will be used", MINAFRAME, MAXFRAME);
- parm= RNA_def_string_file_path(func, "filepath", "", FILE_MAX, "File Path",
+ parm = RNA_def_string_file_path(func, "filepath", "", FILE_MAX, "File Path",
"The resulting filepath from the scenes render settings");
RNA_def_property_flag(parm, PROP_THICK_WRAP); /* needed for string return value */
RNA_def_function_output(func, parm);
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index fa1f6c72430..7a43c8cb770 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -58,33 +58,33 @@ EnumPropertyItem region_type_items[] = {
static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value)
{
- bScreen *sc= (bScreen*)ptr->data;
+ bScreen *sc = (bScreen*)ptr->data;
- if(value.data == NULL)
+ if (value.data == NULL)
return;
- sc->newscene= value.data;
+ sc->newscene = value.data;
}
static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr)
{
- bScreen *sc= (bScreen*)ptr->data;
+ bScreen *sc = (bScreen*)ptr->data;
/* exception: must use context so notifier gets to the right window */
- if(sc->newscene) {
- ED_screen_set_scene(C, sc->newscene);
+ if (sc->newscene) {
+ ED_screen_set_scene(C, sc, sc->newscene);
WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, sc->newscene);
- if(G.f & G_DEBUG)
+ if (G.f & G_DEBUG)
printf("scene set %p\n", sc->newscene);
- sc->newscene= NULL;
+ sc->newscene = NULL;
}
}
-static void rna_Screen_redraw_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Screen_redraw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- bScreen *screen= (bScreen*)ptr->data;
+ bScreen *screen = (bScreen *)ptr->data;
/* the settings for this are currently only available from a menu in the TimeLine, hence refresh=SPACE_TIME */
ED_screen_animation_timer_update(screen, screen->redraws_flag, SPACE_TIME);
@@ -93,25 +93,25 @@ static void rna_Screen_redraw_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static int rna_Screen_is_animation_playing_get(PointerRNA *ptr)
{
- bScreen *sc= (bScreen*)ptr->data;
+ bScreen *sc = (bScreen*)ptr->data;
return (sc->animtimer != NULL);
}
static int rna_Screen_fullscreen_get(PointerRNA *ptr)
{
- bScreen *sc= (bScreen*)ptr->data;
+ bScreen *sc = (bScreen*)ptr->data;
return (sc->full != 0);
}
static void rna_Area_type_set(PointerRNA *ptr, int value)
{
- ScrArea *sa= (ScrArea*)ptr->data;
- sa->butspacetype= value;
+ ScrArea *sa = (ScrArea*)ptr->data;
+ sa->butspacetype = value;
}
static void rna_Area_type_update(bContext *C, PointerRNA *ptr)
{
- ScrArea *sa= (ScrArea*)ptr->data;
+ ScrArea *sa = (ScrArea*)ptr->data;
ED_area_newspace(C, sa, sa->butspacetype); /* XXX - this uses the window */
ED_area_tag_redraw(sa);
@@ -126,11 +126,11 @@ static void rna_def_area_spaces(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "AreaSpaces");
- srna= RNA_def_struct(brna, "AreaSpaces", NULL);
+ srna = RNA_def_struct(brna, "AreaSpaces", NULL);
RNA_def_struct_sdna(srna, "ScrArea");
RNA_def_struct_ui_text(srna, "Area Spaces", "Collection of spaces");
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "spacedata.first");
RNA_def_property_struct_type(prop, "Space");
RNA_def_property_ui_text(prop, "Active Space", "Space currently being displayed in this area");
@@ -142,11 +142,11 @@ static void rna_def_area(BlenderRNA *brna)
PropertyRNA *prop;
FunctionRNA *func;
- srna= RNA_def_struct(brna, "Area", NULL);
+ srna = RNA_def_struct(brna, "Area", NULL);
RNA_def_struct_ui_text(srna, "Area", "Area in a subdivided screen, containing an editor");
RNA_def_struct_sdna(srna, "ScrArea");
- prop= RNA_def_property(srna, "spaces", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "spaces", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "spacedata", NULL);
RNA_def_property_struct_type(prop, "Space");
RNA_def_property_ui_text(prop, "Spaces",
@@ -155,16 +155,16 @@ static void rna_def_area(BlenderRNA *brna)
"in a certain area to get the old view orientation)");
rna_def_area_spaces(brna, prop);
- prop= RNA_def_property(srna, "regions", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "regions", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "regionbase", NULL);
RNA_def_property_struct_type(prop, "Region");
RNA_def_property_ui_text(prop, "Regions", "Regions this area is subdivided in");
- prop= RNA_def_property(srna, "show_menus", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_menus", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", HEADER_NO_PULLDOWN);
RNA_def_property_ui_text(prop, "Show Menus", "Show menus in the header");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "spacetype");
RNA_def_property_enum_items(prop, space_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Area_type_set", NULL);
@@ -172,19 +172,19 @@ static void rna_def_area(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
RNA_def_property_update(prop, 0, "rna_Area_type_update");
- prop= RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "winx");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Width", "Area width");
- prop= RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "winy");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Height", "Area height");
RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw");
- func= RNA_def_function(srna, "header_text_set", "ED_area_headerprint");
+ func = RNA_def_function(srna, "header_text_set", "ED_area_headerprint");
RNA_def_function_ui_description(func, "Set the header text");
RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text");
}
@@ -194,27 +194,27 @@ static void rna_def_region(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Region", NULL);
+ srna = RNA_def_struct(brna, "Region", NULL);
RNA_def_struct_ui_text(srna, "Region", "Region in a subdivided screen area");
RNA_def_struct_sdna(srna, "ARegion");
- prop= RNA_def_property(srna, "id", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "id", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "swinid");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Region ID", "Unique ID for this region");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "regiontype");
RNA_def_property_enum_items(prop, region_type_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Region Type", "Type of this region");
- prop= RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "winx");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Width", "Region width");
- prop= RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "winy");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Height", "Region height");
@@ -227,13 +227,13 @@ static void rna_def_screen(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Screen", "ID");
+ srna = RNA_def_struct(brna, "Screen", "ID");
RNA_def_struct_sdna(srna, "Screen"); /* it is actually bScreen but for 2.5 the dna is patched! */
RNA_def_struct_ui_text(srna, "Screen", "Screen datablock, defining the layout of areas in a window");
RNA_def_struct_ui_icon(srna, ICON_SPLITSCREEN);
/* pointers */
- prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen");
@@ -241,59 +241,59 @@ static void rna_def_screen(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Screen_scene_update");
/* collections */
- prop= RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "areabase", NULL);
RNA_def_property_struct_type(prop, "Area");
RNA_def_property_ui_text(prop, "Areas", "Areas the screen is subdivided into");
/* readonly status indicators */
- prop= RNA_def_property(srna, "is_animation_playing", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_animation_playing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Screen_is_animation_playing_get", NULL);
RNA_def_property_ui_text(prop, "Animation Playing", "Animation playback is active");
- prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Screen_fullscreen_get", NULL);
RNA_def_property_ui_text(prop, "Fullscreen", "An area is maximised, filling this screen");
/* Define Anim Playback Areas */
- prop= RNA_def_property(srna, "use_play_top_left_3d_editor", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_play_top_left_3d_editor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_REGION);
RNA_def_property_ui_text(prop, "Top-Left 3D Editor", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
- prop= RNA_def_property(srna, "use_play_3d_editors", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_play_3d_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_3D_WIN);
RNA_def_property_ui_text(prop, "All 3D View Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
- prop= RNA_def_property(srna, "use_play_animation_editors", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_play_animation_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_ANIM_WIN);
RNA_def_property_ui_text(prop, "Animation Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
- prop= RNA_def_property(srna, "use_play_properties_editors", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_play_properties_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_BUTS_WIN);
RNA_def_property_ui_text(prop, "Property Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
- prop= RNA_def_property(srna, "use_play_image_editors", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_play_image_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_IMAGE_WIN);
RNA_def_property_ui_text(prop, "Image Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
- prop= RNA_def_property(srna, "use_play_sequence_editors", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_play_sequence_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_SEQ);
RNA_def_property_ui_text(prop, "Sequencer Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
- prop= RNA_def_property(srna, "use_play_node_editors", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_play_node_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_NODES);
RNA_def_property_ui_text(prop, "Node Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
- prop= RNA_def_property(srna, "use_play_clip_editors", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_play_clip_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_CLIPS);
RNA_def_property_ui_text(prop, "Clip Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 7b747fcd224..eea11aed803 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -79,11 +79,11 @@ static EnumPropertyItem particle_edit_cache_brush_items[] = {
static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr)
{
- ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data;
- ParticleBrushData *brush= NULL;
+ ParticleEditSettings *pset = (ParticleEditSettings*)ptr->data;
+ ParticleBrushData *brush = NULL;
- if(pset->brushtype != PE_BRUSH_NONE)
- brush= &pset->brush[pset->brushtype];
+ if (pset->brushtype != PE_BRUSH_NONE)
+ brush = &pset->brush[pset->brushtype];
return rna_pointer_inherit_refine(ptr, &RNA_ParticleBrush, brush);
}
@@ -95,10 +95,10 @@ static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr)
static void rna_ParticleEdit_redo(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
- Object *ob= (scene->basact)? scene->basact->object: NULL;
+ Object *ob = (scene->basact)? scene->basact->object: NULL;
PTCacheEdit *edit = PE_get_current(scene, ob);
- if(!edit)
+ if (!edit)
return;
psys_free_path_cache(edit->psys, edit);
@@ -106,18 +106,18 @@ static void rna_ParticleEdit_redo(Main *UNUSED(bmain), Scene *scene, PointerRNA
static void rna_ParticleEdit_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
- Object *ob= (scene->basact)? scene->basact->object: NULL;
+ Object *ob = (scene->basact)? scene->basact->object: NULL;
- if(ob) DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+ if (ob) DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
{
- ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data;
+ ParticleEditSettings *pset = (ParticleEditSettings*)ptr->data;
/* redraw hair completely if weight brush is/was used */
- if((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->scene) {
+ if ((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->scene) {
Object *ob = (pset->scene->basact)? pset->scene->basact->object: NULL;
- if(ob) {
+ if (ob) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
@@ -128,20 +128,20 @@ static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= (scene->basact)? scene->basact->object: NULL;
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = (scene->basact)? scene->basact->object: NULL;
#if 0
PTCacheEdit *edit = PE_get_current(scene, ob);
- ParticleSystem *psys= edit ? edit->psys : NULL;
+ ParticleSystem *psys = edit ? edit->psys : NULL;
#else
/* use this rather than PE_get_current() - because the editing cache is
* dependent on the cache being updated which can happen after this UI
* draws causing a glitch [#28883] */
- ParticleSystem *psys= psys_get_current(ob);
+ ParticleSystem *psys = psys_get_current(ob);
#endif
- if(psys) {
- if(psys->flag & PSYS_GLOBAL_HAIR) {
+ if (psys) {
+ if (psys->flag & PSYS_GLOBAL_HAIR) {
return particle_edit_disconnected_hair_brush_items;
}
else {
@@ -154,15 +154,15 @@ static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UN
static int rna_ParticleEdit_editable_get(PointerRNA *ptr)
{
- ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data;
+ ParticleEditSettings *pset = (ParticleEditSettings*)ptr->data;
return (pset->object && pset->scene && PE_get_current(pset->scene, pset->object));
}
static int rna_ParticleEdit_hair_get(PointerRNA *ptr)
{
- ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data;
+ ParticleEditSettings *pset = (ParticleEditSettings*)ptr->data;
- if(pset->scene) {
+ if (pset->scene) {
PTCacheEdit *edit = PE_get_current(pset->scene, pset->object);
return (edit && edit->psys);
@@ -173,21 +173,21 @@ static int rna_ParticleEdit_hair_get(PointerRNA *ptr)
static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
{
- Scene *scene= (Scene *)ptr->id.data;
+ Scene *scene = (Scene *)ptr->id.data;
ToolSettings *ts = scene->toolsettings;
- Brush *brush= value.id.data;
+ Brush *brush = value.id.data;
int mode = 0;
/* check the origin of the Paint struct to see which paint
- mode to select from */
+ * mode to select from */
- if(ptr->data == &ts->imapaint)
+ if (ptr->data == &ts->imapaint)
mode = OB_MODE_TEXTURE_PAINT;
- else if(ptr->data == ts->sculpt)
+ else if (ptr->data == ts->sculpt)
mode = OB_MODE_SCULPT;
- else if(ptr->data == ts->vpaint)
+ else if (ptr->data == ts->vpaint)
mode = OB_MODE_VERTEX_PAINT;
- else if(ptr->data == ts->wpaint)
+ else if (ptr->data == ts->wpaint)
mode = OB_MODE_WEIGHT_PAINT;
return brush->ob_mode & mode;
@@ -195,9 +195,9 @@ static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
static void rna_Sculpt_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
- Object *ob= (scene->basact)? scene->basact->object: NULL;
+ Object *ob = (scene->basact)? scene->basact->object: NULL;
- if(ob) {
+ if (ob) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
}
@@ -210,25 +210,25 @@ static void rna_def_paint(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Paint", NULL);
+ srna = RNA_def_struct(brna, "Paint", NULL);
RNA_def_struct_ui_text(srna, "Paint", "");
/* Global Settings */
- prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_mode_poll");
RNA_def_property_ui_text(prop, "Brush", "Active Brush");
RNA_def_property_update(prop, NC_BRUSH|NA_EDITED, NULL);
- prop= RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH);
RNA_def_property_ui_text(prop, "Show Brush", "");
- prop= RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH_ON_SURFACE);
RNA_def_property_ui_text(prop, "Show Brush On Surface", "");
- prop= RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_FAST_NAVIGATE);
RNA_def_property_ui_text(prop, "Fast Navigate", "For multires, show low resolution while navigating the view");
}
@@ -238,50 +238,50 @@ static void rna_def_sculpt(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Sculpt", "Paint");
+ srna = RNA_def_struct(brna, "Sculpt", "Paint");
RNA_def_struct_ui_text(srna, "Sculpt", "");
- prop= RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
+ prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
RNA_def_property_int_sdna(prop, NULL, "radial_symm");
RNA_def_property_int_default(prop, 1);
RNA_def_property_range(prop, 1, 64);
RNA_def_property_ui_range(prop, 0, 32, 1, 1);
RNA_def_property_ui_text(prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface");
- prop= RNA_def_property(srna, "use_symmetry_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_symmetry_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_X);
RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis");
- prop= RNA_def_property(srna, "use_symmetry_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_symmetry_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Y);
RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis");
- prop= RNA_def_property(srna, "use_symmetry_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_symmetry_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Z);
RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis");
- prop= RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_X);
RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices");
- prop= RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Y);
RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices");
- prop= RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Z);
RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices");
- prop= RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMMETRY_FEATHER);
RNA_def_property_ui_text(prop, "Symmetry Feathering",
"Reduce the strength of the brush where it overlaps symmetrical daubs");
- prop= RNA_def_property(srna, "use_threaded", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_threaded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_USE_OPENMP);
RNA_def_property_ui_text(prop, "Use OpenMP", "Take advantage of multiple CPU cores to improve sculpting performance");
- prop= RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_ONLY_DEFORM);
RNA_def_property_ui_text(prop, "Use Deform Only",
"Use only deformation modifiers (temporary disable all "
@@ -294,7 +294,7 @@ static void rna_def_uv_sculpt(BlenderRNA *brna)
{
StructRNA *srna;
- srna= RNA_def_struct(brna, "UvSculpt", "Paint");
+ srna = RNA_def_struct(brna, "UvSculpt", "Paint");
RNA_def_struct_ui_text(srna, "UV Sculpting", "");
}
@@ -305,25 +305,25 @@ static void rna_def_vertex_paint(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "VertexPaint", "Paint");
+ srna = RNA_def_struct(brna, "VertexPaint", "Paint");
RNA_def_struct_sdna(srna, "VPaint");
RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode");
/* vertex paint only */
- prop= RNA_def_property(srna, "use_all_faces", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_all_faces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_AREA);
RNA_def_property_ui_text(prop, "All Faces", "Paint on all faces inside brush");
- prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_NORMALS);
RNA_def_property_ui_text(prop, "Normals", "Apply the vertex normal before painting");
- prop= RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SPRAY);
RNA_def_property_ui_text(prop, "Spray", "Keep applying paint effect while holding mouse");
/* weight paint only */
- prop= RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_ONLYVGROUP);
RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to verts already apart of the vertex group");
}
@@ -333,51 +333,51 @@ static void rna_def_image_paint(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ImagePaint", "Paint");
+ srna = RNA_def_struct(brna, "ImagePaint", "Paint");
RNA_def_struct_sdna(srna, "ImagePaintSettings");
RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode");
/* booleans */
- prop= RNA_def_property(srna, "use_projection", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_projection", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_DISABLE);
RNA_def_property_ui_text(prop, "Project Paint", "Use projection painting for improved consistency in the brush strokes");
- prop= RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_XRAY);
RNA_def_property_ui_text(prop, "Occlude", "Only paint onto the faces directly under the brush (slower)");
- prop= RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_BACKFACE);
RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)");
- prop= RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_FLAT);
RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view");
- prop= RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL);
RNA_def_property_ui_text(prop, "Stencil Layer", "Set the mask layer from the UV map buttons");
- prop= RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL_INV);
RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer");
- prop= RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_CLONE);
RNA_def_property_ui_text(prop, "Clone Map",
"Use another UV map as clone source, otherwise use the 3D cursor as the source");
/* integers */
- prop= RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_UNSIGNED);
RNA_def_property_ui_range(prop, 0, 8, 0, 0);
RNA_def_property_ui_text(prop, "Bleed", "Extend paint beyond the faces UVs to reduce seams (in pixels, slower)");
- prop= RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED);
RNA_def_property_range(prop, 0, 90);
RNA_def_property_ui_text(prop, "Angle", "Paint most on faces pointing towards the view according to this angle");
- prop= RNA_def_int_array(srna, "screen_grab_size", 2, NULL, 0, 0, "screen_grab_size",
+ prop = RNA_def_int_array(srna, "screen_grab_size", 2, NULL, 0, 0, "screen_grab_size",
"Size to capture the image for re-projecting", 0, 0);
RNA_def_property_range(prop, 512, 16384);
}
@@ -403,7 +403,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
{1, "SHRINK", 0, "Shrink", "Make hairs shorter"},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem edit_type_items[]= {
+ static EnumPropertyItem edit_type_items[] = {
{PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
{PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft body", ""},
{PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
@@ -413,142 +413,142 @@ static void rna_def_particle_edit(BlenderRNA *brna)
/* edit */
- srna= RNA_def_struct(brna, "ParticleEdit", NULL);
+ srna = RNA_def_struct(brna, "ParticleEdit", NULL);
RNA_def_struct_sdna(srna, "ParticleEditSettings");
RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode");
- prop= RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "brushtype");
RNA_def_property_enum_items(prop, particle_edit_hair_brush_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
RNA_def_property_ui_text(prop, "Tool", "");
- prop= RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode");
RNA_def_property_enum_items(prop, select_mode_items);
RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update");
- prop= RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS);
RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant");
- prop= RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_LOCK_FIRST);
RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified");
- prop= RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DEFLECT_EMITTER);
RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter");
- prop= RNA_def_property(srna, "emitter_distance", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "emitter_distance", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "emitterdist");
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3);
RNA_def_property_ui_text(prop, "Emitter Distance", "Distance to keep particles away from the emitter");
- prop= RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_FADE_TIME);
RNA_def_property_ui_text(prop, "Fade Time", "Fade paths and keys further away from current frame");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update");
- prop= RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY);
RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically");
- prop= RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART);
RNA_def_property_ui_text(prop, "Draw Particles", "Draw actual particles");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo");
- prop= RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_INTERPOLATE_ADDED);
RNA_def_property_ui_text(prop, "Interpolate", "Interpolate new particles from the existing ones");
- prop= RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "totaddkey");
RNA_def_property_range(prop, 2, SHRT_MAX);
RNA_def_property_ui_range(prop, 2, 20, 10, 3);
RNA_def_property_ui_text(prop, "Keys", "How many keys to make new particles with");
- prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ParticleBrush");
RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Brush", "");
- prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Steps", "How many steps to draw the path with");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo");
- prop= RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Frames", "How many frames to fade");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "edittype");
RNA_def_property_enum_items(prop, edit_type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo");
- prop= RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists");
- prop= RNA_def_property(srna, "is_hair", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_hair", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Hair", "Editing hair");
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "The edited object");
/* brush */
- srna= RNA_def_struct(brna, "ParticleBrush", NULL);
+ srna = RNA_def_struct(brna, "ParticleBrush", NULL);
RNA_def_struct_sdna(srna, "ParticleBrushData");
RNA_def_struct_ui_text(srna, "Particle Brush", "Particle editing brush");
- prop= RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
RNA_def_property_range(prop, 1, SHRT_MAX);
RNA_def_property_ui_range(prop, 1, 100, 10, 3);
RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
- prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.001, 1.0);
RNA_def_property_ui_text(prop, "Strength", "Brush strength");
- prop= RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 1000);
RNA_def_property_ui_range(prop, 1, 100, 10, 3);
RNA_def_property_ui_text(prop, "Count", "Particle count");
- prop= RNA_def_property(srna, "steps", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "steps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "step");
RNA_def_property_range(prop, 1, SHRT_MAX);
RNA_def_property_ui_range(prop, 1, 50, 10, 3);
RNA_def_property_ui_text(prop, "Steps", "Brush steps");
- prop= RNA_def_property(srna, "puff_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "puff_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "invert");
RNA_def_property_enum_items(prop, puff_mode);
RNA_def_property_ui_text(prop, "Puff Mode", "");
- prop= RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_BRUSH_DATA_PUFF_VOLUME);
RNA_def_property_ui_text(prop, "Puff Volume",
"Apply puff to unselected end-points (helps maintain hair volume when puffing root)");
- prop= RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "invert");
RNA_def_property_enum_items(prop, length_mode);
RNA_def_property_ui_text(prop, "Length Mode", "");
/* dummy */
- prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Curve", "");
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c
index 4413eee9395..aeb67cb0410 100644
--- a/source/blender/makesrna/intern/rna_sensor.c
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -40,7 +40,7 @@
#include "WM_types.h"
/* Always keep in alphabetical order */
-EnumPropertyItem sensor_type_items[] ={
+EnumPropertyItem sensor_type_items[] = {
{SENS_ACTUATOR, "ACTUATOR", 0, "Actuator", ""},
{SENS_ALWAYS, "ALWAYS", 0, "Always", ""},
{SENS_ARMATURE, "ARMATURE", 0, "Armature", ""},
@@ -65,9 +65,9 @@ EnumPropertyItem sensor_type_items[] ={
static StructRNA* rna_Sensor_refine(struct PointerRNA *ptr)
{
- bSensor *sensor= (bSensor*)ptr->data;
+ bSensor *sensor = (bSensor*)ptr->data;
- switch(sensor->type) {
+ switch (sensor->type) {
case SENS_ALWAYS:
return &RNA_AlwaysSensor;
case SENS_TOUCH:
@@ -105,21 +105,20 @@ static StructRNA* rna_Sensor_refine(struct PointerRNA *ptr)
void rna_Sensor_name_set(PointerRNA *ptr, const char *value)
{
- bSensor *sens= (bSensor *)ptr->data;
+ bSensor *sens = (bSensor *)ptr->data;
BLI_strncpy_utf8(sens->name, value, sizeof(sens->name));
if (ptr->id.data) {
- Object *ob= (Object *)ptr->id.data;
+ Object *ob = (Object *)ptr->id.data;
BLI_uniquename(&ob->sensors, sens, "Sensor", '.', offsetof(bSensor, name), sizeof(sens->name));
}
}
static void rna_Sensor_type_set(struct PointerRNA *ptr, int value)
{
- bSensor *sens= (bSensor *)ptr->data;
- if (value != sens->type)
- {
+ bSensor *sens = (bSensor *)ptr->data;
+ if (value != sens->type) {
sens->type = value;
init_sensor(sens);
}
@@ -141,9 +140,9 @@ static int rna_Sensor_controllers_length(PointerRNA *ptr)
EnumPropertyItem *rna_Sensor_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{
- EnumPropertyItem *item= NULL;
- Object *ob=NULL;
- int totitem= 0;
+ EnumPropertyItem *item = NULL;
+ Object *ob = NULL;
+ int totitem = 0;
if (ptr->type == &RNA_Sensor || RNA_struct_is_a(ptr->type, &RNA_Sensor)) {
ob = (Object *)ptr->id.data;
@@ -156,7 +155,7 @@ EnumPropertyItem *rna_Sensor_type_itemf(bContext *C, PointerRNA *ptr, PropertyRN
RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_ALWAYS);
if (ob != NULL) {
- if (ob->type==OB_ARMATURE) {
+ if (ob->type == OB_ARMATURE) {
RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_ARMATURE);
}
}
@@ -174,14 +173,14 @@ EnumPropertyItem *rna_Sensor_type_itemf(bContext *C, PointerRNA *ptr, PropertyRN
RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_TOUCH);
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
static void rna_Sensor_keyboard_key_set(struct PointerRNA *ptr, int value)
{
- bSensor *sens= (bSensor *)ptr->data;
+ bSensor *sens = (bSensor *)ptr->data;
bKeyboardSensor *ks = (bKeyboardSensor *)sens->data;
if (ISKEYBOARD(value))
@@ -192,7 +191,7 @@ static void rna_Sensor_keyboard_key_set(struct PointerRNA *ptr, int value)
static void rna_Sensor_keyboard_modifier_set(struct PointerRNA *ptr, int value)
{
- bSensor *sens= (bSensor *)ptr->data;
+ bSensor *sens = (bSensor *)ptr->data;
bKeyboardSensor *ks = (bKeyboardSensor *)sens->data;
if (ISKEYBOARD(value))
@@ -203,7 +202,7 @@ static void rna_Sensor_keyboard_modifier_set(struct PointerRNA *ptr, int value)
static void rna_Sensor_keyboard_modifier2_set(struct PointerRNA *ptr, int value)
{
- bSensor *sens= (bSensor *)ptr->data;
+ bSensor *sens = (bSensor *)ptr->data;
bKeyboardSensor *ks = (bKeyboardSensor *)sens->data;
if (ISKEYBOARD(value))
@@ -214,43 +213,43 @@ static void rna_Sensor_keyboard_modifier2_set(struct PointerRNA *ptr, int value)
static void rna_Sensor_tap_set(struct PointerRNA *ptr, int value)
{
- bSensor *sens= (bSensor*)ptr->data;
+ bSensor *sens = (bSensor*)ptr->data;
sens->tap = value;
- if(sens->tap == 1)
+ if (sens->tap == 1)
sens->level = 0;
}
static void rna_Sensor_level_set(struct PointerRNA *ptr, int value)
{
- bSensor *sens= (bSensor*)ptr->data;
+ bSensor *sens = (bSensor*)ptr->data;
sens->level = value;
- if(sens->level == 1)
+ if (sens->level == 1)
sens->tap = 0;
}
static void rna_Sensor_Armature_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- bSensor *sens= (bSensor *)ptr->data;
+ bSensor *sens = (bSensor *)ptr->data;
bArmatureSensor *as = sens->data;
Object *ob = (Object *)ptr->id.data;
- char *posechannel= as->posechannel;
- char *constraint= as->constraint;
+ char *posechannel = as->posechannel;
+ char *constraint = as->constraint;
/* check that bone exist in the active object */
if (ob->type == OB_ARMATURE && ob->pose) {
bPoseChannel *pchan;
bPose *pose = ob->pose;
- for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) {
+ for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
if (!strcmp(pchan->name, posechannel)) {
/* found it, now look for constraint channel */
bConstraint *con;
- for (con=pchan->constraints.first; con; con=con->next) {
+ for (con = pchan->constraints.first; con; con = con->next) {
if (!strcmp(con->name, constraint)) {
/* found it, all ok */
- return;
+ return;
}
}
/* didn't find constraint, make empty */
@@ -279,69 +278,69 @@ static void rna_def_sensor(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Sensor", NULL);
+ srna = RNA_def_struct(brna, "Sensor", NULL);
RNA_def_struct_ui_text(srna, "Sensor", "Game engine logic brick to detect events");
RNA_def_struct_sdna(srna, "bSensor");
RNA_def_struct_refine_func(srna, "rna_Sensor_refine");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Sensor name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Sensor_name_set");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, sensor_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_type_set", "rna_Sensor_type_itemf");
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_PIN);
RNA_def_property_ui_text(prop, "Pinned", "Display when not linked to a visible states controller");
RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_SHOW);
RNA_def_property_ui_text(prop, "Expanded", "Set sensor expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Invert Output", "Invert the level(output) of this sensor");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_level", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_level", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "level", 1);
RNA_def_property_ui_text(prop, "Level", "Level detector, trigger controllers of new states(only applicable upon logic state transition)");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sensor_level_set");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_pulse_true_level", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pulse_true_level", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_PULSE_REPEAT);
RNA_def_property_ui_text(prop, "Pulse True Level", "Activate TRUE level triggering (pulse mode)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_pulse_false_level", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pulse_false_level", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_NEG_PULSE_MODE);
RNA_def_property_ui_text(prop, "Pulse False Level", "Activate FALSE level triggering (pulse mode)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "freq");
RNA_def_property_ui_text(prop, "Frequency", "Delay between repeated pulses(in logic tics, 0=no delay)");
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_tap", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_tap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tap", 1);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sensor_tap_set");
RNA_def_property_ui_text(prop, "Tap", "Trigger controllers only for an instant, even while the sensor remains true");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "links", NULL);
RNA_def_property_struct_type(prop, "Controller");
RNA_def_property_ui_text(prop, "Controllers", "The list containing the controllers connected to the sensor");
@@ -354,7 +353,7 @@ static void rna_def_sensor(BlenderRNA *brna)
static void rna_def_always_sensor(BlenderRNA *brna)
{
StructRNA *srna;
- srna= RNA_def_struct(brna, "AlwaysSensor", "Sensor");
+ srna = RNA_def_struct(brna, "AlwaysSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Always Sensor", "Sensor to generate continuous pulses");
}
@@ -363,22 +362,22 @@ static void rna_def_near_sensor(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "NearSensor", "Sensor");
+ srna = RNA_def_struct(brna, "NearSensor", "Sensor");
RNA_def_struct_ui_text(srna , "Near Sensor", "Sensor to detect nearby objects");
RNA_def_struct_sdna_from(srna, "bNearSensor", "data");
- prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_ui_text(prop, "Distance", "Trigger distance");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "reset_distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "reset_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "resetdist");
RNA_def_property_ui_text(prop, "Reset Distance", "The distance where the sensor forgets the actor");
RNA_def_property_range(prop, 0.0f, 10000.0f);
@@ -390,7 +389,7 @@ static void rna_def_mouse_sensor(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem mouse_event_items[] ={
+ static EnumPropertyItem mouse_event_items[] = {
{BL_SENS_MOUSE_LEFT_BUTTON, "LEFTCLICK", 0, "Left Button", ""},
{BL_SENS_MOUSE_MIDDLE_BUTTON, "MIDDLECLICK", 0, "Middle Button", ""},
{BL_SENS_MOUSE_RIGHT_BUTTON, "RIGHTCLICK", 0, "Right Button", ""},
@@ -401,11 +400,11 @@ static void rna_def_mouse_sensor(BlenderRNA *brna)
{BL_SENS_MOUSE_MOUSEOVER_ANY, "MOUSEOVERANY", 0, "Mouse Over Any", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MouseSensor", "Sensor");
+ srna = RNA_def_struct(brna, "MouseSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Mouse Sensor", "Sensor to detect mouse events");
RNA_def_struct_sdna_from(srna, "bMouseSensor", "data");
- prop= RNA_def_property(srna, "mouse_event", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mouse_event", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, mouse_event_items);
RNA_def_property_ui_text(prop, "Mouse Event", "Type of event this mouse sensor should trigger on");
@@ -417,11 +416,11 @@ static void rna_def_touch_sensor(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "TouchSensor", "Sensor");
+ srna = RNA_def_struct(brna, "TouchSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Touch Sensor", "Sensor to detect objects colliding with the current object");
RNA_def_struct_sdna_from(srna, "bTouchSensor", "data");
- prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_pointer_sdna(prop, NULL, "ma");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -436,42 +435,42 @@ static void rna_def_keyboard_sensor(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "KeyboardSensor", "Sensor");
+ srna = RNA_def_struct(brna, "KeyboardSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Keyboard Sensor", "Sensor to detect keyboard events");
RNA_def_struct_sdna_from(srna, "bKeyboardSensor", "data");
- prop= RNA_def_property(srna, "key", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "key", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "key");
RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_key_set", NULL);
RNA_def_property_ui_text(prop, "Key", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "modifier_key_1", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "modifier_key_1", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "qual");
RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_modifier_set", NULL);
RNA_def_property_ui_text(prop, "Modifier Key", "Modifier key code");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "modifier_key_2", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "modifier_key_2", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "qual2");
RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_modifier2_set", NULL);
RNA_def_property_ui_text(prop, "Second Modifier Key", "Modifier key code");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "target", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "target", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "targetName");
RNA_def_property_ui_text(prop, "Target", "Property that receives the keystrokes in case a string is logged");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "log", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "log", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "toggleName");
RNA_def_property_ui_text(prop, "Log Toggle", "Property that indicates whether to log keystrokes as a string");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_all_keys", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_all_keys", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type", 1);
RNA_def_property_ui_text(prop, "All Keys", "Trigger this sensor on any keystroke");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -481,7 +480,7 @@ static void rna_def_property_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{SENS_PROP_EQUAL, "PROPEQUAL", 0, "Equal", ""},
{SENS_PROP_NEQUAL, "PROPNEQUAL", 0, "Not Equal", ""},
{SENS_PROP_INTERVAL, "PROPINTERVAL", 0, "Interval", ""},
@@ -489,32 +488,32 @@ static void rna_def_property_sensor(BlenderRNA *brna)
/* {SENS_PROP_EXPRESSION, "PROPEXPRESSION", 0, "Expression", ""}, NOT_USED_IN_UI */
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "PropertySensor", "Sensor");
+ srna = RNA_def_struct(brna, "PropertySensor", "Sensor");
RNA_def_struct_ui_text(srna, "Property Sensor", "Sensor to detect values and changes in values of properties");
RNA_def_struct_sdna_from(srna, "bPropertySensor", "data");
- prop= RNA_def_property(srna, "evaluation_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "evaluation_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Evaluation Type", "Type of property evaluation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "value");
RNA_def_property_ui_text(prop, "Value", "Check for this value in types in Equal or Not Equal types");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "value_min", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "value_min", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "value");
RNA_def_property_ui_text(prop, "Minimum Value", "Minimum value in Interval type");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "value_max", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "value_max", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "maxvalue");
RNA_def_property_ui_text(prop, "Maximum Value", "Maximum value in Interval type");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -524,7 +523,7 @@ static void rna_def_armature_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] ={
+ static EnumPropertyItem prop_type_items[] = {
{SENS_ARM_STATE_CHANGED, "STATECHG", 0, "State Changed", ""},
{SENS_ARM_LIN_ERROR_BELOW, "LINERRORBELOW", 0, "Lin error below", ""},
{SENS_ARM_LIN_ERROR_ABOVE, "LINERRORABOVE", 0, "Lin error above", ""},
@@ -532,27 +531,27 @@ static void rna_def_armature_sensor(BlenderRNA *brna)
{SENS_ARM_ROT_ERROR_ABOVE, "ROTERRORABOVE", 0, "Rot error above", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ArmatureSensor", "Sensor");
+ srna = RNA_def_struct(brna, "ArmatureSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Armature Sensor", "Sensor to detect values and changes in values of IK solver");
RNA_def_struct_sdna_from(srna, "bArmatureSensor", "data");
- prop= RNA_def_property(srna, "test_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "test_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Test", "Type of value and test");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "bone", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "bone", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "posechannel");
RNA_def_property_ui_text(prop, "Bone Name", "Identify the bone to check value from");
RNA_def_property_update(prop, NC_LOGIC, "rna_Sensor_Armature_update");
- prop= RNA_def_property(srna, "constraint", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "constraint", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "constraint");
RNA_def_property_ui_text(prop, "Constraint Name", "Identify the bone constraint to check value from");
RNA_def_property_update(prop, NC_LOGIC, "rna_Sensor_Armature_update");
- prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "value");
RNA_def_property_ui_text(prop, "Compare Value", "Value to be used in comparison");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -563,12 +562,12 @@ static void rna_def_actuator_sensor(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ActuatorSensor", "Sensor");
+ srna = RNA_def_struct(brna, "ActuatorSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Actuator Sensor", "Sensor to detect state modifications of actuators");
RNA_def_struct_sdna_from(srna, "bActuatorSensor", "data");
- // XXX if eventually have Logics using RNA 100%, we could use the actuator datablock isntead of its name
- prop= RNA_def_property(srna, "actuator", PROP_STRING, PROP_NONE);
+ /* XXX if eventually have Logics using RNA 100%, we could use the actuator datablock isntead of its name */
+ prop = RNA_def_property(srna, "actuator", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Actuator", "Actuator name, actuator active state modifications will be detected");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -579,21 +578,21 @@ static void rna_def_delay_sensor(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "DelaySensor", "Sensor");
+ srna = RNA_def_struct(brna, "DelaySensor", "Sensor");
RNA_def_struct_ui_text(srna, "Delay Sensor", "Sensor to send delayed events");
RNA_def_struct_sdna_from(srna, "bDelaySensor", "data");
- prop= RNA_def_property(srna, "delay", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "delay", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "Delay", "Delay in number of logic tics before the positive trigger (default 60 per second)");
RNA_def_property_range(prop, 0, 5000);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "duration", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "duration", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "Duration", "If >0, delay in number of logic tics before the negative trigger following the positive trigger");
RNA_def_property_range(prop, 0, 5000);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_repeat", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_repeat", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_DELAY_REPEAT);
RNA_def_property_ui_text(prop, "Repeat", "Toggle repeat option (if selected, the sensor restarts after Delay+Duration logic tics)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -604,46 +603,47 @@ static void rna_def_collision_sensor(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "CollisionSensor", "Sensor");
+ srna = RNA_def_struct(brna, "CollisionSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Collision Sensor", "Sensor to detect objects colliding with the current object, with more settings than the Touch sensor");
RNA_def_struct_sdna_from(srna, "bCollisionSensor", "data");
- prop= RNA_def_property(srna, "use_pulse", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pulse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_PULSE);
RNA_def_property_ui_text(prop, "Pulse", "Change to the set of colliding objects generates pulse");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_MATERIAL);
RNA_def_property_ui_text(prop, "M/P", "Toggle collision on material or property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- //XXX to make a setFunction to create a lookup with all materials in Blend File (not only this object mat.)
- prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
+ /*XXX to make a setFunction to create a lookup with all materials in Blend File (not only this object mat.) */
+ prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "materialName");
RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
-/*//XXX either use a datablock look up to store the string name (material)
- // or to do a doversion and use a material pointer.
- prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
+#if 0
+ /* XXX either use a datablock look up to store the string name (material)
+ * or to do a doversion and use a material pointer. */
+ prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "ma");
RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)");
-*/
+#endif
}
static void rna_def_radar_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem axis_items[] ={
+ static EnumPropertyItem axis_items[] = {
{SENS_RADAR_X_AXIS, "XAXIS", 0, "+X axis", ""},
{SENS_RADAR_Y_AXIS, "YAXIS", 0, "+Y axis", ""},
{SENS_RADAR_Z_AXIS, "ZAXIS", 0, "+Z axis", ""},
@@ -652,27 +652,27 @@ static void rna_def_radar_sensor(BlenderRNA *brna)
{SENS_RADAR_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "RadarSensor", "Sensor");
+ srna = RNA_def_struct(brna, "RadarSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Radar Sensor", "Sensor to detect objects in a cone shaped radar emanating from the current object");
RNA_def_struct_sdna_from(srna, "bRadarSensor", "data");
- prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, axis_items);
RNA_def_property_ui_text(prop, "Axis", "Along which axis the radar cone is cast");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- //XXX TODO - use radians internally then change to PROP_ANGLE
- prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
+ /*XXX TODO - use radians internally then change to PROP_ANGLE */
+ prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 179.9);
RNA_def_property_ui_text(prop, "Angle", "Opening angle of the radar cone (in degrees)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "range");
RNA_def_property_range(prop, 0.0, 10000.0);
RNA_def_property_ui_text(prop, "Distance", "Depth of the radar cone");
@@ -684,11 +684,11 @@ static void rna_def_random_sensor(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "RandomSensor", "Sensor");
+ srna = RNA_def_struct(brna, "RandomSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Random Sensor", "Sensor to send random events");
RNA_def_struct_sdna_from(srna, "bRandomSensor", "data");
- prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop, "Seed", "Initial seed of the generator (choose 0 for not random)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -698,7 +698,7 @@ static void rna_def_ray_sensor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem axis_items[] ={
+ static EnumPropertyItem axis_items[] = {
{SENS_RAY_X_AXIS, "XAXIS", 0, "+X axis", ""},
{SENS_RAY_Y_AXIS, "YAXIS", 0, "+Y axis", ""},
{SENS_RAY_Z_AXIS, "ZAXIS", 0, "+Z axis", ""},
@@ -707,51 +707,52 @@ static void rna_def_ray_sensor(BlenderRNA *brna)
{SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem prop_ray_type_items[]= {
+ static const EnumPropertyItem prop_ray_type_items[] = {
{SENS_COLLISION_PROPERTY, "PROPERTY", ICON_LOGIC, "Property", "Use a material for ray intersections"},
{SENS_COLLISION_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Use a property for ray intersections"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "RaySensor", "Sensor");
+ srna = RNA_def_struct(brna, "RaySensor", "Sensor");
RNA_def_struct_ui_text(srna, "Ray Sensor", "Sensor to detect intersections with a ray emanating from the current object");
RNA_def_struct_sdna_from(srna, "bRaySensor", "data");
- prop= RNA_def_property(srna, "ray_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "ray_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, prop_ray_type_items);
RNA_def_property_ui_text(prop, "Ray Type", "Toggle collision on material or property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "propname");
RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "matname");
RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- /* //XXX either use a datablock look up to store the string name (material)
- // or to do a doversion and use a material pointer.
- prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
+#if 0
+ /* XXX either use a datablock look up to store the string name (material)
+ * or to do a doversion and use a material pointer. */
+ prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "ma");
RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)");
-*/
+#endif
- prop= RNA_def_property(srna, "use_x_ray", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_x_ray", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_RAY_XRAY);
RNA_def_property_ui_text(prop, "X-Ray Mode", "Toggle X-Ray option (see through objects that don't have the property)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 10000.0);
RNA_def_property_ui_text(prop, "Range", "Sense objects no farther than this distance");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "axisflag");
RNA_def_property_enum_items(prop, axis_items);
RNA_def_property_ui_text(prop, "Axis", "Along which axis the ray is cast");
@@ -763,11 +764,11 @@ static void rna_def_message_sensor(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MessageSensor", "Sensor");
+ srna = RNA_def_struct(brna, "MessageSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Message Sensor", "Sensor to detect incoming messages");
RNA_def_struct_sdna_from(srna, "bMessageSensor", "data");
- prop= RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Subject", "Optional subject filter: only accept messages with this subject, or empty to accept all");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
@@ -777,21 +778,21 @@ static void rna_def_joystick_sensor(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem event_type_items[] ={
+ static EnumPropertyItem event_type_items[] = {
{SENS_JOY_BUTTON, "BUTTON", 0, "Button", ""},
{SENS_JOY_AXIS, "AXIS", 0, "Axis", ""},
{SENS_JOY_HAT, "HAT", 0, "Hat", ""},
{SENS_JOY_AXIS_SINGLE, "AXIS_SINGLE", 0, "Single Axis", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem axis_direction_items[] ={
+ static EnumPropertyItem axis_direction_items[] = {
{SENS_JOY_X_AXIS, "RIGHTAXIS", 0, "Right Axis", ""},
{SENS_JOY_Y_AXIS, "UPAXIS", 0, "Up Axis", ""},
{SENS_JOY_NEG_X_AXIS, "LEFTAXIS", 0, "Left Axis", ""},
{SENS_JOY_NEG_Y_AXIS, "DOWNAXIS", 0, "Down Axis", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem hat_direction_items[] ={
+ static EnumPropertyItem hat_direction_items[] = {
{SENS_JOY_HAT_UP, "UP", 0, "Up", ""},
{SENS_JOY_HAT_DOWN, "DOWN", 0, "Down", ""},
{SENS_JOY_HAT_LEFT, "LEFT", 0, "Left", ""},
@@ -803,68 +804,68 @@ static void rna_def_joystick_sensor(BlenderRNA *brna)
{SENS_JOY_HAT_DOWN_RIGHT, "DOWNRIGHT", 0, "Down/Right", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "JoystickSensor", "Sensor");
+ srna = RNA_def_struct(brna, "JoystickSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Joystick Sensor", "Sensor to detect joystick events");
RNA_def_struct_sdna_from(srna, "bJoystickSensor", "data");
- prop= RNA_def_property(srna, "joystick_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "joystick_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "joyindex");
RNA_def_property_ui_text(prop, "Index", "Which joystick to use");
RNA_def_property_range(prop, 0, SENS_JOY_MAXINDEX-1);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "event_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "event_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_ui_text(prop, "Event Type", "The type of event this joystick sensor is triggered on");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "use_all_events", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_all_events", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_JOY_ANY_EVENT);
RNA_def_property_ui_text(prop, "All Events", "Triggered by all events on this joystick's current type (axis/button/hat)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Button */
- prop= RNA_def_property(srna, "button_number", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "button_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "button");
RNA_def_property_ui_text(prop, "Button Number", "Which button to use");
RNA_def_property_range(prop, 0, 18);
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Axis */
- prop= RNA_def_property(srna, "axis_number", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "axis_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "axis");
RNA_def_property_ui_text(prop, "Axis Number", "Which axis pair to use, 1 is usually the main direction input");
RNA_def_property_range(prop, 1, 8);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "axis_threshold", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "axis_threshold", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "precision");
RNA_def_property_ui_text(prop, "Axis Threshold", "Precision of the axis");
RNA_def_property_range(prop, 0, 32768);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "axis_direction", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "axis_direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "axisf");
RNA_def_property_enum_items(prop, axis_direction_items);
RNA_def_property_ui_text(prop, "Axis Direction", "The direction of the axis");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Single Axis */
- prop= RNA_def_property(srna, "single_axis_number", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "single_axis_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "axis_single");
RNA_def_property_ui_text(prop, "Axis Number", "Single axis (vertical/horizontal/other) to detect");
RNA_def_property_range(prop, 1, 16);
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Hat */
- prop= RNA_def_property(srna, "hat_number", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "hat_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "hat");
RNA_def_property_ui_text(prop, "Hat Number", "Which hat to use");
RNA_def_property_range(prop, 1, 2);
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "hat_direction", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "hat_direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "hatf");
RNA_def_property_enum_items(prop, hat_direction_items);
RNA_def_property_ui_text(prop, "Hat Direction", "Hat direction");
diff --git a/source/blender/makesrna/intern/rna_sensor_api.c b/source/blender/makesrna/intern/rna_sensor_api.c
index bb1afd81007..8a5b11eb773 100644
--- a/source/blender/makesrna/intern/rna_sensor_api.c
+++ b/source/blender/makesrna/intern/rna_sensor_api.c
@@ -58,15 +58,15 @@ void RNA_api_sensor(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "link", "rna_Sensor_link");
+ func = RNA_def_function(srna, "link", "rna_Sensor_link");
RNA_def_function_ui_description(func, "Link the sensor to a controller");
- parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to");
+ parm = RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_update(parm, NC_LOGIC, NULL);
- func= RNA_def_function(srna, "unlink", "rna_Sensor_unlink");
+ func = RNA_def_function(srna, "unlink", "rna_Sensor_unlink");
RNA_def_function_ui_description(func, "Unlink the sensor from a controller");
- parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from");
+ parm = RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_update(parm, NC_LOGIC, NULL);
}
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index e4b0f430c2a..d414658f32d 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -53,9 +53,9 @@
/* build a temp referene to the parent */
static void meta_tmp_ref(Sequence *seq_par, Sequence *seq)
{
- for (; seq; seq= seq->next) {
- seq->tmp= seq_par;
- if(seq->type == SEQ_META) {
+ for (; seq; seq = seq->next) {
+ seq->tmp = seq_par;
+ if (seq->type == SEQ_META) {
meta_tmp_ref(seq, seq->seqbase.first);
}
}
@@ -63,8 +63,8 @@ static void meta_tmp_ref(Sequence *seq_par, Sequence *seq)
static void rna_SequenceEditor_sequences_all_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Scene *scene= (Scene*)ptr->id.data;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = (Scene*)ptr->id.data;
+ Editing *ed = seq_give_editing(scene, FALSE);
meta_tmp_ref(NULL, ed->seqbase.first);
@@ -73,32 +73,32 @@ static void rna_SequenceEditor_sequences_all_begin(CollectionPropertyIterator *i
static void rna_SequenceEditor_sequences_all_next(CollectionPropertyIterator *iter)
{
- ListBaseIterator *internal= iter->internal;
- Sequence *seq= (Sequence*)internal->link;
+ ListBaseIterator *internal = iter->internal;
+ Sequence *seq = (Sequence*)internal->link;
- if(seq->seqbase.first)
- internal->link= (Link*)seq->seqbase.first;
- else if(seq->next)
- internal->link= (Link*)seq->next;
+ if (seq->seqbase.first)
+ internal->link = (Link*)seq->seqbase.first;
+ else if (seq->next)
+ internal->link = (Link*)seq->next;
else {
- internal->link= NULL;
+ internal->link = NULL;
do {
- seq= seq->tmp; // XXX - seq's dont reference their parents!
- if(seq && seq->next) {
- internal->link= (Link*)seq->next;
+ seq = seq->tmp; /* XXX - seq's dont reference their parents! */
+ if (seq && seq->next) {
+ internal->link = (Link*)seq->next;
break;
}
- } while(seq);
+ } while (seq);
}
- iter->valid= (internal->link != NULL);
+ iter->valid = (internal->link != NULL);
}
/* internal use */
static int rna_SequenceEditor_elements_length(PointerRNA *ptr)
{
- Sequence *seq= (Sequence*)ptr->data;
+ Sequence *seq = (Sequence*)ptr->data;
/* Hack? copied from sequencer.c::reload_sequence_new_file() */
size_t olen = MEM_allocN_len(seq->strip->stripdata)/sizeof(struct StripElem);
@@ -109,26 +109,26 @@ static int rna_SequenceEditor_elements_length(PointerRNA *ptr)
static void rna_SequenceEditor_elements_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Sequence *seq= (Sequence*)ptr->data;
+ Sequence *seq = (Sequence*)ptr->data;
rna_iterator_array_begin(iter, (void*)seq->strip->stripdata, sizeof(StripElem), rna_SequenceEditor_elements_length(ptr), 0, NULL);
}
static void rna_Sequence_frame_change_update(Scene *scene, Sequence *seq)
{
- Editing *ed= seq_give_editing(scene, FALSE);
- ListBase *seqbase= seq_seqbase(&ed->seqbase, seq);
+ Editing *ed = seq_give_editing(scene, FALSE);
+ ListBase *seqbase = seq_seqbase(&ed->seqbase, seq);
calc_sequence_disp(scene, seq);
- if(seq_test_overlap(seqbase, seq)) {
- shuffle_seq(seqbase, seq, scene); // XXX - BROKEN!, uses context seqbasep
+ if (seq_test_overlap(seqbase, seq)) {
+ shuffle_seq(seqbase, seq, scene); /* XXX - BROKEN!, uses context seqbasep */
}
sort_seq(scene);
}
static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value)
{
- Sequence *seq= (Sequence*)ptr->data;
- Scene *scene= (Scene*)ptr->id.data;
+ Sequence *seq = (Sequence*)ptr->data;
+ Scene *scene = (Scene*)ptr->id.data;
seq_translate(scene, seq, value - seq->start);
rna_Sequence_frame_change_update(scene, seq);
@@ -136,8 +136,8 @@ static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value)
static void rna_Sequence_start_frame_final_set(PointerRNA *ptr, int value)
{
- Sequence *seq= (Sequence*)ptr->data;
- Scene *scene= (Scene*)ptr->id.data;
+ Sequence *seq = (Sequence*)ptr->data;
+ Scene *scene = (Scene*)ptr->id.data;
seq_tx_set_final_left(seq, value);
seq_single_fix(seq);
@@ -146,8 +146,8 @@ static void rna_Sequence_start_frame_final_set(PointerRNA *ptr, int value)
static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value)
{
- Sequence *seq= (Sequence*)ptr->data;
- Scene *scene= (Scene*)ptr->id.data;
+ Sequence *seq = (Sequence*)ptr->data;
+ Scene *scene = (Scene*)ptr->id.data;
seq_tx_set_final_right(seq, value);
seq_single_fix(seq);
@@ -156,8 +156,8 @@ static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value)
static void rna_Sequence_anim_startofs_final_set(PointerRNA *ptr, int value)
{
- Sequence *seq= (Sequence*)ptr->data;
- Scene *scene= (Scene*)ptr->id.data;
+ Sequence *seq = (Sequence*)ptr->data;
+ Scene *scene = (Scene*)ptr->id.data;
seq->anim_startofs = MIN2(value, seq->len + seq->anim_startofs);
@@ -167,8 +167,8 @@ static void rna_Sequence_anim_startofs_final_set(PointerRNA *ptr, int value)
static void rna_Sequence_anim_endofs_final_set(PointerRNA *ptr, int value)
{
- Sequence *seq= (Sequence*)ptr->data;
- Scene *scene= (Scene*)ptr->id.data;
+ Sequence *seq = (Sequence*)ptr->data;
+ Scene *scene = (Scene*)ptr->id.data;
seq->anim_endofs = MIN2(value, seq->len + seq->anim_endofs);
@@ -178,8 +178,8 @@ static void rna_Sequence_anim_endofs_final_set(PointerRNA *ptr, int value)
static void rna_Sequence_frame_length_set(PointerRNA *ptr, int value)
{
- Sequence *seq= (Sequence*)ptr->data;
- Scene *scene= (Scene*)ptr->id.data;
+ Sequence *seq = (Sequence*)ptr->data;
+ Scene *scene = (Scene*)ptr->id.data;
seq_tx_set_final_right(seq, seq->start+value);
rna_Sequence_frame_change_update(scene, seq);
@@ -187,7 +187,7 @@ static void rna_Sequence_frame_length_set(PointerRNA *ptr, int value)
static int rna_Sequence_frame_length_get(PointerRNA *ptr)
{
- Sequence *seq= (Sequence*)ptr->data;
+ Sequence *seq = (Sequence*)ptr->data;
return seq_tx_get_final_right(seq, 0)-seq_tx_get_final_left(seq, 0);
}
@@ -200,15 +200,15 @@ static int rna_Sequence_frame_editable(PointerRNA *ptr)
static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
{
- Sequence *seq= (Sequence*)ptr->data;
- Scene *scene= (Scene*)ptr->id.data;
- Editing *ed= seq_give_editing(scene, FALSE);
- ListBase *seqbase= seq_seqbase(&ed->seqbase, seq);
+ Sequence *seq = (Sequence*)ptr->data;
+ Scene *scene = (Scene*)ptr->id.data;
+ Editing *ed = seq_give_editing(scene, FALSE);
+ ListBase *seqbase = seq_seqbase(&ed->seqbase, seq);
- seq->machine= value;
+ seq->machine = value;
- if( seq_test_overlap(seqbase, seq) ) {
- shuffle_seq(seqbase, seq, scene); // XXX - BROKEN!, uses context seqbasep
+ if ( seq_test_overlap(seqbase, seq) ) {
+ shuffle_seq(seqbase, seq, scene); /* XXX - BROKEN!, uses context seqbasep */
}
sort_seq(scene);
}
@@ -216,14 +216,14 @@ static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
/* properties that need to allocate structs */
static void rna_Sequence_use_color_balance_set(PointerRNA *ptr, int value)
{
- Sequence *seq= (Sequence*)ptr->data;
+ Sequence *seq = (Sequence*)ptr->data;
int c;
- if(value) {
+ if (value) {
seq->flag |= SEQ_USE_COLOR_BALANCE;
- if(seq->strip->color_balance == NULL) {
+ if (seq->strip->color_balance == NULL) {
seq->strip->color_balance = MEM_callocN(sizeof(struct StripColorBalance), "StripColorBalance");
- for (c=0; c<3; c++) {
+ for (c = 0; c<3; c++) {
seq->strip->color_balance->lift[c] = 1.0f;
seq->strip->color_balance->gamma[c] = 1.0f;
seq->strip->color_balance->gain[c] = 1.0f;
@@ -236,14 +236,14 @@ static void rna_Sequence_use_color_balance_set(PointerRNA *ptr, int value)
static void rna_Sequence_use_proxy_set(PointerRNA *ptr, int value)
{
- Sequence *seq= (Sequence*)ptr->data;
- if(value) {
+ Sequence *seq = (Sequence*)ptr->data;
+ if (value) {
seq->flag |= SEQ_USE_PROXY;
- if(seq->strip->proxy == NULL) {
+ if (seq->strip->proxy == NULL) {
seq->strip->proxy = MEM_callocN(sizeof(struct StripProxy), "StripProxy");
seq->strip->proxy->quality = 90;
seq->strip->proxy->build_tc_flags = SEQ_PROXY_TC_ALL;
- seq->strip->proxy->build_size_flags
+ seq->strip->proxy->build_size_flags
= SEQ_PROXY_IMAGE_SIZE_25;
}
} else {
@@ -253,10 +253,10 @@ static void rna_Sequence_use_proxy_set(PointerRNA *ptr, int value)
static void rna_Sequence_use_translation_set(PointerRNA *ptr, int value)
{
- Sequence *seq= (Sequence*)ptr->data;
- if(value) {
+ Sequence *seq = (Sequence*)ptr->data;
+ if (value) {
seq->flag |= SEQ_USE_TRANSFORM;
- if(seq->strip->transform == NULL) {
+ if (seq->strip->transform == NULL) {
seq->strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform");
}
} else {
@@ -266,10 +266,10 @@ static void rna_Sequence_use_translation_set(PointerRNA *ptr, int value)
static void rna_Sequence_use_crop_set(PointerRNA *ptr, int value)
{
- Sequence *seq= (Sequence*)ptr->data;
- if(value) {
+ Sequence *seq = (Sequence*)ptr->data;
+ if (value) {
seq->flag |= SEQ_USE_CROP;
- if(seq->strip->crop == NULL) {
+ if (seq->strip->crop == NULL) {
seq->strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop");
}
} else {
@@ -279,10 +279,10 @@ static void rna_Sequence_use_crop_set(PointerRNA *ptr, int value)
static int transform_seq_cmp_cb(Sequence *seq, void *arg_pt)
{
- struct { Sequence *seq; void *transform; } *data= arg_pt;
+ struct { Sequence *seq; void *transform; } *data = arg_pt;
- if(seq->strip && seq->strip->transform == data->transform) {
- data->seq= seq;
+ if (seq->strip && seq->strip->transform == data->transform) {
+ data->seq = seq;
return -1; /* done so bail out */
}
return 1;
@@ -290,17 +290,17 @@ static int transform_seq_cmp_cb(Sequence *seq, void *arg_pt)
static char *rna_SequenceTransform_path(PointerRNA *ptr)
{
- Scene *scene= ptr->id.data;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = ptr->id.data;
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
struct { Sequence *seq; void *transform; } data;
- data.seq= NULL;
- data.transform= ptr->data;
+ data.seq = NULL;
+ data.transform = ptr->data;
/* irritating we need to search for our sequence! */
seqbase_recursive_apply(&ed->seqbase, transform_seq_cmp_cb, &data);
- seq= data.seq;
+ seq = data.seq;
if (seq && seq->name+2)
return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform", seq->name+2);
@@ -310,10 +310,10 @@ static char *rna_SequenceTransform_path(PointerRNA *ptr)
static int crop_seq_cmp_cb(Sequence *seq, void *arg_pt)
{
- struct { Sequence *seq; void *crop; } *data= arg_pt;
+ struct { Sequence *seq; void *crop; } *data = arg_pt;
- if(seq->strip && seq->strip->crop == data->crop) {
- data->seq= seq;
+ if (seq->strip && seq->strip->crop == data->crop) {
+ data->seq = seq;
return -1; /* done so bail out */
}
return 1;
@@ -321,17 +321,17 @@ static int crop_seq_cmp_cb(Sequence *seq, void *arg_pt)
static char *rna_SequenceCrop_path(PointerRNA *ptr)
{
- Scene *scene= ptr->id.data;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = ptr->id.data;
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
struct { Sequence *seq; void *crop; } data;
- data.seq= NULL;
- data.crop= ptr->data;
+ data.seq = NULL;
+ data.crop = ptr->data;
/* irritating we need to search for our sequence! */
seqbase_recursive_apply(&ed->seqbase, crop_seq_cmp_cb, &data);
- seq= data.seq;
+ seq = data.seq;
if (seq && seq->name+2)
return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop", seq->name+2);
@@ -343,20 +343,20 @@ static char *rna_SequenceCrop_path(PointerRNA *ptr)
/* name functions that ignore the first two characters */
static void rna_Sequence_name_get(PointerRNA *ptr, char *value)
{
- Sequence *seq= (Sequence*)ptr->data;
+ Sequence *seq = (Sequence*)ptr->data;
BLI_strncpy(value, seq->name+2, sizeof(seq->name)-2);
}
static int rna_Sequence_name_length(PointerRNA *ptr)
{
- Sequence *seq= (Sequence*)ptr->data;
+ Sequence *seq = (Sequence*)ptr->data;
return strlen(seq->name+2);
}
static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
{
- Scene *scene= (Scene*)ptr->id.data;
- Sequence *seq= (Sequence*)ptr->data;
+ Scene *scene = (Scene*)ptr->id.data;
+ Sequence *seq = (Sequence*)ptr->data;
char oldname[sizeof(seq->name)];
AnimData *adt;
@@ -373,16 +373,16 @@ static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
/* dont rename everywhere because these are per scene */
/* BKE_all_animdata_fix_paths_rename("sequence_editor.sequences_all", oldname, seq->name+2); */
- adt= BKE_animdata_from_id(&scene->id);
- if(adt)
+ adt = BKE_animdata_from_id(&scene->id);
+ if (adt)
BKE_animdata_fix_paths_rename(&scene->id, adt, "sequence_editor.sequences_all", oldname, seq->name+2, 0, 0, 1);
}
static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr)
{
- Sequence *seq= (Sequence*)ptr->data;
+ Sequence *seq = (Sequence*)ptr->data;
- switch(seq->type) {
+ switch (seq->type) {
case SEQ_IMAGE:
return &RNA_ImageSequence;
case SEQ_META:
@@ -425,7 +425,7 @@ static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr)
static char *rna_Sequence_path(PointerRNA *ptr)
{
- Sequence *seq= (Sequence*)ptr->data;
+ Sequence *seq = (Sequence*)ptr->data;
/* sequencer data comes from scene...
* TODO: would be nice to make SequenceEditor data a datablock of its own (for shorter paths)
@@ -438,8 +438,8 @@ static char *rna_Sequence_path(PointerRNA *ptr)
static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *iter)
{
- ListBaseIterator *internal= iter->internal;
- MetaStack *ms= (MetaStack*)internal->link;
+ ListBaseIterator *internal = iter->internal;
+ MetaStack *ms = (MetaStack*)internal->link;
return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq);
}
@@ -447,9 +447,9 @@ static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *
/* TODO, expose seq path setting as a higher level sequencer BKE function */
static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
{
- Sequence *seq= (Sequence*)(ptr->data);
+ Sequence *seq = (Sequence*)(ptr->data);
- if(seq->type == SEQ_SOUND && seq->sound) {
+ if (seq->type == SEQ_SOUND && seq->sound) {
/* for sound strips we need to update the sound as well.
* arguably, this could load in a new sound rather than modify an existing one.
* but while using the sequencer its most likely your not using the sound in the game engine too.
@@ -466,14 +466,14 @@ static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
static void rna_Sequence_filepath_get(PointerRNA *ptr, char *value)
{
- Sequence *seq= (Sequence*)(ptr->data);
+ Sequence *seq = (Sequence*)(ptr->data);
BLI_join_dirfile(value, FILE_MAX, seq->strip->dir, seq->strip->stripdata->name);
}
static int rna_Sequence_filepath_length(PointerRNA *ptr)
{
- Sequence *seq= (Sequence*)(ptr->data);
+ Sequence *seq = (Sequence*)(ptr->data);
char path[FILE_MAX];
BLI_join_dirfile(path, sizeof(path), seq->strip->dir, seq->strip->stripdata->name);
@@ -482,20 +482,20 @@ static int rna_Sequence_filepath_length(PointerRNA *ptr)
static void rna_Sequence_proxy_filepath_set(PointerRNA *ptr, const char *value)
{
- StripProxy *proxy= (StripProxy*)(ptr->data);
+ StripProxy *proxy = (StripProxy*)(ptr->data);
BLI_split_dirfile(value, proxy->dir, proxy->file, sizeof(proxy->dir), sizeof(proxy->file));
}
static void rna_Sequence_proxy_filepath_get(PointerRNA *ptr, char *value)
{
- StripProxy *proxy= (StripProxy*)(ptr->data);
+ StripProxy *proxy = (StripProxy*)(ptr->data);
BLI_join_dirfile(value, FILE_MAX, proxy->dir, proxy->file);
}
static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr)
{
- StripProxy *proxy= (StripProxy*)(ptr->data);
+ StripProxy *proxy = (StripProxy*)(ptr->data);
char path[FILE_MAX];
BLI_join_dirfile(path, sizeof(path), proxy->dir, proxy->file);
@@ -504,35 +504,35 @@ static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr)
static void rna_Sequence_volume_set(PointerRNA *ptr, float value)
{
- Sequence *seq= (Sequence*)(ptr->data);
+ Sequence *seq = (Sequence*)(ptr->data);
seq->volume = value;
- if(seq->scene_sound)
+ if (seq->scene_sound)
sound_set_scene_sound_volume(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_VOLUME_ANIMATED) != 0);
}
static void rna_Sequence_pitch_set(PointerRNA *ptr, float value)
{
- Sequence *seq= (Sequence*)(ptr->data);
+ Sequence *seq = (Sequence*)(ptr->data);
seq->pitch = value;
- if(seq->scene_sound)
+ if (seq->scene_sound)
sound_set_scene_sound_pitch(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PITCH_ANIMATED) != 0);
}
static void rna_Sequence_pan_set(PointerRNA *ptr, float value)
{
- Sequence *seq= (Sequence*)(ptr->data);
+ Sequence *seq = (Sequence*)(ptr->data);
seq->pan = value;
- if(seq->scene_sound)
+ if (seq->scene_sound)
sound_set_scene_sound_pan(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PAN_ANIMATED) != 0);
}
static int rna_Sequence_input_count_get(PointerRNA *ptr)
{
- Sequence *seq= (Sequence*)(ptr->data);
+ Sequence *seq = (Sequence*)(ptr->data);
return get_sequence_effect_num_inputs(seq->type);
}
@@ -550,25 +550,25 @@ static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
static void rna_Sequence_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
- if(ed)
+ if (ed)
free_imbuf_seq(scene, &ed->seqbase, FALSE, TRUE);
}
static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
- if(RNA_struct_is_a(ptr->type, &RNA_SoundSequence))
+ if (RNA_struct_is_a(ptr->type, &RNA_SoundSequence))
seq_update_sound_bounds(scene, ptr->data);
}
static void rna_Sequence_mute_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
seq_update_muting(ed);
rna_Sequence_update(bmain, scene, ptr);
@@ -576,7 +576,7 @@ static void rna_Sequence_mute_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Sequence_filepath_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Sequence *seq= (Sequence*)(ptr->data);
+ Sequence *seq = (Sequence*)(ptr->data);
reload_sequence_new_file(scene, seq, TRUE);
calc_sequence(scene, seq);
rna_Sequence_update(bmain, scene, ptr);
@@ -584,10 +584,10 @@ static void rna_Sequence_filepath_update(Main *bmain, Scene *scene, PointerRNA *
static int seqproxy_seq_cmp_cb(Sequence *seq, void *arg_pt)
{
- struct { Sequence *seq; void *seq_proxy; } *data= arg_pt;
+ struct { Sequence *seq; void *seq_proxy; } *data = arg_pt;
- if(seq->strip && seq->strip->proxy == data->seq_proxy) {
- data->seq= seq;
+ if (seq->strip && seq->strip->proxy == data->seq_proxy) {
+ data->seq = seq;
return -1; /* done so bail out */
}
return 1;
@@ -595,16 +595,16 @@ static int seqproxy_seq_cmp_cb(Sequence *seq, void *arg_pt)
static void rna_Sequence_tcindex_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
struct { Sequence *seq; void *seq_proxy; } data;
- data.seq= NULL;
+ data.seq = NULL;
data.seq_proxy = ptr->data;
seqbase_recursive_apply(&ed->seqbase, seqproxy_seq_cmp_cb, &data);
- seq= data.seq;
+ seq = data.seq;
reload_sequence_new_file(scene, seq, FALSE);
rna_Sequence_frame_change_update(scene, seq);
@@ -613,12 +613,12 @@ static void rna_Sequence_tcindex_update(Main *bmain, Scene *scene, PointerRNA *p
/* do_versions? */
static float rna_Sequence_opacity_get(PointerRNA *ptr)
{
- Sequence *seq= (Sequence*)(ptr->data);
+ Sequence *seq = (Sequence*)(ptr->data);
return seq->blend_opacity / 100.0f;
}
static void rna_Sequence_opacity_set(PointerRNA *ptr, float value)
{
- Sequence *seq= (Sequence*)(ptr->data);
+ Sequence *seq = (Sequence*)(ptr->data);
CLAMP(value, 0.0f, 1.0f);
seq->blend_opacity = value * 100.0f;
}
@@ -626,27 +626,27 @@ static void rna_Sequence_opacity_set(PointerRNA *ptr, float value)
static int colbalance_seq_cmp_cb(Sequence *seq, void *arg_pt)
{
- struct { Sequence *seq; void *color_balance; } *data= arg_pt;
+ struct { Sequence *seq; void *color_balance; } *data = arg_pt;
- if(seq->strip && seq->strip->color_balance == data->color_balance) {
- data->seq= seq;
+ if (seq->strip && seq->strip->color_balance == data->color_balance) {
+ data->seq = seq;
return -1; /* done so bail out */
}
return 1;
}
static char *rna_SequenceColorBalance_path(PointerRNA *ptr)
{
- Scene *scene= ptr->id.data;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = ptr->id.data;
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
struct { Sequence *seq; void *color_balance; } data;
- data.seq= NULL;
- data.color_balance= ptr->data;
+ data.seq = NULL;
+ data.color_balance = ptr->data;
/* irritating we need to search for our sequence! */
seqbase_recursive_apply(&ed->seqbase, colbalance_seq_cmp_cb, &data);
- seq= data.seq;
+ seq = data.seq;
if (seq && seq->name+2)
return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].color_balance", seq->name+2);
@@ -656,32 +656,32 @@ static char *rna_SequenceColorBalance_path(PointerRNA *ptr)
static void rna_SequenceEditor_overlay_lock_set(PointerRNA *ptr, int value)
{
- Scene *scene= ptr->id.data;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = ptr->id.data;
+ Editing *ed = seq_give_editing(scene, FALSE);
- if(ed==NULL)
+ if (ed == NULL)
return;
/* convert from abs to relative and back */
- if((ed->over_flag & SEQ_EDIT_OVERLAY_ABS)==0 && value) {
- ed->over_cfra= scene->r.cfra + ed->over_ofs;
+ if ((ed->over_flag & SEQ_EDIT_OVERLAY_ABS) == 0 && value) {
+ ed->over_cfra = scene->r.cfra + ed->over_ofs;
ed->over_flag |= SEQ_EDIT_OVERLAY_ABS;
}
- else if((ed->over_flag & SEQ_EDIT_OVERLAY_ABS) && !value) {
- ed->over_ofs= ed->over_cfra - scene->r.cfra;
+ else if ((ed->over_flag & SEQ_EDIT_OVERLAY_ABS) && !value) {
+ ed->over_ofs = ed->over_cfra - scene->r.cfra;
ed->over_flag &= ~SEQ_EDIT_OVERLAY_ABS;
}
}
static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr)
{
- Scene *scene= (Scene *)ptr->id.data;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = (Scene *)ptr->id.data;
+ Editing *ed = seq_give_editing(scene, FALSE);
- if(ed==NULL)
+ if (ed == NULL)
return scene->r.cfra;
- if(ed->over_flag & SEQ_EDIT_OVERLAY_ABS)
+ if (ed->over_flag & SEQ_EDIT_OVERLAY_ABS)
return ed->over_cfra - scene->r.cfra;
else
return ed->over_ofs;
@@ -690,31 +690,31 @@ static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr)
static void rna_SequenceEditor_overlay_frame_set(PointerRNA *ptr, int value)
{
- Scene *scene= (Scene *)ptr->id.data;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = (Scene *)ptr->id.data;
+ Editing *ed = seq_give_editing(scene, FALSE);
- if(ed==NULL)
+ if (ed == NULL)
return;
- if(ed->over_flag & SEQ_EDIT_OVERLAY_ABS)
- ed->over_cfra= (scene->r.cfra + value);
+ if (ed->over_flag & SEQ_EDIT_OVERLAY_ABS)
+ ed->over_cfra = (scene->r.cfra + value);
else
- ed->over_ofs= value;
+ ed->over_ofs = value;
}
static void rna_WipeSequence_angle_set(PointerRNA *ptr, float value)
{
- Sequence *seq= (Sequence *)(ptr->data);
- value= RAD2DEGF(value);
+ Sequence *seq = (Sequence *)(ptr->data);
+ value = RAD2DEGF(value);
CLAMP(value, -90.0f, 90.0f);
- ((WipeVars *)seq->effectdata)->angle= value;
+ ((WipeVars *)seq->effectdata)->angle = value;
}
static float rna_WipeSequence_angle_get(PointerRNA *ptr)
{
- Sequence *seq= (Sequence *)(ptr->data);
+ Sequence *seq = (Sequence *)(ptr->data);
return DEG2RADF(((WipeVars *)seq->effectdata)->angle);
}
@@ -731,17 +731,17 @@ static void rna_def_strip_element(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Sequence Element", "Sequence strip data for a single frame");
RNA_def_struct_sdna(srna, "StripElem");
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
+ prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Filename", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "orig_width", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "orig_width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "orig_width");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Orig Width", "Original image width");
- prop= RNA_def_property(srna, "orig_height", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "orig_height", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "orig_height");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Orig Height", "Original image height");
@@ -756,25 +756,25 @@ static void rna_def_strip_crop(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Sequence Crop", "Cropping parameters for a sequence strip");
RNA_def_struct_sdna(srna, "StripCrop");
- prop= RNA_def_property(srna, "max_y", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "max_y", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "top");
RNA_def_property_ui_text(prop, "Top", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "min_y", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "min_y", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "bottom");
RNA_def_property_ui_text(prop, "Bottom", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "min_x", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "min_x", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "left");
RNA_def_property_ui_text(prop, "Left", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "max_x", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "max_x", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "right");
RNA_def_property_ui_text(prop, "Right", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
@@ -792,13 +792,13 @@ static void rna_def_strip_transform(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Sequence Transform", "Transform parameters for a sequence strip");
RNA_def_struct_sdna(srna, "StripTransform");
- prop= RNA_def_property(srna, "offset_x", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "offset_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xofs");
RNA_def_property_ui_text(prop, "Offset X", "");
RNA_def_property_ui_range(prop, -4096, 4096, 1, 0);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "offset_y", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "offset_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "yofs");
RNA_def_property_ui_text(prop, "Offset Y", "");
RNA_def_property_ui_range(prop, -4096, 4096, 1, 0);
@@ -813,7 +813,7 @@ static void rna_def_strip_proxy(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static const EnumPropertyItem seq_tc_items[]= {
+ static const EnumPropertyItem seq_tc_items[] = {
{SEQ_PROXY_TC_NONE, "NONE", 0, "No TC in use", ""},
{SEQ_PROXY_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run",
"Use images in the order as they are recorded"},
@@ -831,51 +831,51 @@ static void rna_def_strip_proxy(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Sequence Proxy", "Proxy parameters for a sequence strip");
RNA_def_struct_sdna(srna, "StripProxy");
- prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "dir");
RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_ui_text(prop, "Path", "Location of custom proxy file");
RNA_def_property_string_funcs(prop, "rna_Sequence_proxy_filepath_get", "rna_Sequence_proxy_filepath_length", "rna_Sequence_proxy_filepath_set");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_25);
RNA_def_property_ui_text(prop, "25%", "Build 25% proxy resolution");
- prop= RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_50);
RNA_def_property_ui_text(prop, "50%", "Build 50% proxy resolution");
- prop= RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_75);
RNA_def_property_ui_text(prop, "75%", "Build 75% proxy resolution");
- prop= RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_100);
RNA_def_property_ui_text(prop, "100%", "Build 100% proxy resolution");
- prop= RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_RECORD_RUN);
RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index");
- prop= RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_FREE_RUN);
RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index");
- prop= RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN);
RNA_def_property_ui_text(prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time");
- prop= RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "quality");
RNA_def_property_ui_text(prop, "Quality", "JPEG Quality of proxies to build");
RNA_def_property_ui_range(prop, 1, 100, 1, 0);
- prop= RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "tc");
RNA_def_property_enum_items(prop, seq_tc_items);
RNA_def_property_ui_text(prop, "Timecode", "");
@@ -892,32 +892,32 @@ static void rna_def_strip_color_balance(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Sequence Color Balance", "Color balance parameters for a sequence strip");
RNA_def_struct_sdna(srna, "StripColorBalance");
- prop= RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR);
RNA_def_property_ui_text(prop, "Lift", "Color balance lift (shadows)");
RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR);
RNA_def_property_ui_text(prop, "Gamma", "Color balance gamma (midtones)");
RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR);
RNA_def_property_ui_text(prop, "Gain", "Color balance gain (highlights)");
RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "invert_gain", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_gain", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAIN);
RNA_def_property_ui_text(prop, "Inverse Gain", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "invert_gamma", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_gamma", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAMMA);
RNA_def_property_ui_text(prop, "Inverse Gamma", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "invert_lift", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_lift", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_LIFT);
RNA_def_property_ui_text(prop, "Inverse Lift", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
@@ -941,7 +941,7 @@ static void rna_def_sequence(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static const EnumPropertyItem seq_type_items[]= {
+ static const EnumPropertyItem seq_type_items[] = {
{SEQ_IMAGE, "IMAGE", 0, "Image", ""},
{SEQ_META, "META", 0, "Meta", ""},
{SEQ_SCENE, "SCENE", 0, "Scene", ""},
@@ -965,7 +965,7 @@ static void rna_def_sequence(BlenderRNA *brna)
{SEQ_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem blend_mode_items[]= {
+ static const EnumPropertyItem blend_mode_items[] = {
{SEQ_BLEND_REPLACE, "REPLACE", 0, "Replace", ""},
{SEQ_CROSS, "CROSS", 0, "Cross", ""},
{SEQ_ADD, "ADD", 0, "Add", ""},
@@ -982,57 +982,57 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_struct_refine_func(srna, "rna_Sequence_refine");
RNA_def_struct_path_func(srna, "rna_Sequence_path");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_Sequence_name_get", "rna_Sequence_name_length", "rna_Sequence_name_set");
RNA_def_property_string_maxlength(prop, sizeof(((Sequence*)NULL)->name)-2);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, seq_type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- //prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
- //RNA_def_property_ui_text(prop, "IPO Curves", "IPO curves used by this sequence");
+ /*prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE); */
+ /*RNA_def_property_ui_text(prop, "IPO Curves", "IPO curves used by this sequence"); */
/* flags */
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
RNA_def_property_ui_text(prop, "Select", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER|NA_SELECTED, NULL);
- prop= RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL);
RNA_def_property_ui_text(prop, "Left Handle Selected", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER|NA_SELECTED, NULL);
- prop= RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_RIGHTSEL);
RNA_def_property_ui_text(prop, "Right Handle Selected", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER|NA_SELECTED, NULL);
- prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE);
RNA_def_property_ui_text(prop, "Mute", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_mute_update");
- prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LOCK);
RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it can't be transformed");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "waveform", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "waveform", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_AUDIO_DRAW_WAVEFORM);
RNA_def_property_ui_text(prop, "Draw Waveform", "Whether to draw the sound's waveform");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
/* strip positioning */
- prop= RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME);
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip after the handles are applied");
@@ -1040,115 +1040,115 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "frame_duration", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "len");
RNA_def_property_clear_flag(prop, PROP_EDITABLE|PROP_ANIMATABLE);
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied");
- prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "start");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Start Frame", "");
- RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set",NULL); // overlap tests and calc_seq_disp
+ RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set",NULL); /* overlap tests and calc_seq_disp */
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "frame_final_start", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_final_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "startdisp");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Start Frame", "Start frame displayed in the sequence editor after offsets are applied, setting this is equivalent to moving the handle, not the actual start frame");
- RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL); // overlap tests and calc_seq_disp
+ RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL); /* overlap tests and calc_seq_disp */
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "frame_final_end", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_final_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "enddisp");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "End Frame", "End frame displayed in the sequence editor after offsets are applied");
- RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL); // overlap tests and calc_seq_disp
+ RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL); /* overlap tests and calc_seq_disp */
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "frame_offset_start", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_offset_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "startofs");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
RNA_def_property_ui_text(prop, "Start Offset", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "frame_offset_end", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_offset_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "endofs");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
RNA_def_property_ui_text(prop, "End Offset", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "frame_still_start", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_still_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "startstill");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_text(prop, "Start Still", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "frame_still_end", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame_still_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "endstill");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_text(prop, "End Still", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "machine");
RNA_def_property_range(prop, 0, MAXSEQ-1);
RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip");
- RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_channel_set",NULL); // overlap test
+ RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_channel_set",NULL); /* overlap test */
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
/* blending */
- prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blend_mode");
RNA_def_property_enum_items(prop, blend_mode_items);
RNA_def_property_ui_text(prop, "Blend Mode", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "blend_alpha", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "blend_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Blend Opacity", "");
- RNA_def_property_float_funcs(prop, "rna_Sequence_opacity_get", "rna_Sequence_opacity_set", NULL); // stupid 0-100 -> 0-1
+ RNA_def_property_float_funcs(prop, "rna_Sequence_opacity_get", "rna_Sequence_opacity_set", NULL); /* stupid 0-100 -> 0-1 */
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "effect_fader", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "effect_fader", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_float_sdna(prop, NULL, "effect_fader");
RNA_def_property_ui_text(prop, "Effect fader position", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "use_default_fade", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_default_fade", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_EFFECT_DEFAULT_FADE);
RNA_def_property_ui_text(prop, "Use Default Fade", "Fade effect using the built-in default (usually make transition as long as effect strip)");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "speed_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "speed_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "speed_fader");
RNA_def_property_ui_text(prop, "Speed factor", "Multiply the current speed of the sequence with this number or remap current frame to this frame");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
/* effect strip inputs */
- prop= RNA_def_property(srna, "input_count", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "input_count", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_Sequence_input_count_get", NULL, NULL);
- prop= RNA_def_property(srna, "input_1", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "input_1", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "seq1");
RNA_def_property_ui_text(prop, "Input 1", "First input for the effect strip");
- prop= RNA_def_property(srna, "input_2", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "input_2", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "seq2");
RNA_def_property_ui_text(prop, "Input 2", "Second input for the effect strip");
- prop= RNA_def_property(srna, "input_3", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "input_3", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "seq1");
RNA_def_property_ui_text(prop, "Input 3", "Third input for the effect strip");
@@ -1165,40 +1165,40 @@ static void rna_def_editor(BlenderRNA *brna)
RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);
RNA_def_struct_sdna(srna, "Editing");
- prop= RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
RNA_def_property_struct_type(prop, "Sequence");
RNA_def_property_ui_text(prop, "Sequences", "");
- prop= RNA_def_property(srna, "sequences_all", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "sequences_all", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
RNA_def_property_struct_type(prop, "Sequence");
RNA_def_property_ui_text(prop, "Sequences", "");
RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_sequences_all_begin", "rna_SequenceEditor_sequences_all_next", NULL, NULL, NULL, NULL, NULL, NULL);
- prop= RNA_def_property(srna, "meta_stack", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "meta_stack", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "metastack", NULL);
RNA_def_property_struct_type(prop, "Sequence");
RNA_def_property_ui_text(prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip");
RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_SequenceEditor_meta_stack_get", NULL, NULL, NULL, NULL);
- prop= RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act_seq");
RNA_def_property_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "show_overlay", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_overlay", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_SHOW);
RNA_def_property_ui_text(prop, "Draw Axes", "Partial overlay on top of the sequencer");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "overlay_lock", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "overlay_lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_ABS);
RNA_def_property_ui_text(prop, "Overlay Lock", "");
RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_overlay_lock_set");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
/* access to fixed and relative frame */
- prop= RNA_def_property(srna, "overlay_frame", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "overlay_frame", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "Overlay Offset", "");
RNA_def_property_int_funcs(prop, "rna_SequenceEditor_overlay_frame_get", "rna_SequenceEditor_overlay_frame_set", NULL);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
@@ -1209,81 +1209,81 @@ static void rna_def_filter_video(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "use_deinterlace", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_deinterlace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FILTERY);
RNA_def_property_ui_text(prop, "De-Interlace", "For video movies to remove fields");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update_reopen_files");
- prop= RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_PREMUL);
RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "use_flip_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_flip_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPX);
RNA_def_property_ui_text(prop, "Flip X", "Flip on the X axis");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "use_flip_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_flip_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPY);
RNA_def_property_ui_text(prop, "Flip Y", "Flip on the Y axis");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "use_float", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_float", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_FLOAT);
RNA_def_property_ui_text(prop, "Convert Float", "Convert input to float data");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_REVERSE_FRAMES);
RNA_def_property_ui_text(prop, "Flip Time", "Reverse frame order");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "color_multiply", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "color_multiply", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "mul");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Multiply Colors", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "color_saturation", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "color_saturation", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "sat");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_range(prop, 0.0f, 2.0f, 3, 3);
RNA_def_property_ui_text(prop, "Saturation", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 1.0f, 30.0f);
RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "use_color_balance", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_color_balance", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_COLOR_BALANCE);
RNA_def_property_ui_text(prop, "Use Color Balance", "(3-Way color correction) on input");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_color_balance_set");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->color_balance");
RNA_def_property_ui_text(prop, "Color Balance", "");
- prop= RNA_def_property(srna, "use_translation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_translation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_TRANSFORM);
RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_translation_set");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->transform");
RNA_def_property_ui_text(prop, "Transform", "");
- prop= RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_CROP);
RNA_def_property_ui_text(prop, "Use Crop", "Crop image before processing");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_crop_set");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->crop");
RNA_def_property_ui_text(prop, "Crop", "");
}
@@ -1292,21 +1292,21 @@ static void rna_def_proxy(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY);
RNA_def_property_ui_text(prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this strip");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_proxy_set");
- prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->proxy");
RNA_def_property_ui_text(prop, "Proxy", "");
- prop= RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_DIR);
RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "use_proxy_custom_file", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_proxy_custom_file", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_FILE);
RNA_def_property_ui_text(prop, "Proxy Custom File", "Use a custom file to read proxy data from");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
@@ -1316,18 +1316,18 @@ static void rna_def_input(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "animation_offset_start", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "animation_offset_start", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "anim_startofs");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_anim_startofs_final_set", NULL); // overlap tests
+ RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_anim_startofs_final_set", NULL); /* overlap tests */
RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start)");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "animation_offset_end", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "animation_offset_end", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "anim_endofs");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_anim_endofs_final_set", NULL); // overlap tests
+ RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_anim_endofs_final_set", NULL); /* overlap tests */
RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end)");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
}
@@ -1341,12 +1341,12 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Image Sequence", "Sequence strip to load one or more images");
RNA_def_struct_sdna(srna, "Sequence");
- prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->dir");
RNA_def_property_ui_text(prop, "Directory", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL);
RNA_def_property_struct_type(prop, "SequenceElement");
RNA_def_property_ui_text(prop, "Elements", "");
@@ -1385,12 +1385,12 @@ static void rna_def_scene(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Scene Sequence", "Sequence strip to used the rendered image of a scene");
RNA_def_struct_sdna(srna, "Sequence");
- prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Scene", "Scene that this sequence uses");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
RNA_def_property_ui_text(prop, "Camera Override", "Override the scenes active camera");
@@ -1410,25 +1410,25 @@ static void rna_def_movie(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Movie Sequence", "Sequence strip to load a video");
RNA_def_struct_sdna(srna, "Sequence");
- prop= RNA_def_property(srna, "mpeg_preseek", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "mpeg_preseek", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "anim_preseek");
RNA_def_property_range(prop, 0, 50);
RNA_def_property_ui_text(prop, "MPEG Preseek", "For MPEG movies, preseek this many frames");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "stream_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "stream_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "streamindex");
RNA_def_property_range(prop, 0, 20);
RNA_def_property_ui_text(prop, "Streamindex", "For files with several movie streams, use the stream with the given index");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update_reopen_files");
- prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL);
RNA_def_property_struct_type(prop, "SequenceElement");
RNA_def_property_ui_text(prop, "Elements", "");
RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_SequenceEditor_elements_length", NULL, NULL, NULL);
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_ui_text(prop, "File", "");
RNA_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length",
"rna_Sequence_filepath_set");
@@ -1448,33 +1448,33 @@ static void rna_def_sound(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Sound Sequence", "Sequence strip defining a sound to be played over a period of time");
RNA_def_struct_sdna(srna, "Sequence");
- prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Sound");
RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this sequence");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "volume");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_volume_set", NULL);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pitch");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound");
RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pitch_set", NULL);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "pan", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "pan", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pan");
RNA_def_property_range(prop, -2.0f, 2.0f);
RNA_def_property_ui_text(prop, "Pan", "Playback panning of the sound (only for Mono sources)");
RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pan_set", NULL);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_ui_text(prop, "File", "");
RNA_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length",
"rna_Sequence_filepath_set");
@@ -1504,7 +1504,7 @@ static void rna_def_multicam(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Multicam Select Sequence", "Sequence strip to perform multicam editing: select channel from below");
RNA_def_struct_sdna(srna, "Sequence");
- prop= RNA_def_property(srna, "multicam_source", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "multicam_source", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "multicam_source");
RNA_def_property_range(prop, 0, MAXSEQ-1);
RNA_def_property_ui_text(prop, "Multicam Source Channel", "");
@@ -1518,7 +1518,7 @@ static void rna_def_multicam(BlenderRNA *brna)
static void rna_def_adjustment(BlenderRNA *brna)
{
StructRNA *srna;
-// PropertyRNA *prop;
+/* PropertyRNA *prop; */
srna = RNA_def_struct(brna, "AdjustmentSequence", "Sequence");
RNA_def_struct_ui_text(srna, "Adjustment Layer Sequence", "Sequence strip to perform filter adjustments to layers below");
@@ -1538,7 +1538,7 @@ static void rna_def_plugin(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Plugin Sequence", "Sequence strip applying an effect, loaded from an external plugin");
RNA_def_struct_sdna_from(srna, "PluginSeq", "plugin");
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
+ prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Filename", "");
@@ -1552,7 +1552,7 @@ static void rna_def_wipe(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static const EnumPropertyItem wipe_type_items[]= {
+ static const EnumPropertyItem wipe_type_items[] = {
{0, "SINGLE", 0, "Single", ""},
{1, "DOUBLE", 0, "Double", ""},
/* not used yet {2, "BOX", 0, "Box", ""}, */
@@ -1562,7 +1562,7 @@ static void rna_def_wipe(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- static const EnumPropertyItem wipe_direction_items[]= {
+ static const EnumPropertyItem wipe_direction_items[] = {
{0, "OUT", 0, "Out", ""},
{1, "IN", 0, "In", ""},
{0, NULL, 0, NULL, NULL}
@@ -1572,31 +1572,31 @@ static void rna_def_wipe(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Wipe Sequence", "Sequence strip creating a wipe transition");
RNA_def_struct_sdna_from(srna, "WipeVars", "effectdata");
- prop= RNA_def_property(srna, "blur_width", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "blur_width", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "edgeWidth");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Blur Width", "Width of the blur edge, in percentage relative to the image size");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
#if 1 /* expose as radians */
- prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_funcs(prop, "rna_WipeSequence_angle_get", "rna_WipeSequence_angle_set", NULL);
RNA_def_property_range(prop, DEG2RAD(-90.0), DEG2RAD(90.0));
#else
- prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "angle");
RNA_def_property_range(prop, -90.0f, 90.0f);
#endif
RNA_def_property_ui_text(prop, "Angle", "Edge angle");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "forward");
RNA_def_property_enum_items(prop, wipe_direction_items);
RNA_def_property_ui_text(prop, "Direction", "Wipe direction");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "wipetype");
RNA_def_property_enum_items(prop, wipe_type_items);
RNA_def_property_ui_text(prop, "Transition Type", "");
@@ -1612,37 +1612,37 @@ static void rna_def_glow(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Glow Sequence", "Sequence strip creating a glow effect");
RNA_def_struct_sdna_from(srna, "GlowVars", "effectdata");
- prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fMini");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Threshold", "Minimum intensity to trigger a glow");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fClamp");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Clamp", "Brightness limit of intensity");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fBoost");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "blur_radius", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "blur_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dDist");
RNA_def_property_range(prop, 0.5f, 20.0f);
RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dQuality");
RNA_def_property_range(prop, 1, 5);
RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "use_only_boost", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_only_boost", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0);
RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
@@ -1653,14 +1653,14 @@ static void rna_def_transform(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static const EnumPropertyItem interpolation_items[]= {
+ static const EnumPropertyItem interpolation_items[] = {
{0, "NONE", 0, "None", "No interpolation"},
{1, "BILINEAR", 0, "Bilinear", "Bilinear interpolation"},
{2, "BICUBIC", 0, "Bicubic", "Bicubic interpolation"},
{0, NULL, 0, NULL, NULL}
};
- static const EnumPropertyItem translation_unit_items[]= {
+ static const EnumPropertyItem translation_unit_items[] = {
{0, "PIXELS", 0, "Pixels", ""},
{1, "PERCENT", 0, "Percent", ""},
{0, NULL, 0, NULL, NULL}
@@ -1670,49 +1670,49 @@ static void rna_def_transform(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Transform Sequence", "Sequence strip applying affine transformations to other strips");
RNA_def_struct_sdna_from(srna, "TransformVars", "effectdata");
- prop= RNA_def_property(srna, "scale_start_x", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "scale_start_x", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "ScalexIni");
RNA_def_property_ui_text(prop, "Scale X", "");
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "ScaleyIni");
RNA_def_property_ui_text(prop, "Scale Y", "");
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "use_uniform_scale", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_uniform_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uniform_scale", 0);
RNA_def_property_ui_text(prop, "Uniform Scale", "Scale uniformly, preserving aspect ratio");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xIni");
RNA_def_property_ui_text(prop, "Translate X", "");
RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yIni");
RNA_def_property_ui_text(prop, "Translate Y", "");
RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rotIni");
RNA_def_property_range(prop, -360.0f, 360.0f);
RNA_def_property_ui_text(prop, "Rotation", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "percent");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */
RNA_def_property_enum_items(prop, translation_unit_items);
RNA_def_property_ui_text(prop, "Translation Unit", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, interpolation_items);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */
RNA_def_property_ui_text(prop, "Interpolation", "");
@@ -1728,7 +1728,7 @@ static void rna_def_solid_color(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single color");
RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "col");
RNA_def_property_ui_text(prop, "Color", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
@@ -1743,24 +1743,24 @@ static void rna_def_speed_control(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "SpeedControl Sequence", "Sequence strip to control the speed of other strips");
RNA_def_struct_sdna_from(srna, "SpeedControlVars", "effectdata");
- prop= RNA_def_property(srna, "multiply_speed", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "multiply_speed", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "globalSpeed");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* seq->facf0 is used to animate this */
RNA_def_property_ui_text(prop, "Multiply Speed", "Multiply the resulting speed after the speed factor");
RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 0);
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "use_as_speed", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_as_speed", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_INTEGRATE);
RNA_def_property_ui_text(prop, "Use as speed", "Interpret the value as speed instead of a frame number");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "use_frame_blend", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_frame_blend", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_BLEND);
RNA_def_property_ui_text(prop, "Frame Blending", "Blend two frames into the target for a smoother result");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "scale_to_length", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "scale_to_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_COMPRESS_IPO_Y);
RNA_def_property_ui_text(prop, "Scale to length", "Scale values from 0.0 to 1.0 to target sequence length");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c
index 98eb302b620..899f6a6d32f 100644
--- a/source/blender/makesrna/intern/rna_sequencer_api.c
+++ b/source/blender/makesrna/intern/rna_sequencer_api.c
@@ -51,7 +51,7 @@ static void rna_Sequence_swap_internal(Sequence *seq_self, ReportList *reports,
{
const char *error_msg;
- if(seq_swap(seq_self, seq_other, &error_msg) == 0)
+ if (seq_swap(seq_self, seq_other, &error_msg) == 0)
BKE_report(reports, RPT_ERROR, error_msg);
}
@@ -62,16 +62,16 @@ void RNA_api_sequence_strip(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "getStripElem", "give_stripelem");
+ func = RNA_def_function(srna, "getStripElem", "give_stripelem");
RNA_def_function_ui_description(func, "Return the strip element from a given frame or None");
- parm= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame",
+ parm = RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame",
"The frame to get the strip element from", -MAXFRAME, MAXFRAME);
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
- func= RNA_def_function(srna, "swap", "rna_Sequence_swap_internal");
+ func = RNA_def_function(srna, "swap", "rna_Sequence_swap_internal");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "other", "Sequence", "Other", "");
+ parm = RNA_def_pointer(func, "other", "Sequence", "Other", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 30db0a300ab..ee1dd52a93f 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -68,7 +68,7 @@ static void rna_Smoke_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
smokeModifier_reset(settings->smd);
- if(settings->smd && settings->smd->domain)
+ if (settings->smd && settings->smd->domain)
settings->point_cache[0]->flag |= PTCACHE_OUTDATED;
rna_Smoke_update(bmain, scene, ptr);
@@ -80,7 +80,7 @@ static void rna_Smoke_reset_dependancy(Main *bmain, Scene *scene, PointerRNA *pt
smokeModifier_reset(settings->smd);
- if(settings->smd && settings->smd->domain)
+ if (settings->smd && settings->smd->domain)
settings->smd->domain->point_cache[0]->flag |= PTCACHE_OUTDATED;
rna_Smoke_dependency_update(bmain, scene, ptr);
@@ -89,7 +89,7 @@ static void rna_Smoke_reset_dependancy(Main *bmain, Scene *scene, PointerRNA *pt
static char *rna_SmokeDomainSettings_path(PointerRNA *ptr)
{
SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
- ModifierData *md= (ModifierData *)settings->smd;
+ ModifierData *md = (ModifierData *)settings->smd;
return BLI_sprintfN("modifiers[\"%s\"].domain_settings", md->name);
}
@@ -97,7 +97,7 @@ static char *rna_SmokeDomainSettings_path(PointerRNA *ptr)
static char *rna_SmokeFlowSettings_path(PointerRNA *ptr)
{
SmokeFlowSettings *settings = (SmokeFlowSettings*)ptr->data;
- ModifierData *md= (ModifierData *)settings->smd;
+ ModifierData *md = (ModifierData *)settings->smd;
return BLI_sprintfN("modifiers[\"%s\"].flow_settings", md->name);
}
@@ -105,7 +105,7 @@ static char *rna_SmokeFlowSettings_path(PointerRNA *ptr)
static char *rna_SmokeCollSettings_path(PointerRNA *ptr)
{
SmokeCollSettings *settings = (SmokeCollSettings*)ptr->data;
- ModifierData *md= (ModifierData *)settings->smd;
+ ModifierData *md = (ModifierData *)settings->smd;
return BLI_sprintfN("modifiers[\"%s\"].coll_settings", md->name);
}
@@ -141,129 +141,129 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "SmokeDomainSettings");
RNA_def_struct_path_func(srna, "rna_SmokeDomainSettings_path");
- prop= RNA_def_property(srna, "resolution_max", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "resolution_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxres");
RNA_def_property_range(prop, 24, 512);
RNA_def_property_ui_range(prop, 24, 512, 2, 0);
RNA_def_property_ui_text(prop, "Max Res", "Maximal resolution used in the fluid domain");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "amplify");
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_range(prop, 1, 10, 1, 0);
RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "use_high_resolution", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_high_resolution", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES);
RNA_def_property_ui_text(prop, "High res", "Enable high resolution (using amplification)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "show_high_resolution", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_high_resolution", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_VIEW_SHOWBIG);
RNA_def_property_ui_text(prop, "Show High Resolution", "Show high resolution (using amplification)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noise");
RNA_def_property_enum_items(prop, prop_noise_type_items);
RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_range(prop, -5.0, 5.0);
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
RNA_def_property_ui_text(prop, "Density", "How much density affects smoke motion (higher value results in faster rising smoke)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "beta");
RNA_def_property_range(prop, -5.0, 5.0);
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
RNA_def_property_ui_text(prop, "Heat", "How much heat affects smoke motion (higher value results in faster rising smoke)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "coll_group");
RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Collision Group", "Limit collisions to this group");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
- prop= RNA_def_property(srna, "fluid_group", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "fluid_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "fluid_group");
RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Fluid Group", "Limit fluid objects to this group");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
- prop= RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "eff_group");
RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this group");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
- prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strength");
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2);
RNA_def_property_ui_text(prop, "Strength", "Strength of noise");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "diss_speed");
RNA_def_property_range(prop, 1.0, 10000.0);
RNA_def_property_ui_range(prop, 1.0, 10000.0, 1, 0);
RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "use_dissolve_smoke", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_dissolve_smoke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE);
RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "use_dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG);
RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x ");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "point_cache[0]");
RNA_def_property_ui_text(prop, "Point Cache", "");
- prop= RNA_def_property(srna, "point_cache_compress_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "point_cache_compress_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "cache_comp");
RNA_def_property_enum_items(prop, smoke_cache_comp_items);
RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
- prop= RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "border_collisions");
RNA_def_property_enum_items(prop, smoke_domain_colli_items);
RNA_def_property_ui_text(prop, "Border Collisions", "Select which domain border will be treated as collision object");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EffectorWeights");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Effector Weights", "");
- prop= RNA_def_property(srna, "smooth_emitter", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "smooth_emitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGH_SMOOTH);
RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothen emitted smoke to avoid blockiness");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "time_scale");
RNA_def_property_range(prop, 0.2, 1.5);
RNA_def_property_ui_range(prop, 0.2, 1.5, 0.02, 5);
RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vorticity");
RNA_def_property_range(prop, 0.01, 4.0);
RNA_def_property_ui_range(prop, 0.01, 4.0, 0.02, 5);
@@ -282,43 +282,43 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "SmokeFlowSettings");
RNA_def_struct_path_func(srna, "rna_SmokeFlowSettings_path");
- prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "density");
RNA_def_property_range(prop, 0.001, 1);
RNA_def_property_ui_range(prop, 0.001, 1.0, 1.0, 4);
RNA_def_property_ui_text(prop, "Density", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "temp");
RNA_def_property_range(prop, -10, 10);
RNA_def_property_ui_range(prop, -10, 10, 1, 1);
RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambient temperature");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "psys");
RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object");
RNA_def_property_update(prop, 0, "rna_Smoke_reset_dependancy");
- prop= RNA_def_property(srna, "use_outflow", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_outflow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW);
RNA_def_property_ui_text(prop, "Outflow", "Delete smoke from simulation");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE);
RNA_def_property_ui_text(prop, "Absolute Density", "Only allow given density value in emitter area");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY);
RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits its velocity from the emitter particle");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vel_multi");
RNA_def_property_range(prop, -2.0, 2.0);
RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5);
diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c
index f5984d2f940..866b4787a9c 100644
--- a/source/blender/makesrna/intern/rna_sound.c
+++ b/source/blender/makesrna/intern/rna_sound.c
@@ -53,7 +53,7 @@ static int rna_Sound_caching_get(PointerRNA *ptr)
static void rna_Sound_caching_set(PointerRNA *ptr, const int value)
{
bSound *sound = (bSound*)(ptr->data);
- if(value)
+ if (value)
sound_cache(sound);
else
sound_delete_cache(sound);
@@ -71,28 +71,28 @@ static void rna_def_sound(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Sound", "ID");
+ srna = RNA_def_struct(brna, "Sound", "ID");
RNA_def_struct_sdna(srna, "bSound");
RNA_def_struct_ui_text(srna, "Sound", "Sound datablock referencing an external or packed sound file");
RNA_def_struct_ui_icon(srna, ICON_SOUND);
- //rna_def_ipo_common(srna);
+ /*rna_def_ipo_common(srna); */
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ 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", "Sound sample file used by this Sound datablock");
RNA_def_property_update(prop, 0, "rna_Sound_update");
- prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
RNA_def_property_ui_text(prop, "Packed File", "");
- prop= RNA_def_property(srna, "use_memory_cache", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_memory_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_Sound_caching_get", "rna_Sound_caching_set");
RNA_def_property_ui_text(prop, "Caching", "The sound file is decoded and loaded into RAM");
RNA_def_property_update(prop, 0, "rna_Sound_caching_update");
- prop= RNA_def_property(srna, "use_mono", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mono", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_MONO);
RNA_def_property_ui_text(prop, "Mono", "If the file contains multiple audio channels they are rendered to a single one");
RNA_def_property_update(prop, 0, "rna_Sound_update");
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index c7e28851084..d89af94d447 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -136,9 +136,9 @@ EnumPropertyItem viewport_shade_items[] = {
static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
{
- SpaceLink *space= (SpaceLink*)ptr->data;
+ SpaceLink *space = (SpaceLink*)ptr->data;
- switch(space->spacetype) {
+ switch (space->spacetype) {
case SPACE_VIEW3D:
return &RNA_SpaceView3D;
case SPACE_IPO:
@@ -181,41 +181,47 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
static ScrArea *rna_area_from_space(PointerRNA *ptr)
{
bScreen *sc = (bScreen*)ptr->id.data;
- SpaceLink *link= (SpaceLink*)ptr->data;
+ SpaceLink *link = (SpaceLink*)ptr->data;
ScrArea *sa;
- for(sa=sc->areabase.first; sa; sa=sa->next)
- if(BLI_findindex(&sa->spacedata, link) != -1)
+ for (sa = sc->areabase.first; sa; sa = sa->next)
+ if (BLI_findindex(&sa->spacedata, link) != -1)
return sa;
return NULL;
}
-static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **sa_r, ARegion **ar_r)
+static void area_region_from_regiondata(bScreen *sc, void *regiondata, ScrArea **r_sa, ARegion **r_ar)
{
- bScreen *sc = (bScreen*)ptr->id.data;
ScrArea *sa;
ARegion *ar;
- void *regiondata= ptr->data;
- *sa_r= NULL;
- *ar_r= NULL;
+ *r_sa = NULL;
+ *r_ar = NULL;
- for(sa=sc->areabase.first; sa; sa=sa->next) {
- for(ar=sa->regionbase.first; ar; ar=ar->next) {
- if(ar->regiondata == regiondata) {
- *sa_r= sa;
- *ar_r= ar;
+ for (sa = sc->areabase.first; sa; sa = sa->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar->regiondata == regiondata) {
+ *r_sa = sa;
+ *r_ar = ar;
return;
}
}
}
}
+static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_sa, ARegion **r_ar)
+{
+ bScreen *sc = (bScreen*)ptr->id.data;
+ void *regiondata = ptr->data;
+
+ area_region_from_regiondata(sc, regiondata, r_sa, r_ar);
+}
+
static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr)
{
Scene *scene = ((bScreen*)ptr->id.data)->scene;
- View3D *v3d= (View3D*)ptr->data;
+ View3D *v3d = (View3D*)ptr->data;
if (v3d->twmode < V3D_MANIP_CUSTOM)
return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, NULL);
@@ -228,10 +234,10 @@ EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, P
{
Scene *scene = NULL;
ListBase *transform_spaces;
- TransformOrientation *ts= NULL;
+ TransformOrientation *ts = NULL;
EnumPropertyItem tmp = {0, "", 0, "", ""};
- EnumPropertyItem *item= NULL;
- int i = V3D_MANIP_CUSTOM, totitem= 0;
+ EnumPropertyItem *item = NULL;
+ int i = V3D_MANIP_CUSTOM, totitem = 0;
RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_GLOBAL);
RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_NORMAL);
@@ -244,25 +250,24 @@ EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, P
else
scene = CTX_data_scene(C); /* can't use scene from ptr->id.data because that enum is also used by operators */
- if(scene) {
+ if (scene) {
transform_spaces = &scene->transform_spaces;
ts = transform_spaces->first;
}
- if(ts)
- {
+ if (ts) {
RNA_enum_item_add_separator(&item, &totitem);
- for(; ts; ts = ts->next) {
+ for (; ts; ts = ts->next) {
tmp.identifier = ts->name;
- tmp.name= ts->name;
+ tmp.name = ts->name;
tmp.value = i++;
RNA_enum_item_add(&item, &totitem, &tmp);
}
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
@@ -270,32 +275,32 @@ EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, P
/* Space 3D View */
static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int value)
{
- View3D *v3d= (View3D*)(ptr->data);
- bScreen *sc= (bScreen*)ptr->id.data;
+ View3D *v3d = (View3D*)(ptr->data);
+ bScreen *sc = (bScreen*)ptr->id.data;
v3d->scenelock = value;
- if(value) {
+ if (value) {
int bit;
- v3d->lay= sc->scene->lay;
+ v3d->lay = sc->scene->lay;
/* seek for layact */
- bit= 0;
- while(bit<32) {
- if(v3d->lay & (1<<bit)) {
- v3d->layact= 1<<bit;
+ bit = 0;
+ while (bit<32) {
+ if (v3d->lay & (1<<bit)) {
+ v3d->layact = 1<<bit;
break;
}
bit++;
}
- v3d->camera= sc->scene->camera;
+ v3d->camera = sc->scene->camera;
}
}
static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values)
{
- View3D *v3d= (View3D*)(ptr->data);
- bScreen *sc= (bScreen*)ptr->id.data;
- Scene *scene= (Scene *)sc->scene;
+ View3D *v3d = (View3D*)(ptr->data);
+ bScreen *sc = (bScreen*)ptr->id.data;
+ Scene *scene = (Scene *)sc->scene;
float *loc = give_cursor(scene, v3d);
copy_v3_v3(values, loc);
@@ -303,9 +308,9 @@ static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values)
static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values)
{
- View3D *v3d= (View3D*)(ptr->data);
- bScreen *sc= (bScreen*)ptr->id.data;
- Scene *scene= (Scene *)sc->scene;
+ View3D *v3d = (View3D*)(ptr->data);
+ bScreen *sc = (bScreen*)ptr->id.data;
+ Scene *scene = (Scene *)sc->scene;
float *cursor = give_cursor(scene, v3d);
copy_v3_v3(cursor, values);
@@ -313,9 +318,9 @@ static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values)
static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values)
{
- View3D *v3d= (View3D*)(ptr->data);
+ View3D *v3d = (View3D*)(ptr->data);
- v3d->lay= ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact);
+ v3d->lay = ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact);
}
static void rna_SpaceView3D_layer_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
@@ -325,18 +330,18 @@ static void rna_SpaceView3D_layer_update(Main *bmain, Scene *UNUSED(scene), Poin
static void rna_SpaceView3D_viewport_shade_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- View3D *v3d= (View3D*)(ptr->data);
- ScrArea *sa= rna_area_from_space(ptr);
+ View3D *v3d = (View3D*)(ptr->data);
+ ScrArea *sa = rna_area_from_space(ptr);
- if(v3d->drawtype != OB_RENDER) {
+ if (v3d->drawtype != OB_RENDER) {
ARegion *ar;
- for(ar=sa->regionbase.first; ar; ar=ar->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
RegionView3D *rv3d = ar->regiondata;
- if(rv3d && rv3d->render_engine) {
+ if (rv3d && rv3d->render_engine) {
RE_engine_free(rv3d->render_engine);
- rv3d->render_engine= NULL;
+ rv3d->render_engine = NULL;
}
}
}
@@ -345,20 +350,20 @@ static void rna_SpaceView3D_viewport_shade_update(Main *UNUSED(bmain), Scene *UN
static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
if (U.uiflag & USER_LOCKAROUND) {
- View3D *v3d_act= (View3D*)(ptr->data);
+ View3D *v3d_act = (View3D*)(ptr->data);
/* TODO, space looper */
bScreen *screen;
- for(screen= bmain->screen.first; screen; screen= screen->id.next) {
+ for (screen = bmain->screen.first; screen; screen = screen->id.next) {
ScrArea *sa;
- for(sa= screen->areabase.first; sa; sa= sa->next) {
+ for (sa = screen->areabase.first; sa; sa = sa->next) {
SpaceLink *sl;
- for(sl= sa->spacedata.first; sl ;sl= sl->next) {
- if(sl->spacetype==SPACE_VIEW3D) {
- View3D *v3d= (View3D *)sl;
+ for (sl = sa->spacedata.first; sl ;sl = sl->next) {
+ if (sl->spacetype == SPACE_VIEW3D) {
+ View3D *v3d = (View3D *)sl;
if (v3d != v3d_act) {
- v3d->around= v3d_act->around;
- v3d->flag= (v3d->flag & ~V3D_ALIGN) | (v3d_act->flag & V3D_ALIGN);
+ v3d->around = v3d_act->around;
+ v3d->flag = (v3d->flag & ~V3D_ALIGN) | (v3d_act->flag & V3D_ALIGN);
ED_area_tag_redraw_regiontype(sa, RGN_TYPE_HEADER);
}
}
@@ -370,13 +375,13 @@ static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), Poin
static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
{
- View3D *v3d= (View3D*)(ptr->data);
- ScrArea *sa= rna_area_from_space(ptr);
- void *regiondata= NULL;
- if(sa) {
- ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
- ARegion *ar= regionbase->last; /* always last in list, weak .. */
- regiondata= ar->regiondata;
+ View3D *v3d = (View3D*)(ptr->data);
+ ScrArea *sa = rna_area_from_space(ptr);
+ void *regiondata = NULL;
+ if (sa) {
+ ListBase *regionbase = (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
+ ARegion *ar = regionbase->last; /* always last in list, weak .. */
+ regiondata = ar->regiondata;
}
return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata);
@@ -384,16 +389,16 @@ static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
static PointerRNA rna_SpaceView3D_region_quadview_get(PointerRNA *ptr)
{
- View3D *v3d= (View3D*)(ptr->data);
- ScrArea *sa= rna_area_from_space(ptr);
- void *regiondata= NULL;
- if(sa) {
- ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
- ARegion *ar= regionbase->last; /* always before last in list, weak .. */
+ View3D *v3d = (View3D*)(ptr->data);
+ ScrArea *sa = rna_area_from_space(ptr);
+ void *regiondata = NULL;
+ if (sa) {
+ ListBase *regionbase = (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
+ ARegion *ar = regionbase->last; /* always before last in list, weak .. */
- ar= (ar->alignment == RGN_ALIGN_QSPLIT)? ar->prev: NULL;
- if(ar) {
- regiondata= ar->regiondata;
+ ar = (ar->alignment == RGN_ALIGN_QSPLIT)? ar->prev: NULL;
+ if (ar) {
+ regiondata = ar->regiondata;
}
}
@@ -406,7 +411,7 @@ static void rna_RegionView3D_quadview_update(Main *UNUSED(main), Scene *UNUSED(s
ARegion *ar;
rna_area_region_from_regiondata(ptr, &sa, &ar);
- if(sa && ar && ar->alignment==RGN_ALIGN_QSPLIT)
+ if (sa && ar && ar->alignment == RGN_ALIGN_QSPLIT)
ED_view3d_quadview_update(sa, ar, FALSE);
}
@@ -417,62 +422,81 @@ static void rna_RegionView3D_quadview_clip_update(Main *UNUSED(main), Scene *UNU
ARegion *ar;
rna_area_region_from_regiondata(ptr, &sa, &ar);
- if(sa && ar && ar->alignment==RGN_ALIGN_QSPLIT)
+ if (sa && ar && ar->alignment == RGN_ALIGN_QSPLIT)
ED_view3d_quadview_update(sa, ar, TRUE);
}
static void rna_RegionView3D_view_location_get(PointerRNA *ptr, float *values)
{
- RegionView3D *rv3d= (RegionView3D *)(ptr->data);
+ RegionView3D *rv3d = (RegionView3D *)(ptr->data);
negate_v3_v3(values, rv3d->ofs);
}
static void rna_RegionView3D_view_location_set(PointerRNA *ptr, const float *values)
{
- RegionView3D *rv3d= (RegionView3D *)(ptr->data);
+ RegionView3D *rv3d = (RegionView3D *)(ptr->data);
negate_v3_v3(rv3d->ofs, values);
}
static void rna_RegionView3D_view_rotation_get(PointerRNA *ptr, float *values)
{
- RegionView3D *rv3d= (RegionView3D *)(ptr->data);
+ RegionView3D *rv3d = (RegionView3D *)(ptr->data);
invert_qt_qt(values, rv3d->viewquat);
}
static void rna_RegionView3D_view_rotation_set(PointerRNA *ptr, const float *values)
{
- RegionView3D *rv3d= (RegionView3D *)(ptr->data);
+ RegionView3D *rv3d = (RegionView3D *)(ptr->data);
invert_qt_qt(rv3d->viewquat, values);
}
static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *values)
{
- RegionView3D *rv3d= (RegionView3D *)(ptr->data);
+ RegionView3D *rv3d = (RegionView3D *)(ptr->data);
negate_v3_v3(rv3d->ofs, values);
ED_view3d_from_m4((float (*)[4])values, rv3d->ofs, rv3d->viewquat, &rv3d->dist);
}
+/* api call */
+void rna_RegionView3D_update(ID *id, RegionView3D *rv3d)
+{
+ bScreen *sc = (bScreen *)id;
+
+ ScrArea *sa;
+ ARegion *ar;
+
+ area_region_from_regiondata(sc, rv3d, &sa, &ar);
+
+ if (sa && ar && sa->spacetype == SPACE_VIEW3D) {
+ View3D *v3d;
+
+ v3d = (View3D *)sa->spacedata.first;
+
+ ED_view3d_update_viewmat(sc->scene, v3d, ar, NULL, NULL);
+ }
+}
+
static EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{
Scene *scene = ((bScreen*)ptr->id.data)->scene;
RenderEngineType *type = RE_engines_find(scene->r.engine);
- EnumPropertyItem *item= NULL;
- int totitem= 0;
+ EnumPropertyItem *item = NULL;
+ int totitem = 0;
RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_BOUNDBOX);
RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_WIRE);
RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_SOLID);
RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_TEXTURE);
- if(scene_use_new_shading_nodes(scene))
+ if (scene_use_new_shading_nodes(scene))
RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_MATERIAL);
- if(type->view_draw)
+ if (type->view_draw)
RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_RENDER);
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
@@ -493,27 +517,27 @@ static void rna_SpaceImageEditor_paint_update(Main *bmain, Scene *scene, Pointer
static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
{
- SpaceImage *sima= (SpaceImage*)(ptr->data);
+ SpaceImage *sima = (SpaceImage*)(ptr->data);
return ED_space_image_show_render(sima);
}
static int rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr)
{
- SpaceImage *sima= (SpaceImage*)(ptr->data);
+ SpaceImage *sima = (SpaceImage*)(ptr->data);
return ED_space_image_show_paint(sima);
}
static int rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
{
- SpaceImage *sima= (SpaceImage*)(ptr->data);
- bScreen *sc= (bScreen*)ptr->id.data;
+ SpaceImage *sima = (SpaceImage*)(ptr->data);
+ bScreen *sc = (bScreen*)ptr->id.data;
return ED_space_image_show_uvedit(sima, sc->scene->obedit);
}
static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
{
- SpaceImage *sima= (SpaceImage*)(ptr->data);
- bScreen *sc= (bScreen*)ptr->id.data;
+ SpaceImage *sima = (SpaceImage*)(ptr->data);
+ bScreen *sc = (bScreen*)ptr->id.data;
ED_space_image_set(sima, sc->scene, sc->scene->obedit, (Image*)value.data);
}
@@ -521,57 +545,57 @@ static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *UNUSED(C), PointerRNA *ptr,
PropertyRNA *UNUSED(prop), int *free)
{
- SpaceImage *sima= (SpaceImage*)ptr->data;
- EnumPropertyItem *item= NULL;
+ SpaceImage *sima = (SpaceImage*)ptr->data;
+ EnumPropertyItem *item = NULL;
ImBuf *ibuf;
void *lock;
- int zbuf, alpha, totitem= 0;
+ int zbuf, alpha, totitem = 0;
- ibuf= ED_space_image_acquire_buffer(sima, &lock);
+ ibuf = ED_space_image_acquire_buffer(sima, &lock);
- alpha= ibuf && (ibuf->channels == 4);
- zbuf= ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1));
+ alpha = ibuf && (ibuf->channels == 4);
+ zbuf = ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels == 1));
ED_space_image_release_buffer(sima, lock);
- if(alpha && zbuf)
+ if (alpha && zbuf)
return draw_channels_items;
RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
- if(alpha) {
+ if (alpha) {
RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_USE_ALPHA);
RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ALPHA);
}
- else if(zbuf) {
+ else if (zbuf) {
RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ZBUF);
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values)
{
- SpaceImage *sima= (SpaceImage*)ptr->data;
+ SpaceImage *sima = (SpaceImage*)ptr->data;
ScrArea *sa;
ARegion *ar;
values[0] = values[1] = 1;
/* find aregion */
- sa= rna_area_from_space(ptr); /* can be NULL */
- ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
- if(ar) {
+ sa = rna_area_from_space(ptr); /* can be NULL */
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+ if (ar) {
ED_space_image_zoom(sima, ar, &values[0], &values[1]);
}
}
static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *values)
{
- SpaceImage *sima= (SpaceImage*)ptr->data;
+ SpaceImage *sima = (SpaceImage*)ptr->data;
if (sima->flag & SI_COORDFLOATS) {
copy_v2_v2(values, sima->cursor);
@@ -586,7 +610,7 @@ static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *val
static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const float *values)
{
- SpaceImage *sima= (SpaceImage*)ptr->data;
+ SpaceImage *sima = (SpaceImage*)ptr->data;
if (sima->flag & SI_COORDFLOATS) {
copy_v2_v2(sima->cursor, values);
@@ -601,12 +625,12 @@ static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const floa
static void rna_SpaceImageEditor_curves_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- SpaceImage *sima= (SpaceImage*)ptr->data;
+ SpaceImage *sima = (SpaceImage*)ptr->data;
ImBuf *ibuf;
void *lock;
- ibuf= ED_space_image_acquire_buffer(sima, &lock);
- if(ibuf->rect_float)
+ ibuf = ED_space_image_acquire_buffer(sima, &lock);
+ if (ibuf->rect_float)
curvemapping_do_ibuf(sima->cumap, ibuf);
ED_space_image_release_buffer(sima, lock);
@@ -615,12 +639,12 @@ static void rna_SpaceImageEditor_curves_update(Main *UNUSED(bmain), Scene *UNUSE
static void rna_SpaceImageEditor_scopes_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
- SpaceImage *sima= (SpaceImage*)ptr->data;
+ SpaceImage *sima = (SpaceImage*)ptr->data;
ImBuf *ibuf;
void *lock;
- ibuf= ED_space_image_acquire_buffer(sima, &lock);
- if(ibuf) {
+ ibuf = ED_space_image_acquire_buffer(sima, &lock);
+ if (ibuf) {
scopes_update(&sima->scopes, ibuf, scene->r.color_mgt_flag & R_COLOR_MANAGEMENT);
WM_main_add_notifier(NC_IMAGE, sima->image);
}
@@ -631,26 +655,26 @@ static void rna_SpaceImageEditor_scopes_update(Main *UNUSED(bmain), Scene *scene
static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value)
{
- SpaceText *st= (SpaceText*)(ptr->data);
+ SpaceText *st = (SpaceText*)(ptr->data);
- st->wordwrap= value;
- st->left= 0;
+ st->wordwrap = value;
+ st->left = 0;
}
static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
{
- SpaceText *st= (SpaceText*)(ptr->data);
+ SpaceText *st = (SpaceText*)(ptr->data);
- st->text= value.data;
+ st->text = value.data;
WM_main_add_notifier(NC_TEXT|NA_SELECTED, st->text);
}
static void rna_SpaceTextEditor_updateEdited(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- SpaceText *st= (SpaceText*)ptr->data;
+ SpaceText *st = (SpaceText*)ptr->data;
- if(st->text)
+ if (st->text)
WM_main_add_notifier(NC_TEXT|NA_EDITED, st->text);
}
@@ -660,15 +684,15 @@ static void rna_SpaceTextEditor_updateEdited(Main *UNUSED(bmain), Scene *UNUSED(
/* note: this function exists only to avoid id refcounting */
static void rna_SpaceProperties_pin_id_set(PointerRNA *ptr, PointerRNA value)
{
- SpaceButs *sbuts= (SpaceButs*)(ptr->data);
- sbuts->pinid= value.data;
+ SpaceButs *sbuts = (SpaceButs*)(ptr->data);
+ sbuts->pinid = value.data;
}
static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
{
- SpaceButs *sbuts= (SpaceButs*)(ptr->data);
+ SpaceButs *sbuts = (SpaceButs*)(ptr->data);
- if(sbuts->pinid)
+ if (sbuts->pinid)
return ID_code_to_RNA_type(GS(sbuts->pinid->name));
return &RNA_ID;
@@ -676,7 +700,7 @@ static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
static void rna_SpaceProperties_pin_id_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- SpaceButs *sbuts= (SpaceButs*)(ptr->data);
+ SpaceButs *sbuts = (SpaceButs*)(ptr->data);
ID *id = sbuts->pinid;
if (id == NULL) {
@@ -703,68 +727,68 @@ static void rna_SpaceProperties_pin_id_update(Main *UNUSED(bmain), Scene *UNUSED
static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value)
{
- SpaceButs *sbuts= (SpaceButs*)(ptr->data);
+ SpaceButs *sbuts = (SpaceButs*)(ptr->data);
- sbuts->mainb= value;
+ sbuts->mainb = value;
sbuts->mainbuser = value;
}
static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
{
- SpaceButs *sbuts= (SpaceButs*)(ptr->data);
+ SpaceButs *sbuts = (SpaceButs*)(ptr->data);
- sbuts->align= value;
- sbuts->re_align= 1;
+ sbuts->align = value;
+ sbuts->re_align = 1;
}
/* Space Console */
static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value)
{
- ConsoleLine *ci= (ConsoleLine*)ptr->data;
+ ConsoleLine *ci = (ConsoleLine*)ptr->data;
strcpy(value, ci->line);
}
static int rna_ConsoleLine_body_length(PointerRNA *ptr)
{
- ConsoleLine *ci= (ConsoleLine*)ptr->data;
+ ConsoleLine *ci = (ConsoleLine*)ptr->data;
return ci->len;
}
static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value)
{
- ConsoleLine *ci= (ConsoleLine*)ptr->data;
- int len= strlen(value);
+ ConsoleLine *ci = (ConsoleLine*)ptr->data;
+ int len = strlen(value);
- if((len >= ci->len_alloc) || (len * 2 < ci->len_alloc) ) { /* allocate a new string */
+ if ((len >= ci->len_alloc) || (len * 2 < ci->len_alloc) ) { /* allocate a new string */
MEM_freeN(ci->line);
- ci->line= MEM_mallocN((len + 1) * sizeof(char), "rna_consoleline");
- ci->len_alloc= len + 1;
+ ci->line = MEM_mallocN((len + 1) * sizeof(char), "rna_consoleline");
+ ci->len_alloc = len + 1;
}
memcpy(ci->line, value, len + 1);
- ci->len= len;
+ ci->len = len;
- if(ci->cursor > len) /* clamp the cursor */
- ci->cursor= len;
+ if (ci->cursor > len) /* clamp the cursor */
+ ci->cursor = len;
}
static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *max)
{
- ConsoleLine *ci= (ConsoleLine*)ptr->data;
+ ConsoleLine *ci = (ConsoleLine*)ptr->data;
- *min= 0;
- *max= ci->len; /* intentionally _not_ -1 */
+ *min = 0;
+ *max = ci->len; /* intentionally _not_ -1 */
}
/* Space Dopesheet */
static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA value)
{
- SpaceAction *saction= (SpaceAction*)(ptr->data);
+ SpaceAction *saction = (SpaceAction*)(ptr->data);
bAction *act = (bAction*)value.data;
if ((act == NULL) || (act->idroot == 0)) {
/* just set if we're clearing the action or if the action is "amorphous" still */
- saction->action= act;
+ saction->action = act;
}
else {
/* action to set must strictly meet the mode criteria... */
@@ -792,21 +816,21 @@ static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA valu
static void rna_SpaceDopeSheetEditor_action_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
- SpaceAction *saction= (SpaceAction*)(ptr->data);
- Object *obact= (scene->basact)? scene->basact->object: NULL;
+ SpaceAction *saction = (SpaceAction*)(ptr->data);
+ Object *obact = (scene->basact)? scene->basact->object: NULL;
/* we must set this action to be the one used by active object (if not pinned) */
if (obact/* && saction->pin == 0*/) {
AnimData *adt = NULL;
if (saction->mode == SACTCONT_ACTION) {
- // TODO: context selector could help decide this with more control?
- adt= BKE_id_add_animdata(&obact->id); /* this only adds if non-existant */
+ /* TODO: context selector could help decide this with more control? */
+ adt = BKE_id_add_animdata(&obact->id); /* this only adds if non-existant */
}
else if (saction->mode == SACTCONT_SHAPEKEY) {
Key *key = ob_get_key(obact);
if (key)
- adt= BKE_id_add_animdata(&key->id); /* this only adds if non-existant */
+ adt = BKE_id_add_animdata(&key->id); /* this only adds if non-existant */
}
/* set action */
@@ -815,7 +839,7 @@ static void rna_SpaceDopeSheetEditor_action_update(Main *UNUSED(bmain), Scene *s
id_us_min(&adt->action->id);
/* show new id-count of action we're replacing */
- adt->action= saction->action;
+ adt->action = saction->action;
id_us_plus(&adt->action->id);
}
@@ -826,8 +850,8 @@ static void rna_SpaceDopeSheetEditor_action_update(Main *UNUSED(bmain), Scene *s
static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
- SpaceAction *saction= (SpaceAction*)(ptr->data);
- Object *obact= (scene->basact)? scene->basact->object: NULL;
+ SpaceAction *saction = (SpaceAction*)(ptr->data);
+ Object *obact = (scene->basact)? scene->basact->object: NULL;
/* special exceptions for ShapeKey Editor mode */
if (saction->mode == SACTCONT_SHAPEKEY) {
@@ -848,7 +872,7 @@ static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *sce
/* make sure action stored is valid */
else if (saction->mode == SACTCONT_ACTION) {
/* 1) update the action stored for the editor */
- // TODO: context selector could help decide this with more control?
+ /* TODO: context selector could help decide this with more control? */
if (obact)
saction->action = (obact->adt)? obact->adt->action : NULL;
else
@@ -860,7 +884,7 @@ static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *sce
static void rna_SpaceGraphEditor_display_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- ScrArea *sa= rna_area_from_space(ptr);
+ ScrArea *sa = rna_area_from_space(ptr);
/* after changing view mode, must force recalculation of F-Curve colors
* which can only be achieved using refresh as opposed to redraw
@@ -870,31 +894,31 @@ static void rna_SpaceGraphEditor_display_mode_update(Main *UNUSED(bmain), Scene
static int rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr)
{
- SpaceIpo *sipo= (SpaceIpo*)(ptr->data);
+ SpaceIpo *sipo = (SpaceIpo*)(ptr->data);
return (sipo->ghostCurves.first != NULL);
}
static void rna_Sequencer_view_type_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- ScrArea *sa= rna_area_from_space(ptr);
+ ScrArea *sa = rna_area_from_space(ptr);
ED_area_tag_refresh(sa);
}
static float rna_BackgroundImage_opacity_get(PointerRNA *ptr)
{
- BGpic *bgpic= (BGpic *)ptr->data;
+ BGpic *bgpic = (BGpic *)ptr->data;
return 1.0f-bgpic->blend;
}
static void rna_BackgroundImage_opacity_set(PointerRNA *ptr, float value)
{
- BGpic *bgpic= (BGpic *)ptr->data;
+ BGpic *bgpic = (BGpic *)ptr->data;
bgpic->blend = 1.0f - value;
}
static BGpic *rna_BackgroundImage_new(View3D *v3d)
{
- BGpic *bgpic= ED_view3D_background_image_new(v3d);
+ BGpic *bgpic = ED_view3D_background_image_new(v3d);
WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, v3d);
@@ -922,16 +946,16 @@ static void rna_BackgroundImage_clear(View3D *v3d)
static int rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, PointerRNA value)
{
- SpaceNode *snode= (SpaceNode*)ptr->data;
- bNodeTree *ntree= (bNodeTree*)value.data;
+ SpaceNode *snode = (SpaceNode*)ptr->data;
+ bNodeTree *ntree = (bNodeTree*)value.data;
/* exclude group trees, only trees of the active type */
- return (ntree->nodetype==0 && ntree->type == snode->treetype);
+ return (ntree->nodetype == 0 && ntree->type == snode->treetype);
}
static void rna_SpaceNodeEditor_node_tree_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
- SpaceNode *snode= (SpaceNode*)ptr->data;
+ SpaceNode *snode = (SpaceNode*)ptr->data;
ED_node_tree_update(snode, scene);
}
@@ -941,19 +965,19 @@ static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C,
{
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
- EnumPropertyItem *item= NULL;
- EnumPropertyItem tmp= {0, "", 0, "", ""};
- int totitem= 0;
+ EnumPropertyItem *item = NULL;
+ EnumPropertyItem tmp = {0, "", 0, "", ""};
+ int totitem = 0;
- if(ob) {
- if(ob->type == OB_LAMP) {
+ if (ob) {
+ if (ob->type == OB_LAMP) {
tmp.value = SB_TEXC_MAT_OR_LAMP;
tmp.description = "Show Lamp Textures";
tmp.identifier = "LAMP";
tmp.icon = ICON_LAMP_POINT;
RNA_enum_item_add(&item, &totitem, &tmp);
}
- else if(ob->totcol) {
+ else if (ob->totcol) {
tmp.value = SB_TEXC_MAT_OR_LAMP;
tmp.description = "Show Material Textures";
tmp.identifier = "MATERIAL";
@@ -961,7 +985,7 @@ static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C,
RNA_enum_item_add(&item, &totitem, &tmp);
}
- if(ob->particlesystem.first) {
+ if (ob->particlesystem.first) {
tmp.value = SB_TEXC_PARTICLES;
tmp.description = "Show Particle Textures";
tmp.identifier = "PARTICLE";
@@ -970,7 +994,7 @@ static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C,
}
}
- if(scene && scene->world) {
+ if (scene && scene->world) {
tmp.value = SB_TEXC_WORLD;
tmp.description = "Show World Textures";
tmp.identifier = "WORLD";
@@ -992,29 +1016,29 @@ static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C,
static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, PointerRNA value)
{
- SpaceClip *sc= (SpaceClip*)(ptr->data);
+ SpaceClip *sc = (SpaceClip*)(ptr->data);
ED_space_clip_set(NULL, sc, (MovieClip*)value.data);
}
static void rna_SpaceClipEditor_clip_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- SpaceClip *sc= (SpaceClip*)(ptr->data);
+ SpaceClip *sc = (SpaceClip*)(ptr->data);
- sc->scopes.ok= 0;
+ sc->scopes.ok = 0;
}
static void rna_SpaceClipEditor_lock_selection_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- SpaceClip *sc= (SpaceClip*)(ptr->data);
+ SpaceClip *sc = (SpaceClip*)(ptr->data);
- sc->xlockof= 0.f;
- sc->ylockof= 0.f;
+ sc->xlockof = 0.f;
+ sc->ylockof = 0.f;
}
static void rna_SpaceClipEditor_view_type_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- ScrArea *sa= rna_area_from_space(ptr);
+ ScrArea *sa = rna_area_from_space(ptr);
ED_area_tag_refresh(sa);
}
@@ -1025,12 +1049,12 @@ static void rna_def_space(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Space", NULL);
+ srna = RNA_def_struct(brna, "Space", NULL);
RNA_def_struct_sdna(srna, "SpaceLink");
RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area");
RNA_def_struct_refine_func(srna, "rna_Space_refine");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "spacetype");
RNA_def_property_enum_items(prop, space_type_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -1068,13 +1092,13 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
{V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SpaceUVEditor", NULL);
+ srna = RNA_def_struct(brna, "SpaceUVEditor", NULL);
RNA_def_struct_sdna(srna, "SpaceImage");
RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space");
/* selection */
- prop= RNA_def_property(srna, "sticky_select_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "sticky_select_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "sticky");
RNA_def_property_enum_items(prop, sticky_mode_items);
RNA_def_property_ui_text(prop, "Sticky Selection Mode",
@@ -1082,51 +1106,51 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
/* drawing */
- prop= RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "dt_uv");
RNA_def_property_enum_items(prop, dt_uv_items);
RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "show_smooth_edges", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_smooth_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV);
RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti-aliased");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH);
RNA_def_property_ui_text(prop, "Draw Stretch",
"Draw faces colored according to the difference in shape between UVs and "
"their 3D coordinates (blue for low distortion, red for high distortion)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch");
RNA_def_property_enum_items(prop, dt_uvstretch_items);
RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW);
RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "show_other_objects", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_other_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER);
RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "show_normalized_coords", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_normalized_coords", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS);
RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SI_NO_DRAWFACES);
RNA_def_property_ui_text(prop, "Draw Faces", "Draw faces over the image");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get",
"rna_SpaceImageEditor_cursor_location_set", NULL);
@@ -1135,23 +1159,23 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
/* todo: move edge and face drawing options here from G.f */
- prop= RNA_def_property(srna, "use_snap_to_pixels", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_snap_to_pixels", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP);
RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel locations while editing");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_CLIP_UV);
RNA_def_property_ui_text(prop, "Constrain to Image Bounds", "Constraint to stay within the image bounds while editing");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP);
RNA_def_property_ui_text(prop, "Live Unwrap",
"Continuously unwrap the selected UV island while transforming pinned vertices");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "around");
RNA_def_property_enum_items(prop, pivot_items);
RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
@@ -1178,32 +1202,32 @@ static void rna_def_space_outliner(BlenderRNA *brna)
{SO_KEYMAP, "KEYMAPS", 0, "Key Maps", "Display keymap datablocks"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SpaceOutliner", "Space");
+ srna = RNA_def_struct(brna, "SpaceOutliner", "Space");
RNA_def_struct_sdna(srna, "SpaceOops");
RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data");
- prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "outlinevis");
RNA_def_property_enum_items(prop, display_mode_items);
RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
- prop= RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "search_string");
RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
- prop= RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_CASE_SENSITIVE);
RNA_def_property_ui_text(prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
- prop= RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_COMPLETE);
RNA_def_property_ui_text(prop, "Complete Matches Only", "Only use complete matches of search string");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
- prop= RNA_def_property(srna, "show_restrict_columns", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_restrict_columns", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS);
RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show column");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
@@ -1239,81 +1263,81 @@ static void rna_def_background_image(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- srna= RNA_def_struct(brna, "BackgroundImage", NULL);
+ srna = RNA_def_struct(brna, "BackgroundImage", NULL);
RNA_def_struct_sdna(srna, "BGpic");
RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3d View background");
- prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "source");
RNA_def_property_enum_items(prop, bgpic_source_items);
RNA_def_property_ui_text(prop, "Background Source", "Data source used for background");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ima");
RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clip");
RNA_def_property_ui_text(prop, "MovieClip", "Movie clip displayed and edited in this space");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MovieClipUser");
RNA_def_property_pointer_sdna(prop, NULL, "cuser");
RNA_def_property_ui_text(prop, "Clip User", "Parameters defining which frame of the movie clip is displayed");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xof");
RNA_def_property_ui_text(prop, "X Offset", "Offset image horizontally from the world origin");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yof");
RNA_def_property_ui_text(prop, "Y Offset", "Offset image vertically from the world origin");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Size", "Scaling factor for the background image");
RNA_def_property_range(prop, 0.0, FLT_MAX);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "blend");
RNA_def_property_float_funcs(prop, "rna_BackgroundImage_opacity_get", "rna_BackgroundImage_opacity_set", NULL);
RNA_def_property_ui_text(prop, "Opacity", "Image opacity to blend the image against the background color");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "view_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "view_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "view");
RNA_def_property_enum_items(prop, bgpic_axis_items);
RNA_def_property_ui_text(prop, "Image Axis", "The axis to display the image on");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_EXPANDED);
RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
- prop= RNA_def_property(srna, "use_camera_clip", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_camera_clip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_CAMERACLIP);
RNA_def_property_ui_text(prop, "Camera Clip", "Use movie clip from active scene camera");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "show_background_image", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_background_image", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_BGPIC_DISABLED);
RNA_def_property_ui_text(prop, "Show Background Image", "Show this image as background");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
@@ -1326,22 +1350,22 @@ static void rna_def_backgroundImages(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "BackgroundImages");
- srna= RNA_def_struct(brna, "BackgroundImages", NULL);
+ srna = RNA_def_struct(brna, "BackgroundImages", NULL);
RNA_def_struct_sdna(srna, "View3D");
RNA_def_struct_ui_text(srna, "Background Images", "Collection of background images");
- func= RNA_def_function(srna, "new", "rna_BackgroundImage_new");
+ func = RNA_def_function(srna, "new", "rna_BackgroundImage_new");
RNA_def_function_ui_description(func, "Add new background image");
- parm= RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background");
+ parm = RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_BackgroundImage_remove");
+ func = RNA_def_function(srna, "remove", "rna_BackgroundImage_remove");
RNA_def_function_ui_description(func, "Remove background image");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background");
+ parm = RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "clear", "rna_BackgroundImage_clear");
+ func = RNA_def_function(srna, "clear", "rna_BackgroundImage_clear");
RNA_def_function_ui_description(func, "Remove all background images");
}
@@ -1349,7 +1373,7 @@ static void rna_def_space_view3d(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- const int matrix_dimsize[]= {4, 4};
+ const int matrix_dimsize[] = {4, 4};
static EnumPropertyItem pivot_items[] = {
{V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center",
@@ -1376,205 +1400,205 @@ static void rna_def_space_view3d(BlenderRNA *brna)
{OB_EMPTY_CONE, "CONE", 0, "Cone", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SpaceView3D", "Space");
+ srna = RNA_def_struct(brna, "SpaceView3D", "Space");
RNA_def_struct_sdna(srna, "View3D");
RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
- prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "camera");
RNA_def_property_ui_text(prop, "Camera", "Active camera used in this view (when unlocked from the scene's active camera)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "ob_centre");
RNA_def_property_ui_text(prop, "Lock to Object", "3D View center is locked to this object's position");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "ob_centre_bone");
RNA_def_property_ui_text(prop, "Lock to Bone", "3D View center is locked to this bone's position");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "lock_cursor", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_cursor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ob_centre_cursor", 1);
RNA_def_property_ui_text(prop, "Lock to Cursor", "3D View center is locked to the cursor's position");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "viewport_shade", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "viewport_shade", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "drawtype");
RNA_def_property_enum_items(prop, viewport_shade_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceView3D_viewport_shade_itemf");
RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_viewport_shade_update");
- prop= RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "localvd");
RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-set of objects, apart from the scene visibility");
- prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
+ prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_View3D_CursorLocation_get", "rna_View3D_CursorLocation_set", NULL);
RNA_def_property_ui_text(prop, "3D Cursor Location", "3D cursor location for this view (dependent on local view setting)");
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "lens");
RNA_def_property_ui_text(prop, "Lens", "Lens angle (mm) in perspective view");
RNA_def_property_range(prop, 1.0f, 250.0f);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "near");
RNA_def_property_range(prop, 0.001f, FLT_MAX);
RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "far");
RNA_def_property_range(prop, 1.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "grid_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "grid_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "grid");
RNA_def_property_ui_text(prop, "Grid Scale", "Distance between 3D View grid lines");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gridlines");
RNA_def_property_ui_text(prop, "Grid Lines", "Number of grid lines to display in perspective view");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gridsubdiv");
RNA_def_property_ui_text(prop, "Grid Subdivisions", "Number of subdivisions between grid lines");
RNA_def_property_range(prop, 1, 1024);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR);
RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_X);
RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line in perspective view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "show_axis_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_axis_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Y);
RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line in perspective view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "show_axis_z", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_axis_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Z);
RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line in perspective view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SELECT_OUTLINE);
RNA_def_property_ui_text(prop, "Outline Selected",
"Show an outline highlight around selected objects in non-wireframe views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "show_all_objects_origin", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_all_objects_origin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS);
RNA_def_property_ui_text(prop, "All Object Origins",
"Show the object origin center dot for all (selected and unselected) objects");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_HIDE_HELPLINES);
RNA_def_property_ui_text(prop, "Relationship Lines", "Show dashed lines indicating parent or constraint relationships");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "show_textured_solid", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_textured_solid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX);
RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "lock_camera", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_camera", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_LOCK_CAMERA);
RNA_def_property_ui_text(prop, "Lock Camera to View", "Enable view navigation within the camera view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "show_only_render", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_only_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_RENDER_OVERRIDE);
RNA_def_property_ui_text(prop, "Only Render", "Display only objects which will be rendered");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "use_occlude_geometry", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_occlude_geometry", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ZBUF_SELECT);
RNA_def_property_ui_text(prop, "Occlude Geometry", "Limit selection to visible (clipped with depth buffer)");
RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "background_images", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "background_images", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "bgpicbase", NULL);
RNA_def_property_struct_type(prop, "BackgroundImage");
RNA_def_property_ui_text(prop, "Background Images", "List of background images");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
rna_def_backgroundImages(brna, prop);
- prop= RNA_def_property(srna, "show_background_images", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_background_images", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPICS);
RNA_def_property_ui_text(prop, "Display Background Images", "Display reference images behind objects in the 3D View");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "around");
RNA_def_property_enum_items(prop, pivot_items);
RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
- prop= RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN);
RNA_def_property_ui_text(prop, "Align", "Manipulate center points (object and pose mode only)");
RNA_def_property_ui_icon(prop, ICON_ALIGN, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
- prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR);
RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms");
RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "use_manipulator_translate", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_manipulator_translate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_TRANSLATE);
RNA_def_property_ui_text(prop, "Manipulator Translate", "Use the manipulator for movement transformations");
RNA_def_property_ui_icon(prop, ICON_MAN_TRANS, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "use_manipulator_rotate", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_manipulator_rotate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_ROTATE);
RNA_def_property_ui_text(prop, "Manipulator Rotate", "Use the manipulator for rotation transformations");
RNA_def_property_ui_icon(prop, ICON_MAN_ROT, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "use_manipulator_scale", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_manipulator_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_SCALE);
RNA_def_property_ui_text(prop, "Manipulator Scale", "Use the manipulator for scale transformations");
RNA_def_property_ui_icon(prop, ICON_MAN_SCALE, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "twmode");
RNA_def_property_enum_items(prop, transform_orientation_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_TransformOrientation_itemf");
RNA_def_property_ui_text(prop, "Transform Orientation", "Transformation orientation");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "current_orientation", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "current_orientation", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "TransformOrientation");
RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current transformation orientation");
- prop= RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scenelock", 1);
RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_lock_camera_and_layers_set");
RNA_def_property_ui_text(prop, "Lock Camera and Layers",
@@ -1582,104 +1606,104 @@ static void rna_def_space_view3d(BlenderRNA *brna)
RNA_def_property_ui_icon(prop, ICON_LOCKVIEW_OFF, 1);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_layer_set");
RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible in this 3D View");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_layer_update");
- prop= RNA_def_property(srna, "layers_used", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop = RNA_def_property(srna, "layers_used", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "lay_used", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Used Layers", "Layers that contain something");
- prop= RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "RegionView3D");
RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "3D Region", "3D region in this space, in case of quad view the camera region");
- prop= RNA_def_property(srna, "region_quadview", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "region_quadview", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "RegionView3D");
RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_quadview_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Quad View Region", "3D region that defines the quad view settings");
- prop= RNA_def_property(srna, "show_reconstruction", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_reconstruction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_RECONSTRUCTION);
RNA_def_property_ui_text(prop, "Show Reconstruction", "Display reconstruction data from active movie clip");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "tracks_draw_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "tracks_draw_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, FLT_MAX);
RNA_def_property_float_sdna(prop, NULL, "bundle_size");
RNA_def_property_ui_text(prop, "Tracks Size", "Display size of tracks from reconstructed data");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "tracks_draw_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "tracks_draw_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "bundle_drawtype");
RNA_def_property_enum_items(prop, bundle_drawtype_items);
RNA_def_property_ui_text(prop, "Tracks Display Type", "Viewport display style for tracks");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "show_camera_path", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_camera_path", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_CAMERAPATH);
RNA_def_property_ui_text(prop, "Show Camera Path", "Show reconstructed camera path");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "show_bundle_names", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_bundle_names", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_BUNDLENAME);
RNA_def_property_ui_text(prop, "Show 3D Marker Names", "Show names for reconstructed tracks objects");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
/* region */
- srna= RNA_def_struct(brna, "RegionView3D", NULL);
+ srna = RNA_def_struct(brna, "RegionView3D", NULL);
RNA_def_struct_sdna(srna, "RegionView3D");
RNA_def_struct_ui_text(srna, "3D View Region", "3D View region data");
- prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_LOCKED);
RNA_def_property_ui_text(prop, "Lock", "Lock view rotation in side views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
- prop= RNA_def_property(srna, "show_sync_view", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_sync_view", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXVIEW);
RNA_def_property_ui_text(prop, "Box", "Sync view position between side views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
- prop= RNA_def_property(srna, "use_box_clip", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_box_clip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXCLIP);
RNA_def_property_ui_text(prop, "Clip", "Clip objects based on what's visible in other side views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_clip_update");
- prop= RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "persmat");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX: for now, it's too risky for users to do this
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* XXX: for now, it's too risky for users to do this */
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_ui_text(prop, "Perspective Matrix", "Current perspective matrix of the 3D region");
- prop= RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "viewmat");
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_float_funcs(prop, NULL, "rna_RegionView3D_view_matrix_set", NULL);
RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix of the 3D region");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "persp");
RNA_def_property_enum_items(prop, rv3d_persp_items);
RNA_def_property_ui_text(prop, "Perspective", "View Perspective");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "is_perspective", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_perspective", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "is_persp", 1);
RNA_def_property_ui_text(prop, "Is Perspective", "");
RNA_def_property_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION);
#if 0
- RNA_def_property_float_sdna(prop, NULL, "ofs"); // cant use because its negated
+ RNA_def_property_float_sdna(prop, NULL, "ofs"); /* cant use because its negated */
#else
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_location_get", "rna_RegionView3D_view_location_set", NULL);
@@ -1688,7 +1712,7 @@ static void rna_def_space_view3d(BlenderRNA *brna)
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
RNA_def_property_update(prop, NC_WINDOW, NULL);
- prop= RNA_def_property(srna, "view_rotation", PROP_FLOAT, PROP_QUATERNION); // cant use because its inverted
+ prop = RNA_def_property(srna, "view_rotation", PROP_FLOAT, PROP_QUATERNION); /* cant use because its inverted */
#if 0
RNA_def_property_float_sdna(prop, NULL, "viewquat");
#else
@@ -1699,21 +1723,31 @@ static void rna_def_space_view3d(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
/* not sure we need rna access to these but adding anyway */
- prop= RNA_def_property(srna, "view_distance", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "view_distance", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_ui_text(prop, "Distance", "Distance to the view location");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "view_camera_zoom", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_sdna(prop, NULL, "camzoom");
+ prop = RNA_def_property(srna, "view_camera_zoom", PROP_FLOAT, PROP_UNSIGNED);
+ RNA_def_property_float_sdna(prop, NULL, "camzoom");
RNA_def_property_ui_text(prop, "Camera Zoom", "Zoom factor in camera view");
+ RNA_def_property_range(prop, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "view_camera_offset", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "view_camera_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "camdx");
RNA_def_property_array(prop, 2);
RNA_def_property_ui_text(prop, "Camera Offset", "View shift in camera view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+
+ /* until we have real api call */
+ {
+ FunctionRNA *func;
+
+ func = RNA_def_function(srna, "update", "rna_RegionView3D_update");
+ RNA_def_function_flag(func, FUNC_USE_SELF_ID);
+ RNA_def_function_ui_description(func, "Recalculate the view matrices");
+ }
}
static void rna_def_space_buttons(BlenderRNA *brna)
@@ -1744,34 +1778,34 @@ static void rna_def_space_buttons(BlenderRNA *brna)
static EnumPropertyItem buttons_texture_context_items[] = {
{SB_TEXC_MAT_OR_LAMP, "MATERIAL", ICON_MATERIAL, "Material", "Material"},
- {0, NULL, 0, NULL, NULL}}; //actually populated dynamically trough a function
+ {0, NULL, 0, NULL, NULL}}; /*actually populated dynamically trough a function */
- srna= RNA_def_struct(brna, "SpaceProperties", "Space");
+ srna = RNA_def_struct(brna, "SpaceProperties", "Space");
RNA_def_struct_sdna(srna, "SpaceButs");
RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
- prop= RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mainb");
RNA_def_property_enum_items(prop, buttons_context_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_context_set", NULL);
RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
- prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "align");
RNA_def_property_enum_items(prop, align_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL);
RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
- prop= RNA_def_property(srna, "texture_context", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_context", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, buttons_texture_context_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceProperties_texture_context_itemf");
RNA_def_property_ui_text(prop, "Texture Context", "Type of texture data to display and edit");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
/* pinned data */
- prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pinid");
RNA_def_property_struct_type(prop, "ID");
/* note: custom set function is ONLY to avoid rna setting a user for this. */
@@ -1779,7 +1813,7 @@ static void rna_def_space_buttons(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update");
- prop= RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_PIN_CONTEXT);
RNA_def_property_ui_text(prop, "Pin ID", "Use the pinned context");
}
@@ -1789,58 +1823,58 @@ static void rna_def_space_image(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SpaceImageEditor", "Space");
+ srna = RNA_def_struct(brna, "SpaceImageEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceImage");
RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data");
/* image */
- prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL); // is handled in image editor too
+ RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL); /* is handled in image editor too */
- prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "cumap");
RNA_def_property_ui_text(prop, "Curve", "Color curve mapping to use for displaying the image");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_curves_update");
- prop= RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "scopes");
RNA_def_property_struct_type(prop, "Scopes");
RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_scopes_update");
- prop= RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pin", 0);
RNA_def_property_ui_text(prop, "Image Pin", "Display current image regardless of object selection");
RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "sample_histogram", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "sample_histogram", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "sample_line_hist");
RNA_def_property_struct_type(prop, "Histogram");
RNA_def_property_ui_text(prop, "Line sample", "Sampled colors along line");
- prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
RNA_def_property_array(prop, 2);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_zoom_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Zoom", "Zoom factor");
/* image draw */
- prop= RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE);
RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, draw_channels_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_draw_channels_itemf");
@@ -1848,50 +1882,50 @@ static void rna_def_space_image(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
/* uv */
- prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "SpaceUVEditor");
RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings");
/* paint */
- prop= RNA_def_property(srna, "use_image_paint", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_image_paint", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWTOOL);
RNA_def_property_ui_text(prop, "Image Painting", "Enable image painting mode");
RNA_def_property_ui_icon(prop, ICON_TPAINT_HLT, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_paint_update");
/* grease pencil */
- prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "gpd");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "GreasePencil");
RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DISPGP);
RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay");
/* update */
- prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "lock", 0);
RNA_def_property_ui_text(prop, "Update Automatically",
"Update other affected window spaces automatically to reflect changes "
"during interactive operations such as transform");
/* state */
- prop= RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Show Render", "Show render related properties");
- prop= RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Show Paint", "Show paint related properties");
- prop= RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Show UV Editor", "Show UV editing related properties");
@@ -1927,81 +1961,81 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
{SEQ_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
+ srna = RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceSeq");
RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data");
/* view type, fairly important */
- prop= RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "view");
RNA_def_property_enum_items(prop, view_type_items);
RNA_def_property_ui_text(prop, "View Type", "Type of the Sequencer view (sequencer, preview or both)");
RNA_def_property_update(prop, 0, "rna_Sequencer_view_type_update");
/* display type, fairly important */
- prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mainb");
RNA_def_property_enum_items(prop, display_mode_items);
RNA_def_property_ui_text(prop, "Display Mode", "View mode to use for displaying sequencer output");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
/* flag's */
- prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_NO_DRAW_CFRANUM);
RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "show_frames", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES);
RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather than seconds");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS);
RNA_def_property_ui_text(prop, "Sync Markers", "Transform markers as well as strips");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "show_separate_color", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPERATED);
+ prop = RNA_def_property(srna, "show_separate_color", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPARATED);
RNA_def_property_ui_text(prop, "Separate Colors", "Separate color channels in preview");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "show_safe_margin", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_safe_margin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS);
RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_GPENCIL);
RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES);
RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
/* grease pencil */
- prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "gpd");
RNA_def_property_struct_type(prop, "UnknownType");
RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "chanshown");
RNA_def_property_ui_text(prop, "Display Channel",
"The channel number shown in the image preview. 0 is the result of all strips combined");
RNA_def_property_range(prop, -5, MAXSEQ);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "zebra");
RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes");
RNA_def_property_range(prop, 0, 110);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "render_size");
RNA_def_property_enum_items(prop, proxy_render_size_items);
RNA_def_property_ui_text(prop, "Proxy render size", "Draw preview using full resolution or different proxy resolutions");
@@ -2013,98 +2047,98 @@ static void rna_def_space_text(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SpaceTextEditor", "Space");
+ srna = RNA_def_struct(brna, "SpaceTextEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceText");
RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data");
/* text */
- prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space");
RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL, NULL);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
/* display */
- prop= RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0);
RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wrap_set");
RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space");
RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0);
RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text");
RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0);
RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting");
RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "line_hlight", 0);
RNA_def_property_ui_text(prop, "Highlight Line", "Highlight the current line");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tabnumber");
RNA_def_property_range(prop, 2, 8);
RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, "rna_SpaceTextEditor_updateEdited");
- prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "lheight");
RNA_def_property_range(prop, 8, 32);
RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "show_margin", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_margin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_SHOW_MARGIN);
RNA_def_property_ui_text(prop, "Show Margin", "Show right margin");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "margin_column", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "margin_column", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "margin_column");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Margin Column", "Column number to show right margin at");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
/* functionality options */
- prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "overwrite", 1);
RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "use_live_edit", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_live_edit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "live_edit", 1);
RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
/* find */
- prop= RNA_def_property(srna, "use_find_all", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_find_all", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_ALL);
RNA_def_property_ui_text(prop, "Find All", "Search in all text datablocks, instead of only the active one");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "use_find_wrap", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_find_wrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_WRAP);
RNA_def_property_ui_text(prop, "Find Wrap", "Search again from the start of the file when reaching the end");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "use_match_case", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_match_case", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_MATCH_CASE);
RNA_def_property_ui_text(prop, "Match case", "Search string is sensitive to uppercase and lowercase letters");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "findstr");
RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
- prop= RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "replacestr");
RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
@@ -2115,7 +2149,7 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- // XXX: action-editor is currently for object-level only actions, so show that using object-icon hint
+ /* XXX: action-editor is currently for object-level only actions, so show that using object-icon hint */
static EnumPropertyItem mode_items[] = {
{SACTCONT_DOPESHEET, "DOPESHEET", ICON_OOPS, "DopeSheet", "DopeSheet Editor"},
{SACTCONT_ACTION, "ACTION", ICON_OBJECT_DATA, "Action Editor", "Action Editor"},
@@ -2124,41 +2158,41 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
+ srna = RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceAction");
RNA_def_struct_ui_text(srna, "Space DopeSheet Editor", "DopeSheet space data");
/* data */
- prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL, "rna_Action_actedit_assign_poll");
RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, "rna_SpaceDopeSheetEditor_action_update");
/* mode */
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, mode_items);
RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
/* display */
- prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_DRAWTIME);
RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
- prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWCFRANUM);
RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
- prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SLIDERS);
RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
- prop= RNA_def_property(srna, "show_pose_markers", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_pose_markers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_POSEMARKERS_SHOW);
RNA_def_property_ui_text(prop, "Show Pose Markers",
"Show markers belonging to the active action instead of Scene markers "
@@ -2166,29 +2200,29 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
/* editing */
- prop= RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL);
RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
- prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOREALTIMEUPDATES);
RNA_def_property_ui_text(prop, "Realtime Updates",
"When transforming keyframes, changes to the animation data are flushed to other views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
- prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_MARKERS_MOVE);
RNA_def_property_ui_text(prop, "Sync Markers", "Sync Markers with keyframe edits");
/* dopesheet */
- prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "DopeSheet");
RNA_def_property_pointer_sdna(prop, NULL, "ads");
RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
/* autosnap */
- prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "autosnap");
RNA_def_property_enum_items(prop, autosnap_items);
RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
@@ -2210,104 +2244,104 @@ static void rna_def_space_graph(BlenderRNA *brna)
{V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},
{V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
{V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Centers", ""},
- //{V3D_CENTROID, "MEDIAN_POINT", 0, "Median Point", ""},
- //{V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""},
+ /*{V3D_CENTROID, "MEDIAN_POINT", 0, "Median Point", ""}, */
+ /*{V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""}, */
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SpaceGraphEditor", "Space");
+ srna = RNA_def_struct(brna, "SpaceGraphEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceIpo");
RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data");
/* mode */
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, mode_items);
RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, "rna_SpaceGraphEditor_display_mode_update");
/* display */
- prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_DRAWTIME);
RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
- prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM);
RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
- prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS);
RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
- prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOHANDLES);
RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
- prop= RNA_def_property(srna, "use_only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY);
RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes",
"Only keyframes of selected F-Curves are visible and editable");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
- prop= RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELVHANDLESONLY);
RNA_def_property_ui_text(prop, "Only Selected Keyframes Handles", "Only show and edit handles of selected keyframes");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
- prop= RNA_def_property(srna, "use_beauty_drawing", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_beauty_drawing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_BEAUTYDRAW_OFF);
RNA_def_property_ui_text(prop, "Use High Quality Drawing",
"Draw F-Curves using Anti-Aliasing and other fancy effects (disable for better performance)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
/* editing */
- prop= RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL);
RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
- prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOREALTIMEUPDATES);
RNA_def_property_ui_text(prop, "Realtime Updates",
"When transforming keyframes, changes to the animation data are flushed to other views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
/* cursor */
- prop= RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCURSOR);
RNA_def_property_ui_text(prop, "Show Cursor", "Show 2D cursor");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
- prop= RNA_def_property(srna, "cursor_position_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "cursor_position_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cursorVal");
RNA_def_property_ui_text(prop, "Cursor Y-Value", "Graph Editor 2D-Value cursor - Y-Value component");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
- prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "around");
RNA_def_property_enum_items(prop, gpivot_items);
RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
/* dopesheet */
- prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "DopeSheet");
RNA_def_property_pointer_sdna(prop, NULL, "ads");
RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
/* autosnap */
- prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "autosnap");
RNA_def_property_enum_items(prop, autosnap_items);
RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
/* readonly state info */
- prop= RNA_def_property(srna, "has_ghost_curves", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "has_ghost_curves", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 0); /* XXX: hack to make this compile, since this property doesn't actually exist*/
RNA_def_property_boolean_funcs(prop, "rna_SpaceGraphEditor_has_ghost_curves_get", NULL);
RNA_def_property_ui_text(prop, "Has Ghost Curves", "Graph Editor instance has some ghost curves stored");
@@ -2319,41 +2353,41 @@ static void rna_def_space_nla(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SpaceNLA", "Space");
+ srna = RNA_def_struct(brna, "SpaceNLA", "Space");
RNA_def_struct_sdna(srna, "SpaceNla");
RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data");
/* display */
- prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SNLA_DRAWTIME);
RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
- prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM);
RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
- prop= RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPCURVES);
RNA_def_property_ui_text(prop, "Show Control F-Curves", "Show influence F-Curves on strips");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
/* editing */
- prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOREALTIMEUPDATES);
RNA_def_property_ui_text(prop, "Realtime Updates",
"When transforming strips, changes to the animation data are flushed to other views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
/* dopesheet */
- prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "DopeSheet");
RNA_def_property_pointer_sdna(prop, NULL, "ads");
RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
/* autosnap */
- prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "autosnap");
RNA_def_property_enum_items(prop, autosnap_items);
RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
@@ -2365,53 +2399,53 @@ static void rna_def_space_time(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SpaceTimeline", "Space");
+ srna = RNA_def_struct(brna, "SpaceTimeline", "Space");
RNA_def_struct_sdna(srna, "SpaceTime");
RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor space data");
/* view settings */
- prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL);
RNA_def_property_ui_text(prop, "Only Selected Channels", "Show keyframes for active Object and/or its selected bones only");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
- prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_CFRA_NUM);
RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
- prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TIME_DRAWFRAMES);
RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
/* displaying cache status */
- prop= RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DISPLAY);
RNA_def_property_ui_text(prop, "Show Cache", "Show the status of cached frames in the timeline");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
- prop= RNA_def_property(srna, "cache_softbody", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "cache_softbody", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SOFTBODY);
RNA_def_property_ui_text(prop, "Softbody", "Show the active object's softbody point cache");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
- prop= RNA_def_property(srna, "cache_particles", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "cache_particles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_PARTICLES);
RNA_def_property_ui_text(prop, "Particles", "Show the active object's particle point cache");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
- prop= RNA_def_property(srna, "cache_cloth", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "cache_cloth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_CLOTH);
RNA_def_property_ui_text(prop, "Cloth", "Show the active object's cloth point cache");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
- prop= RNA_def_property(srna, "cache_smoke", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "cache_smoke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SMOKE);
RNA_def_property_ui_text(prop, "Smoke", "Show the active object's smoke cache");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
- prop= RNA_def_property(srna, "cache_dynamicpaint", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "cache_dynamicpaint", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DYNAMICPAINT);
RNA_def_property_ui_text(prop, "Dynamic Paint", "Show the active object's Dynamic Paint cache");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
@@ -2424,14 +2458,14 @@ static void rna_def_console_line(BlenderRNA *brna)
srna = RNA_def_struct(brna, "ConsoleLine", NULL);
RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console");
- // XXX using non-inited "prop", uh? RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
+ /* XXX using non-inited "prop", uh? RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); */
- prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ConsoleLine_body_get", "rna_ConsoleLine_body_length", "rna_ConsoleLine_body_set");
RNA_def_property_ui_text(prop, "Line", "Text in the line");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
- prop= RNA_def_property(srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */
+ prop = RNA_def_property(srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */
RNA_def_property_int_sdna(prop, NULL, "cursor");
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_ConsoleLine_cursor_index_range");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
@@ -2442,38 +2476,38 @@ static void rna_def_space_console(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SpaceConsole", "Space");
+ srna = RNA_def_struct(brna, "SpaceConsole", "Space");
RNA_def_struct_sdna(srna, "SpaceConsole");
RNA_def_struct_ui_text(srna, "Space Console", "Interactive python console");
/* display */
- prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); /* copied from text editor */
+ prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); /* copied from text editor */
RNA_def_property_int_sdna(prop, NULL, "lheight");
RNA_def_property_range(prop, 8, 32);
RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
- prop= RNA_def_property(srna, "select_start", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
+ prop = RNA_def_property(srna, "select_start", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
RNA_def_property_int_sdna(prop, NULL, "sel_start");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
- prop= RNA_def_property(srna, "select_end", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
+ prop = RNA_def_property(srna, "select_end", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
RNA_def_property_int_sdna(prop, NULL, "sel_end");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
- prop= RNA_def_property(srna, "prompt", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "prompt", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Prompt", "Command line prompt");
- prop= RNA_def_property(srna, "language", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "language", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Language", "Command line prompt language");
- prop= RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "history", NULL);
RNA_def_property_struct_type(prop, "ConsoleLine");
RNA_def_property_ui_text(prop, "History", "Command history");
- prop= RNA_def_property(srna, "scrollback", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "scrollback", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "scrollback", NULL);
RNA_def_property_struct_type(prop, "ConsoleLine");
RNA_def_property_ui_text(prop, "Output", "Command output");
@@ -2497,95 +2531,95 @@ static void rna_def_fileselect_params(BlenderRNA *brna)
{FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_SORTSIZE, "Sort by size", "Sort files by size"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "FileSelectParams", NULL);
+ srna = RNA_def_struct(brna, "FileSelectParams", NULL);
RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters");
- prop= RNA_def_property(srna, "title", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "title", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "title");
RNA_def_property_ui_text(prop, "Title", "Title for the file browser");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "dir");
RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
+ prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
RNA_def_property_string_sdna(prop, NULL, "file");
RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "display");
RNA_def_property_enum_items(prop, file_display_items);
RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER);
RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FILE_HIDE_DOT);
RNA_def_property_ui_text(prop, "Show Hidden", "Show hidden dot files");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS , NULL);
- prop= RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "sort");
RNA_def_property_enum_items(prop, file_sort_items);
RNA_def_property_ui_text(prop, "Sort", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "use_filter_image", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_filter_image", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", IMAGEFILE);
RNA_def_property_ui_text(prop, "Filter Images", "Show image files");
RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "use_filter_blender", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_filter_blender", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", BLENDERFILE);
RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files");
RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "use_filter_movie", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_filter_movie", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", MOVIEFILE);
RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files");
RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "use_filter_script", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_filter_script", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", PYSCRIPTFILE);
RNA_def_property_ui_text(prop, "Filter Script", "Show script files");
RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "use_filter_font", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_filter_font", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", FTFONTFILE);
RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files");
RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "use_filter_sound", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_filter_sound", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", SOUNDFILE);
RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files");
RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "use_filter_text", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_filter_text", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", TEXTFILE);
RNA_def_property_ui_text(prop, "Filter Text", "Show text files");
RNA_def_property_ui_icon(prop, ICON_FILE_BLANK, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "use_filter_folder", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_filter_folder", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filter", FOLDERFILE);
RNA_def_property_ui_text(prop, "Filter Folder", "Show folders");
RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
- prop= RNA_def_property(srna, "filter_glob", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "filter_glob", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "filter_glob");
RNA_def_property_ui_text(prop, "Extension Filter", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
@@ -2597,21 +2631,21 @@ static void rna_def_space_filebrowser(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SpaceFileBrowser", "Space");
+ srna = RNA_def_struct(brna, "SpaceFileBrowser", "Space");
RNA_def_struct_sdna(srna, "SpaceFile");
RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space data");
- prop= RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "params");
RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser");
- prop= RNA_def_property(srna, "active_operator", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active_operator", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "op");
RNA_def_property_ui_text(prop, "Active Operator", "");
/* keep this for compatibility with existing presets,
- not exposed in c++ api because of keyword conflict */
- prop= RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE);
+ * not exposed in c++ api because of keyword conflict */
+ prop = RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "op");
RNA_def_property_ui_text(prop, "Active Operator", "");
}
@@ -2621,32 +2655,32 @@ static void rna_def_space_info(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SpaceInfo", "Space");
+ srna = RNA_def_struct(brna, "SpaceInfo", "Space");
RNA_def_struct_sdna(srna, "SpaceInfo");
RNA_def_struct_ui_text(srna, "Space Info", "Info space data");
/* reporting display */
- prop= RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_DEBUG);
RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
- prop= RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_INFO);
RNA_def_property_ui_text(prop, "Show Info", "Display general information");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
- prop= RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_OP);
RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
- prop= RNA_def_property(srna, "show_report_warning", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_report_warning", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_WARN);
RNA_def_property_ui_text(prop, "Show Warn", "Display warnings");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
- prop= RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_ERR);
RNA_def_property_ui_text(prop, "Show Error", "Display error text");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
@@ -2657,11 +2691,11 @@ static void rna_def_space_userpref(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SpaceUserPreferences", "Space");
+ srna = RNA_def_struct(brna, "SpaceUserPreferences", "Space");
RNA_def_struct_sdna(srna, "SpaceUserPref");
RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data");
- prop= RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "filter");
RNA_def_property_ui_text(prop, "Filter", "Search term for filtering in the UI");
@@ -2690,55 +2724,55 @@ static void rna_def_space_node(BlenderRNA *brna)
{SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SpaceNodeEditor", "Space");
+ srna = RNA_def_struct(brna, "SpaceNodeEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceNode");
RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data");
- prop= RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "treetype");
RNA_def_property_enum_items(prop, nodetree_type_items);
RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL);
- prop= RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texfrom");
RNA_def_property_enum_items(prop, texture_type_items);
RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL);
- prop= RNA_def_property(srna, "shader_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "shader_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "shaderfrom");
RNA_def_property_enum_items(prop, shader_type_items);
RNA_def_property_ui_text(prop, "Shader Type", "Type of data to take shader from");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL);
- prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "ID", "Datablock whose nodes are being edited");
- prop= RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "from");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "ID From", "Datablock from which the edited datablock is linked");
- prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_SpaceNodeEditor_node_tree_poll");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Node Tree", "Node tree being displayed and edited");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, "rna_SpaceNodeEditor_node_tree_update");
- prop= RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_BACKDRAW);
RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
- prop= RNA_def_property(srna, "use_auto_render", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_AUTO_RENDER);
RNA_def_property_ui_text(prop, "Auto Render", "Re-render and composite changed layers on 3D edits");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
- prop= RNA_def_property(srna, "backdrop_zoom", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "backdrop_zoom", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zoom");
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_range(prop, 0.01f, FLT_MAX);
@@ -2746,17 +2780,17 @@ static void rna_def_space_node(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Backdrop Zoom", "Backdrop zoom factor");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
- prop= RNA_def_property(srna, "backdrop_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "backdrop_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xof");
RNA_def_property_ui_text(prop, "Backdrop X", "Backdrop X offset");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
- prop= RNA_def_property(srna, "backdrop_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "backdrop_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yof");
RNA_def_property_ui_text(prop, "Backdrop Y", "Backdrop Y offset");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
- prop= RNA_def_property(srna, "backdrop_channels", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "backdrop_channels", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, backdrop_channels_items);
RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw");
@@ -2768,64 +2802,64 @@ static void rna_def_space_logic(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "SpaceLogicEditor", "Space");
+ srna = RNA_def_struct(brna, "SpaceLogicEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceLogic");
RNA_def_struct_ui_text(srna, "Space Logic Editor", "Logic editor space data");
/* sensors */
- prop= RNA_def_property(srna, "show_sensors_selected_objects", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_sensors_selected_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_SEL);
RNA_def_property_ui_text(prop, "Show Selected Object", "Show sensors of all selected objects");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "show_sensors_active_object", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_sensors_active_object", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_ACT);
RNA_def_property_ui_text(prop, "Show Active Object", "Show sensors of active object");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "show_sensors_linked_controller", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_sensors_linked_controller", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_LINK);
RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to the controller");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "show_sensors_active_states", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_sensors_active_states", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_STATE);
RNA_def_property_ui_text(prop, "Show Active States", "Show only sensors connected to active states");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* controllers */
- prop= RNA_def_property(srna, "show_controllers_selected_objects", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_controllers_selected_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_SEL);
RNA_def_property_ui_text(prop, "Show Selected Object", "Show controllers of all selected objects");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "show_controllers_active_object", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_controllers_active_object", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_ACT);
RNA_def_property_ui_text(prop, "Show Active Object", "Show controllers of active object");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "show_controllers_linked_controller", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_controllers_linked_controller", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_LINK);
RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to sensor/actuator");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* actuators */
- prop= RNA_def_property(srna, "show_actuators_selected_objects", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_actuators_selected_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_SEL);
RNA_def_property_ui_text(prop, "Show Selected Object", "Show actuators of all selected objects");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "show_actuators_active_object", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_actuators_active_object", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_ACT);
RNA_def_property_ui_text(prop, "Show Active Object", "Show actuators of active object");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "show_actuators_linked_controller", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_actuators_linked_controller", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_LINK);
RNA_def_property_ui_text(prop, "Show Linked to Actuator", "Show linked objects to the actuator");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "show_actuators_active_states", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_actuators_active_states", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_STATE);
RNA_def_property_ui_text(prop, "Show Active States", "Show only actuators connected to active states");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -2848,19 +2882,19 @@ static void rna_def_space_clip(BlenderRNA *brna)
{SC_VIEW_GRAPH, "GRAPH", ICON_IPO, "Graph", "Show graph view for active element"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SpaceClipEditor", "Space");
+ srna = RNA_def_struct(brna, "SpaceClipEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceClip");
RNA_def_struct_ui_text(srna, "Space Clip Editor", "Clip editor space data");
/* movieclip */
- prop= RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Movie Clip", "Movie clip displayed and edited in this space");
RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceClipEditor_clip_set", NULL, NULL);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* clip user */
- prop= RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MovieClipUser");
RNA_def_property_pointer_sdna(prop, NULL, "user");
@@ -2868,124 +2902,124 @@ static void rna_def_space_clip(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* mode */
- prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, mode_items);
RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, "rna_SpaceClipEditor_clip_mode_update");
/* view */
- prop= RNA_def_property(srna, "view", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "view", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "view");
RNA_def_property_enum_items(prop, view_items);
RNA_def_property_ui_text(prop, "View", "Type of the clip editor view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, "rna_SpaceClipEditor_view_type_update");
/* show pattern */
- prop= RNA_def_property(srna, "show_marker_pattern", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_marker_pattern", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Show Marker Pattern", "Show pattern boundbox for markers");
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_MARKER_PATTERN);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* show search */
- prop= RNA_def_property(srna, "show_marker_search", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_marker_search", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Show Marker Search", "Show search boundbox for markers");
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_MARKER_SEARCH);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* lock to selection */
- prop= RNA_def_property(srna, "lock_selection", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_selection", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Lock to Selection", "Lock viewport to selected markers during playback");
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_LOCK_SELECTION);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, "rna_SpaceClipEditor_lock_selection_update");
/* lock to time cursor */
- prop= RNA_def_property(srna, "lock_time_cursor", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock_time_cursor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Lock to Time Cursor", "Lock curves view to time cursor during playback and tracking");
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_LOCK_TIMECURSOR);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
- /* show markers pathes */
- prop= RNA_def_property(srna, "show_track_path", PROP_BOOLEAN, PROP_NONE);
+ /* show markers paths */
+ prop = RNA_def_property(srna, "show_track_path", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_TRACK_PATH);
RNA_def_property_ui_text(prop, "Show Track Path", "Show path of how track moves");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* path length */
- prop= RNA_def_property(srna, "path_length", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "path_length", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "path_length");
RNA_def_property_range(prop, 0, 50);
RNA_def_property_ui_text(prop, "Path Length", "Length of displaying path, in frames");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* show tiny markers */
- prop= RNA_def_property(srna, "show_tiny_markers", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_tiny_markers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Show Tiny Markers", "Show markers in a more compact manner");
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_TINY_MARKER);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* show bundles */
- prop= RNA_def_property(srna, "show_bundles", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_bundles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Show Bundles", "Show projection of 3D markers into footage");
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_BUNDLES);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* mute footage */
- prop= RNA_def_property(srna, "use_mute_footage", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mute_footage", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Mute Footage", "Mute footage and show black background instead");
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_MUTE_FOOTAGE);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* hide disabled */
- prop= RNA_def_property(srna, "show_disabled", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_disabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Show Disabled", "Show disabled tracks from the footage");
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SC_HIDE_DISABLED);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* scopes */
- prop= RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "scopes");
RNA_def_property_struct_type(prop, "MovieClipScopes");
RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize movie clip statistics");
/* show names */
- prop= RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_NAMES);
RNA_def_property_ui_text(prop, "Show Names", "Show track names and status");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* show grid */
- prop= RNA_def_property(srna, "show_grid", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_grid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GRID);
RNA_def_property_ui_text(prop, "Show Grid", "Show grid showing lens distortion");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* show stable */
- prop= RNA_def_property(srna, "show_stable", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_stable", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_STABLE);
RNA_def_property_ui_text(prop, "Show Stable", "Show stable footage in editor (if stabilization is enabled)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* manual calibration */
- prop= RNA_def_property(srna, "use_manual_calibration", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_manual_calibration", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_MANUAL_CALIBRATION);
RNA_def_property_ui_text(prop, "Manual Calibration", "Use manual calibration helpers");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* show filters */
- prop= RNA_def_property(srna, "show_filters", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_filters", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_FILTERS);
RNA_def_property_ui_text(prop, "Show Filters", "Show filters for graph editor");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* show graph_frames */
- prop= RNA_def_property(srna, "show_graph_frames", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_graph_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GRAPH_FRAMES);
RNA_def_property_ui_text(prop, "Show Frames", "Show curve for per-frame average error (camera motion should be solved first)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* show graph_tracks */
- prop= RNA_def_property(srna, "show_graph_tracks", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_graph_tracks", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GRAPH_TRACKS);
RNA_def_property_ui_text(prop, "Show Tracks", "Display the speed curves (in \"x\" direction red, in \"y\" direction green) for the selected tracks");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
@@ -2993,25 +3027,25 @@ static void rna_def_space_clip(BlenderRNA *brna)
/* ** channels ** */
/* show_red_channel */
- prop= RNA_def_property(srna, "show_red_channel", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_red_channel", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "postproc_flag", MOVIECLIP_DISABLE_RED);
RNA_def_property_ui_text(prop, "Show Red Channel", "Show red channel in the frame");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* show_green_channel */
- prop= RNA_def_property(srna, "show_green_channel", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_green_channel", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "postproc_flag", MOVIECLIP_DISABLE_GREEN);
RNA_def_property_ui_text(prop, "Show Green Channel", "Show green channel in the frame");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* show_blue_channel */
- prop= RNA_def_property(srna, "show_blue_channel", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_blue_channel", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "postproc_flag", MOVIECLIP_DISABLE_BLUE);
RNA_def_property_ui_text(prop, "Show Blue Channel", "Show blue channel in the frame");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
/* preview_grayscale */
- prop= RNA_def_property(srna, "use_grayscale_preview", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_grayscale_preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "postproc_flag", MOVIECLIP_PREVIEW_GRAYSCALE);
RNA_def_property_ui_text(prop, "Grayscale", "Display frame in grayscale mode");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
diff --git a/source/blender/makesrna/intern/rna_speaker.c b/source/blender/makesrna/intern/rna_speaker.c
index cb2b1fe4c60..1e3c8df9273 100644
--- a/source/blender/makesrna/intern/rna_speaker.c
+++ b/source/blender/makesrna/intern/rna_speaker.c
@@ -53,112 +53,113 @@ static void rna_def_speaker(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Speaker", "ID");
+ srna = RNA_def_struct(brna, "Speaker", "ID");
RNA_def_struct_ui_text(srna, "Speaker", "Speaker datablock for 3D audio speaker objects");
RNA_def_struct_ui_icon(srna, ICON_SPEAKER);
- prop= RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_MUTED);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Mute", "Mute the speaker");
- // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+ /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
- /* This shouldn't be changed actually, hiding it!
- prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
+#if 0 /* This shouldn't be changed actually, hiding it! */
+ prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_RELATIVE);
RNA_def_property_ui_text(prop, "Relative", "Whether the source is relative to the camera or not");
- // RNA_def_property_update(prop, 0, "rna_Speaker_update");*/
+ /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
+#endif
- prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "sound");
RNA_def_property_struct_type(prop, "Sound");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this speaker");
- // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_sound_set", NULL);
- // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+ /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_sound_set", NULL); */
+ /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
- prop= RNA_def_property(srna, "volume_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "volume_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "volume_max");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Maximum Volume", "Maximum volume, no matter how near the object is");
- // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_max_set", NULL);
- // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+ /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_max_set", NULL); */
+ /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
- prop= RNA_def_property(srna, "volume_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "volume_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "volume_min");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Minimum Volume", "Minimum volume, no matter how far away the object is");
- // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_min_set", NULL);
- // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+ /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_min_set", NULL); */
+ /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
- prop= RNA_def_property(srna, "distance_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "distance_max");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Maximum Distance",
"Maximum distance for volume calculation, no matter how far away the object is");
- // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_max_set", NULL);
- // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+ /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_max_set", NULL); */
+ /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
- prop= RNA_def_property(srna, "distance_reference", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance_reference", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "distance_reference");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Reference Distance", "Reference distance at which volume is 100 %");
- // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_reference_set", NULL);
- // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+ /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_reference_set", NULL); */
+ /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
- prop= RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "attenuation");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Attenuation", "How strong the distance affects volume, depending on distance model");
- // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_attenuation_set", NULL);
- // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+ /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_attenuation_set", NULL); */
+ /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
- prop= RNA_def_property(srna, "cone_angle_outer", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "cone_angle_outer", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cone_angle_outer");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 360.0f);
RNA_def_property_ui_text(prop, "Outer Cone Angle",
"Angle of the outer cone, in degrees, outside this cone the volume is "
"the outer cone volume, between inner and outer cone the volume is interpolated");
- // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_outer_set", NULL);
- // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+ /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_outer_set", NULL); */
+ /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
- prop= RNA_def_property(srna, "cone_angle_inner", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "cone_angle_inner", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cone_angle_inner");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 360.0f);
RNA_def_property_ui_text(prop, "Inner Cone Angle",
"Angle of the inner cone, in degrees, inside the cone the volume is 100 %");
- // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_inner_set", NULL);
- // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+ /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_inner_set", NULL); */
+ /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
- prop= RNA_def_property(srna, "cone_volume_outer", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "cone_volume_outer", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cone_volume_outer");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Outer Cone Volume", "Volume outside the outer cone");
- // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_volume_outer_set", NULL);
- // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+ /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_volume_outer_set", NULL); */
+ /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
- prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "volume");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Volume", "How loud the sound is");
- // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_set", NULL);
- // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+ /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_set", NULL); */
+ /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
- prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pitch");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound");
- // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_pitch_set", NULL);
- // RNA_def_property_update(prop, 0, "rna_Speaker_update");
+ /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_pitch_set", NULL); */
+ /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
/* common */
rna_def_animdata_common(srna);
diff --git a/source/blender/makesrna/intern/rna_test.c b/source/blender/makesrna/intern/rna_test.c
index c0f5e0735a6..175aa0046ae 100644
--- a/source/blender/makesrna/intern/rna_test.c
+++ b/source/blender/makesrna/intern/rna_test.c
@@ -50,10 +50,10 @@
#define DEF_VARS(type, prefix) \
static type prefix ## arr[ARRAY_SIZE]; \
static type prefix ## darr[DYNAMIC_ARRAY_SIZE]; \
- static int prefix ## darr_len= ARRAY_SIZE; \
+ static int prefix ## darr_len = ARRAY_SIZE; \
static type prefix ## marr MARRAY_DIM; \
static type prefix ## dmarr DYNAMIC_MARRAY_DIM; \
- static int prefix ## dmarr_len= sizeof(prefix ## dmarr);
+ static int prefix ## dmarr_len = sizeof(prefix ## dmarr);
#define DEF_GET_SET(type, arr) \
void rna_Test_ ## arr ## _get(PointerRNA *ptr, type *values) \
@@ -77,7 +77,7 @@
if (length > max) \
return 0; \
\
- arr ## _len= length; \
+ arr ## _len = length; \
\
return 1; \
} \
@@ -117,66 +117,66 @@ void RNA_def_test(BlenderRNA *brna)
#ifdef UNIT_TEST
StructRNA *srna;
PropertyRNA *prop;
- unsigned short dimsize[]= {MARRAY_DIMSIZE};
+ unsigned short dimsize[] = {MARRAY_DIMSIZE};
- srna= RNA_def_struct(brna, "Test", NULL);
+ srna = RNA_def_struct(brna, "Test", NULL);
RNA_def_struct_sdna(srna, "Test");
- prop= RNA_def_float_array(srna, "farr", ARRAY_SIZE, NULL, 0.0f, 0.0f, "farr", "float array", 0.0f, 0.0f);
+ prop = RNA_def_float_array(srna, "farr", ARRAY_SIZE, NULL, 0.0f, 0.0f, "farr", "float array", 0.0f, 0.0f);
RNA_def_property_float_funcs(prop, "rna_Test_farr_get", "rna_Test_farr_set", NULL);
- prop= RNA_def_int_array(srna, "iarr", ARRAY_SIZE, NULL, 0, 0, "iarr", "int array", 0, 0);
+ prop = RNA_def_int_array(srna, "iarr", ARRAY_SIZE, NULL, 0, 0, "iarr", "int array", 0, 0);
RNA_def_property_int_funcs(prop, "rna_Test_iarr_get", "rna_Test_iarr_set", NULL);
- prop= RNA_def_boolean_array(srna, "barr", ARRAY_SIZE, NULL, "barr", "boolean array");
+ prop = RNA_def_boolean_array(srna, "barr", ARRAY_SIZE, NULL, "barr", "boolean array");
RNA_def_property_boolean_funcs(prop, "rna_Test_barr_get", "rna_Test_barr_set");
/* dynamic arrays */
- prop= RNA_def_float_array(srna, "fdarr", DYNAMIC_ARRAY_SIZE, NULL, 0.0f, 0.0f, "fdarr", "dynamic float array", 0.0f, 0.0f);
+ prop = RNA_def_float_array(srna, "fdarr", DYNAMIC_ARRAY_SIZE, NULL, 0.0f, 0.0f, "fdarr", "dynamic float array", 0.0f, 0.0f);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_Test_fdarr_get_length", "rna_Test_fdarr_set_length");
RNA_def_property_float_funcs(prop, "rna_Test_fdarr_get", "rna_Test_fdarr_set", NULL);
- prop= RNA_def_int_array(srna, "idarr", DYNAMIC_ARRAY_SIZE, NULL, 0, 0, "idarr", "int array", 0, 0);
+ prop = RNA_def_int_array(srna, "idarr", DYNAMIC_ARRAY_SIZE, NULL, 0, 0, "idarr", "int array", 0, 0);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_Test_idarr_get_length", "rna_Test_idarr_set_length");
RNA_def_property_int_funcs(prop, "rna_Test_idarr_get", "rna_Test_idarr_set", NULL);
- prop= RNA_def_boolean_array(srna, "bdarr", DYNAMIC_ARRAY_SIZE, NULL, "bdarr", "boolean array");
+ prop = RNA_def_boolean_array(srna, "bdarr", DYNAMIC_ARRAY_SIZE, NULL, "bdarr", "boolean array");
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_Test_bdarr_get_length", "rna_Test_bdarr_set_length");
RNA_def_property_boolean_funcs(prop, "rna_Test_bdarr_get", "rna_Test_bdarr_set");
/* multidimensional arrays */
- prop= RNA_def_property(srna, "fmarr", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "fmarr", PROP_FLOAT, PROP_NONE);
RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(float), MARRAY_TOTDIM, dimsize);
RNA_def_property_float_funcs(prop, "rna_Test_fmarr_get", "rna_Test_fmarr_set", NULL);
- prop= RNA_def_property(srna, "imarr", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "imarr", PROP_INT, PROP_NONE);
RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize);
RNA_def_property_int_funcs(prop, "rna_Test_imarr_get", "rna_Test_imarr_set", NULL);
- prop= RNA_def_property(srna, "bmarr", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "bmarr", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize);
RNA_def_property_boolean_funcs(prop, "rna_Test_bmarr_get", "rna_Test_bmarr_set");
/* dynamic multidimensional arrays */
- prop= RNA_def_property(srna, "fdmarr", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "fdmarr", PROP_FLOAT, PROP_NONE);
RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(float), MARRAY_TOTDIM, dimsize);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_Test_fdmarr_get_length", "rna_Test_fdmarr_set_length");
RNA_def_property_float_funcs(prop, "rna_Test_fdmarr_get", "rna_Test_fdmarr_set", NULL);
- prop= RNA_def_property(srna, "idmarr", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "idmarr", PROP_INT, PROP_NONE);
RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_Test_idmarr_get_length", "rna_Test_idmarr_set_length");
RNA_def_property_int_funcs(prop, "rna_Test_idmarr_get", "rna_Test_idmarr_set", NULL);
- prop= RNA_def_property(srna, "bdmarr", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "bdmarr", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_Test_bdmarr_get_length", "rna_Test_bdmarr_set_length");
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index 9e3611b4cc5..267c8124611 100644
--- a/source/blender/makesrna/intern/rna_text.c
+++ b/source/blender/makesrna/intern/rna_text.c
@@ -46,70 +46,70 @@ int text_file_modified(Text *text); /* XXX bad level call */
static void rna_Text_filename_get(PointerRNA *ptr, char *value)
{
- Text *text= (Text*)ptr->data;
+ Text *text = (Text*)ptr->data;
- if(text->name)
+ if (text->name)
strcpy(value, text->name);
else
- value[0]= '\0';
+ value[0] = '\0';
}
static int rna_Text_filename_length(PointerRNA *ptr)
{
- Text *text= (Text*)ptr->data;
+ Text *text = (Text*)ptr->data;
return (text->name)? strlen(text->name): 0;
}
static void rna_Text_filename_set(PointerRNA *ptr, const char *value)
{
- Text *text= (Text*)ptr->data;
+ Text *text = (Text*)ptr->data;
- if(text->name)
+ if (text->name)
MEM_freeN(text->name);
- if(value[0])
- text->name= BLI_strdup(value);
+ if (value[0])
+ text->name = BLI_strdup(value);
else
- text->name= NULL;
+ text->name = NULL;
}
static int rna_Text_modified_get(PointerRNA *ptr)
{
- Text *text= (Text*)ptr->data;
+ Text *text = (Text*)ptr->data;
return text_file_modified(text);
}
static void rna_TextLine_body_get(PointerRNA *ptr, char *value)
{
- TextLine *line= (TextLine*)ptr->data;
+ TextLine *line = (TextLine*)ptr->data;
- if(line->line)
+ if (line->line)
strcpy(value, line->line);
else
- value[0]= '\0';
+ value[0] = '\0';
}
static int rna_TextLine_body_length(PointerRNA *ptr)
{
- TextLine *line= (TextLine*)ptr->data;
+ TextLine *line = (TextLine*)ptr->data;
return line->len;
}
static void rna_TextLine_body_set(PointerRNA *ptr, const char *value)
{
- TextLine *line= (TextLine*)ptr->data;
- int len= strlen(value);
+ TextLine *line = (TextLine*)ptr->data;
+ int len = strlen(value);
- if(line->line)
+ if (line->line)
MEM_freeN(line->line);
- line->line= MEM_mallocN((len + 1) * sizeof(char), "rna_text_body");
- line->len= len;
+ line->line = MEM_mallocN((len + 1) * sizeof(char), "rna_text_body");
+ line->len = len;
memcpy(line->line, value, len + 1);
- if(line->format) {
+ if (line->format) {
MEM_freeN(line->format);
- line->format= NULL;
+ line->format = NULL;
}
}
@@ -123,7 +123,7 @@ static void rna_def_text_line(BlenderRNA *brna)
srna = RNA_def_struct(brna, "TextLine", NULL);
RNA_def_struct_ui_text(srna, "Text Line", "Line of text in a Text datablock");
- prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_TextLine_body_get", "rna_TextLine_body_length", "rna_TextLine_body_set");
RNA_def_property_ui_text(prop, "Line", "Text in the line");
RNA_def_property_update(prop, NC_TEXT|NA_EDITED, NULL);
@@ -137,37 +137,37 @@ static void rna_def_text_marker(BlenderRNA *brna)
srna = RNA_def_struct(brna, "TextMarker", NULL);
RNA_def_struct_ui_text(srna, "Text Marker", "Marker highlighting a portion of text in a Text datablock");
- prop= RNA_def_property(srna, "line", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "line", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "lineno");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Line", "Line in which the marker is located");
- prop= RNA_def_property(srna, "character_index_start", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "character_index_start", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "start");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Start", "Start position of the marker in the line");
- prop= RNA_def_property(srna, "character_index_end", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "character_index_end", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "end");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "End", "Start position of the marker in the line");
- prop= RNA_def_property(srna, "group", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "group", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_range(prop, 0, (int)0xFFFF);
RNA_def_property_ui_text(prop, "Group", "");
- prop= RNA_def_property(srna, "is_temporary", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_temporary", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TMARK_TEMP);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Temporary", "Marker is temporary");
- prop= RNA_def_property(srna, "use_edit_all", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_edit_all", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TMARK_EDITALL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Edit All", "Edit all markers of the same group as one");
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Color", "Color to display the marker with");
}
@@ -182,62 +182,62 @@ static void rna_def_text(BlenderRNA *brna)
RNA_def_struct_ui_icon(srna, ICON_TEXT);
RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_Text_filename_get", "rna_Text_filename_length", "rna_Text_filename_set");
RNA_def_property_ui_text(prop, "File Path", "Filename of the text file");
- prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISDIRTY);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Dirty", "Text file has been edited since last save");
- prop= RNA_def_property(srna, "is_modified", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_modified", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Text_modified_get", NULL);
RNA_def_property_ui_text(prop, "Modified", "Text file on disk is different than the one in memory");
- prop= RNA_def_property(srna, "is_in_memory", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_in_memory", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISMEM);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Memory", "Text file is in memory, without a corresponding file on disk");
- prop= RNA_def_property(srna, "use_module", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_module", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISSCRIPT);
RNA_def_property_ui_text(prop, "Register", "Register this text as a module on loading, Text name must end with \".py\"");
- prop= RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_TABSTOSPACES);
RNA_def_property_ui_text(prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces");
- prop= RNA_def_property(srna, "lines", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "lines", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "TextLine");
RNA_def_property_ui_text(prop, "Lines", "Lines of text");
- prop= RNA_def_property(srna, "current_line", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "current_line", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "curl");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "TextLine");
RNA_def_property_ui_text(prop, "Current Line", "Current line, and start line of selection if one exists");
- prop= RNA_def_property(srna, "current_character", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "current_character", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "curc");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Current Character", "Index of current character in current line, and also start index of character in selection if one exists");
- prop= RNA_def_property(srna, "select_end_line", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "select_end_line", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "sell");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "TextLine");
RNA_def_property_ui_text(prop, "Selection End Line", "End line of selection");
- prop= RNA_def_property(srna, "select_end_character", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "select_end_character", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "selc");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Selection End Character", "Index of character after end of selection in the selection end line");
- prop= RNA_def_property(srna, "markers", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "markers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "TextMarker");
RNA_def_property_ui_text(prop, "Markers", "Text markers highlighting part of the text");
diff --git a/source/blender/makesrna/intern/rna_text_api.c b/source/blender/makesrna/intern/rna_text_api.c
index acfcad80f19..3f511858332 100644
--- a/source/blender/makesrna/intern/rna_text_api.c
+++ b/source/blender/makesrna/intern/rna_text_api.c
@@ -54,12 +54,12 @@ void RNA_api_text(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *prop;
- func= RNA_def_function(srna, "clear", "rna_Text_clear");
+ func = RNA_def_function(srna, "clear", "rna_Text_clear");
RNA_def_function_ui_description(func, "clear the text block");
- func= RNA_def_function(srna, "write", "rna_Text_write");
+ func = RNA_def_function(srna, "write", "rna_Text_write");
RNA_def_function_ui_description(func, "write text at the cursor location and advance to the end of the text block");
- prop= RNA_def_string(func, "text", "Text", 0, "", "New text for this datablock");
+ prop = RNA_def_string(func, "text", "Text", 0, "", "New text for this datablock");
RNA_def_property_flag(prop, PROP_REQUIRED);
}
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index ba8460e5477..bfe23e97dd9 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -67,7 +67,7 @@ EnumPropertyItem texture_type_items[] = {
{TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", "Procedural - highly flexible fractal noise texture"},
{TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise",
"Procedural - random noise, gives a different result every time, for every frame, for every pixel"},
- //{TEX_PLUGIN, "PLUGIN", ICON_PLUGIN, "Plugin", ""}, /* Nothing yet */
+ /*{TEX_PLUGIN, "PLUGIN", ICON_PLUGIN, "Plugin", ""}, *//* Nothing yet */
{TEX_POINTDENSITY, "POINT_DENSITY", ICON_TEXTURE, "Point Density", ""},
{TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", "Procedural - create a fractal noise texture"},
{TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - create cell-like patterns based on Worley noise"},
@@ -113,9 +113,9 @@ EnumPropertyItem blend_type_items[] = {
static StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
{
- Tex *tex= (Tex*)ptr->data;
+ Tex *tex = (Tex*)ptr->data;
- switch(tex->type) {
+ switch (tex->type) {
case TEX_BLEND:
return &RNA_BlendTexture;
case TEX_CLOUDS:
@@ -155,17 +155,17 @@ static StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
static void rna_Texture_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
- if(GS(id->name) == ID_TE) {
- Tex *tex= ptr->id.data;
+ if (GS(id->name) == ID_TE) {
+ Tex *tex = ptr->id.data;
DAG_id_tag_update(&tex->id, 0);
WM_main_add_notifier(NC_TEXTURE, tex);
WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, NULL);
}
- else if(GS(id->name) == ID_NT) {
- bNodeTree *ntree= ptr->id.data;
+ else if (GS(id->name) == ID_NT) {
+ bNodeTree *ntree = ptr->id.data;
ED_node_generic_update(bmain, ntree, NULL);
}
}
@@ -184,7 +184,7 @@ static void rna_Color_mapping_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Texture_voxeldata_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Tex *tex= ptr->id.data;
+ Tex *tex = ptr->id.data;
tex->vd->ok = 0;
rna_Texture_update(bmain, scene, ptr);
@@ -192,9 +192,9 @@ static void rna_Texture_voxeldata_update(Main *bmain, Scene *scene, PointerRNA *
static void rna_Texture_voxeldata_image_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Tex *tex= ptr->id.data;
+ Tex *tex = ptr->id.data;
- if(tex->ima) { /* may be getting cleared too */
+ if (tex->ima) { /* may be getting cleared too */
tex->ima->source = IMA_SRC_SEQUENCE;
}
rna_Texture_voxeldata_update(bmain, scene, ptr);
@@ -204,7 +204,7 @@ static void rna_Texture_voxeldata_image_update(Main *bmain, Scene *scene, Pointe
/* Used for Texture Properties, used (also) for/in Nodes */
static void rna_Texture_nodes_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Tex *tex= ptr->id.data;
+ Tex *tex = ptr->id.data;
DAG_id_tag_update(&tex->id, 0);
WM_main_add_notifier(NC_TEXTURE|ND_NODES, tex);
@@ -212,18 +212,18 @@ static void rna_Texture_nodes_update(Main *UNUSED(bmain), Scene *UNUSED(scene),
static void rna_Texture_type_set(PointerRNA *ptr, int value)
{
- Tex *tex= (Tex*)ptr->data;
+ Tex *tex = (Tex*)ptr->data;
tex_set_type(tex, value);
}
void rna_TextureSlot_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- ID *id= ptr->id.data;
+ ID *id = ptr->id.data;
DAG_id_tag_update(id, 0);
- switch(GS(id->name)) {
+ switch (GS(id->name)) {
case ID_MA:
WM_main_add_notifier(NC_MATERIAL|ND_SHADING, id);
WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, id);
@@ -239,12 +239,12 @@ void rna_TextureSlot_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN
break;
case ID_PA:
{
- MTex *mtex= ptr->data;
+ MTex *mtex = ptr->data;
int recalc = OB_RECALC_DATA;
- if(mtex->mapto & PAMAP_INIT)
+ if (mtex->mapto & PAMAP_INIT)
recalc |= PSYS_RECALC_RESET;
- if(mtex->mapto & PAMAP_CHILD)
+ if (mtex->mapto & PAMAP_CHILD)
recalc |= PSYS_RECALC_CHILD;
DAG_id_tag_update(id, recalc);
@@ -256,7 +256,7 @@ void rna_TextureSlot_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN
char *rna_TextureSlot_path(PointerRNA *ptr)
{
- MTex *mtex= ptr->data;
+ MTex *mtex = ptr->data;
/* if there is ID-data, resolve the path using the index instead of by name,
* since the name used is the name of the texture assigned, but the texture
@@ -268,11 +268,11 @@ char *rna_TextureSlot_path(PointerRNA *ptr)
/* find the 'textures' property of the ID-struct */
RNA_id_pointer_create(ptr->id.data, &id_ptr);
- prop= RNA_struct_find_property(&id_ptr, "texture_slots");
+ prop = RNA_struct_find_property(&id_ptr, "texture_slots");
/* get an iterator for this property, and try to find the relevant index */
if (prop) {
- int index= RNA_property_collection_lookup_index(&id_ptr, prop, ptr);
+ int index = RNA_property_collection_lookup_index(&id_ptr, prop, ptr);
if (index >= 0)
return BLI_sprintfN("texture_slots[%d]", index);
@@ -288,9 +288,9 @@ char *rna_TextureSlot_path(PointerRNA *ptr)
static int rna_TextureSlot_name_length(PointerRNA *ptr)
{
- MTex *mtex= ptr->data;
+ MTex *mtex = ptr->data;
- if(mtex->tex)
+ if (mtex->tex)
return strlen(mtex->tex->id.name+2);
return 0;
@@ -298,49 +298,49 @@ static int rna_TextureSlot_name_length(PointerRNA *ptr)
static void rna_TextureSlot_name_get(PointerRNA *ptr, char *str)
{
- MTex *mtex= ptr->data;
+ MTex *mtex = ptr->data;
- if(mtex->tex)
+ if (mtex->tex)
strcpy(str, mtex->tex->id.name+2);
else
- str[0]= '\0';
+ str[0] = '\0';
}
static int rna_TextureSlot_output_node_get(PointerRNA *ptr)
{
- MTex *mtex= ptr->data;
- Tex *tex= mtex->tex;
- int cur= mtex->which_output;
+ MTex *mtex = ptr->data;
+ Tex *tex = mtex->tex;
+ int cur = mtex->which_output;
- if(tex) {
- bNodeTree *ntree= tex->nodetree;
+ if (tex) {
+ bNodeTree *ntree = tex->nodetree;
bNode *node;
- if(ntree) {
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type == TEX_NODE_OUTPUT) {
- if(cur == node->custom1)
+ if (ntree) {
+ for (node = ntree->nodes.first; node; node = node->next) {
+ if (node->type == TEX_NODE_OUTPUT) {
+ if (cur == node->custom1)
return cur;
}
}
}
}
- mtex->which_output= 0;
+ mtex->which_output = 0;
return 0;
}
static EnumPropertyItem *rna_TextureSlot_output_node_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{
- MTex *mtex= ptr->data;
- Tex *tex= mtex->tex;
- EnumPropertyItem *item= NULL;
- int totitem= 0;
-
- if(tex) {
- bNodeTree *ntree= tex->nodetree;
- if(ntree) {
- EnumPropertyItem tmp= {0, "", 0, "", ""};
+ MTex *mtex = ptr->data;
+ Tex *tex = mtex->tex;
+ EnumPropertyItem *item = NULL;
+ int totitem = 0;
+
+ if (tex) {
+ bNodeTree *ntree = tex->nodetree;
+ if (ntree) {
+ EnumPropertyItem tmp = {0, "", 0, "", ""};
bNode *node;
tmp.value = 0;
@@ -348,10 +348,10 @@ static EnumPropertyItem *rna_TextureSlot_output_node_itemf(bContext *C, PointerR
tmp.identifier = "NOT_SPECIFIED";
RNA_enum_item_add(&item, &totitem, &tmp);
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type == TEX_NODE_OUTPUT) {
- tmp.value= node->custom1;
- tmp.name= ((TexNodeOutput*)node->storage)->name;
+ for (node = ntree->nodes.first; node; node = node->next) {
+ if (node->type == TEX_NODE_OUTPUT) {
+ tmp.value = node->custom1;
+ tmp.name = ((TexNodeOutput*)node->storage)->name;
tmp.identifier = tmp.name;
RNA_enum_item_add(&item, &totitem, &tmp);
}
@@ -367,37 +367,37 @@ static EnumPropertyItem *rna_TextureSlot_output_node_itemf(bContext *C, PointerR
static void rna_Texture_use_color_ramp_set(PointerRNA *ptr, int value)
{
- Tex *tex= (Tex*)ptr->data;
+ Tex *tex = (Tex*)ptr->data;
- if(value) tex->flag |= TEX_COLORBAND;
+ if (value) tex->flag |= TEX_COLORBAND;
else tex->flag &= ~TEX_COLORBAND;
- if((tex->flag & TEX_COLORBAND) && tex->coba == NULL)
- tex->coba= add_colorband(0);
+ if ((tex->flag & TEX_COLORBAND) && tex->coba == NULL)
+ tex->coba = add_colorband(0);
}
static void rna_Texture_use_nodes_set(PointerRNA *ptr, int v)
{
- Tex *tex= (Tex*)ptr->data;
+ Tex *tex = (Tex*)ptr->data;
tex->use_nodes = v;
tex->type = 0;
- if(v && tex->nodetree==NULL)
+ if (v && tex->nodetree == NULL)
ED_node_texture_default(tex);
}
static void rna_ImageTexture_mipmap_set(PointerRNA *ptr, int value)
{
- Tex *tex= (Tex*)ptr->data;
+ Tex *tex = (Tex*)ptr->data;
- if(value) tex->imaflag |= TEX_MIPMAP;
+ if (value) tex->imaflag |= TEX_MIPMAP;
else tex->imaflag &= ~TEX_MIPMAP;
}
static void rna_Envmap_source_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Tex *tex= ptr->id.data;
+ Tex *tex = ptr->id.data;
if (tex->env)
BKE_free_envmapdata(tex->env);
@@ -407,13 +407,13 @@ static void rna_Envmap_source_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static PointerRNA rna_PointDensity_psys_get(PointerRNA *ptr)
{
- PointDensity *pd= ptr->data;
- Object *ob= pd->object;
- ParticleSystem *psys= NULL;
+ PointDensity *pd = ptr->data;
+ Object *ob = pd->object;
+ ParticleSystem *psys = NULL;
PointerRNA value;
- if(ob && pd->psys)
- psys= BLI_findlink(&ob->particlesystem, pd->psys-1);
+ if (ob && pd->psys)
+ psys = BLI_findlink(&ob->particlesystem, pd->psys-1);
RNA_pointer_create(&ob->id, &RNA_ParticleSystem, psys, &value);
return value;
@@ -421,11 +421,11 @@ static PointerRNA rna_PointDensity_psys_get(PointerRNA *ptr)
static void rna_PointDensity_psys_set(PointerRNA *ptr, PointerRNA value)
{
- PointDensity *pd= ptr->data;
- Object *ob= pd->object;
+ PointDensity *pd = ptr->data;
+ Object *ob = pd->object;
- if(ob && value.id.data == ob)
- pd->psys= BLI_findindex(&ob->particlesystem, value.data) + 1;
+ if (ob && value.id.data == ob)
+ pd->psys = BLI_findindex(&ob->particlesystem, value.data) + 1;
}
static char *rna_PointDensity_path(PointerRNA *UNUSED(ptr))
@@ -464,63 +464,63 @@ static void rna_def_texmapping(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "TexMapping", NULL);
+ srna = RNA_def_struct(brna, "TexMapping", NULL);
RNA_def_struct_ui_text(srna, "Texture Mapping", "Texture coordinate mapping settings");
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); /* Not PROP_XYZ, this is now in radians, no more degrees */
+ prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); /* Not PROP_XYZ, this is now in radians, no more degrees */
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Rotation", "");
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
- prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Scale", "");
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
- prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping");
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
- prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping");
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
- prop= RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN);
RNA_def_property_ui_text(prop, "Has Minimum", "Whether to use minimum clipping value");
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
- prop= RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX);
RNA_def_property_ui_text(prop, "Has Maximum", "Whether to use maximum clipping value");
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
- prop= RNA_def_property(srna, "mapping_x", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping_x", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projx");
RNA_def_property_enum_items(prop, prop_xyz_mapping_items);
RNA_def_property_ui_text(prop, "X Mapping", "");
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
- prop= RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projy");
RNA_def_property_enum_items(prop, prop_xyz_mapping_items);
RNA_def_property_ui_text(prop, "Y Mapping", "");
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
- prop= RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projz");
RNA_def_property_enum_items(prop, prop_xyz_mapping_items);
RNA_def_property_ui_text(prop, "Z Mapping", "");
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
- prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_mapping_items);
RNA_def_property_ui_text(prop, "Mapping", "");
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
@@ -531,47 +531,47 @@ static void rna_def_colormapping(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ColorMapping", NULL);
+ srna = RNA_def_struct(brna, "ColorMapping", NULL);
RNA_def_struct_ui_text(srna, "Color Mapping", "Color mapping settings");
- prop= RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", COLORMAP_USE_RAMP);
RNA_def_property_ui_text(prop, "Use Color Ramp", "Toggle color ramp operations");
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
- prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
+ prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Color Ramp", "");
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
- prop= RNA_def_property(srna, "brightness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bright");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Brightness", "Adjust the brightness of the texture");
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
- prop= RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 5);
RNA_def_property_ui_text(prop, "Contrast", "Adjust the contrast of the texture");
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
- prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Saturation", "Adjust the saturation of colors in the texture");
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
- prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, blend_type_items);
RNA_def_property_ui_text(prop, "Blend Type", "Mode used to mix with texture output color");
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
- prop= RNA_def_property(srna, "blend_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "blend_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "Blend color to mix with texture output color");
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
- prop= RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Blend Factor", "");
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
}
@@ -585,20 +585,20 @@ static void rna_def_mtex(BlenderRNA *brna)
{0, "DUMMY", 0, "Dummy", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "TextureSlot", NULL);
+ srna = RNA_def_struct(brna, "TextureSlot", NULL);
RNA_def_struct_sdna(srna, "MTex");
RNA_def_struct_ui_text(srna, "Texture Slot", "Texture slot defining the mapping and influence of a texture");
RNA_def_struct_path_func(srna, "rna_TextureSlot_path");
RNA_def_struct_ui_icon(srna, ICON_TEXTURE_DATA);
- prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tex");
RNA_def_property_struct_type(prop, "Texture");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture", "Texture datablock used by this texture slot");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_TextureSlot_name_get", "rna_TextureSlot_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "Texture slot name");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -606,53 +606,53 @@ static void rna_def_mtex(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
/* mapping */
- prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "ofs");
RNA_def_property_ui_range(prop, -10, 10, 10, 2);
RNA_def_property_ui_text(prop, "Offset", "Fine tune of the texture mapping X, Y and Z locations");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
- prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_range(prop, -100, 100, 10, 2);
RNA_def_property_ui_text(prop, "Size", "Set scaling for the texture's X, Y and Z sizes");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color",
"Default color for textures that don't return RGB or when RGB to intensity is enabled");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
- prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blendtype");
RNA_def_property_enum_items(prop, blend_type_items);
RNA_def_property_ui_text(prop, "Blend Type", "Mode used to apply the texture");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
- prop= RNA_def_property(srna, "use_stencil", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stencil", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_STENCIL);
RNA_def_property_ui_text(prop, "Stencil", "Use this texture as a blending value on the next texture");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
- prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_NEGATIVE);
RNA_def_property_ui_text(prop, "Negate", "Invert the values of the texture to reverse its effect");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
- prop= RNA_def_property(srna, "use_rgb_to_intensity", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_rgb_to_intensity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_RGBTOINT);
RNA_def_property_ui_text(prop, "RGB to Intensity", "Convert texture RGB values to intensity (gray) values");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
- prop= RNA_def_property(srna, "default_value", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "default_value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "def_var");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Default Value", "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
- prop= RNA_def_property(srna, "output_node", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "output_node", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "which_output");
RNA_def_property_enum_items(prop, output_node_items);
RNA_def_property_enum_funcs(prop, "rna_TextureSlot_output_node_get", NULL, "rna_TextureSlot_output_node_itemf");
@@ -664,43 +664,43 @@ static void rna_def_filter_common(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "use_mipmap", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mipmap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_MIPMAP);
RNA_def_property_boolean_funcs(prop, NULL, "rna_ImageTexture_mipmap_set");
RNA_def_property_ui_text(prop, "MIP Map", "Use auto-generated MIP maps for the image");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "use_mipmap_gauss", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mipmap_gauss", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_GAUSS_MIP);
RNA_def_property_ui_text(prop, "MIP Map Gaussian filter", "Use Gauss filter to sample down MIP maps");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texfilter");
RNA_def_property_enum_items(prop, texture_filter_items);
RNA_def_property_ui_text(prop, "Filter", "Texture filter to use for sampling image");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "filter_probes", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "filter_probes", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "afmax");
RNA_def_property_range(prop, 1, 256);
RNA_def_property_ui_text(prop, "Filter Probes",
"Maximum number of samples (higher gives less blur at distant/oblique angles, but is also slower)");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "afmax");
RNA_def_property_range(prop, 1, 256);
RNA_def_property_ui_text(prop, "Filter Eccentricity",
"Maximum eccentricity (higher gives less blur at distant/oblique angles, but is also slower)");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "use_filter_size_min", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_filter_size_min", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_FILTER_MIN);
RNA_def_property_ui_text(prop, "Minimum Filter Size", "Use Filter Size as a minimal filter value in pixels");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "filtersize");
RNA_def_property_range(prop, 0.1, 50.0);
RNA_def_property_ui_range(prop, 0.1, 50.0, 1, 0.2);
@@ -724,67 +724,67 @@ static void rna_def_environment_map(BlenderRNA *brna)
{ENV_PLANE, "PLANE", 0, "Plane", "Only one side is rendered, with Z axis pointing in direction of image"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "EnvironmentMap", NULL);
+ srna = RNA_def_struct(brna, "EnvironmentMap", NULL);
RNA_def_struct_sdna(srna, "EnvMap");
RNA_def_struct_ui_text(srna, "EnvironmentMap", "Environment map created by the renderer and cached for subsequent renders");
- prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_source_items);
RNA_def_property_ui_text(prop, "Source", "");
RNA_def_property_update(prop, 0, "rna_Envmap_source_update");
- prop= RNA_def_property(srna, "viewpoint_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "viewpoint_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Viewpoint Object", "Object to use as the environment map's viewpoint location");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_mapping_items);
RNA_def_property_ui_text(prop, "Mapping", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.01, 50, 100, 2);
RNA_def_property_ui_text(prop, "Clip Start", "Objects nearer than this are not visible to map");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_range(prop, 0.10, 20000, 100, 2);
RNA_def_property_ui_text(prop, "Clip End", "Objects further than this are not visible to map");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "viewscale");
RNA_def_property_range(prop, 0.1, 5.0);
RNA_def_property_ui_range(prop, 0.5, 1.5, 1, 2);
RNA_def_property_ui_text(prop, "Zoom", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "layers_ignore", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop = RNA_def_property(srna, "layers_ignore", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "notlay", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_ui_text(prop, "Ignore Layers", "Hide objects on these layers when generating the Environment Map");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "cuberes");
RNA_def_property_range(prop, 50, 4096);
RNA_def_property_ui_text(prop, "Resolution", "Pixel resolution of the rendered environment map");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_range(prop, 0, 5);
RNA_def_property_ui_text(prop, "Depth", "Number of times a map will be rendered recursively (mirror effects)");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, 0);
+ prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, 0);
RNA_def_property_boolean_sdna(prop, NULL, "ok", 2);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Validity", "True if this map is ready for use, False if it needs rendering");
@@ -830,43 +830,43 @@ static void rna_def_texture_clouds(BlenderRNA *brna)
{TEX_COLOR, "COLOR", 0, "Color", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "CloudsTexture", "Texture");
+ srna = RNA_def_struct(brna, "CloudsTexture", "Texture");
RNA_def_struct_ui_text(srna, "Clouds Texture", "Procedural noise texture");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, 30);
RNA_def_property_ui_range(prop, 0, 24, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Depth of the cloud calculation");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "cloud_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "cloud_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_clouds_stype);
RNA_def_property_ui_text(prop, "Color", "Determine whether Noise returns grayscale or RGB values");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
@@ -891,49 +891,49 @@ static void rna_def_texture_wood(BlenderRNA *brna)
{TEX_TRI, "TRI", 0, "Tri", "Use a triangle wave to produce bands"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "WoodTexture", "Texture");
+ srna = RNA_def_struct(brna, "WoodTexture", "Texture");
RNA_def_struct_ui_text(srna, "Wood Texture", "Procedural noise texture");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turbul");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the bandnoise and ringnoise types");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "wood_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "wood_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_wood_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "noise_basis_2", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_basis_2", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_wood_noisebasis2);
RNA_def_property_ui_text(prop, "Noise Basis 2", "");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
@@ -958,56 +958,56 @@ static void rna_def_texture_marble(BlenderRNA *brna)
{TEX_TRI, "TRI", 0, "Tri", "Use a triangle wave to produce bands"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MarbleTexture", "Texture");
+ srna = RNA_def_struct(brna, "MarbleTexture", "Texture");
RNA_def_struct_ui_text(srna, "Marble Texture", "Procedural noise texture");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turbul");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the bandnoise and ringnoise types");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, 30);
RNA_def_property_ui_range(prop, 0, 24, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Depth of the cloud calculation");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "marble_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "marble_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_marble_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "noise_basis_2", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_basis_2", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_marble_noisebasis2);
RNA_def_property_ui_text(prop, "Noise Basis 2", "");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
@@ -1020,18 +1020,18 @@ static void rna_def_texture_magic(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MagicTexture", "Texture");
+ srna = RNA_def_struct(brna, "MagicTexture", "Texture");
RNA_def_struct_ui_text(srna, "Magic Texture", "Procedural noise texture");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turbul");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the noise");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, 30);
RNA_def_property_ui_range(prop, 0, 24, 0, 2);
@@ -1054,22 +1054,22 @@ static void rna_def_texture_blend(BlenderRNA *brna)
{TEX_RAD, "RADIAL", 0, "Radial", "Create a radial progression"},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem prop_flip_axis_items[]= {
+ static const EnumPropertyItem prop_flip_axis_items[] = {
{0, "HORIZONTAL", 0, "Horizontal", "No flipping"},
{TEX_FLIPBLEND, "VERTICAL", 0, "Vertical", "Flip the texture's X and Y axis"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "BlendTexture", "Texture");
+ srna = RNA_def_struct(brna, "BlendTexture", "Texture");
RNA_def_struct_ui_text(srna, "Blend Texture", "Procedural color blending texture");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "progression", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "progression", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_blend_progression);
RNA_def_property_ui_text(prop, "Progression", "Style of the color blending");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "use_flip_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "use_flip_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_flip_axis_items);
RNA_def_property_ui_text(prop, "Flip Axis", "Flip the texture's X and Y axis");
@@ -1088,37 +1088,37 @@ static void rna_def_texture_stucci(BlenderRNA *brna)
{TEX_WALLOUT, "WALL_OUT", 0, "Wall out", "Create Ridges"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "StucciTexture", "Texture");
+ srna = RNA_def_struct(brna, "StucciTexture", "Texture");
RNA_def_struct_ui_text(srna, "Stucci Texture", "Procedural noise texture");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turbul");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the noise");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "stucci_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "stucci_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_stucci_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
@@ -1129,7 +1129,7 @@ static void rna_def_texture_noise(BlenderRNA *brna)
{
StructRNA *srna;
- srna= RNA_def_struct(brna, "NoiseTexture", "Texture");
+ srna = RNA_def_struct(brna, "NoiseTexture", "Texture");
RNA_def_struct_ui_text(srna, "Noise Texture", "Procedural noise texture");
RNA_def_struct_sdna(srna, "Tex");
}
@@ -1148,77 +1148,77 @@ static void rna_def_texture_image(BlenderRNA *brna)
{TEX_CHECKER, "CHECKER", 0, "Checker", "Cause the image to repeat in checker board pattern"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ImageTexture", "Texture");
+ srna = RNA_def_struct(brna, "ImageTexture", "Texture");
RNA_def_struct_ui_text(srna, "Image Texture", "");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "use_interpolation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_interpolation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_INTERPOL);
RNA_def_property_ui_text(prop, "Interpolation", "Interpolate pixels using selected filter");
RNA_def_property_update(prop, 0, "rna_Texture_update");
/* XXX: I think flip_axis should be a generic Texture property, enabled for all the texture types */
- prop= RNA_def_property(srna, "use_flip_axis", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_flip_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_IMAROT);
RNA_def_property_ui_text(prop, "Flip Axis", "Flip the texture's X and Y axis");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_USEALPHA);
RNA_def_property_ui_text(prop, "Use Alpha", "Use the alpha channel information in the image");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "use_calculate_alpha", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_calculate_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_CALCALPHA);
RNA_def_property_ui_text(prop, "Calculate Alpha", "Calculate an alpha channel based on RGB values in the image");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "invert_alpha", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_NEGALPHA);
RNA_def_property_ui_text(prop, "Invert Alpha", "Invert all the alpha values in the image");
RNA_def_property_update(prop, 0, "rna_Texture_update");
rna_def_filter_common(srna);
- prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extend");
RNA_def_property_enum_items(prop, prop_image_extension);
RNA_def_property_ui_text(prop, "Extension", "How the image is extrapolated past its original bounds");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "repeat_x", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "repeat_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xrepeat");
RNA_def_property_range(prop, 1, 512);
RNA_def_property_ui_text(prop, "Repeat X", "Repetition multiplier in the X direction");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "repeat_y", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "repeat_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "yrepeat");
RNA_def_property_range(prop, 1, 512);
RNA_def_property_ui_text(prop, "Repeat Y", "Repetition multiplier in the Y direction");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_XMIR);
RNA_def_property_ui_text(prop, "Mirror X", "Mirror the image repetition on the X direction");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_YMIR);
RNA_def_property_ui_text(prop, "Mirror Y", "Mirror the image repetition on the Y direction");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "use_checker_odd", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_checker_odd", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_ODD);
RNA_def_property_ui_text(prop, "Checker Odd", "Odd checker tiles");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "use_checker_even", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_checker_even", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_EVEN);
RNA_def_property_ui_text(prop, "Checker Even", "Even checker tiles");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "checker_distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "checker_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "checkerdist");
RNA_def_property_range(prop, 0.0, 0.99);
RNA_def_property_ui_range(prop, 0.0, 0.99, 0.1, 0.01);
@@ -1230,7 +1230,7 @@ static void rna_def_texture_image(BlenderRNA *brna)
/* XXX: did this as an array, but needs better descriptions than "1 2 3 4"
perhaps a new subtype could be added?
--I actually used single values for this, maybe change later with a RNA_Rect thing? */
- prop= RNA_def_property(srna, "crop_rectangle", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "crop_rectangle", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropxmin");
RNA_def_property_array(prop, 4);
RNA_def_property_range(prop, -10, 10);
@@ -1239,54 +1239,54 @@ static void rna_def_texture_image(BlenderRNA *brna)
#endif
- prop= RNA_def_property(srna, "crop_min_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "crop_min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropxmin");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Minimum X", "Minimum X value to crop the image");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "crop_min_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "crop_min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropymin");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Minimum Y", "Minimum Y value to crop the image");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "crop_max_x", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "crop_max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropxmax");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Maximum X", "Maximum X value to crop the image");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "crop_max_y", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "crop_max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropymax");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Maximum Y", "Maximum Y value to crop the image");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ima");
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
+ prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
RNA_def_property_update(prop, 0, "rna_Texture_update");
/* Normal Map */
- prop= RNA_def_property(srna, "use_normal_map", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_normal_map", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP);
RNA_def_property_ui_text(prop, "Normal Map", "Use image RGB values for normal mapping");
RNA_def_property_update(prop, 0, "rna_Texture_update");
/* Derivative Map */
- prop= RNA_def_property(srna, "use_derivative_map", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_derivative_map", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_DERIVATIVEMAP);
RNA_def_property_ui_text(prop, "Derivative Map", "Use red and green as derivative values");
RNA_def_property_update(prop, 0, "rna_Texture_update");
@@ -1296,7 +1296,7 @@ static void rna_def_texture_plugin(BlenderRNA *brna)
{
StructRNA *srna;
- srna= RNA_def_struct(brna, "PluginTexture", "Texture");
+ srna = RNA_def_struct(brna, "PluginTexture", "Texture");
RNA_def_struct_ui_text(srna, "Plugin", "External plugin texture");
RNA_def_struct_sdna(srna, "Tex");
@@ -1308,25 +1308,25 @@ static void rna_def_texture_environment_map(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "EnvironmentMapTexture", "Texture");
+ srna = RNA_def_struct(brna, "EnvironmentMapTexture", "Texture");
RNA_def_struct_ui_text(srna, "Environment Map", "Environment map texture");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ima");
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "Source image file to read the environment map from");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
+ prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
RNA_def_property_update(prop, 0, "rna_Texture_update");
rna_def_filter_common(srna);
- prop= RNA_def_property(srna, "environment_map", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "environment_map", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "env");
RNA_def_property_struct_type(prop, "EnvironmentMap");
RNA_def_property_ui_text(prop, "Environment Map", "Get the environment map associated with this texture");
@@ -1348,66 +1348,66 @@ static void rna_def_texture_musgrave(BlenderRNA *brna)
{TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", "Similar to multifractal"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MusgraveTexture", "Texture");
+ srna = RNA_def_struct(brna, "MusgraveTexture", "Texture");
RNA_def_struct_ui_text(srna, "Musgrave", "Procedural musgrave texture");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "musgrave_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "musgrave_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_musgrave_type);
RNA_def_property_ui_text(prop, "Type", "Fractal noise algorithm");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "dimension_max", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "dimension_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_H");
RNA_def_property_range(prop, 0.0001, 2);
RNA_def_property_ui_text(prop, "Highest Dimension", "Highest fractal dimension");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "lacunarity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "lacunarity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_lacunarity");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Lacunarity", "Gap between successive frequencies");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "octaves", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "octaves", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_octaves");
RNA_def_property_range(prop, 0, 8);
RNA_def_property_ui_text(prop, "Octaves", "Number of frequencies used");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_offset");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Offset", "The fractal offset");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_gain");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Gain", "The gain multiplier");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ns_outscale");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Noise Intensity", "Intensity of the noise");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
@@ -1444,66 +1444,66 @@ static void rna_def_texture_voronoi(BlenderRNA *brna)
"Multiply position and outline by intensity"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "VoronoiTexture", "Texture");
+ srna = RNA_def_struct(brna, "VoronoiTexture", "Texture");
RNA_def_struct_ui_text(srna, "Voronoi", "Procedural voronoi texture");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "weight_1", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "weight_1", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w1");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 1", "Voronoi feature weight 1");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "weight_2", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "weight_2", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w2");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 2", "Voronoi feature weight 2");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "weight_3", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "weight_3", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w3");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 3", "Voronoi feature weight 3");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "weight_4", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "weight_4", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w4");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 4", "Voronoi feature weight 4");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "minkovsky_exponent", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "minkovsky_exponent", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_mexp");
RNA_def_property_range(prop, 0.01, 10);
RNA_def_property_ui_text(prop, "Minkovsky Exponent", "Minkovsky exponent");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "distance_metric", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "distance_metric", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "vn_distm");
RNA_def_property_enum_items(prop, prop_distance_metric_items);
RNA_def_property_ui_text(prop, "Distance Metric", "Algorithm used to calculate distance of sample points to feature points");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "vn_coltype");
RNA_def_property_enum_items(prop, prop_coloring_items);
RNA_def_property_ui_text(prop, "Coloring", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ns_outscale");
RNA_def_property_range(prop, 0.01, 10);
RNA_def_property_ui_text(prop, "Noise Intensity", "Scales the intensity of the noise");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
@@ -1515,36 +1515,36 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "DistortedNoiseTexture", "Texture");
+ srna = RNA_def_struct(brna, "DistortedNoiseTexture", "Texture");
RNA_def_struct_ui_text(srna, "Distorted Noise", "Procedural distorted noise texture");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "distortion", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distortion", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dist_amount");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Distortion Amount", "Amount of distortion");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Distortion", "Noise basis for the distortion");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
@@ -1559,7 +1559,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
static EnumPropertyItem point_source_items[] = {
{TEX_PD_PSYS, "PARTICLE_SYSTEM", 0, "Particle System", "Generate point density from a particle system"},
{TEX_PD_OBJECT, "OBJECT", 0, "Object Vertices", "Generate point density from an object's vertices"},
- //{TEX_PD_FILE, "FILE", 0 , "File", ""},
+ /*{TEX_PD_FILE, "FILE", 0 , "File", ""}, */
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem particle_cache_items[] = {
@@ -1600,137 +1600,137 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
{TEX_PD_NOISE_TIME, "GLOBAL_TIME", 0, "Global Time", "Turbulent noise driven by the global current frame"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "PointDensity", NULL);
+ srna = RNA_def_struct(brna, "PointDensity", NULL);
RNA_def_struct_sdna(srna, "PointDensity");
RNA_def_struct_ui_text(srna, "PointDensity", "Point density settings");
RNA_def_struct_path_func(srna, "rna_PointDensity_path");
- prop= RNA_def_property(srna, "point_source", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "point_source", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "source");
RNA_def_property_enum_items(prop, point_source_items);
RNA_def_property_ui_text(prop, "Point Source", "Point data to use as renderable point density");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Object", "Object to take point data from");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Particle System", "Particle System to render as points");
RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_pointer_funcs(prop, "rna_PointDensity_psys_get", "rna_PointDensity_psys_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "particle_cache_space", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "particle_cache_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "psys_cache_space");
RNA_def_property_enum_items(prop, particle_cache_items);
RNA_def_property_ui_text(prop, "Particle Cache", "Coordinate system to cache particles in");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "vertex_cache_space", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_cache_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ob_cache_space");
RNA_def_property_enum_items(prop, vertice_cache_items);
RNA_def_property_ui_text(prop, "Vertices Cache", "Coordinate system to cache vertices in");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "radius");
RNA_def_property_range(prop, 0.001, FLT_MAX);
RNA_def_property_ui_text(prop, "Radius", "Radius from the shaded sample to look for points within");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "falloff_type");
RNA_def_property_enum_items(prop, falloff_items);
RNA_def_property_ui_text(prop, "Falloff", "Method of attenuating density by distance from the point");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "falloff_soft", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff_soft", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "falloff_softness");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Softness", "Softness of the 'soft' falloff option");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "color_source", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "color_source", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "color_source");
RNA_def_property_enum_items(prop, color_source_items);
RNA_def_property_ui_text(prop, "Color Source", "Data to derive color results from");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "speed_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "speed_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "speed_scale");
RNA_def_property_range(prop, 0.001, 100.0);
RNA_def_property_ui_text(prop, "Scale", "Multiplier to bring particle speed within an acceptable range");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "falloff_speed_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff_speed_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "falloff_speed_scale");
RNA_def_property_range(prop, 0.001, 100.0);
RNA_def_property_ui_text(prop, "Velocity Scale", "Multiplier to bring particle speed within an acceptable range");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
+ prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Color Ramp", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NEVER_NULL);
+ prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "falloff_curve");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Falloff Curve", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "use_falloff_curve", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_falloff_curve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_FALLOFF_CURVE);
RNA_def_property_ui_text(prop, "Falloff Curve", "Use a custom falloff curve");
RNA_def_property_update(prop, 0, "rna_Texture_update");
/* Turbulence */
- prop= RNA_def_property(srna, "use_turbulence", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_turbulence", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_TURBULENCE);
RNA_def_property_ui_text(prop, "Turbulence", "Add directed noise to the density at render-time");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "turbulence_scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "turbulence_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noise_size");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Size", "Scale of the added turbulent noise");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "turbulence_strength", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "turbulence_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noise_fac");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noise_depth");
RNA_def_property_range(prop, 0, 30);
RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "turbulence_influence", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "turbulence_influence", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noise_influence");
RNA_def_property_enum_items(prop, turbulence_influence_items);
RNA_def_property_ui_text(prop, "Turbulence Influence", "Method for driving added turbulent noise");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noise_basis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Noise formula used for turbulence");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- srna= RNA_def_struct(brna, "PointDensityTexture", "Texture");
+ srna = RNA_def_struct(brna, "PointDensityTexture", "Texture");
RNA_def_struct_sdna(srna, "Tex");
RNA_def_struct_ui_text(srna, "Point Density", "Settings for the Point Density texture");
- prop= RNA_def_property(srna, "point_density", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "point_density", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pd");
RNA_def_property_struct_type(prop, "PointDensity");
RNA_def_property_ui_text(prop, "Point Density", "The point density settings associated with this texture");
@@ -1753,7 +1753,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
static EnumPropertyItem file_format_items[] = {
{TEX_VD_BLENDERVOXEL, "BLENDER_VOXEL", 0, "Blender Voxel", "Default binary voxel file format"},
{TEX_VD_RAW_8BIT, "RAW_8BIT", 0, "8 bit RAW", "8 bit greyscale binary data"},
- //{TEX_VD_RAW_16BIT, "RAW_16BIT", 0, "16 bit RAW", ""},
+ /*{TEX_VD_RAW_16BIT, "RAW_16BIT", 0, "16 bit RAW", ""}, */
{TEX_VD_IMAGE_SEQUENCE, "IMAGE_SEQUENCE", 0, "Image Sequence", "Generate voxels from a sequence of image slices"},
{TEX_VD_SMOKE, "SMOKE", 0, "Smoke", "Render voxels from a Blender smoke simulation"},
{0, NULL, 0, NULL, NULL}};
@@ -1770,88 +1770,88 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
{TEX_VD_SMOKEVEL, "SMOKEVEL", 0, "Velocity", "Use smoke velocity as texture data"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "VoxelData", NULL);
+ srna = RNA_def_struct(brna, "VoxelData", NULL);
RNA_def_struct_sdna(srna, "VoxelData");
RNA_def_struct_ui_text(srna, "VoxelData", "Voxel data settings");
RNA_def_struct_path_func(srna, "rna_VoxelData_path");
- prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "interp_type");
RNA_def_property_enum_items(prop, interpolation_type_items);
RNA_def_property_ui_text(prop, "Interpolation", "Method to interpolate/smooth values between voxel cells");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "smoke_data_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "smoke_data_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "smoked_type");
RNA_def_property_enum_items(prop, smoked_type_items);
RNA_def_property_ui_text(prop, "Source", "Simulation value to be used as a texture");
RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
- prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extend");
RNA_def_property_enum_items(prop, voxeldata_extension);
RNA_def_property_ui_text(prop, "Extension", "How the texture is extrapolated past its original bounds");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "int_multiplier");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Intensity", "Multiplier for intensity values");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "file_format");
RNA_def_property_enum_items(prop, file_format_items);
RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render ");
RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "source_path");
RNA_def_property_ui_text(prop, "Source Path", "The external source data file to use");
RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
- prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resol");
RNA_def_property_range(prop, 1, 100000);
RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid");
RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
- prop= RNA_def_property(srna, "use_still_frame", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_still_frame", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_VD_STILL);
RNA_def_property_ui_text(prop, "Still Frame Only", "Always render a still frame from the voxel data sequence");
RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
- prop= RNA_def_property(srna, "still_frame", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "still_frame", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "still_frame");
RNA_def_property_range(prop, -MAXFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use");
RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
- prop= RNA_def_property(srna, "domain_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "domain_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Domain Object", "Object used as the smoke simulation domain");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
- srna= RNA_def_struct(brna, "VoxelDataTexture", "Texture");
+ srna = RNA_def_struct(brna, "VoxelDataTexture", "Texture");
RNA_def_struct_sdna(srna, "Tex");
RNA_def_struct_ui_text(srna, "Voxel Data", "Settings for the Voxel Data texture");
- prop= RNA_def_property(srna, "voxel_data", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "voxel_data", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "vd");
RNA_def_property_struct_type(prop, "VoxelData");
RNA_def_property_ui_text(prop, "Voxel Data", "The voxel data associated with this texture");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ima");
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_image_update");
- prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
+ prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
@@ -1864,36 +1864,36 @@ static void rna_def_texture_ocean(BlenderRNA *brna)
static EnumPropertyItem ocean_output_items[] = {
{TEX_OCN_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Output XYZ displacement in RGB channels"},
- //{TEX_OCN_NORMALS, "NORMALS", 0, "Normals", "Outputs wave normals"}, // these are in nor channel now
+ /*{TEX_OCN_NORMALS, "NORMALS", 0, "Normals", "Outputs wave normals"}, *//* these are in nor channel now */
{TEX_OCN_FOAM, "FOAM", 0, "Foam", "Output Foam (wave overlap) amount in single channel"},
{TEX_OCN_JPLUS, "JPLUS", 0, "Eigenvalues", "Positive Eigenvalues"},
{TEX_OCN_EMINUS, "EMINUS", 0, "Eigenvectors (-)", "Negative Eigenvectors"},
{TEX_OCN_EPLUS, "EPLUS", 0, "Eigenvectors (+)", "Positive Eigenvectors"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "OceanTexData", NULL);
+ srna = RNA_def_struct(brna, "OceanTexData", NULL);
RNA_def_struct_sdna(srna, "OceanTex");
RNA_def_struct_ui_text(srna, "Ocean", "Ocean Texture settings");
RNA_def_struct_path_func(srna, "rna_OceanTex_path");
- prop= RNA_def_property(srna, "output", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "output", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "output");
RNA_def_property_enum_items(prop, ocean_output_items);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Output", "The data that is output by the texture");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "ocean_object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "ocean_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Modifier Object", "Object containing the ocean modifier");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Texture_update");
- srna= RNA_def_struct(brna, "OceanTexture", "Texture");
+ srna = RNA_def_struct(brna, "OceanTexture", "Texture");
RNA_def_struct_sdna(srna, "Tex");
RNA_def_struct_ui_text(srna, "Ocean", "Settings for the Ocean texture");
- prop= RNA_def_property(srna, "ocean", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "ocean", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ot");
RNA_def_property_struct_type(prop, "OceanTexData");
RNA_def_property_ui_text(prop, "Ocean", "The ocean data associated with this texture");
@@ -1905,81 +1905,81 @@ static void rna_def_texture(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Texture", "ID");
+ srna = RNA_def_struct(brna, "Texture", "ID");
RNA_def_struct_sdna(srna, "Tex");
RNA_def_struct_ui_text(srna, "Texture", "Texture datablock used by materials, lamps, worlds and brushes");
RNA_def_struct_ui_icon(srna, ICON_TEXTURE_DATA);
RNA_def_struct_refine_func(srna, "rna_Texture_refine");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
- //RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ /*RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, texture_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Texture_type_set", NULL);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_COLORBAND);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_color_ramp_set");
RNA_def_property_ui_text(prop, "Use Color Ramp", "Toggle color ramp operations");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
+ prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Color Ramp", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bright");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Brightness", "Adjust the brightness of the texture");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 5);
RNA_def_property_ui_text(prop, "Contrast", "Adjust the contrast of the texture");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Saturation", "Adjust the saturation of colors in the texture");
RNA_def_property_update(prop, 0, "rna_Texture_update");
/* RGB Factor */
- prop= RNA_def_property(srna, "factor_red", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "factor_red", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rfac");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Factor Red", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "factor_green", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "factor_green", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "gfac");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Factor Green", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "factor_blue", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "factor_blue", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bfac");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Factor Blue", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
/* Alpha for preview render */
- prop= RNA_def_property(srna, "use_preview_alpha", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_preview_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PRV_ALPHA);
RNA_def_property_ui_text(prop, "Show Alpha", "Show Alpha in Preview Render");
RNA_def_property_update(prop, 0, "rna_Texture_update");
/* nodetree */
- prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_nodes_set");
RNA_def_property_ui_text(prop, "Use Nodes", "Make this a node-based texture");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
- prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based textures");
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
diff --git a/source/blender/makesrna/intern/rna_texture_api.c b/source/blender/makesrna/intern/rna_texture_api.c
index 88ea78cd0da..a3176ae4d34 100644
--- a/source/blender/makesrna/intern/rna_texture_api.c
+++ b/source/blender/makesrna/intern/rna_texture_api.c
@@ -59,7 +59,7 @@ void clear_envmap(struct EnvMap *env, bContext *C)
BKE_free_envmapdata(env);
- for (tex=bmain->tex.first; tex; tex=tex->id.next)
+ for (tex = bmain->tex.first; tex; tex = tex->id.next)
if (tex->env == env) {
WM_event_add_notifier(C, NC_TEXTURE|NA_EDITED, tex);
break;
@@ -68,7 +68,7 @@ void clear_envmap(struct EnvMap *env, bContext *C)
void texture_evaluate(struct Tex *tex, float value[3], float color_r[4])
{
- TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
+ TexResult texres = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
multitex_ext(tex, value, NULL, NULL, 1, &texres);
color_r[0] = texres.tr;
@@ -84,14 +84,14 @@ void RNA_api_texture(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "evaluate", "texture_evaluate");
+ func = RNA_def_function(srna, "evaluate", "texture_evaluate");
RNA_def_function_ui_description(func, "Evaluate the texture at the coordinates given");
- parm= RNA_def_float_vector(func, "value", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4);
+ parm = RNA_def_float_vector(func, "value", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return location and normal */
- parm= RNA_def_float_vector(func, "result", 4, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
+ parm = RNA_def_float_vector(func, "result", 4, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm);
@@ -104,16 +104,16 @@ void RNA_api_environment_map(StructRNA *srna)
static const float default_layout[] = { 0,0, 1,0, 2,0, 0,1, 1,1, 2,1 };
- func= RNA_def_function(srna, "clear", "clear_envmap");
+ func = RNA_def_function(srna, "clear", "clear_envmap");
RNA_def_function_ui_description(func, "Discard the environment map and free it from memory");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- func= RNA_def_function(srna,"save", "save_envmap");
+ func = RNA_def_function(srna,"save", "save_envmap");
RNA_def_function_ui_description(func, "Save the environment map to disc using the scene render settings");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_string_file_name(func,"filepath","",FILE_MAX,"File path","Location of the output file");
+ parm = RNA_def_string_file_name(func,"filepath","",FILE_MAX,"File path","Location of the output file");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "scene", "Scene", "", "Overrides the scene from which image parameters are taken");
diff --git a/source/blender/makesrna/intern/rna_timeline.c b/source/blender/makesrna/intern/rna_timeline.c
index 1dba222fea7..93c28ce2720 100644
--- a/source/blender/makesrna/intern/rna_timeline.c
+++ b/source/blender/makesrna/intern/rna_timeline.c
@@ -44,27 +44,27 @@ static void rna_def_timeline_marker(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "TimelineMarker", NULL);
+ srna = RNA_def_struct(brna, "TimelineMarker", NULL);
RNA_def_struct_sdna(srna, "TimeMarker");
RNA_def_struct_ui_text(srna, "Marker", "Marker for noting points in the timeline");
/* String values */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_ANIMATION, NULL);
- prop= RNA_def_property(srna, "frame", PROP_INT, PROP_TIME);
+ prop = RNA_def_property(srna, "frame", PROP_INT, PROP_TIME);
RNA_def_property_ui_text(prop, "Frame", "The frame on which the timeline marker appears");
RNA_def_property_update(prop, NC_ANIMATION, NULL);
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 1 /*SELECT*/);
RNA_def_property_ui_text(prop, "Select", "Marker selection state");
RNA_def_property_update(prop, NC_ANIMATION, NULL);
#ifdef DURIAN_CAMERA_SWITCH
- prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_ui_text(prop, "Camera", "Camera this timeline sets to active");
diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c
index cb3f30c9284..d2385daa526 100644
--- a/source/blender/makesrna/intern/rna_tracking.c
+++ b/source/blender/makesrna/intern/rna_tracking.c
@@ -61,36 +61,36 @@ static char *rna_tracking_path(PointerRNA *UNUSED(ptr))
static void rna_tracking_defaultSettings_levelsUpdate(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingSettings *settings= &tracking->settings;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingSettings *settings = &tracking->settings;
- if(settings->default_tracker==TRACKER_KLT) {
- int max_pyramid_level_factor= 1 << (settings->default_pyramid_levels - 1);
- float search_ratio= 2.3f * max_pyramid_level_factor;
+ if (settings->default_tracker == TRACKER_KLT) {
+ int max_pyramid_level_factor = 1 << (settings->default_pyramid_levels - 1);
+ float search_ratio = 2.3f * max_pyramid_level_factor;
- settings->default_search_size= settings->default_pattern_size*search_ratio;
+ settings->default_search_size = settings->default_pattern_size*search_ratio;
}
}
static void rna_tracking_defaultSettings_patternUpdate(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingSettings *settings= &tracking->settings;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingSettings *settings = &tracking->settings;
- if(settings->default_search_size<settings->default_pattern_size)
- settings->default_search_size= settings->default_pattern_size;
+ if (settings->default_search_size<settings->default_pattern_size)
+ settings->default_search_size = settings->default_pattern_size;
}
static void rna_tracking_defaultSettings_searchUpdate(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingSettings *settings= &tracking->settings;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingSettings *settings = &tracking->settings;
- if(settings->default_pattern_size>settings->default_search_size)
- settings->default_pattern_size= settings->default_search_size;
+ if (settings->default_pattern_size>settings->default_search_size)
+ settings->default_pattern_size = settings->default_search_size;
}
static char *rna_trackingTrack_path(PointerRNA *ptr)
@@ -102,84 +102,84 @@ static char *rna_trackingTrack_path(PointerRNA *ptr)
static void rna_trackingTracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
rna_iterator_listbase_begin(iter, &clip->tracking.tracks, NULL);
}
static void rna_trackingObjects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
rna_iterator_listbase_begin(iter, &clip->tracking.objects, NULL);
}
static int rna_tracking_active_object_index_get(PointerRNA *ptr)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
return clip->tracking.objectnr;
}
static void rna_tracking_active_object_index_set(PointerRNA *ptr, int value)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
- clip->tracking.objectnr= value;
+ clip->tracking.objectnr = value;
}
static void rna_tracking_active_object_index_range(PointerRNA *ptr, int *min, int *max)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
- *min= 0;
- *max= clip->tracking.tot_object-1;
- *max= MAX2(0, *max);
+ *min = 0;
+ *max = clip->tracking.tot_object-1;
+ *max = MAX2(0, *max);
}
static PointerRNA rna_tracking_active_track_get(PointerRNA *ptr)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
- MovieTrackingTrack *act_track= BKE_tracking_active_track(&clip->tracking);
+ MovieClip *clip = (MovieClip*)ptr->id.data;
+ MovieTrackingTrack *act_track = BKE_tracking_active_track(&clip->tracking);
return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingTrack, act_track);
}
static void rna_tracking_active_track_set(PointerRNA *ptr, PointerRNA value)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
- MovieTrackingTrack *track= (MovieTrackingTrack *)value.data;
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
- int index= BLI_findindex(tracksbase, track);
+ MovieClip *clip = (MovieClip*)ptr->id.data;
+ MovieTrackingTrack *track = (MovieTrackingTrack *)value.data;
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
+ int index = BLI_findindex(tracksbase, track);
- if(index>=0)
- clip->tracking.act_track= track;
+ if (index >= 0)
+ clip->tracking.act_track = track;
else
- clip->tracking.act_track= NULL;
+ clip->tracking.act_track = NULL;
}
void rna_trackingTrack_name_set(PointerRNA *ptr, const char *value)
{
- MovieClip *clip= (MovieClip *)ptr->id.data;
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data;
- ListBase *tracksbase= &tracking->tracks;
+ MovieClip *clip = (MovieClip *)ptr->id.data;
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingTrack *track = (MovieTrackingTrack *)ptr->data;
+ ListBase *tracksbase = &tracking->tracks;
BLI_strncpy(track->name, value, sizeof(track->name));
/* TODO: it's a bit difficult to find list track came from knowing just
movie clip ID and MovieTracking structure, so keep this naive
search for a while */
- if(BLI_findindex(tracksbase, track) < 0) {
- MovieTrackingObject *object= tracking->objects.first;
+ if (BLI_findindex(tracksbase, track) < 0) {
+ MovieTrackingObject *object = tracking->objects.first;
- while(object) {
- if(BLI_findindex(&object->tracks, track)) {
- tracksbase= &object->tracks;
+ while (object) {
+ if (BLI_findindex(&object->tracks, track)) {
+ tracksbase = &object->tracks;
break;
}
- object= object->next;
+ object = object->next;
}
}
@@ -188,46 +188,46 @@ void rna_trackingTrack_name_set(PointerRNA *ptr, const char *value)
static int rna_trackingTrack_select_get(PointerRNA *ptr)
{
- MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data;
+ MovieTrackingTrack *track = (MovieTrackingTrack *)ptr->data;
return TRACK_SELECTED(track);
}
static void rna_trackingTrack_select_set(PointerRNA *ptr, int value)
{
- MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data;
+ MovieTrackingTrack *track = (MovieTrackingTrack *)ptr->data;
- if(value) {
- track->flag|= SELECT;
- track->pat_flag|= SELECT;
- track->search_flag|= SELECT;
+ if (value) {
+ track->flag |= SELECT;
+ track->pat_flag |= SELECT;
+ track->search_flag |= SELECT;
}
else {
- track->flag&= ~SELECT;
- track->pat_flag&= ~SELECT;
- track->search_flag&= ~SELECT;
+ track->flag &= ~SELECT;
+ track->pat_flag &= ~SELECT;
+ track->search_flag &= ~SELECT;
}
}
static void rna_tracking_trackerPattern_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data;
+ MovieTrackingTrack *track = (MovieTrackingTrack *)ptr->data;
BKE_tracking_clamp_track(track, CLAMP_PAT_DIM);
}
static void rna_tracking_trackerSearch_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data;
+ MovieTrackingTrack *track = (MovieTrackingTrack *)ptr->data;
BKE_tracking_clamp_track(track, CLAMP_SEARCH_DIM);
}
static void rna_tracking_trackerAlgorithm_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data;
+ MovieTrackingTrack *track = (MovieTrackingTrack *)ptr->data;
- if(track->tracker==TRACKER_KLT)
+ if (track->tracker == TRACKER_KLT)
BKE_tracking_clamp_track(track, CLAMP_PYRAMID_LEVELS);
else
BKE_tracking_clamp_track(track, CLAMP_SEARCH_DIM);
@@ -235,7 +235,7 @@ static void rna_tracking_trackerAlgorithm_update(Main *UNUSED(bmain), Scene *UNU
static void rna_tracking_trackerPyramid_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data;
+ MovieTrackingTrack *track = (MovieTrackingTrack *)ptr->data;
BKE_tracking_clamp_track(track, CLAMP_PYRAMID_LEVELS);
}
@@ -247,26 +247,26 @@ static char *rna_trackingCamera_path(PointerRNA *UNUSED(ptr))
static float rna_trackingCamera_focal_mm_get(PointerRNA *ptr)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
- MovieTrackingCamera *camera= &clip->tracking.camera;
- float val= camera->focal;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
+ MovieTrackingCamera *camera = &clip->tracking.camera;
+ float val = camera->focal;
- if(clip->lastsize[0])
- val= val*camera->sensor_width/(float)clip->lastsize[0];
+ if (clip->lastsize[0])
+ val = val*camera->sensor_width/(float)clip->lastsize[0];
return val;
}
static void rna_trackingCamera_focal_mm_set(PointerRNA *ptr, float value)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
- MovieTrackingCamera *camera= &clip->tracking.camera;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
+ MovieTrackingCamera *camera = &clip->tracking.camera;
- if(clip->lastsize[0])
- value= clip->lastsize[0]*value/camera->sensor_width;
+ if (clip->lastsize[0])
+ value = clip->lastsize[0]*value/camera->sensor_width;
- if(value>=0.0001)
- camera->focal= value;
+ if (value >= 0.0001)
+ camera->focal = value;
}
static char *rna_trackingStabilization_path(PointerRNA *UNUSED(ptr))
@@ -276,9 +276,9 @@ static char *rna_trackingStabilization_path(PointerRNA *UNUSED(ptr))
static int rna_track_2d_stabilization(CollectionPropertyIterator *UNUSED(iter), void *data)
{
- MovieTrackingTrack *track= (MovieTrackingTrack*)data;
+ MovieTrackingTrack *track = (MovieTrackingTrack*)data;
- if((track->flag&TRACK_USE_2D_STAB)==0)
+ if ((track->flag&TRACK_USE_2D_STAB) == 0)
return 1;
return 0;
@@ -286,37 +286,37 @@ static int rna_track_2d_stabilization(CollectionPropertyIterator *UNUSED(iter),
static void rna_tracking_stabTracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
rna_iterator_listbase_begin(iter, &clip->tracking.tracks, rna_track_2d_stabilization);
}
static int rna_tracking_stabTracks_active_index_get(PointerRNA *ptr)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
return clip->tracking.stabilization.act_track;
}
static void rna_tracking_stabTracks_active_index_set(PointerRNA *ptr, int value)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
- clip->tracking.stabilization.act_track= value;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
+ clip->tracking.stabilization.act_track = value;
}
static void rna_tracking_stabTracks_active_index_range(PointerRNA *ptr, int *min, int *max)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
- *min= 0;
- *max= clip->tracking.stabilization.tot_track-1;
- *max= MAX2(0, *max);
+ *min = 0;
+ *max = clip->tracking.stabilization.tot_track-1;
+ *max = MAX2(0, *max);
}
static void rna_tracking_flushUpdate(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
- MovieTrackingStabilization *stab= &clip->tracking.stabilization;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
+ MovieTrackingStabilization *stab = &clip->tracking.stabilization;
- stab->ok= 0;
+ stab->ok = 0;
nodeUpdateID(scene->nodetree, &clip->id);
@@ -326,10 +326,10 @@ static void rna_tracking_flushUpdate(Main *UNUSED(bmain), Scene *scene, PointerR
static void rna_trackingObject_tracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- MovieTrackingObject *object= (MovieTrackingObject* )ptr->data;
+ MovieTrackingObject *object = (MovieTrackingObject* )ptr->data;
- if(object->flag&TRACKING_OBJECT_CAMERA) {
- MovieClip *clip= (MovieClip*)ptr->id.data;
+ if (object->flag&TRACKING_OBJECT_CAMERA) {
+ MovieClip *clip = (MovieClip*)ptr->id.data;
rna_iterator_listbase_begin(iter, &clip->tracking.tracks, NULL);
}
@@ -340,26 +340,26 @@ static void rna_trackingObject_tracks_begin(CollectionPropertyIterator *iter, Po
static PointerRNA rna_tracking_active_object_get(PointerRNA *ptr)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
- MovieTrackingObject *object= BLI_findlink(&clip->tracking.objects, clip->tracking.objectnr);
+ MovieClip *clip = (MovieClip*)ptr->id.data;
+ MovieTrackingObject *object = BLI_findlink(&clip->tracking.objects, clip->tracking.objectnr);
return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingObject, object);
}
static void rna_tracking_active_object_set(PointerRNA *ptr, PointerRNA value)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
- MovieTrackingObject *object= (MovieTrackingObject *)value.data;
- int index= BLI_findindex(&clip->tracking.objects, object);
+ MovieClip *clip = (MovieClip*)ptr->id.data;
+ MovieTrackingObject *object = (MovieTrackingObject *)value.data;
+ int index = BLI_findindex(&clip->tracking.objects, object);
- if(index>=0) clip->tracking.objectnr= index;
- else clip->tracking.objectnr= 0;
+ if (index >= 0) clip->tracking.objectnr = index;
+ else clip->tracking.objectnr = 0;
}
void rna_trackingObject_name_set(PointerRNA *ptr, const char *value)
{
- MovieClip *clip= (MovieClip *)ptr->id.data;
- MovieTrackingObject *object= (MovieTrackingObject *)ptr->data;
+ MovieClip *clip = (MovieClip *)ptr->id.data;
+ MovieTrackingObject *object = (MovieTrackingObject *)ptr->data;
BLI_strncpy(object->name, value, sizeof(object->name));
@@ -368,7 +368,7 @@ void rna_trackingObject_name_set(PointerRNA *ptr, const char *value)
static void rna_trackingObject_flushUpdate(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- MovieClip *clip= (MovieClip*)ptr->id.data;
+ MovieClip *clip = (MovieClip*)ptr->id.data;
WM_main_add_notifier(NC_OBJECT|ND_TRANSFORM, NULL);
DAG_id_tag_update(&clip->id, 0);
@@ -404,19 +404,19 @@ static void rna_trackingMarker_frame_set(PointerRNA *ptr, int value)
static void add_tracks_to_base(MovieClip *clip, MovieTracking *tracking, ListBase *tracksbase, int frame, int number)
{
int a, width, height;
- MovieClipUser user= {0};
+ MovieClipUser user = {0};
- user.framenr= 1;
+ user.framenr = 1;
BKE_movieclip_get_size(clip, &user, &width, &height);
- for(a= 0; a<number; a++)
+ for (a = 0; a<number; a++)
BKE_tracking_add_track(tracking, tracksbase, 0, 0, frame, width, height);
}
static void rna_trackingTracks_add(ID *id, MovieTracking *tracking, int frame, int number)
{
- MovieClip *clip= (MovieClip *) id;
+ MovieClip *clip = (MovieClip *) id;
add_tracks_to_base(clip, tracking, &tracking->tracks, frame, number);
@@ -425,11 +425,11 @@ static void rna_trackingTracks_add(ID *id, MovieTracking *tracking, int frame, i
static void rna_trackingObject_tracks_add(ID *id, MovieTrackingObject *object, int frame, int number)
{
- MovieClip *clip= (MovieClip *) id;
- ListBase *tracksbase= &object->tracks;
+ MovieClip *clip = (MovieClip *) id;
+ ListBase *tracksbase = &object->tracks;
- if(object->flag&TRACKING_OBJECT_CAMERA)
- tracksbase= &clip->tracking.tracks;
+ if (object->flag&TRACKING_OBJECT_CAMERA)
+ tracksbase = &clip->tracking.tracks;
add_tracks_to_base(clip, &clip->tracking, tracksbase, frame, number);
@@ -438,7 +438,7 @@ static void rna_trackingObject_tracks_add(ID *id, MovieTrackingObject *object, i
static MovieTrackingObject *rna_trackingObject_new(MovieTracking *tracking, const char *name)
{
- MovieTrackingObject *object= BKE_tracking_new_object(tracking, name);
+ MovieTrackingObject *object = BKE_tracking_new_object(tracking, name);
WM_main_add_notifier(NC_MOVIECLIP|NA_EDITED, NULL);
@@ -474,7 +474,7 @@ static MovieTrackingMarker* rna_trackingMarkers_insert_frame(MovieTrackingTrack
void rna_trackingMarkers_delete_frame(MovieTrackingTrack *track, int framenr)
{
- if(track->markersnr==1)
+ if (track->markersnr == 1)
return;
BKE_tracking_delete_marker(track, framenr);
@@ -495,7 +495,7 @@ static EnumPropertyItem pattern_match_items[] = {
{TRACK_MATCH_PREVFRAME, "PREV_FRAME", 0, "Previous frame", "Track pattern from current frame to next frame"},
{0, NULL, 0, NULL, NULL}};
-static int rna_matrix_dimsize_4x4[]= {4, 4};
+static int rna_matrix_dimsize_4x4[] = {4, 4};
static void rna_def_trackingSettings(BlenderRNA *brna)
{
@@ -534,29 +534,29 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- srna= RNA_def_struct(brna, "MovieTrackingSettings", NULL);
+ srna = RNA_def_struct(brna, "MovieTrackingSettings", NULL);
RNA_def_struct_ui_text(srna, "Movie tracking settings", "Match moving settings");
/* speed */
- prop= RNA_def_property(srna, "speed", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "speed", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, speed_items);
RNA_def_property_ui_text(prop, "Speed", "Limit speed of tracking to make visual feedback easier (this does not affect the tracking quality)");
/* keyframe_a */
- prop= RNA_def_property(srna, "keyframe_a", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "keyframe_a", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "keyframe1");
RNA_def_property_ui_text(prop, "Keyframe A", "First keyframe used for reconstruction initialization");
/* keyframe_b */
- prop= RNA_def_property(srna, "keyframe_b", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "keyframe_b", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "keyframe2");
RNA_def_property_ui_text(prop, "Keyframe B", "Second keyframe used for reconstruction initialization");
/* intrinsics refinement during bundle adjustment */
- prop= RNA_def_property(srna, "refine_intrinsics", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "refine_intrinsics", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "refine_camera_intrinsics");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, refine_items);
@@ -565,63 +565,63 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
/* tool settings */
/* distance */
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Distance", "Distance between two bundles used for scene scaling");
/* frames count */
- prop= RNA_def_property(srna, "clean_frames", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "clean_frames", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "clean_frames");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_text(prop, "Tracked Frames", "Effect on tracks which are tracked less than the specified amount of frames");
- /* reprojection error */
- prop= RNA_def_property(srna, "clean_error", PROP_FLOAT, PROP_NONE);
+ /* re-projection error */
+ prop = RNA_def_property(srna, "clean_error", PROP_FLOAT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_float_sdna(prop, NULL, "clean_error");
RNA_def_property_range(prop, 0, FLT_MAX);
- RNA_def_property_ui_text(prop, "Reprojection Error", "Effect on tracks which have a larger reprojection error");
+ RNA_def_property_ui_text(prop, "Reprojection Error", "Effect on tracks which have a larger re-projection error");
/* cleanup action */
- prop= RNA_def_property(srna, "clean_action", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "clean_action", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "clean_action");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, cleanup_items);
RNA_def_property_ui_text(prop, "Action", "Cleanup action to execute");
/* ** default tracker settings ** */
- prop= RNA_def_property(srna, "show_default_expanded", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_default_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_SETTINGS_SHOW_DEFAULT_EXPANDED);
RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
/* limit frames */
- prop= RNA_def_property(srna, "default_frames_limit", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "default_frames_limit", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "default_frames_limit");
RNA_def_property_range(prop, 0, SHRT_MAX);
RNA_def_property_ui_text(prop, "Frames Limit", "Every tracking cycle, this number of frames are tracked");
/* pattern match */
- prop= RNA_def_property(srna, "default_pattern_match", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "default_pattern_match", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "default_pattern_match");
RNA_def_property_enum_items(prop, pattern_match_items);
RNA_def_property_ui_text(prop, "Pattern Match", "Track pattern from given frame when tracking marker to next frame");
/* margin */
- prop= RNA_def_property(srna, "default_margin", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "default_margin", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "default_margin");
RNA_def_property_range(prop, 0, 300);
RNA_def_property_ui_text(prop, "Margin", "Default distance from image boudary at which marker stops tracking");
/* tracking algorithm */
- prop= RNA_def_property(srna, "default_tracker", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "default_tracker", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, tracker_items);
@@ -629,7 +629,7 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Tracker", "Default tracking algorithm to use");
/* pyramid level for pyramid klt tracking */
- prop= RNA_def_property(srna, "default_pyramid_levels", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "default_pyramid_levels", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "default_pyramid_levels");
@@ -638,7 +638,7 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Pyramid levels", "Default number of pyramid levels (increase on blurry footage)");
/* minmal correlation - only used for SAD tracker */
- prop= RNA_def_property(srna, "default_correlation_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "default_correlation_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_float_sdna(prop, NULL, "default_minimum_correlation");
@@ -647,7 +647,7 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Correlation", "Default minimal value of correlation between matched pattern and reference which is still treated as successful tracking");
/* default pattern size */
- prop= RNA_def_property(srna, "default_pattern_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "default_pattern_size", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "default_pattern_size");
RNA_def_property_range(prop, 5, 1000);
@@ -655,7 +655,7 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Pattern Size", "Size of pattern area for newly created tracks");
/* default search size */
- prop= RNA_def_property(srna, "default_search_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "default_search_size", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "default_search_size");
RNA_def_property_range(prop, 5, 1000);
@@ -663,19 +663,19 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Search Size", "Size of search area for newly created tracks");
/* use_red_channel */
- prop= RNA_def_property(srna, "use_default_red_channel", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_default_red_channel", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "default_flag", TRACK_DISABLE_RED);
RNA_def_property_ui_text(prop, "Use Red Channel", "Use red channel from footage for tracking");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* use_green_channel */
- prop= RNA_def_property(srna, "use_default_green_channel", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_default_green_channel", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "default_flag", TRACK_DISABLE_GREEN);
RNA_def_property_ui_text(prop, "Use Green Channel", "Use green channel from footage for tracking");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* use_blue_channel */
- prop= RNA_def_property(srna, "use_default_blue_channel", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_default_blue_channel", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "default_flag", TRACK_DISABLE_BLUE);
RNA_def_property_ui_text(prop, "Use Blue Channel", "Use blue channel from footage for tracking");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
@@ -683,7 +683,7 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
/* ** object tracking ** */
/* object distance */
- prop= RNA_def_property(srna, "object_distance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "object_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_float_sdna(prop, NULL, "object_distance");
RNA_def_property_ui_text(prop, "Distance", "Distance between two bundles used for object scaling");
@@ -702,12 +702,12 @@ static void rna_def_trackingCamera(BlenderRNA *brna)
{CAMERA_UNITS_MM, "MILLIMETERS", 0, "mm", "Use millimeters for units of focal length"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MovieTrackingCamera", NULL);
+ srna = RNA_def_struct(brna, "MovieTrackingCamera", NULL);
RNA_def_struct_path_func(srna, "rna_trackingCamera_path");
RNA_def_struct_ui_text(srna, "Movie tracking camera data", "Match-moving camera data for tracking");
/* Sensor */
- prop= RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sensor_width");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 500.0f);
@@ -715,7 +715,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
/* Focal Length */
- prop= RNA_def_property(srna, "focal_length", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "focal_length", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "focal");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0001f, 5000.0f);
@@ -724,7 +724,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
/* Focal Length in pixels */
- prop= RNA_def_property(srna, "focal_length_pixels", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "focal_length_pixels", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "focal");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 5000.0f);
@@ -732,7 +732,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
/* Units */
- prop= RNA_def_property(srna, "units", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "units", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "units");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -740,7 +740,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Units", "Units used for camera focal length");
/* Principal Point */
- prop= RNA_def_property(srna, "principal", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "principal", PROP_FLOAT, PROP_NONE);
RNA_def_property_array(prop, 2);
RNA_def_property_float_sdna(prop, NULL, "principal");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -748,21 +748,21 @@ static void rna_def_trackingCamera(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
/* Radial distortion parameters */
- prop= RNA_def_property(srna, "k1", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "k1", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "k1");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_range(prop, -10, 10, .1, 3);
RNA_def_property_ui_text(prop, "K1", "First coefficient of third order polynomial radial distortion");
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate");
- prop= RNA_def_property(srna, "k2", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "k2", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "k2");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_range(prop, -10, 10, .1, 3);
RNA_def_property_ui_text(prop, "K2", "Second coefficient of third order polynomial radial distortion");
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate");
- prop= RNA_def_property(srna, "k3", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "k3", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "k3");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_range(prop, -10, 10, .1, 3);
@@ -770,7 +770,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate");
/* pixel aspect */
- prop= RNA_def_property(srna, "pixel_aspect", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "pixel_aspect", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "pixel_aspect");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.1f, 5000.0f);
@@ -785,11 +785,11 @@ static void rna_def_trackingMarker(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MovieTrackingMarker", NULL);
+ srna = RNA_def_struct(brna, "MovieTrackingMarker", NULL);
RNA_def_struct_ui_text(srna, "Movie tracking marker data", "Match-moving marker data for tracking");
/* position */
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 2);
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5);
RNA_def_property_float_sdna(prop, NULL, "pos");
@@ -797,14 +797,14 @@ static void rna_def_trackingMarker(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
/* frame */
- prop= RNA_def_property(srna, "frame", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "framenr");
RNA_def_property_ui_text(prop, "Frame", "Frame number marker is keyframed on");
RNA_def_property_int_funcs(prop, NULL, "rna_trackingMarker_frame_set", NULL);
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, 0);
/* enable */
- prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MARKER_DISABLED);
RNA_def_property_ui_text(prop, "Mode", "Is marker muted for current frame");
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
@@ -817,32 +817,32 @@ static void rna_def_trackingMarkers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MovieTrackingMarkers");
- srna= RNA_def_struct(brna, "MovieTrackingMarkers", NULL);
+ srna = RNA_def_struct(brna, "MovieTrackingMarkers", NULL);
RNA_def_struct_sdna(srna, "MovieTrackingTrack");
RNA_def_struct_ui_text(srna, "Movie Tracking Markers", "Collection of markers for movie tracking track");
- func= RNA_def_function(srna, "find_frame", "rna_trackingMarkers_find_frame");
+ func = RNA_def_function(srna, "find_frame", "rna_trackingMarkers_find_frame");
RNA_def_function_ui_description(func, "Get marker for specified frame");
- parm= RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame",
+ parm = RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame",
"Frame number to find marker for", MINFRAME, MAXFRAME);
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "marker", "MovieTrackingMarker", "", "Marker for specified frame");
+ parm = RNA_def_pointer(func, "marker", "MovieTrackingMarker", "", "Marker for specified frame");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "insert_frame", "rna_trackingMarkers_insert_frame");
+ func = RNA_def_function(srna, "insert_frame", "rna_trackingMarkers_insert_frame");
RNA_def_function_ui_description(func, "Add a number of tracks to this movie clip");
- parm= RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame",
+ parm = RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame",
"Frame number to insert marker to", MINFRAME, MAXFRAME);
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_float_vector(func, "co", 2, 0, -1.0, 1.0, "Coordinate",
"Place new marker at the given frame using specified in normalized space coordinates", -1.0, 1.0);
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "marker", "MovieTrackingMarker", "", "Newly created marker");
+ parm = RNA_def_pointer(func, "marker", "MovieTrackingMarker", "", "Newly created marker");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "delete_frame", "rna_trackingMarkers_delete_frame");
+ func = RNA_def_function(srna, "delete_frame", "rna_trackingMarkers_delete_frame");
RNA_def_function_ui_description(func, "Delete marker at specified frame");
- parm= RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame",
+ parm = RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame",
"Frame number to delete marker from", MINFRAME, MAXFRAME);
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -854,13 +854,13 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
rna_def_trackingMarker(brna);
- srna= RNA_def_struct(brna, "MovieTrackingTrack", NULL);
+ srna = RNA_def_struct(brna, "MovieTrackingTrack", NULL);
RNA_def_struct_path_func(srna, "rna_trackingTrack_path");
RNA_def_struct_ui_text(srna, "Movie tracking track data", "Match-moving track data for tracking");
RNA_def_struct_ui_icon(srna, ICON_ANIM_DATA);
/* name */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Unique name of track");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_trackingTrack_name_set");
RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2);
@@ -868,7 +868,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
RNA_def_struct_name_property(srna, prop);
/* Pattern */
- prop= RNA_def_property(srna, "pattern_min", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "pattern_min", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 2);
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5);
RNA_def_property_float_sdna(prop, NULL, "pat_min");
@@ -876,7 +876,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Pattern Min", "Left-bottom corner of pattern area in normalized coordinates relative to marker position");
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerPattern_update");
- prop= RNA_def_property(srna, "pattern_max", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "pattern_max", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 2);
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5);
RNA_def_property_float_sdna(prop, NULL, "pat_max");
@@ -885,7 +885,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerPattern_update");
/* Search */
- prop= RNA_def_property(srna, "search_min", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "search_min", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 2);
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5);
RNA_def_property_float_sdna(prop, NULL, "search_min");
@@ -893,7 +893,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Search Min", "Left-bottom corner of search area in normalized coordinates relative to marker position");
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerSearch_update");
- prop= RNA_def_property(srna, "search_max", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "search_max", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 2);
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5);
RNA_def_property_float_sdna(prop, NULL, "search_max");
@@ -902,7 +902,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerSearch_update");
/* limit frames */
- prop= RNA_def_property(srna, "frames_limit", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frames_limit", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "frames_limit");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -910,7 +910,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Frames Limit", "Every tracking cycle, this number of frames are tracked");
/* pattern match */
- prop= RNA_def_property(srna, "pattern_match", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "pattern_match", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "pattern_match");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -918,7 +918,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Pattern Match", "Track pattern from given frame when tracking marker to next frame");
/* margin */
- prop= RNA_def_property(srna, "margin", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "margin", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "margin");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -926,7 +926,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Margin", "Distance from image boudary at which marker stops tracking");
/* tracking algorithm */
- prop= RNA_def_property(srna, "tracker", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "tracker", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, tracker_items);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -934,7 +934,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerAlgorithm_update");
/* pyramid level for pyramid klt tracking */
- prop= RNA_def_property(srna, "pyramid_levels", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "pyramid_levels", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "pyramid_levels");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -943,7 +943,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerPyramid_update");
/* minmal correlation - only used for SAD tracker */
- prop= RNA_def_property(srna, "correlation_min", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "correlation_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_float_sdna(prop, NULL, "minimum_correlation");
RNA_def_property_range(prop, -1.0f, 1.0f);
@@ -951,7 +951,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Correlation", "Minimal value of correlation between matched pattern and reference which is still treated as successful tracking");
/* markers */
- prop= RNA_def_property(srna, "markers", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "markers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MovieTrackingMarker");
RNA_def_property_collection_sdna(prop, NULL, "markers", "markersnr");
RNA_def_property_ui_text(prop, "Markers", "Collection of markers in track");
@@ -960,100 +960,100 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
/* ** channels ** */
/* use_red_channel */
- prop= RNA_def_property(srna, "use_red_channel", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_red_channel", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_RED);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Use Red Channel", "Use red channel from footage for tracking");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* use_green_channel */
- prop= RNA_def_property(srna, "use_green_channel", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_green_channel", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_GREEN);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Use Green Channel", "Use green channel from footage for tracking");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* use_blue_channel */
- prop= RNA_def_property(srna, "use_blue_channel", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_blue_channel", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_BLUE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Use Blue Channel", "Use blue channel from footage for tracking");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* preview_grayscale */
- prop= RNA_def_property(srna, "use_grayscale_preview", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_grayscale_preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_PREVIEW_GRAYSCALE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Grayscale", "Display what the tracking algorithm sees in the preview");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* has bundle */
- prop= RNA_def_property(srna, "has_bundle", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "has_bundle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_HAS_BUNDLE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Has Bundle", "True if track has a valid bundle");
/* bundle position */
- prop= RNA_def_property(srna, "bundle", PROP_FLOAT, PROP_TRANSLATION);
+ prop = RNA_def_property(srna, "bundle", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_sdna(prop, NULL, "bundle_pos");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bundle", "Position of bundle reconstructed from this track");
/* hide */
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_HIDDEN);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Hide", "Track is hidden");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* select */
- prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_trackingTrack_select_get", "rna_trackingTrack_select_set");
RNA_def_property_ui_text(prop, "Select", "Track is selected");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* select_anchor */
- prop= RNA_def_property(srna, "select_anchor", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_anchor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
RNA_def_property_ui_text(prop, "Select Anchor", "Track's anchor point is selected");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* select_pattern */
- prop= RNA_def_property(srna, "select_pattern", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_pattern", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pat_flag", SELECT);
RNA_def_property_ui_text(prop, "Select Pattern", "Track's pattern area is selected");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* select_search */
- prop= RNA_def_property(srna, "select_search", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "select_search", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "search_flag", SELECT);
RNA_def_property_ui_text(prop, "Select Search", "Track's search area is selected");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* locked */
- prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_LOCKED);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Lock", "Track is locked and all changes to it are disabled");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* custom color */
- prop= RNA_def_property(srna, "use_custom_color", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_custom_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_CUSTOMCOLOR);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Custom Color", "Use custom color instead of theme-defined");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* color */
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Color", "Color of the track in the Movie Track Editor and the 3D viewport after a solve");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* average error */
- prop= RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "error");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Average Error", "Average error of re-projection");
@@ -1070,75 +1070,75 @@ static void rna_def_trackingStabilization(BlenderRNA *brna)
{TRACKING_FILTER_BICUBIC, "BICUBIC", 0, "Bicubic", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "MovieTrackingStabilization", NULL);
+ srna = RNA_def_struct(brna, "MovieTrackingStabilization", NULL);
RNA_def_struct_path_func(srna, "rna_trackingStabilization_path");
RNA_def_struct_ui_text(srna, "Movie tracking stabilization data", "Match-moving stabilization data for tracking");
/* 2d stabilization */
- prop= RNA_def_property(srna, "use_2d_stabilization", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_2d_stabilization", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_2D_STABILIZATION);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Use 2D stabilization", "Use 2D stabilization for footage");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
/* tracks */
- prop= RNA_def_property(srna, "tracks", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "tracks", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_tracking_stabTracks_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0);
RNA_def_property_struct_type(prop, "MovieTrackingTrack");
RNA_def_property_ui_text(prop, "Tracks", "Collection of tracks used for stabilization");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
/* rotation track */
- prop= RNA_def_property(srna, "rotation_track", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "rotation_track", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "rot_track");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Rotation Track", "Track used to compensate rotation");
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate");
/* active track index */
- prop= RNA_def_property(srna, "active_track_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "active_track_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "act_track");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_funcs(prop, "rna_tracking_stabTracks_active_index_get", "rna_tracking_stabTracks_active_index_set", "rna_tracking_stabTracks_active_index_range");
RNA_def_property_ui_text(prop, "Active Track Index", "Index of active track in stabilization tracks list");
/* autoscale */
- prop= RNA_def_property(srna, "use_autoscale", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_autoscale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_AUTOSCALE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Autoscale", "Automatically scale footage to cover unfilled areas when stabilizating");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
/* max scale */
- prop= RNA_def_property(srna, "scale_max", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "scale_max", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "maxscale");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Maximal Scale", "Limit the amount of automatic scaling");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
/* influence_location */
- prop= RNA_def_property(srna, "influence_location", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "influence_location", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "locinf");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Location Influence", "Influence of stabilization algorithm on footage location");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
/* influence_scale */
- prop= RNA_def_property(srna, "influence_scale", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "influence_scale", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "scaleinf");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Scale Influence", "Influence of stabilization algorithm on footage scale");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
/* use_stabilize_rotation */
- prop= RNA_def_property(srna, "use_stabilize_rotation", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stabilize_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_STABILIZE_ROTATION);
RNA_def_property_ui_text(prop, "Stabilize Rotation", "Stabilize horizon line on the shot");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
/* influence_rotation */
- prop= RNA_def_property(srna, "influence_rotation", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "influence_rotation", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "rotinf");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Rotation Influence", "Influence of stabilization algorithm on footage rotation");
@@ -1157,24 +1157,24 @@ static void rna_def_reconstructedCamera(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MovieReconstructedCamera", NULL);
+ srna = RNA_def_struct(brna, "MovieReconstructedCamera", NULL);
RNA_def_struct_ui_text(srna, "Movie tracking reconstructed camera data", "Match-moving reconstructed camera data from tracker");
/* frame */
- prop= RNA_def_property(srna, "frame", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_sdna(prop, NULL, "framenr");
RNA_def_property_ui_text(prop, "Frame", "Frame number marker is keyframed on");
/* matrix */
- prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
+ prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "mat");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
RNA_def_property_ui_text(prop, "Matrix", "Worldspace transformation matrix");
/* average_error */
- prop= RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "error");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Average Error", "Average error of resonctruction");
@@ -1187,23 +1187,23 @@ static void rna_def_trackingReconstruction(BlenderRNA *brna)
rna_def_reconstructedCamera(brna);
- srna= RNA_def_struct(brna, "MovieTrackingReconstruction", NULL);
+ srna = RNA_def_struct(brna, "MovieTrackingReconstruction", NULL);
RNA_def_struct_ui_text(srna, "Movie tracking reconstruction data", "Match-moving reconstruction data from tracker");
/* is_valid */
- prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_RECONSTRUCTED);
RNA_def_property_ui_text(prop, "Reconstructed", "Is tracking data contains valid reconstruction information");
/* average_error */
- prop= RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "error");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Average Error", "Average error of resonctruction");
/* cameras */
- prop= RNA_def_property(srna, "cameras", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "cameras", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MovieReconstructedCamera");
RNA_def_property_collection_sdna(prop, NULL, "cameras", "camnr");
RNA_def_property_ui_text(prop, "Cameras", "Collection of solved cameras");
@@ -1215,18 +1215,18 @@ static void rna_def_trackingTracks(BlenderRNA *brna)
FunctionRNA *func;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MovieTrackingTracks", NULL);
+ srna = RNA_def_struct(brna, "MovieTrackingTracks", NULL);
RNA_def_struct_sdna(srna, "MovieTracking");
RNA_def_struct_ui_text(srna, "Movie Tracks", "Collection of movie tracking tracks");
- func= RNA_def_function(srna, "add", "rna_trackingTracks_add");
+ func = RNA_def_function(srna, "add", "rna_trackingTracks_add");
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
RNA_def_function_ui_description(func, "Add a number of tracks to this movie clip");
RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame", "Frame number to add tracks on", MINFRAME, MAXFRAME);
RNA_def_int(func, "count", 1, 0, INT_MAX, "Number", "Number of tracks to add to the movie clip", 0, INT_MAX);
/* active track */
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "MovieTrackingTrack");
RNA_def_property_pointer_funcs(prop, "rna_tracking_active_track_get", "rna_tracking_active_track_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK);
@@ -1239,18 +1239,18 @@ static void rna_def_trackingObjectTracks(BlenderRNA *brna)
FunctionRNA *func;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MovieTrackingObjectTracks", NULL);
+ srna = RNA_def_struct(brna, "MovieTrackingObjectTracks", NULL);
RNA_def_struct_sdna(srna, "MovieTrackingObject");
RNA_def_struct_ui_text(srna, "Movie Tracks", "Collection of movie tracking tracks");
- func= RNA_def_function(srna, "add", "rna_trackingObject_tracks_add");
+ func = RNA_def_function(srna, "add", "rna_trackingObject_tracks_add");
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
RNA_def_function_ui_description(func, "Add a number of tracks to this movie clip");
RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame", "Frame number to add tracks on", MINFRAME, MAXFRAME);
RNA_def_int(func, "count", 1, 0, INT_MAX, "Number", "Number of tracks to add to the movie clip", 0, INT_MAX);
/* active track */
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "MovieTrackingTrack");
RNA_def_property_pointer_funcs(prop, "rna_tracking_active_track_get", "rna_tracking_active_track_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK);
@@ -1262,11 +1262,11 @@ static void rna_def_trackingObject(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MovieTrackingObject", NULL);
+ srna = RNA_def_struct(brna, "MovieTrackingObject", NULL);
RNA_def_struct_ui_text(srna, "Movie tracking object data", "Match-moving object tracking and reconstruction data");
/* name */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Unique name of object");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_trackingObject_name_set");
RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2);
@@ -1274,25 +1274,25 @@ static void rna_def_trackingObject(BlenderRNA *brna)
RNA_def_struct_name_property(srna, prop);
/* is_camera */
- prop= RNA_def_property(srna, "is_camera", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_camera", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_OBJECT_CAMERA);
RNA_def_property_ui_text(prop, "Camera", "Object is used for camera tracking");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* tracks */
- prop= RNA_def_property(srna, "tracks", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "tracks", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_trackingObject_tracks_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0);
RNA_def_property_struct_type(prop, "MovieTrackingTrack");
RNA_def_property_ui_text(prop, "Tracks", "Collection of tracks in this tracking data object");
RNA_def_property_srna(prop, "MovieTrackingObjectTracks");
/* reconstruction */
- prop= RNA_def_property(srna, "reconstruction", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "reconstruction", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "MovieTrackingReconstruction");
/* scale */
- prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_float_sdna(prop, NULL, "scale");
RNA_def_property_range(prop, 0.0001f, 10000.0f);
@@ -1311,22 +1311,22 @@ static void rna_def_trackingObjects(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MovieTrackingObjects");
- srna= RNA_def_struct(brna, "MovieTrackingObjects", NULL);
+ srna = RNA_def_struct(brna, "MovieTrackingObjects", NULL);
RNA_def_struct_sdna(srna, "MovieTracking");
RNA_def_struct_ui_text(srna, "Movie Objects", "Collection of movie trackingobjects");
- func= RNA_def_function(srna, "new", "rna_trackingObject_new");
+ func = RNA_def_function(srna, "new", "rna_trackingObject_new");
RNA_def_function_ui_description(func, "Add tracking object to this movie clip");
RNA_def_string(func, "name", "", 0, "", "Name of new object");
- parm= RNA_def_pointer(func, "object", "MovieTrackingObject", "", "New motion tracking object");
+ parm = RNA_def_pointer(func, "object", "MovieTrackingObject", "", "New motion tracking object");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_trackingObject_remove");
+ func = RNA_def_function(srna, "remove", "rna_trackingObject_remove");
RNA_def_function_ui_description(func, "Remove tracking object from this movie clip");
RNA_def_pointer(func, "object", "MovieTrackingObject", "", "Motion tracking object to be removed");
/* active object */
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "MovieTrackingObject");
RNA_def_property_pointer_funcs(prop, "rna_tracking_active_object_get", "rna_tracking_active_object_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK);
@@ -1347,42 +1347,42 @@ static void rna_def_tracking(BlenderRNA *brna)
rna_def_trackingReconstruction(brna);
rna_def_trackingObject(brna);
- srna= RNA_def_struct(brna, "MovieTracking", NULL);
+ srna = RNA_def_struct(brna, "MovieTracking", NULL);
RNA_def_struct_path_func(srna, "rna_tracking_path");
RNA_def_struct_ui_text(srna, "Movie tracking data", "Match-moving data for tracking");
/* settings */
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "MovieTrackingSettings");
/* camera properties */
- prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "MovieTrackingCamera");
/* tracks */
- prop= RNA_def_property(srna, "tracks", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "tracks", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_trackingTracks_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0);
RNA_def_property_struct_type(prop, "MovieTrackingTrack");
RNA_def_property_ui_text(prop, "Tracks", "Collection of tracks in this tracking data object");
RNA_def_property_srna(prop, "MovieTrackingTracks");
/* stabilization */
- prop= RNA_def_property(srna, "stabilization", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "stabilization", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "MovieTrackingStabilization");
/* reconstruction */
- prop= RNA_def_property(srna, "reconstruction", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "reconstruction", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "MovieTrackingReconstruction");
/* objects */
- prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_trackingObjects_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0);
RNA_def_property_struct_type(prop, "MovieTrackingObject");
RNA_def_property_ui_text(prop, "Objects", "Collection of objects in this tracking data object");
rna_def_trackingObjects(brna, prop);
/* active object index */
- prop= RNA_def_property(srna, "active_object_index", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "active_object_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "objectnr");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_funcs(prop, "rna_tracking_active_object_index_get", "rna_tracking_active_object_index_set", "rna_tracking_active_object_index_range");
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 1bfed372626..7258e6353da 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -75,15 +75,15 @@ static ARegionType *region_type_find(ReportList *reports, int space_type, int re
SpaceType *st;
ARegionType *art;
- st= BKE_spacetype_from_id(space_type);
+ st = BKE_spacetype_from_id(space_type);
- for(art= (st)? st->regiontypes.first: NULL; art; art= art->next) {
- if (art->regionid==region_type)
+ for (art = (st)? st->regiontypes.first: NULL; art; art = art->next) {
+ if (art->regionid == region_type)
break;
}
/* region type not found? abort */
- if (art==NULL) {
+ if (art == NULL) {
BKE_report(reports, RPT_ERROR, "Region not found in spacetype");
return NULL;
}
@@ -104,14 +104,14 @@ static int panel_poll(const bContext *C, PanelType *pt)
int visible;
RNA_pointer_create(NULL, pt->ext.srna, NULL, &ptr); /* dummy */
- func= &rna_Panel_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
+ func = &rna_Panel_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
pt->ext.call((bContext *)C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret);
- visible= *(int*)ret;
+ visible = *(int*)ret;
RNA_parameter_list_free(&list);
@@ -127,7 +127,7 @@ static void panel_draw(const bContext *C, Panel *pnl)
FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->ext.srna, pnl, &ptr);
- func= &rna_Panel_draw_func;/* RNA_struct_find_function(&ptr, "draw"); */
+ func = &rna_Panel_draw_func;/* RNA_struct_find_function(&ptr, "draw"); */
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -145,7 +145,7 @@ static void panel_draw_header(const bContext *C, Panel *pnl)
FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->ext.srna, pnl, &ptr);
- func= &rna_Panel_draw_header_func; /* RNA_struct_find_function(&ptr, "draw_header"); */
+ func = &rna_Panel_draw_header_func; /* RNA_struct_find_function(&ptr, "draw_header"); */
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -157,11 +157,11 @@ static void panel_draw_header(const bContext *C, Panel *pnl)
static void rna_Panel_unregister(Main *UNUSED(bmain), StructRNA *type)
{
ARegionType *art;
- PanelType *pt= RNA_struct_blender_type_get(type);
+ PanelType *pt = RNA_struct_blender_type_get(type);
- if(!pt)
+ if (!pt)
return;
- if(!(art=region_type_find(NULL, pt->space_type, pt->region_type)))
+ if (!(art = region_type_find(NULL, pt->space_type, pt->region_type)))
return;
RNA_struct_free_extension(type, &pt->ext);
@@ -178,31 +178,31 @@ static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *dat
{
ARegionType *art;
PanelType *pt, dummypt = {NULL};
- Panel dummypanel= {NULL};
+ Panel dummypanel = {NULL};
PointerRNA dummyptr;
int have_function[3];
/* setup dummy panel & panel type to store static properties in */
- dummypanel.type= &dummypt;
+ dummypanel.type = &dummypt;
RNA_pointer_create(NULL, &RNA_Panel, &dummypanel, &dummyptr);
/* validate the python class */
- if(validate(&dummyptr, data, have_function) != 0)
+ if (validate(&dummyptr, data, have_function) != 0)
return NULL;
- if(strlen(identifier) >= sizeof(dummypt.idname)) {
+ if (strlen(identifier) >= sizeof(dummypt.idname)) {
BKE_reportf(reports, RPT_ERROR, "registering panel class: '%s' is too long, maximum length is %d",
identifier, (int)sizeof(dummypt.idname));
return NULL;
}
- if(!(art=region_type_find(reports, dummypt.space_type, dummypt.region_type)))
+ if (!(art = region_type_find(reports, dummypt.space_type, dummypt.region_type)))
return NULL;
/* check if we have registered this panel type before, and remove it */
- for(pt=art->paneltypes.first; pt; pt=pt->next) {
- if(strcmp(pt->idname, dummypt.idname) == 0) {
- if(pt->ext.srna)
+ for (pt = art->paneltypes.first; pt; pt = pt->next) {
+ if (strcmp(pt->idname, dummypt.idname) == 0) {
+ if (pt->ext.srna)
rna_Panel_unregister(bmain, pt->ext.srna);
else
BLI_freelinkN(&art->paneltypes, pt);
@@ -211,27 +211,27 @@ static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *dat
}
/* create a new panel type */
- pt= MEM_callocN(sizeof(PanelType), "python buttons panel");
+ pt = MEM_callocN(sizeof(PanelType), "python buttons panel");
memcpy(pt, &dummypt, sizeof(dummypt));
- pt->ext.srna= RNA_def_struct(&BLENDER_RNA, pt->idname, "Panel");
- pt->ext.data= data;
- pt->ext.call= call;
- pt->ext.free= free;
+ pt->ext.srna = RNA_def_struct(&BLENDER_RNA, pt->idname, "Panel");
+ pt->ext.data = data;
+ pt->ext.call = call;
+ pt->ext.free = free;
RNA_struct_blender_type_set(pt->ext.srna, pt);
RNA_def_struct_flag(pt->ext.srna, STRUCT_NO_IDPROPERTIES);
- pt->poll= (have_function[0])? panel_poll: NULL;
- pt->draw= (have_function[1])? panel_draw: NULL;
- pt->draw_header= (have_function[2])? panel_draw_header: NULL;
+ pt->poll = (have_function[0])? panel_poll: NULL;
+ pt->draw = (have_function[1])? panel_draw: NULL;
+ pt->draw_header = (have_function[2])? panel_draw_header: NULL;
/* XXX use "no header" flag for some ordering of panels until we have real panel ordering */
- if(pt->flag & PNL_NO_HEADER) {
+ if (pt->flag & PNL_NO_HEADER) {
PanelType *pth = art->paneltypes.first;
- while(pth && pth->flag & PNL_NO_HEADER)
- pth=pth->next;
+ while (pth && pth->flag & PNL_NO_HEADER)
+ pth = pth->next;
- if(pth)
+ if (pth)
BLI_insertlinkbefore(&art->paneltypes, pth, pt);
else
BLI_addtail(&art->paneltypes, pt);
@@ -247,7 +247,7 @@ static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *dat
static StructRNA* rna_Panel_refine(PointerRNA *ptr)
{
- Panel *hdr= (Panel*)ptr->data;
+ Panel *hdr = (Panel*)ptr->data;
return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Panel;
}
@@ -262,7 +262,7 @@ static void header_draw(const bContext *C, Header *hdr)
FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, hdr->type->ext.srna, hdr, &htr);
- func= &rna_Header_draw_func; /* RNA_struct_find_function(&htr, "draw"); */
+ func = &rna_Header_draw_func; /* RNA_struct_find_function(&htr, "draw"); */
RNA_parameter_list_create(&list, &htr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -274,11 +274,11 @@ static void header_draw(const bContext *C, Header *hdr)
static void rna_Header_unregister(Main *UNUSED(bmain), StructRNA *type)
{
ARegionType *art;
- HeaderType *ht= RNA_struct_blender_type_get(type);
+ HeaderType *ht = RNA_struct_blender_type_get(type);
- if(!ht)
+ if (!ht)
return;
- if(!(art=region_type_find(NULL, ht->space_type, RGN_TYPE_HEADER)))
+ if (!(art = region_type_find(NULL, ht->space_type, RGN_TYPE_HEADER)))
return;
RNA_struct_free_extension(type, &ht->ext);
@@ -295,47 +295,47 @@ static StructRNA *rna_Header_register(Main *bmain, ReportList *reports, void *da
{
ARegionType *art;
HeaderType *ht, dummyht = {NULL};
- Header dummyheader= {NULL};
+ Header dummyheader = {NULL};
PointerRNA dummyhtr;
int have_function[1];
/* setup dummy header & header type to store static properties in */
- dummyheader.type= &dummyht;
+ dummyheader.type = &dummyht;
RNA_pointer_create(NULL, &RNA_Header, &dummyheader, &dummyhtr);
/* validate the python class */
- if(validate(&dummyhtr, data, have_function) != 0)
+ if (validate(&dummyhtr, data, have_function) != 0)
return NULL;
- if(strlen(identifier) >= sizeof(dummyht.idname)) {
+ if (strlen(identifier) >= sizeof(dummyht.idname)) {
BKE_reportf(reports, RPT_ERROR, "registering header class: '%s' is too long, maximum length is %d",
identifier, (int)sizeof(dummyht.idname));
return NULL;
}
- if(!(art=region_type_find(reports, dummyht.space_type, RGN_TYPE_HEADER)))
+ if (!(art = region_type_find(reports, dummyht.space_type, RGN_TYPE_HEADER)))
return NULL;
/* check if we have registered this header type before, and remove it */
- for(ht=art->headertypes.first; ht; ht=ht->next) {
- if(strcmp(ht->idname, dummyht.idname) == 0) {
- if(ht->ext.srna)
+ for (ht = art->headertypes.first; ht; ht = ht->next) {
+ if (strcmp(ht->idname, dummyht.idname) == 0) {
+ if (ht->ext.srna)
rna_Header_unregister(bmain, ht->ext.srna);
break;
}
}
/* create a new header type */
- ht= MEM_callocN(sizeof(HeaderType), "python buttons header");
+ ht = MEM_callocN(sizeof(HeaderType), "python buttons header");
memcpy(ht, &dummyht, sizeof(dummyht));
- ht->ext.srna= RNA_def_struct(&BLENDER_RNA, ht->idname, "Header");
- ht->ext.data= data;
- ht->ext.call= call;
- ht->ext.free= free;
+ ht->ext.srna = RNA_def_struct(&BLENDER_RNA, ht->idname, "Header");
+ ht->ext.data = data;
+ ht->ext.call = call;
+ ht->ext.free = free;
RNA_struct_blender_type_set(ht->ext.srna, ht);
- ht->draw= (have_function[0])? header_draw: NULL;
+ ht->draw = (have_function[0])? header_draw: NULL;
BLI_addtail(&art->headertypes, ht);
@@ -347,7 +347,7 @@ static StructRNA *rna_Header_register(Main *bmain, ReportList *reports, void *da
static StructRNA* rna_Header_refine(PointerRNA *htr)
{
- Header *hdr= (Header*)htr->data;
+ Header *hdr = (Header*)htr->data;
return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Header;
}
@@ -364,14 +364,14 @@ static int menu_poll(const bContext *C, MenuType *pt)
int visible;
RNA_pointer_create(NULL, pt->ext.srna, NULL, &ptr); /* dummy */
- func= &rna_Menu_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
+ func = &rna_Menu_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
pt->ext.call((bContext *)C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret);
- visible= *(int*)ret;
+ visible = *(int*)ret;
RNA_parameter_list_free(&list);
@@ -387,7 +387,7 @@ static void menu_draw(const bContext *C, Menu *hdr)
FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, hdr->type->ext.srna, hdr, &mtr);
- func= &rna_Menu_draw_func; /* RNA_struct_find_function(&mtr, "draw"); */
+ func = &rna_Menu_draw_func; /* RNA_struct_find_function(&mtr, "draw"); */
RNA_parameter_list_create(&list, &mtr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -398,9 +398,9 @@ static void menu_draw(const bContext *C, Menu *hdr)
static void rna_Menu_unregister(Main *UNUSED(bmain), StructRNA *type)
{
- MenuType *mt= RNA_struct_blender_type_get(type);
+ MenuType *mt = RNA_struct_blender_type_get(type);
- if(!mt)
+ if (!mt)
return;
RNA_struct_free_extension(type, &mt->ext);
@@ -418,59 +418,59 @@ static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data
StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
MenuType *mt, dummymt = {NULL};
- Menu dummymenu= {NULL};
+ Menu dummymenu = {NULL};
PointerRNA dummymtr;
int have_function[2];
- size_t over_alloc= 0; /* warning, if this becomes a bess, we better do another alloc */
- size_t description_size= 0;
+ size_t over_alloc = 0; /* warning, if this becomes a bess, we better do another alloc */
+ size_t description_size = 0;
/* setup dummy menu & menu type to store static properties in */
- dummymenu.type= &dummymt;
- dummymenu.type->description= _menu_descr;
+ dummymenu.type = &dummymt;
+ dummymenu.type->description = _menu_descr;
RNA_pointer_create(NULL, &RNA_Menu, &dummymenu, &dummymtr);
- /* clear incase they are left unset */
- _menu_descr[0]= '\0';
+ /* clear in case they are left unset */
+ _menu_descr[0] = '\0';
/* validate the python class */
- if(validate(&dummymtr, data, have_function) != 0)
+ if (validate(&dummymtr, data, have_function) != 0)
return NULL;
- if(strlen(identifier) >= sizeof(dummymt.idname)) {
+ if (strlen(identifier) >= sizeof(dummymt.idname)) {
BKE_reportf(reports, RPT_ERROR, "registering menu class: '%s' is too long, maximum length is %d",
identifier, (int)sizeof(dummymt.idname));
return NULL;
}
/* check if we have registered this menu type before, and remove it */
- mt= WM_menutype_find(dummymt.idname, TRUE);
- if(mt && mt->ext.srna)
+ mt = WM_menutype_find(dummymt.idname, TRUE);
+ if (mt && mt->ext.srna)
rna_Menu_unregister(bmain, mt->ext.srna);
/* create a new menu type */
if (_menu_descr[0]) {
- description_size= strlen(_menu_descr) + 1;
+ description_size = strlen(_menu_descr) + 1;
over_alloc += description_size;
}
- mt= MEM_callocN(sizeof(MenuType) + over_alloc, "python buttons menu");
+ mt = MEM_callocN(sizeof(MenuType) + over_alloc, "python buttons menu");
memcpy(mt, &dummymt, sizeof(dummymt));
if (_menu_descr[0]) {
- char *buf= (char *)(mt + 1);
+ char *buf = (char *)(mt + 1);
memcpy(buf, _menu_descr, description_size);
- mt->description= buf;
+ mt->description = buf;
}
- mt->ext.srna= RNA_def_struct(&BLENDER_RNA, mt->idname, "Menu");
- mt->ext.data= data;
- mt->ext.call= call;
- mt->ext.free= free;
+ mt->ext.srna = RNA_def_struct(&BLENDER_RNA, mt->idname, "Menu");
+ mt->ext.data = data;
+ mt->ext.call = call;
+ mt->ext.free = free;
RNA_struct_blender_type_set(mt->ext.srna, mt);
RNA_def_struct_flag(mt->ext.srna, STRUCT_NO_IDPROPERTIES);
- mt->poll= (have_function[0])? menu_poll: NULL;
- mt->draw= (have_function[1])? menu_draw: NULL;
+ mt->poll = (have_function[0])? menu_poll: NULL;
+ mt->draw = (have_function[1])? menu_draw: NULL;
WM_menutype_add(mt);
@@ -482,15 +482,15 @@ static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data
static StructRNA* rna_Menu_refine(PointerRNA *mtr)
{
- Menu *hdr= (Menu*)mtr->data;
+ Menu *hdr = (Menu*)mtr->data;
return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Menu;
}
static void rna_Menu_bl_description_set(PointerRNA *ptr, const char *value)
{
- Menu *data= (Menu*)(ptr->data);
- char *str= (char *)data->type->description;
- if(!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
+ Menu *data = (Menu*)(ptr->data);
+ char *str = (char *)data->type->description;
+ if (!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
else assert(!"setting the bl_description on a non-builtin menu");
}
@@ -586,7 +586,7 @@ static void rna_UILayout_scale_y_set(PointerRNA *ptr, float value)
uiLayoutSetScaleY(ptr->data, value);
}
-#else // RNA_RUNTIME
+#else /* RNA_RUNTIME */
static void rna_def_ui_layout(BlenderRNA *brna)
{
@@ -602,38 +602,38 @@ static void rna_def_ui_layout(BlenderRNA *brna)
/* layout */
- srna= RNA_def_struct(brna, "UILayout", NULL);
+ srna = RNA_def_struct(brna, "UILayout", NULL);
RNA_def_struct_sdna(srna, "uiLayout");
RNA_def_struct_ui_text(srna, "UI Layout", "User interface layout in a panel or header");
- prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_UILayout_active_get", "rna_UILayout_active_set");
- prop= RNA_def_property(srna, "operator_context", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "operator_context", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, operator_context_items);
RNA_def_property_enum_funcs(prop, "rna_UILayout_op_context_get", "rna_UILayout_op_context_set", NULL);
- prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_UILayout_enabled_get", "rna_UILayout_enabled_set");
RNA_def_property_ui_text(prop, "Enabled", "When false, this (sub)layout is greyed out");
- prop= RNA_def_property(srna, "alert", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "alert", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_UILayout_alert_get", "rna_UILayout_alert_set");
- prop= RNA_def_property(srna, "alignment", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "alignment", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, alignment_items);
RNA_def_property_enum_funcs(prop, "rna_UILayout_alignment_get", "rna_UILayout_alignment_set", NULL);
#if 0
- prop= RNA_def_property(srna, "keep_aspect", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "keep_aspect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_UILayout_keep_aspect_get", "rna_UILayout_keep_aspect_set");
#endif
- prop= RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_funcs(prop, "rna_UILayout_scale_x_get", "rna_UILayout_scale_x_set", NULL);
RNA_def_property_ui_text(prop, "Scale X", "Scale factor along the X for items in this (sub)layout");
- prop= RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_funcs(prop, "rna_UILayout_scale_y_get", "rna_UILayout_scale_y_set", NULL);
RNA_def_property_ui_text(prop, "Scale Y", "Scale factor along the Y for items in this (sub)layout");
RNA_api_ui_layout(srna);
@@ -654,43 +654,43 @@ static void rna_def_panel(BlenderRNA *brna)
"arrow to collapse the panel and the label (see bl_label)"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Panel", NULL);
+ srna = RNA_def_struct(brna, "Panel", NULL);
RNA_def_struct_ui_text(srna, "Panel", "Panel containing UI elements");
RNA_def_struct_sdna(srna, "Panel");
RNA_def_struct_refine_func(srna, "rna_Panel_refine");
RNA_def_struct_register_funcs(srna, "rna_Panel_register", "rna_Panel_unregister", NULL);
/* poll */
- func= RNA_def_function(srna, "poll", NULL);
+ func = RNA_def_function(srna, "poll", NULL);
RNA_def_function_ui_description(func, "If this method returns a non-null output, then the panel can be drawn");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* draw */
- func= RNA_def_function(srna, "draw", NULL);
+ func = RNA_def_function(srna, "draw", NULL);
RNA_def_function_ui_description(func, "Draw UI elements into the panel UI layout");
RNA_def_function_flag(func, FUNC_REGISTER);
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "draw_header", NULL);
+ func = RNA_def_function(srna, "draw_header", NULL);
RNA_def_function_ui_description(func, "Draw UI elements into the panel's header UI layout");
RNA_def_function_flag(func, FUNC_REGISTER);
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "UILayout");
RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the panel in the UI");
- prop= RNA_def_property(srna, "text", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "text", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "drawname");
RNA_def_property_ui_text(prop, "Text", "XXX todo");
/* registration */
- prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_property_ui_text(prop, "ID Name",
@@ -702,33 +702,33 @@ static void rna_def_panel(BlenderRNA *brna)
/* panel's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
* when drawing panel and having this flag set will make runtime switching of language much more tricky
* because label will be stored translated */
- prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->label");
RNA_def_property_flag(prop, PROP_REGISTER);
RNA_def_property_ui_text(prop, "Label",
"The panel label, shows up in the panel header at the right of the "
"triangle used to collapse the panel");
- prop= RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->space_type");
RNA_def_property_enum_items(prop, space_type_items);
RNA_def_property_flag(prop, PROP_REGISTER);
RNA_def_property_ui_text(prop, "Space type", "The space where the panel is going to be used in");
- prop= RNA_def_property(srna, "bl_region_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_region_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->region_type");
RNA_def_property_enum_items(prop, region_type_items);
RNA_def_property_flag(prop, PROP_REGISTER);
RNA_def_property_ui_text(prop, "Region Type", "The region where the panel is going to be used in");
- prop= RNA_def_property(srna, "bl_context", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_context", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->context");
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); /* should this be optional? - Campbell */
RNA_def_property_ui_text(prop, "Context",
"The context in which the panel belongs to. (TODO: explain the "
"possible combinations bl_context/bl_region_type/bl_space_type)");
- prop= RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->flag");
RNA_def_property_enum_items(prop, panel_flag_items);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL|PROP_ENUM_FLAG);
@@ -742,28 +742,28 @@ static void rna_def_header(BlenderRNA *brna)
PropertyRNA *parm;
FunctionRNA *func;
- srna= RNA_def_struct(brna, "Header", NULL);
+ srna = RNA_def_struct(brna, "Header", NULL);
RNA_def_struct_ui_text(srna, "Header", "Editor header containing UI elements");
RNA_def_struct_sdna(srna, "Header");
RNA_def_struct_refine_func(srna, "rna_Header_refine");
RNA_def_struct_register_funcs(srna, "rna_Header_register", "rna_Header_unregister", NULL);
/* draw */
- func= RNA_def_function(srna, "draw", NULL);
+ func = RNA_def_function(srna, "draw", NULL);
RNA_def_function_ui_description(func, "Draw UI elements into the header UI layout");
RNA_def_function_flag(func, FUNC_REGISTER);
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- RNA_define_verify_sdna(0); // not in sdna
+ RNA_define_verify_sdna(0); /* not in sdna */
- prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "layout");
RNA_def_property_struct_type(prop, "UILayout");
RNA_def_property_ui_text(prop, "Layout", "Structure of the header in the UI");
/* registration */
- prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_property_ui_text(prop, "ID Name",
@@ -772,7 +772,7 @@ static void rna_def_header(BlenderRNA *brna)
"class name is \"OBJECT_HT_hello\", and bl_idname is not set by the "
"script, then bl_idname = \"OBJECT_HT_hello\"");
- prop= RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->space_type");
RNA_def_property_enum_items(prop, space_type_items);
RNA_def_property_flag(prop, PROP_REGISTER);
@@ -788,36 +788,36 @@ static void rna_def_menu(BlenderRNA *brna)
PropertyRNA *parm;
FunctionRNA *func;
- srna= RNA_def_struct(brna, "Menu", NULL);
+ srna = RNA_def_struct(brna, "Menu", NULL);
RNA_def_struct_ui_text(srna, "Menu", "Editor menu containing buttons");
RNA_def_struct_sdna(srna, "Menu");
RNA_def_struct_refine_func(srna, "rna_Menu_refine");
RNA_def_struct_register_funcs(srna, "rna_Menu_register", "rna_Menu_unregister", NULL);
/* poll */
- func= RNA_def_function(srna, "poll", NULL);
+ func = RNA_def_function(srna, "poll", NULL);
RNA_def_function_ui_description(func, "If this method returns a non-null output, then the menu can be drawn");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* draw */
- func= RNA_def_function(srna, "draw", NULL);
+ func = RNA_def_function(srna, "draw", NULL);
RNA_def_function_ui_description(func, "Draw UI elements into the menu UI layout");
RNA_def_function_flag(func, FUNC_REGISTER);
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- RNA_define_verify_sdna(0); // not in sdna
+ RNA_define_verify_sdna(0); /* not in sdna */
- prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "layout");
RNA_def_property_struct_type(prop, "UILayout");
RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the menu in the UI");
/* registration */
- prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_property_ui_text(prop, "ID Name",
@@ -829,16 +829,16 @@ static void rna_def_menu(BlenderRNA *brna)
/* menu's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
* when drawing panel and having this flag set will make runtime switching of language much more tricky
* because label will be stored translated */
- prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->label");
RNA_def_property_flag(prop, PROP_REGISTER);
RNA_def_property_ui_text(prop, "Label", "The menu label");
- prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE);
+ prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "type->description");
RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Menu_bl_description_set");
- // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
RNA_define_verify_sdna(1);
@@ -852,5 +852,5 @@ void RNA_def_ui(BlenderRNA *brna)
rna_def_menu(brna);
}
-#endif // RNA_RUNTIME
+#endif /* RNA_RUNTIME */
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 52ffdec7174..d390bedaa04 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -40,10 +40,10 @@
static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *name, int icon, int expand, int slider, int toggle, int icon_only, int event, int full_event, int emboss, int index)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
- int flag= 0;
+ PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
+ int flag = 0;
- if(!prop) {
+ if (!prop) {
RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
return;
}
@@ -61,7 +61,7 @@ static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname,
static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char *name, int icon, int emboss)
{
- int flag= UI_ITEM_O_RETURN_PROPS;
+ int flag = UI_ITEM_O_RETURN_PROPS;
flag |= (emboss)? 0: UI_ITEM_R_NO_BG;
return uiItemFullO(layout, opname, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag);
}
@@ -84,7 +84,7 @@ static void api_ui_item_common(FunctionRNA *func)
RNA_def_string_translate(func, "text", "", 0, "", "Override automatic text of the item");
- prop= RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, icon_items);
RNA_def_property_ui_text(prop, "Icon", "Override automatic icon of the item");
@@ -93,7 +93,7 @@ static void api_ui_item_common(FunctionRNA *func)
static void api_ui_item_op(FunctionRNA *func)
{
PropertyRNA *parm;
- parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator");
+ parm = RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -107,9 +107,9 @@ static void api_ui_item_rna_common(FunctionRNA *func)
{
PropertyRNA *parm;
- parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
+ parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
+ parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -131,40 +131,40 @@ void RNA_api_ui_layout(StructRNA *srna)
{0, NULL, 0, NULL, NULL}};
/* simple layout specifiers */
- func= RNA_def_function(srna, "row", "uiLayoutRow");
- parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
+ func = RNA_def_function(srna, "row", "uiLayoutRow");
+ parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed next to each other in a row");
RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
- func= RNA_def_function(srna, "column", "uiLayoutColumn");
- parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
+ func = RNA_def_function(srna, "column", "uiLayoutColumn");
+ parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed under each other in a column");
RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
- func= RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow");
+ func = RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow");
RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic", 0, INT_MAX);
- parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
+ parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
/* box layout */
- func= RNA_def_function(srna, "box", "uiLayoutBox");
- parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
+ func = RNA_def_function(srna, "box", "uiLayoutBox");
+ parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
RNA_def_function_ui_description(func, "Sublayout (items placed in this sublayout are placed "
"under each other in a column and are surrounded by a box)");
/* split layout */
- func= RNA_def_function(srna, "split", "uiLayoutSplit");
- parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
+ func = RNA_def_function(srna, "split", "uiLayoutSplit");
+ parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at", 0.0f, 1.0f);
RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
/* items */
- func= RNA_def_function(srna, "prop", "rna_uiItemR");
+ func = RNA_def_function(srna, "prop", "rna_uiItemR");
RNA_def_function_ui_description(func, "Item. Exposes an RNA item and places it into the layout");
api_ui_item_rna_common(func);
api_ui_item_common(func);
@@ -179,31 +179,31 @@ void RNA_api_ui_layout(StructRNA *srna)
"The index of this button, when set a single member of an array can be accessed, "
"when set to -1 all array members are used", -2, INT_MAX); /* RNA_NO_INDEX == -1 */
- func= RNA_def_function(srna, "props_enum", "uiItemsEnumR");
+ func = RNA_def_function(srna, "props_enum", "uiItemsEnumR");
api_ui_item_rna_common(func);
- func= RNA_def_function(srna, "prop_menu_enum", "uiItemMenuEnumR");
+ func = RNA_def_function(srna, "prop_menu_enum", "uiItemMenuEnumR");
api_ui_item_rna_common(func);
api_ui_item_common(func);
- func= RNA_def_function(srna, "prop_enum", "uiItemEnumR_string");
+ func = RNA_def_function(srna, "prop_enum", "uiItemEnumR_string");
api_ui_item_rna_common(func);
- parm= RNA_def_string(func, "value", "", 0, "", "Enum property value");
+ parm = RNA_def_string(func, "value", "", 0, "", "Enum property value");
RNA_def_property_flag(parm, PROP_REQUIRED);
api_ui_item_common(func);
- func= RNA_def_function(srna, "prop_search", "uiItemPointerR");
+ func = RNA_def_function(srna, "prop_search", "uiItemPointerR");
api_ui_item_rna_common(func);
- parm= RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in");
+ parm = RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property");
+ parm = RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property");
RNA_def_property_flag(parm, PROP_REQUIRED);
api_ui_item_common(func);
- func= RNA_def_function(srna, "operator", "rna_uiItemO");
+ func = RNA_def_function(srna, "operator", "rna_uiItemO");
api_ui_item_op_common(func);
RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text");
- parm= RNA_def_pointer(func, "properties", "OperatorProperties", "",
+ parm = RNA_def_pointer(func, "properties", "OperatorProperties", "",
"Operator properties to fill in, return when 'properties' is set to true");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
RNA_def_function_return(func, parm);
@@ -216,15 +216,15 @@ void RNA_api_ui_layout(StructRNA *srna)
parm= RNA_def_string(func, "value", "", 0, "", "Enum property value");
RNA_def_property_flag(parm, PROP_REQUIRED); */
- func= RNA_def_function(srna, "operator_enum", "uiItemsEnumO");
- parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator");
+ func = RNA_def_function(srna, "operator_enum", "uiItemsEnumO");
+ parm = RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
+ parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "operator_menu_enum", "uiItemMenuEnumO");
+ func = RNA_def_function(srna, "operator_menu_enum", "uiItemMenuEnumO");
api_ui_item_op(func); /* cant use api_ui_item_op_common because property must come right after */
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
+ parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
api_ui_item_common(func);
@@ -258,39 +258,39 @@ void RNA_api_ui_layout(StructRNA *srna)
parm= RNA_def_string(func, "value", "", 0, "", "Value of the property to call the operator with");
RNA_def_property_flag(parm, PROP_REQUIRED); */
- func= RNA_def_function(srna, "label", "uiItemL");
+ func = RNA_def_function(srna, "label", "uiItemL");
RNA_def_function_ui_description(func, "Item. Display text in the layout");
api_ui_item_common(func);
- func= RNA_def_function(srna, "menu", "uiItemM");
+ func = RNA_def_function(srna, "menu", "uiItemM");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- parm= RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu");
+ parm = RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu");
api_ui_item_common(func);
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "separator", "uiItemS");
+ func = RNA_def_function(srna, "separator", "uiItemS");
RNA_def_function_ui_description(func, "Item. Inserts empty space into the layout between items");
/* context */
- func= RNA_def_function(srna, "context_pointer_set", "uiLayoutSetContextPointer");
- parm= RNA_def_string(func, "name", "", 0, "Name", "Name of entry in the context");
+ func = RNA_def_function(srna, "context_pointer_set", "uiLayoutSetContextPointer");
+ parm = RNA_def_string(func, "name", "", 0, "Name", "Name of entry in the context");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context");
+ parm = RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
/* templates */
- func= RNA_def_function(srna, "template_header", "uiTemplateHeader");
+ func = RNA_def_function(srna, "template_header", "uiTemplateHeader");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_boolean(func, "menus", 1, "", "The header has menus, and should show menu expander");
- func= RNA_def_function(srna, "template_ID", "uiTemplateID");
+ func = RNA_def_function(srna, "template_ID", "uiTemplateID");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func);
RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block");
RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block");
RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block");
- func= RNA_def_function(srna, "template_ID_preview", "uiTemplateIDPreview");
+ func = RNA_def_function(srna, "template_ID_preview", "uiTemplateIDPreview");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func);
RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block");
@@ -299,82 +299,82 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_int(func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX);
RNA_def_int(func, "cols", 0, 0, INT_MAX, "Number of thumbnail preview columns to display", "", 0, INT_MAX);
- func= RNA_def_function(srna, "template_any_ID", "uiTemplateAnyID");
- parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
+ func = RNA_def_function(srna, "template_any_ID", "uiTemplateAnyID");
+ parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
+ parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_string(func, "type_property", "", 0, "",
+ parm = RNA_def_string(func, "type_property", "", 0, "",
"Identifier of property in data giving the type of the ID-blocks to use");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_string_translate(func, "text", "", 0, "", "Custom label to display in UI");
- func= RNA_def_function(srna, "template_path_builder", "uiTemplatePathBuilder");
- parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
+ func = RNA_def_function(srna, "template_path_builder", "uiTemplatePathBuilder");
+ parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
+ parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from");
+ parm = RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
RNA_def_string_translate(func, "text", "", 0, "", "Custom label to display in UI");
- func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier");
+ func = RNA_def_function(srna, "template_modifier", "uiTemplateModifier");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Layout . Generates the UI layout for modifiers");
- parm= RNA_def_pointer(func, "data", "Modifier", "", "Modifier data");
+ parm = RNA_def_pointer(func, "data", "Modifier", "", "Modifier data");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
+ parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "template_constraint", "uiTemplateConstraint");
+ func = RNA_def_function(srna, "template_constraint", "uiTemplateConstraint");
RNA_def_function_ui_description(func, "Layout . Generates the UI layout for constraints");
- parm= RNA_def_pointer(func, "data", "Constraint", "", "Constraint data");
+ parm = RNA_def_pointer(func, "data", "Constraint", "", "Constraint data");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
+ parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "template_preview", "uiTemplatePreview");
+ func = RNA_def_function(srna, "template_preview", "uiTemplatePreview");
RNA_def_function_ui_description(func, "Item. A preview window for materials, textures, lamps, etc");
- parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock");
+ parm = RNA_def_pointer(func, "id", "ID", "", "ID datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_boolean(func, "show_buttons", 1, "", "Show preview buttons?");
RNA_def_pointer(func, "parent", "ID", "", "ID datablock");
RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot");
- func= RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping");
+ func = RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping");
RNA_def_function_ui_description(func, "Item. A curve mapping widget used for e.g falloff curves for lamps");
api_ui_item_rna_common(func);
RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display");
RNA_def_boolean(func, "levels", 0, "", "Show black/white levels");
RNA_def_boolean(func, "brush", 0, "", "Show brush options");
- func= RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp");
+ func = RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp");
RNA_def_function_ui_description(func, "Item. A color ramp widget");
api_ui_item_rna_common(func);
RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail");
- func= RNA_def_function(srna, "template_histogram", "uiTemplateHistogram");
+ func = RNA_def_function(srna, "template_histogram", "uiTemplateHistogram");
RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data");
api_ui_item_rna_common(func);
- func= RNA_def_function(srna, "template_waveform", "uiTemplateWaveform");
+ func = RNA_def_function(srna, "template_waveform", "uiTemplateWaveform");
RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data");
api_ui_item_rna_common(func);
- func= RNA_def_function(srna, "template_vectorscope", "uiTemplateVectorscope");
+ func = RNA_def_function(srna, "template_vectorscope", "uiTemplateVectorscope");
RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data");
api_ui_item_rna_common(func);
- func= RNA_def_function(srna, "template_layers", "uiTemplateLayers");
+ func = RNA_def_function(srna, "template_layers", "uiTemplateLayers");
api_ui_item_rna_common(func);
- parm= RNA_def_pointer(func, "used_layers_data", "AnyType", "", "Data from which to take property");
+ parm = RNA_def_pointer(func, "used_layers_data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
- parm= RNA_def_string(func, "used_layers_property", "", 0, "", "Identifier of property in data");
+ parm = RNA_def_string(func, "used_layers_property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_int(func, "active_layer", 0, 0, INT_MAX, "Active Layer", "", 0, INT_MAX);
+ parm = RNA_def_int(func, "active_layer", 0, 0, INT_MAX, "Active Layer", "", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "template_color_wheel", "uiTemplateColorWheel");
+ func = RNA_def_function(srna, "template_color_wheel", "uiTemplateColorWheel");
RNA_def_function_ui_description(func, "Item. A color wheel widget to pick colors");
api_ui_item_rna_common(func);
RNA_def_boolean(func, "value_slider", 0, "", "Display the value slider to the right of the color wheel");
@@ -382,55 +382,55 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_boolean(func, "lock_luminosity", 0, "", "Keep the color at its original vector length");
RNA_def_boolean(func, "cubic", 1, "", "Cubic saturation for picking values close to white");
- func= RNA_def_function(srna, "template_image_layers", "uiTemplateImageLayers");
+ func = RNA_def_function(srna, "template_image_layers", "uiTemplateImageLayers");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "image", "Image", "", "");
+ parm = RNA_def_pointer(func, "image", "Image", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "image_user", "ImageUser", "", "");
+ parm = RNA_def_pointer(func, "image_user", "ImageUser", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "template_image", "uiTemplateImage");
+ func = RNA_def_function(srna, "template_image", "uiTemplateImage");
RNA_def_function_ui_description(func, "Item(s). User interface for selecting images and their source paths");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func);
- parm= RNA_def_pointer(func, "image_user", "ImageUser", "", "");
+ parm = RNA_def_pointer(func, "image_user", "ImageUser", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
RNA_def_boolean(func, "compact", 0, "", "Use more compact layout");
- func= RNA_def_function(srna, "template_image_settings", "uiTemplateImageSettings");
+ func = RNA_def_function(srna, "template_image_settings", "uiTemplateImageSettings");
RNA_def_function_ui_description(func, "User interface for setting image format options");
- parm= RNA_def_pointer(func, "image_settings", "ImageFormatSettings", "", "");
+ parm = RNA_def_pointer(func, "image_settings", "ImageFormatSettings", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "template_movieclip", "uiTemplateMovieClip");
+ func = RNA_def_function(srna, "template_movieclip", "uiTemplateMovieClip");
RNA_def_function_ui_description(func, "Item(s). User interface for selecting movie clips and their source paths");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func);
RNA_def_boolean(func, "compact", 0, "", "Use more compact layout");
- func= RNA_def_function(srna, "template_track", "uiTemplateTrack");
+ func = RNA_def_function(srna, "template_track", "uiTemplateTrack");
RNA_def_function_ui_description(func, "Item. A movie-track widget to preview tracking image.");
api_ui_item_rna_common(func);
- func= RNA_def_function(srna, "template_marker", "uiTemplateMarker");
+ func = RNA_def_function(srna, "template_marker", "uiTemplateMarker");
RNA_def_function_ui_description(func, "Item. A widget to control single marker settings.");
api_ui_item_rna_common(func);
- parm= RNA_def_pointer(func, "clip_user", "MovieClipUser", "", "");
+ parm = RNA_def_pointer(func, "clip_user", "MovieClipUser", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_pointer(func, "track", "MovieTrackingTrack", "", "");
+ parm = RNA_def_pointer(func, "track", "MovieTrackingTrack", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
RNA_def_boolean(func, "compact", 0, "", "Use more compact layout");
- func= RNA_def_function(srna, "template_list", "uiTemplateList");
+ func = RNA_def_function(srna, "template_list", "uiTemplateList");
RNA_def_function_ui_description(func, "Item. A list widget to display data. e.g. vertexgroups");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
+ parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
+ parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element");
+ parm = RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element");
+ parm = RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_string(func, "prop_list", "", 0, "",
"Identifier of a string property in each data member, specifying which "
@@ -440,46 +440,46 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display", 0, INT_MAX);
RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use");
- func= RNA_def_function(srna, "template_running_jobs", "uiTemplateRunningJobs");
+ func = RNA_def_function(srna, "template_running_jobs", "uiTemplateRunningJobs");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function(srna, "template_operator_search", "uiTemplateOperatorSearch");
- func= RNA_def_function(srna, "template_header_3D", "uiTemplateHeader3D");
+ func = RNA_def_function(srna, "template_header_3D", "uiTemplateHeader3D");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- func= RNA_def_function(srna, "template_edit_mode_selection", "uiTemplateEditModeSelection");
+ func = RNA_def_function(srna, "template_edit_mode_selection", "uiTemplateEditModeSelection");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- func= RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner");
+ func = RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- func= RNA_def_function(srna, "template_node_link", "uiTemplateNodeLink");
- parm= RNA_def_pointer(func, "ntree", "NodeTree", "", "");
+ func = RNA_def_function(srna, "template_node_link", "uiTemplateNodeLink");
+ parm = RNA_def_pointer(func, "ntree", "NodeTree", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "node", "Node", "", "");
+ parm = RNA_def_pointer(func, "node", "Node", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "");
+ parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "template_node_view", "uiTemplateNodeView");
+ func = RNA_def_function(srna, "template_node_view", "uiTemplateNodeView");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "ntree", "NodeTree", "", "");
+ parm = RNA_def_pointer(func, "ntree", "NodeTree", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "node", "Node", "", "");
+ parm = RNA_def_pointer(func, "node", "Node", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "");
+ parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "template_texture_user", "uiTemplateTextureUser");
+ func = RNA_def_function(srna, "template_texture_user", "uiTemplateTextureUser");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- func= RNA_def_function(srna, "template_keymap_item_properties", "uiTemplateKeymapItemProperties");
- parm= RNA_def_pointer(func, "item", "KeyMapItem", "", "");
+ func = RNA_def_function(srna, "template_keymap_item_properties", "uiTemplateKeymapItemProperties");
+ parm = RNA_def_pointer(func, "item", "KeyMapItem", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- func= RNA_def_function(srna, "introspect", "uiLayoutIntrospect");
- parm= RNA_def_string(func, "string", "", 1024*1024, "Descr", "DESCR");
+ func = RNA_def_function(srna, "introspect", "uiLayoutIntrospect");
+ parm = RNA_def_string(func, "string", "", 1024*1024, "Descr", "DESCR");
RNA_def_function_return(func, parm);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 1ca95f96ee5..68e713ef7c5 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -105,12 +105,12 @@ static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, Point
SpaceLink *sl;
/* from scene copy to the other views */
- for(sc=bmain->screen.first; sc; sc=sc->id.next) {
- for(sa=sc->areabase.first; sa; sa=sa->next) {
- for(sl=sa->spacedata.first; sl; sl=sl->next) {
- if(sl->spacetype==SPACE_VIEW3D) {
- View3D *v3d= (View3D *)sl;
- if(userdef->tw_flag & V3D_USE_MANIPULATOR)
+ for (sc = bmain->screen.first; sc; sc = sc->id.next) {
+ for (sa = sc->areabase.first; sa; sa = sa->next) {
+ for (sl = sa->spacedata.first; sl; sl = sl->next) {
+ if (sl->spacetype == SPACE_VIEW3D) {
+ View3D *v3d = (View3D *)sl;
+ if (userdef->tw_flag & V3D_USE_MANIPULATOR)
v3d->twflag |= V3D_USE_MANIPULATOR;
else
v3d->twflag &= ~V3D_USE_MANIPULATOR;
@@ -158,7 +158,7 @@ static void rna_userdef_select_mouse_set(PointerRNA *ptr,int value)
{
UserDef *userdef = (UserDef*)ptr->data;
- if(value) {
+ if (value) {
userdef->flag |= USER_LMOUSESELECT;
userdef->flag &= ~USER_TWOBUTTONMOUSE;
}
@@ -171,7 +171,7 @@ static int rna_userdef_autokeymode_get(PointerRNA *ptr)
UserDef *userdef = (UserDef*)ptr->data;
short retval = userdef->autokey_mode;
- if(!(userdef->autokey_mode & AUTOKEY_ON))
+ if (!(userdef->autokey_mode & AUTOKEY_ON))
retval |= AUTOKEY_ON;
return retval;
@@ -181,11 +181,11 @@ static void rna_userdef_autokeymode_set(PointerRNA *ptr,int value)
{
UserDef *userdef = (UserDef*)ptr->data;
- if(value == AUTOKEY_MODE_NORMAL) {
+ if (value == AUTOKEY_MODE_NORMAL) {
userdef->autokey_mode |= (AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
userdef->autokey_mode &= ~(AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
}
- else if(value == AUTOKEY_MODE_EDITKEYS) {
+ else if (value == AUTOKEY_MODE_EDITKEYS) {
userdef->autokey_mode |= (AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
userdef->autokey_mode &= ~(AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
}
@@ -197,7 +197,7 @@ static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value)
int required_size = userdef->v2d_min_gridsize;
/* set the timecode style */
- userdef->timecode_style= value;
+ userdef->timecode_style = value;
/* adjust the v2d gridsize if needed so that timecodes don't overlap
* NOTE: most of these have been hand-picked to avoid overlaps while still keeping
@@ -207,22 +207,22 @@ static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value)
case USER_TIMECODE_MINIMAL:
case USER_TIMECODE_SECONDS_ONLY:
/* 35 is great most of the time, but not that great for full-blown */
- required_size= 35;
+ required_size = 35;
break;
case USER_TIMECODE_SMPTE_MSF:
- required_size= 50;
+ required_size = 50;
break;
case USER_TIMECODE_SMPTE_FULL:
/* the granddaddy! */
- required_size= 65;
+ required_size = 65;
break;
case USER_TIMECODE_MILLISECONDS:
- required_size= 45;
+ required_size = 45;
break;
}
if (U.v2d_min_gridsize < required_size)
- U.v2d_min_gridsize= required_size;
+ U.v2d_min_gridsize = required_size;
}
static PointerRNA rna_UserDef_view_get(PointerRNA *ptr)
@@ -266,8 +266,8 @@ static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRN
vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
- for(ob= bmain->object.first; ob; ob= ob->id.next) {
- if(ob->mode & OB_MODE_WEIGHT_PAINT)
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
+ if (ob->mode & OB_MODE_WEIGHT_PAINT)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
@@ -278,8 +278,8 @@ static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, Pointe
{
/* if all lights are off gpu_draw resets them all, [#27627]
* so disallow them all to be disabled */
- if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) {
- SolidLight *light= ptr->data;
+ if (U.light[0].flag == 0 && U.light[1].flag == 0 && U.light[2].flag == 0) {
+ SolidLight *light = ptr->data;
light->flag |= 1;
}
@@ -289,16 +289,16 @@ static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, Pointe
static void rna_userdef_autosave_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- wmWindowManager *wm= bmain->wm.first;
+ wmWindowManager *wm = bmain->wm.first;
- if(wm)
+ if (wm)
WM_autosave_init(wm);
rna_userdef_update(bmain, scene, ptr);
}
static bAddon *rna_userdef_addon_new(void)
{
- bAddon *bext= MEM_callocN(sizeof(bAddon), "bAddon");
+ bAddon *bext = MEM_callocN(sizeof(bAddon), "bAddon");
BLI_addtail(&U.addons, bext);
return bext;
}
@@ -333,14 +333,14 @@ static PointerRNA rna_Theme_space_list_generic_get(PointerRNA *ptr)
#ifdef WITH_CYCLES
static EnumPropertyItem *rna_userdef_compute_device_type_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
{
- EnumPropertyItem *item= NULL;
- int totitem= 0;
+ EnumPropertyItem *item = NULL;
+ int totitem = 0;
/* add supported device types */
RNA_enum_items_add_value(&item, &totitem, compute_device_type_items, USER_COMPUTE_DEVICE_NONE);
- if(CCL_compute_device_list(0))
+ if (CCL_compute_device_list(0))
RNA_enum_items_add_value(&item, &totitem, compute_device_type_items, USER_COMPUTE_DEVICE_CUDA);
- if(CCL_compute_device_list(1))
+ if (CCL_compute_device_list(1))
RNA_enum_items_add_value(&item, &totitem, compute_device_type_items, USER_COMPUTE_DEVICE_OPENCL);
RNA_enum_item_end(&item, &totitem);
@@ -351,7 +351,7 @@ static EnumPropertyItem *rna_userdef_compute_device_type_itemf(bContext *UNUSED(
static int rna_userdef_compute_device_get(PointerRNA *UNUSED(ptr))
{
- if(U.compute_device_type == USER_COMPUTE_DEVICE_NONE)
+ if (U.compute_device_type == USER_COMPUTE_DEVICE_NONE)
return 0;
return U.compute_device_id;
@@ -359,11 +359,11 @@ static int rna_userdef_compute_device_get(PointerRNA *UNUSED(ptr))
static EnumPropertyItem *rna_userdef_compute_device_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
{
- EnumPropertyItem tmp= {0, "", 0, "", ""};
- EnumPropertyItem *item= NULL;
- int totitem= 0;
+ EnumPropertyItem tmp = {0, "", 0, "", ""};
+ EnumPropertyItem *item = NULL;
+ int totitem = 0;
- if(U.compute_device_type == USER_COMPUTE_DEVICE_NONE) {
+ if (U.compute_device_type == USER_COMPUTE_DEVICE_NONE) {
/* only add a single CPU device */
tmp.value = 0;
tmp.name = "CPU";
@@ -377,8 +377,8 @@ static EnumPropertyItem *rna_userdef_compute_device_itemf(bContext *UNUSED(C), P
CCLDeviceInfo *devices = CCL_compute_device_list(opencl);
int a;
- if(devices) {
- for(a = 0; devices[a].name; a++) {
+ if (devices) {
+ for (a = 0; devices[a].name; a++) {
tmp.value = devices[a].value;
tmp.identifier = devices[a].identifier;
tmp.name = devices[a].name;
@@ -412,49 +412,49 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
{1, "DEFAULT", 0, "Default", "Use scaled and grid-fitted kerning distances"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ThemeFontStyle", NULL);
+ srna = RNA_def_struct(brna, "ThemeFontStyle", NULL);
RNA_def_struct_sdna(srna, "uiFontStyle");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Font Style", "Theme settings for Font");
- prop= RNA_def_property(srna, "points", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "points", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 6, 48);
RNA_def_property_ui_text(prop, "Points", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "font_kerning_style", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "font_kerning_style", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "kerning");
RNA_def_property_enum_items(prop, font_kerning_style);
RNA_def_property_ui_text(prop, "Kerning Style", "Which style to use for font kerning");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 5);
RNA_def_property_ui_text(prop, "Shadow Size", "Shadow size in pixels (0, 3 and 5 supported)");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "shadow_offset_x", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_offset_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "shadx");
RNA_def_property_range(prop, -10, 10);
RNA_def_property_ui_text(prop, "Shadow X Offset", "Shadow offset in pixels");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "shadow_offset_y", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadow_offset_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "shady");
RNA_def_property_range(prop, -10, 10);
RNA_def_property_ui_text(prop, "Shadow Y Offset", "Shadow offset in pixels");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "shadowalpha", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadowalpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Shadow Alpha", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "shadowcolor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadowcolor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in grey value");
RNA_def_property_update(prop, 0, "rna_userdef_update");
-}
+}
static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
{
@@ -463,7 +463,7 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
rna_def_userdef_theme_ui_font_style(brna);
- srna= RNA_def_struct(brna, "ThemeStyle", NULL);
+ srna = RNA_def_struct(brna, "ThemeStyle", NULL);
RNA_def_struct_sdna(srna, "uiStyle");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
@@ -473,7 +473,7 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
RNA_def_property_range(prop, 0.5, 2.0);
RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas");
*/
- prop= RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
@@ -487,73 +487,73 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Group Label Font", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
*/
- prop= RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
RNA_def_property_ui_text(prop, "Widget Label Style", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "widget");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
RNA_def_property_ui_text(prop, "Widget Style", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
-}
+}
static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ThemeWidgetColors", NULL);
+ srna = RNA_def_struct(brna, "ThemeWidgetColors", NULL);
RNA_def_struct_sdna(srna, "uiWidgetColors");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Widget Color Set", "Theme settings for widget color sets");
- prop= RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Outline", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "inner", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "inner", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Inner", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "inner_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "inner_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Inner Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "item", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "item", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Item", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Text", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "text_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "text_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Text Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "show_shaded", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_shaded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shaded", 1);
RNA_def_property_ui_text(prop, "Shaded", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "shadetop", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadetop", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, -100, 100);
RNA_def_property_ui_text(prop, "Shade Top", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "shadedown", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "shadedown", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, -100, 100);
RNA_def_property_ui_text(prop, "Shade Down", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -564,42 +564,42 @@ static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ThemeWidgetStateColors", NULL);
+ srna = RNA_def_struct(brna, "ThemeWidgetStateColors", NULL);
RNA_def_struct_sdna(srna, "uiWidgetStateColors");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Widget State Color", "Theme settings for widget state colors");
- prop= RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Animated", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "inner_anim_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "inner_anim_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Animated Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "inner_key", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "inner_key", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Keyframe", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "inner_key_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "inner_key_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Keyframe Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "inner_driven", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "inner_driven", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Driven", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "inner_driven_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "inner_driven_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Driven Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "blend", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "blend", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_ui_text(prop, "Blend", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
}
@@ -609,16 +609,16 @@ static void rna_def_userdef_theme_ui_panel(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ThemePanelColors", NULL);
+ srna = RNA_def_struct(brna, "ThemePanelColors", NULL);
RNA_def_struct_sdna(srna, "uiPanelColors");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Panel Color", "Theme settings for panel colors");
- prop= RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_ui_text(prop, "Header", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "show_header", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_header", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Show Header", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
}
@@ -632,107 +632,107 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
rna_def_userdef_theme_ui_wcol_state(brna);
rna_def_userdef_theme_ui_panel(brna);
- srna= RNA_def_struct(brna, "ThemeUserInterface", NULL);
+ srna = RNA_def_struct(brna, "ThemeUserInterface", NULL);
RNA_def_struct_sdna(srna, "ThemeUI");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme User Interface", "Theme settings for user interface elements");
- prop= RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Regular Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Tool Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Radio Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Text Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Option Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Toggle Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Number Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Slider Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Box Backdrop Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Menu Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Pulldown Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Menu Backdrop Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Menu Item Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Scroll Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_progress", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_progress", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Progress Bar Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "List Item Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "State Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "panel", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "panel", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Panel Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "icon_file", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "icon_file", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "iconfile");
RNA_def_property_ui_text(prop, "Icon File", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "icon_alpha", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "icon_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_ui_text(prop, "Icon Alpha", "Transparency of icons in the interface, to reduce contrast");
RNA_def_property_update(prop, 0, "rna_userdef_update");
}
@@ -742,69 +742,69 @@ static void rna_def_userdef_theme_space_generic(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ThemeSpaceGeneric", NULL);
+ srna = RNA_def_struct(brna, "ThemeSpaceGeneric", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_ui_text(srna, "Theme Space Settings", "");
/* window */
- prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Window Background", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "title", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "title", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Title", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Text", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Text Highlight", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* header */
- prop= RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Header", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "header_text", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "header_text", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Header Text", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "header_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "header_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Header Text Highlight", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* buttons */
-// if(! ELEM(spacetype, SPACE_BUTS, SPACE_OUTLINER)) {
- prop= RNA_def_property(srna, "button", PROP_FLOAT, PROP_COLOR_GAMMA);
+/* if(! ELEM(spacetype, SPACE_BUTS, SPACE_OUTLINER)) { */
+ prop = RNA_def_property(srna, "button", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Region Background", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "button_title", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "button_title", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Region Text Titles", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "button_text", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "button_text", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Region Text", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "button_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "button_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Region Text Highlight", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
-// }
+/* } */
}
/* list / channels */
@@ -813,26 +813,26 @@ static void rna_def_userdef_theme_space_list_generic(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ThemeSpaceListGeneric", NULL);
+ srna = RNA_def_struct(brna, "ThemeSpaceListGeneric", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_ui_text(srna, "Theme Space List Settings", "");
- prop= RNA_def_property(srna, "list", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "list", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Source List", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "list_title", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "list_title", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Source List Title", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "list_text", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "list_text", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Source List Text", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "list_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "list_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Source List Text Highlight", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -842,7 +842,7 @@ static void rna_def_userdef_theme_spaces_main(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "space", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "space", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "ThemeSpaceGeneric");
RNA_def_property_pointer_funcs(prop, "rna_Theme_space_generic_get", NULL, NULL, NULL);
@@ -853,7 +853,7 @@ static void rna_def_userdef_theme_spaces_list_main(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "space_list", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "space_list", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "ThemeSpaceListGeneric");
RNA_def_property_pointer_funcs(prop, "rna_Theme_space_list_generic_get", NULL, NULL, NULL);
@@ -864,17 +864,17 @@ static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Vertex", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Vertex Select", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "vertex_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "vertex_size", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Vertex Size", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -884,27 +884,27 @@ static void rna_def_userdef_theme_spaces_edge(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Edge Select", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "edge_seam", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "edge_seam", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Edge Seam", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "edge_sharp", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "edge_sharp", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Edge Sharp", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "edge_crease", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "edge_crease", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Edge Crease", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "edge_facesel", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "edge_facesel", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Edge UV Face Select", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -919,22 +919,22 @@ static void rna_def_userdef_theme_spaces_face(StructRNA *srna)
{
PropertyRNA *prop;
- prop= RNA_def_property(srna, "face", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "face", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Face", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "face_select", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "face_select", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Face Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "face_dot", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "face_dot", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Face Dot Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "facedot_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "facedot_size", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Face Dot Size", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -950,80 +950,80 @@ static void rna_def_userdef_theme_spaces_curves(StructRNA *srna, short incl_nurb
PropertyRNA *prop;
if (incl_nurbs) {
- prop= RNA_def_property(srna, "nurb_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "nurb_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "nurb_uline");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "NURBS U-lines", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "nurb_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "nurb_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "nurb_vline");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "NURBS V-lines", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "nurb_sel_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "nurb_sel_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "nurb_sel_uline");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "NURBS active U-lines", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "nurb_sel_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "nurb_sel_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "nurb_sel_vline");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "NURBS active V-lines", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "act_spline", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "act_spline", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "act_spline");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Active spline", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
}
- prop= RNA_def_property(srna, "handle_free", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "handle_free", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "handle_free");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Free handle color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "handle_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "handle_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "handle_auto");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Auto handle color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "handle_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "handle_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "handle_vect");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Vector handle color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "handle_align", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "handle_align", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "handle_align");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Align handle color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "handle_sel_free", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "handle_sel_free", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "handle_sel_free");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Free handle selected color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "handle_sel_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "handle_sel_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "handle_sel_auto");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Auto handle selected color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "handle_sel_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "handle_sel_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "handle_sel_vect");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Vector handle selected color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "handle_sel_align", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "handle_sel_align", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "handle_sel_align");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Align handle selected color", "");
@@ -1031,20 +1031,20 @@ static void rna_def_userdef_theme_spaces_curves(StructRNA *srna, short incl_nurb
if (incl_nurbs == 0) {
/* assume that when nurbs are off, this is for 2D (i.e. anim) editors */
- prop= RNA_def_property(srna, "handle_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "handle_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "handle_auto_clamped");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Auto-Clamped handle color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "handle_sel_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "handle_sel_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "handle_sel_auto_clamped");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Auto-Clamped handle selected color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
}
- prop= RNA_def_property(srna, "lastsel_point", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "lastsel_point", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "lastsel_point");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Last selected point", "");
@@ -1058,63 +1058,63 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
/* space_view3d */
- srna= RNA_def_struct(brna, "ThemeView3D", NULL);
+ srna = RNA_def_struct(brna, "ThemeView3D", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme 3D View", "Theme settings for the 3D View");
rna_def_userdef_theme_spaces_main(srna);
- prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Grid", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Panel", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Wire", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "lamp", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "lamp", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Lamp", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "speaker", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "speaker", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Speaker", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "select");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Object Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "object_active", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "object_active", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "active");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Active Object", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "object_grouped", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "object_grouped", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "group");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Object Grouped", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "object_grouped_active", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "object_grouped_active", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "group_active");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Object Grouped Active", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "transform", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "transform", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Transform", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -1124,64 +1124,64 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
rna_def_userdef_theme_spaces_face(srna);
rna_def_userdef_theme_spaces_curves(srna, 1);
- prop= RNA_def_property(srna, "extra_edge_len", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "extra_edge_len", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Edge Length Text", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "extra_face_angle", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "extra_face_angle", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Face Angle Text", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "extra_face_area", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "extra_face_area", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Face Area Text", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Face Normal", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "vertex_normal", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "vertex_normal", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Vertex Normal", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "bone_solid", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "bone_solid", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Bone Solid", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "bone_pose", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "bone_pose", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Bone Pose", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "cframe");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Current Frame", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "outline_width", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "outline_width", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 5);
RNA_def_property_ui_text(prop, "Outline Width", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "bundle_solid", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "bundle_solid", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "bundle_solid");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Bundle Solid", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "camera_path", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "camera_path", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "camera_path");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Camera Path", "");
@@ -1196,7 +1196,7 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna)
/* space_graph */
- srna= RNA_def_struct(brna, "ThemeGraphEditor", NULL);
+ srna = RNA_def_struct(brna, "ThemeGraphEditor", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the graph editor");
@@ -1204,23 +1204,23 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna)
rna_def_userdef_theme_spaces_main(srna);
rna_def_userdef_theme_spaces_list_main(srna);
- prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Grid", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Panel", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "shade1");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Window Sliders", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "channels_region", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "channels_region", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "shade2");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Channels Region", "");
@@ -1229,46 +1229,46 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna)
rna_def_userdef_theme_spaces_vertex(srna);
rna_def_userdef_theme_spaces_curves(srna, 0);
- prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "cframe");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Current Frame", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Handle Vertex", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Handle Vertex Select", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Handle Vertex Size", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "group");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Channel Group", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "group_active");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Active Channel Group", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "ds_channel");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
@@ -1282,7 +1282,7 @@ static void rna_def_userdef_theme_space_file(BlenderRNA *brna)
/* space_file */
- srna= RNA_def_struct(brna, "ThemeFileBrowser", NULL);
+ srna = RNA_def_struct(brna, "ThemeFileBrowser", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme File Browser", "Theme settings for the File Browser");
@@ -1290,37 +1290,37 @@ static void rna_def_userdef_theme_space_file(BlenderRNA *brna)
rna_def_userdef_theme_spaces_main(srna);
rna_def_userdef_theme_spaces_list_main(srna);
- prop= RNA_def_property(srna, "selected_file", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "selected_file", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "hilite");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Selected File", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "tiles", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "tiles", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "panel");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Tiles", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "scrollbar", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "scrollbar", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "shade1");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Scrollbar", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "scroll_handle", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "scroll_handle", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "shade2");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Scroll Handle", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "active_file", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "active_file", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "active");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Active File", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "active_file_text", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "active_file_text", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "grid");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Active File Text", "");
@@ -1334,19 +1334,19 @@ static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna)
/* space_outliner */
- srna= RNA_def_struct(brna, "ThemeOutliner", NULL);
+ srna = RNA_def_struct(brna, "ThemeOutliner", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Outliner", "Theme settings for the Outliner");
rna_def_userdef_theme_spaces_main(srna);
- prop= RNA_def_property(srna, "match", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "match", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Filter Match", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "selected_highlight", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "selected_highlight", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Selected Highlight", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -1358,7 +1358,7 @@ static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna)
/* space_userpref */
- srna= RNA_def_struct(brna, "ThemeUserPreferences", NULL);
+ srna = RNA_def_struct(brna, "ThemeUserPreferences", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences");
@@ -1373,38 +1373,38 @@ static void rna_def_userdef_theme_space_console(BlenderRNA *brna)
/* space_console */
- srna= RNA_def_struct(brna, "ThemeConsole", NULL);
+ srna = RNA_def_struct(brna, "ThemeConsole", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Console", "Theme settings for the Console");
rna_def_userdef_theme_spaces_main(srna);
- prop= RNA_def_property(srna, "line_output", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "line_output", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "console_output");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Line Output", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "line_input", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "line_input", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "console_input");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Line Input", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "line_info", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "line_info", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "console_info");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Line Info", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "line_error", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "line_error", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "console_error");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Line Error", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "console_cursor");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Cursor", "");
@@ -1417,7 +1417,7 @@ static void rna_def_userdef_theme_space_info(BlenderRNA *brna)
/* space_info */
- srna= RNA_def_struct(brna, "ThemeInfo", NULL);
+ srna = RNA_def_struct(brna, "ThemeInfo", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Info", "Theme settings for Info");
@@ -1433,62 +1433,62 @@ static void rna_def_userdef_theme_space_text(BlenderRNA *brna)
/* space_text */
- srna= RNA_def_struct(brna, "ThemeTextEditor", NULL);
+ srna = RNA_def_struct(brna, "ThemeTextEditor", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Text Editor", "Theme settings for the Text Editor");
rna_def_userdef_theme_spaces_main(srna);
- prop= RNA_def_property(srna, "line_numbers_background", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "line_numbers_background", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "grid");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Line Numbers Background", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "scroll_bar", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "scroll_bar", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "shade1");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Scroll Bar", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "shade2");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Selected Text", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "hilite");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Cursor", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "syntax_builtin", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "syntax_builtin", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "syntaxb");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Syntax Built-in", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "syntaxv");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Syntax Special", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "syntaxc");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Syntax Comment", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "syntax_string", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "syntax_string", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "syntaxl");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Syntax String", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "syntax_numbers", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "syntax_numbers", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "syntaxn");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Syntax Numbers", "");
@@ -1502,7 +1502,7 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
/* space_node */
- srna= RNA_def_struct(brna, "ThemeNodeEditor", NULL);
+ srna = RNA_def_struct(brna, "ThemeNodeEditor", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Node Editor", "Theme settings for the Node Editor");
@@ -1510,55 +1510,55 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
rna_def_userdef_theme_spaces_main(srna);
rna_def_userdef_theme_spaces_list_main(srna);
- prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "wire");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Wires", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wire_select", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "wire_select", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "edge_select");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Wire Select", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "shade2");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Selected Text", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "node_backdrop", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "node_backdrop", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "syntaxl");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Node Backdrop", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "in_out_node", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "in_out_node", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "syntaxn");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "In/Out Node", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "syntaxv");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Converter Node", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "operator_node", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "operator_node", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "syntaxb");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Operator Node", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "syntaxc");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Group Node", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "noodle_curving", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "noodle_curving", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noodle_curving");
RNA_def_property_int_default(prop, 5);
RNA_def_property_range(prop, 0, 10);
@@ -1573,14 +1573,14 @@ static void rna_def_userdef_theme_space_logic(BlenderRNA *brna)
/* space_logic */
- srna= RNA_def_struct(brna, "ThemeLogicEditor", NULL);
+ srna = RNA_def_struct(brna, "ThemeLogicEditor", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Logic Editor", "Theme settings for the Logic Editor");
rna_def_userdef_theme_spaces_main(srna);
- prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Panel", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -1594,14 +1594,14 @@ static void rna_def_userdef_theme_space_buts(BlenderRNA *brna)
/* space_buts */
- srna= RNA_def_struct(brna, "ThemeProperties", NULL);
+ srna = RNA_def_struct(brna, "ThemeProperties", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties");
rna_def_userdef_theme_spaces_main(srna);
- prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Panel", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -1614,19 +1614,19 @@ static void rna_def_userdef_theme_space_time(BlenderRNA *brna)
/* space_time */
- srna= RNA_def_struct(brna, "ThemeTimeline", NULL);
+ srna = RNA_def_struct(brna, "ThemeTimeline", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Timeline", "Theme settings for the Timeline");
rna_def_userdef_theme_spaces_main(srna);
- prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Grid", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "cframe");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Current Frame", "");
@@ -1640,7 +1640,7 @@ static void rna_def_userdef_theme_space_image(BlenderRNA *brna)
/* space_image */
- srna= RNA_def_struct(brna, "ThemeImageEditor", NULL);
+ srna = RNA_def_struct(brna, "ThemeImageEditor", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Image Editor", "Theme settings for the Image Editor");
@@ -1649,48 +1649,48 @@ static void rna_def_userdef_theme_space_image(BlenderRNA *brna)
rna_def_userdef_theme_spaces_vertex(srna);
rna_def_userdef_theme_spaces_face(srna);
- prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "scope_back", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "scope_back", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "preview_back");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Scope region background color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "preview_stitch_face", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "preview_stitch_face", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "preview_stitch_face");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Stitch preview face color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "preview_stitch_edge", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "preview_stitch_edge", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "preview_stitch_edge");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Stitch preview edge color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "preview_stitch_vert", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "preview_stitch_vert", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "preview_stitch_vert");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Stitch preview vertex color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "preview_stitch_stitchable", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "preview_stitch_stitchable", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "preview_stitch_stitchable");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Stitch preview stitchable color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "preview_stitch_unstitchable", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "preview_stitch_unstitchable", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "preview_stitch_unstitchable");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Stitch preview unstitchable color", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "preview_stitch_active", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "preview_stitch_active", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "preview_stitch_active");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Stitch preview active island", "");
@@ -1704,85 +1704,85 @@ static void rna_def_userdef_theme_space_seq(BlenderRNA *brna)
/* space_seq */
- srna= RNA_def_struct(brna, "ThemeSequenceEditor", NULL);
+ srna = RNA_def_struct(brna, "ThemeSequenceEditor", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Sequence Editor", "Theme settings for the Sequence Editor");
rna_def_userdef_theme_spaces_main(srna);
- prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Grid", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "shade1");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Window Sliders", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "movie_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "movie_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "movie");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Movie Strip", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "image_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "image_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "image");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Image Strip", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "scene_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "scene_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "scene");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Scene Strip", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "audio_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "audio_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "audio");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Audio Strip", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "effect_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "effect_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "effect");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Effect Strip", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "plugin_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "plugin_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "plugin");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Plugin Strip", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "transition_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "transition_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "transition");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Transition Strip", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "meta_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "meta_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "meta");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Meta Strip", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "cframe");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Current Frame", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "keyframe", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "keyframe", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "vertex_select");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Keyframe", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "draw_action", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "draw_action", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "bone_pose");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Draw Action", "");
@@ -1796,7 +1796,7 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
/* space_action */
- srna= RNA_def_struct(brna, "ThemeDopeSheet", NULL);
+ srna = RNA_def_struct(brna, "ThemeDopeSheet", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme DopeSheet", "Theme settings for the DopeSheet");
@@ -1804,72 +1804,72 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
rna_def_userdef_theme_spaces_main(srna);
rna_def_userdef_theme_spaces_list_main(srna);
- prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Grid", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "value_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "value_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "face");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Value Sliders", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "shade1");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "View Sliders", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "channels", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "channels", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "shade2");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Channels", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "channels_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "channels_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "hilite");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Channels Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "group");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Channel Group", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "group_active");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Active Channel Group", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "long_key", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "long_key", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "strip");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Long Key", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "long_key_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "long_key_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "strip_select");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Long Key Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "cframe");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Current Frame", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "ds_channel");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
@@ -1883,7 +1883,7 @@ static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
/* space_nla */
- srna= RNA_def_struct(brna, "ThemeNLAEditor", NULL);
+ srna = RNA_def_struct(brna, "ThemeNLAEditor", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme NLA Editor", "Theme settings for the NLA Editor");
@@ -1891,42 +1891,42 @@ static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
rna_def_userdef_theme_spaces_main(srna);
rna_def_userdef_theme_spaces_list_main(srna);
- prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Grid", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "shade1");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "View Sliders", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "bars", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "bars", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "shade2");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Bars", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "bars_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "bars_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "hilite");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Bars Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "strip");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Strips", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "strip_select");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Strips Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "cframe");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Current Frame", "");
@@ -1938,29 +1938,29 @@ static void rna_def_userdef_theme_colorset(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ThemeBoneColorSet", NULL);
+ srna = RNA_def_struct(brna, "ThemeBoneColorSet", NULL);
RNA_def_struct_sdna(srna, "ThemeWireColor");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Bone Color Set", "Theme settings for bone color sets");
- prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "solid");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Normal", "Color used for the surface of bones");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "select", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "select", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "select");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Select", "Color used for selected bones");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Active", "Color used for active bones");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "show_colored_constraints", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_colored_constraints", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TH_WIRECOLOR_CONSTCOLS);
RNA_def_property_ui_text(prop, "Colored Constraints", "Allow the use of colors indicating constraints/keyed status");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -1973,83 +1973,83 @@ static void rna_def_userdef_theme_space_clip(BlenderRNA *brna)
/* space_clip */
- srna= RNA_def_struct(brna, "ThemeClipEditor", NULL);
+ srna = RNA_def_struct(brna, "ThemeClipEditor", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Clip Editor", "Theme settings for the Movie Clip Editor");
rna_def_userdef_theme_spaces_main(srna);
- prop= RNA_def_property(srna, "marker_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "marker_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "marker_outline");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Marker Outline Color", "Color of marker's outile");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "marker", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "marker", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "marker");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Marker Color", "Color of marker");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "active_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "active_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "act_marker");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Active Marker", "Color of active marker");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "selected_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "selected_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "sel_marker");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Selected Marker", "Color of sleected marker");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "disabled_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "disabled_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "dis_marker");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Disabled Marker", "Color of disabled marker");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "locked_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "locked_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "lock_marker");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Locked Marker", "Color of locked marker");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "path_before", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "path_before", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "path_before");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Path Before", "Color of path before current frame");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "path_after", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "path_after", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "path_after");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Path After", "Color of path after current frame");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Grid", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "cframe");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Current Frame", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Handle Vertex", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Handle Vertex Select", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Handle Vertex Size", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
@@ -2066,7 +2066,7 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
{1, "VIEW_3D", ICON_VIEW3D, "3D View", ""},
{2, "TIMELINE", ICON_TIME, "Timeline", ""},
{3, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", ""},
- {4, "DOPESHEET_EDITOR", ICON_ACTION, "Dopesheet", ""},
+ {4, "DOPESHEET_EDITOR", ICON_ACTION, "DopeSheet", ""},
{5, "NLA_EDITOR", ICON_NLA, "NLA Editor", ""},
{6, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", ""},
{7, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", ""},
@@ -2082,131 +2082,131 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
{20, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "Theme", NULL);
+ srna = RNA_def_struct(brna, "Theme", NULL);
RNA_def_struct_sdna(srna, "bTheme");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme", "Theme settings defining draw style and colors in the user interface");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Name of the theme");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_flag(prop, PROP_SKIP_SAVE); /* XXX: for now putting this in presets is silly - its just Default */
- prop= RNA_def_property(srna, "theme_area", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "theme_area", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "active_theme_area");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
RNA_def_property_enum_items(prop, active_theme_area);
RNA_def_property_ui_text(prop, "Active Theme Area", "");
- prop= RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tui");
RNA_def_property_struct_type(prop, "ThemeUserInterface");
RNA_def_property_ui_text(prop, "User Interface", "");
- prop= RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tv3d");
RNA_def_property_struct_type(prop, "ThemeView3D");
RNA_def_property_ui_text(prop, "3D View", "");
- prop= RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tipo");
RNA_def_property_struct_type(prop, "ThemeGraphEditor");
RNA_def_property_ui_text(prop, "Graph Editor", "");
- prop= RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tfile");
RNA_def_property_struct_type(prop, "ThemeFileBrowser");
RNA_def_property_ui_text(prop, "File Browser", "");
- prop= RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tnla");
RNA_def_property_struct_type(prop, "ThemeNLAEditor");
RNA_def_property_ui_text(prop, "NLA Editor", "");
- prop= RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tact");
RNA_def_property_struct_type(prop, "ThemeDopeSheet");
RNA_def_property_ui_text(prop, "DopeSheet", "");
- prop= RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tima");
RNA_def_property_struct_type(prop, "ThemeImageEditor");
RNA_def_property_ui_text(prop, "Image Editor", "");
- prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tseq");
RNA_def_property_struct_type(prop, "ThemeSequenceEditor");
RNA_def_property_ui_text(prop, "Sequence Editor", "");
- prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tbuts");
RNA_def_property_struct_type(prop, "ThemeProperties");
RNA_def_property_ui_text(prop, "Properties", "");
- prop= RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "text");
RNA_def_property_struct_type(prop, "ThemeTextEditor");
RNA_def_property_ui_text(prop, "Text Editor", "");
- prop= RNA_def_property(srna, "timeline", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "timeline", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "ttime");
RNA_def_property_struct_type(prop, "ThemeTimeline");
RNA_def_property_ui_text(prop, "Timeline", "");
- prop= RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tnode");
RNA_def_property_struct_type(prop, "ThemeNodeEditor");
RNA_def_property_ui_text(prop, "Node Editor", "");
- prop= RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tlogic");
RNA_def_property_struct_type(prop, "ThemeLogicEditor");
RNA_def_property_ui_text(prop, "Logic Editor", "");
- prop= RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "toops");
RNA_def_property_struct_type(prop, "ThemeOutliner");
RNA_def_property_ui_text(prop, "Outliner", "");
- prop= RNA_def_property(srna, "info", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "info", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tinfo");
RNA_def_property_struct_type(prop, "ThemeInfo");
RNA_def_property_ui_text(prop, "Info", "");
- prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tuserpref");
RNA_def_property_struct_type(prop, "ThemeUserPreferences");
RNA_def_property_ui_text(prop, "User Preferences", "");
- prop= RNA_def_property(srna, "console", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "console", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tconsole");
RNA_def_property_struct_type(prop, "ThemeConsole");
RNA_def_property_ui_text(prop, "Console", "");
- prop= RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_collection_sdna(prop, NULL, "tarm", "");
RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
RNA_def_property_ui_text(prop, "Bone Color Sets", "");
- prop= RNA_def_property(srna, "clip_editor", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "clip_editor", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tclip");
RNA_def_property_struct_type(prop, "ThemeClipEditor");
@@ -2218,12 +2218,12 @@ static void rna_def_userdef_addon(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Addon", NULL);
+ srna = RNA_def_struct(brna, "Addon", NULL);
RNA_def_struct_sdna(srna, "bAddon");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Addon", "Python addons to be loaded automatically");
- prop= RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Module", "Module name");
RNA_def_struct_name_property(srna, prop);
}
@@ -2265,30 +2265,30 @@ static void rna_def_userdef_solidlight(BlenderRNA *brna)
PropertyRNA *prop;
static float default_dir[3] = {0.f, 1.f, 0.f};
- srna= RNA_def_struct(brna, "UserSolidLight", NULL);
+ srna = RNA_def_struct(brna, "UserSolidLight", NULL);
RNA_def_struct_sdna(srna, "SolidLight");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Solid Light", "Light used for OpenGL lighting in solid draw mode");
- prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
RNA_def_property_ui_text(prop, "Enabled", "Enable this OpenGL light in solid draw mode");
RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
- prop= RNA_def_property(srna, "direction", PROP_FLOAT, PROP_DIRECTION);
+ prop = RNA_def_property(srna, "direction", PROP_FLOAT, PROP_DIRECTION);
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_array(prop, 3);
RNA_def_property_float_array_default(prop, default_dir);
RNA_def_property_ui_text(prop, "Direction", "Direction that the OpenGL light is shining");
RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
- prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "col");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Diffuse Color", "Diffuse color of the OpenGL light");
RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
- prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "spec");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Specular Color", "Color of the light's specular highlight");
@@ -2314,7 +2314,7 @@ static void rna_def_userdef_view(BlenderRNA *brna)
PropertyRNA *prop;
StructRNA *srna;
- srna= RNA_def_struct(brna, "UserPreferencesView", NULL);
+ srna = RNA_def_struct(brna, "UserPreferencesView", NULL);
RNA_def_struct_sdna(srna, "UserDef");
RNA_def_struct_nested(brna, srna, "UserPreferences");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
@@ -2323,185 +2323,185 @@ static void rna_def_userdef_view(BlenderRNA *brna)
/* View */
/* display */
- prop= RNA_def_property(srna, "show_tooltips", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_tooltips", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS);
RNA_def_property_ui_text(prop, "Tooltips", "Display tooltips");
- prop= RNA_def_property(srna, "show_tooltips_python", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_tooltips_python", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TOOLTIPS_PYTHON);
RNA_def_property_ui_text(prop, "Show Python Tooltips", "Show Python references in tooltips");
- prop= RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO);
RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3D view");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "use_global_scene", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_global_scene", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SCENEGLOBAL);
RNA_def_property_ui_text(prop, "Global Scene", "Force the current Scene to be displayed in all Screens");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "show_large_cursors", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_large_cursors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "curssize", 0);
RNA_def_property_ui_text(prop, "Large Cursors", "Use large mouse cursors when available");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "show_view_name", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_view_name", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_VIEWPORTNAME);
RNA_def_property_ui_text(prop, "Show View Name", "Show the name of the view's direction in each 3D View");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "show_splash", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_splash", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_SPLASH_DISABLE);
RNA_def_property_ui_text(prop, "Show Splash", "Display splash screen on startup");
- prop= RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS);
RNA_def_property_ui_text(prop, "Show Playback FPS",
"Show the frames per second screen refresh rate, while animation is played back");
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* menus */
- prop= RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MENUOPENAUTO);
RNA_def_property_ui_text(prop, "Open On Mouse Over",
"Open menu buttons and pulldowns automatically when the mouse is hovering");
- prop= RNA_def_property(srna, "open_toplevel_delay", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "open_toplevel_delay", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "menuthreshold1");
RNA_def_property_range(prop, 1, 40);
RNA_def_property_ui_text(prop, "Top Level Menu Open Delay",
"Time delay in 1/10 seconds before automatically opening top level menus");
- prop= RNA_def_property(srna, "open_sublevel_delay", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "open_sublevel_delay", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "menuthreshold2");
RNA_def_property_range(prop, 1, 40);
RNA_def_property_ui_text(prop, "Sub Level Menu Open Delay",
"Time delay in 1/10 seconds before automatically opening sub level menus");
/* Toolbox click-hold delay */
- prop= RNA_def_property(srna, "open_left_mouse_delay", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "open_left_mouse_delay", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tb_leftmouse");
RNA_def_property_range(prop, 1, 40);
RNA_def_property_ui_text(prop, "Hold LMB Open Toolbox Delay",
"Time in 1/10 seconds to hold the Left Mouse Button before opening the toolbox");
- prop= RNA_def_property(srna, "open_right_mouse_delay", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "open_right_mouse_delay", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tb_rightmouse");
RNA_def_property_range(prop, 1, 40);
RNA_def_property_ui_text(prop, "Hold RMB Open Toolbox Delay",
"Time in 1/10 seconds to hold the Right Mouse Button before opening the toolbox");
- prop= RNA_def_property(srna, "show_column_layout", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_column_layout", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_PLAINMENUS);
RNA_def_property_ui_text(prop, "Toolbox Column Layout", "Use a column layout for toolbox");
- prop= RNA_def_property(srna, "use_directional_menus", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_directional_menus", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_MENUFIXEDORDER);
RNA_def_property_ui_text(prop, "Contents Follow Opening Direction",
"Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction");
- prop= RNA_def_property(srna, "use_global_pivot", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_global_pivot", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCKAROUND);
RNA_def_property_ui_text(prop, "Global Pivot", "Lock the same rotation/scaling pivot in all 3D Views");
- prop= RNA_def_property(srna, "use_mouse_auto_depth", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mouse_auto_depth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_ZBUF);
RNA_def_property_ui_text(prop, "Auto Depth", "Use the depth under the mouse to improve view pan/rotate/zoom functionality");
- prop= RNA_def_property(srna, "use_camera_lock_parent", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_camera_lock_parent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_CAM_LOCK_NO_PARENT);
RNA_def_property_ui_text(prop, "Camera Parent Lock",
"When the camera is locked to the view and in fly mode, "
"transform the parent rather than the camera");
/* view zoom */
- prop= RNA_def_property(srna, "use_zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_TO_MOUSEPOS);
RNA_def_property_ui_text(prop, "Zoom To Mouse Position",
"Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center");
/* view rotation */
- prop= RNA_def_property(srna, "use_auto_perspective", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_perspective", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_AUTOPERSP);
RNA_def_property_ui_text(prop, "Auto Perspective",
"Automatically switch between orthographic and perspective when changing "
"from top/front/side views");
- prop= RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_SELECTION);
RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the pivot point");
/* mini axis */
- prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON);
RNA_def_property_ui_text(prop, "Show Mini Axes", "Show a small rotating 3D axes in the bottom left corner of the 3D View");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rvisize");
RNA_def_property_range(prop, 10, 64);
RNA_def_property_ui_text(prop, "Mini Axes Size", "The axes icon's size");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rvibright");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Mini Axes Brightness", "Brightness of the icon");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "smooth_view", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "smooth_view", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "smooth_viewtx");
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop, "Smooth View", "Time to animate the view in milliseconds, zero to disable");
- prop= RNA_def_property(srna, "rotation_angle", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "rotation_angle", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "pad_rot_angle");
RNA_def_property_range(prop, 0, 90);
RNA_def_property_ui_text(prop, "Rotation Angle", "Rotation step for numerical pad keys (2 4 6 8)");
/* 3D transform widget */
- prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", V3D_USE_MANIPULATOR);
RNA_def_property_ui_text(prop, "Manipulator", "Use 3D transform manipulator");
RNA_def_property_update(prop, 0, "rna_userdef_show_manipulator_update");
- prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tw_size");
RNA_def_property_range(prop, 2, 40);
RNA_def_property_int_default(prop, 15);
RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of widget, in 10 pixel units");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tw_handlesize");
RNA_def_property_range(prop, 2, 40);
RNA_def_property_int_default(prop, 25);
RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of widget handles as percentage of widget radius");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tw_hotspot");
RNA_def_property_range(prop, 4, 40);
RNA_def_property_int_default(prop, 14);
RNA_def_property_ui_text(prop, "Manipulator Hotspot", "Pixel distance around the handles to accept mouse clicks");
- prop= RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "obcenter_dia");
RNA_def_property_range(prop, 4, 10);
RNA_def_property_ui_text(prop, "Object Origin Size", "Diameter in Pixels for Object/Lamp origin display");
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* View2D Grid Displays */
- prop= RNA_def_property(srna, "view2d_grid_spacing_min", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "view2d_grid_spacing_min", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "v2d_min_gridsize");
- RNA_def_property_range(prop, 1, 500); // XXX: perhaps the lower range should only go down to 5?
+ RNA_def_property_range(prop, 1, 500); /* XXX: perhaps the lower range should only go down to 5? */
RNA_def_property_ui_text(prop, "2D View Minimum Grid Spacing",
"Minimum number of pixels between each gridline in 2D Viewports");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- // TODO: add a setter for this, so that we can bump up the minimum size as necessary...
- prop= RNA_def_property(srna, "timecode_style", PROP_ENUM, PROP_NONE);
+ /* TODO: add a setter for this, so that we can bump up the minimum size as necessary... */
+ prop = RNA_def_property(srna, "timecode_style", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, timecode_styles);
RNA_def_property_enum_sdna(prop, NULL, "timecode_style");
RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL);
@@ -2520,17 +2520,17 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
{AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem material_link_items[]= {
+ static const EnumPropertyItem material_link_items[] = {
{0, "OBDATA", 0, "ObData", "Toggle whether the material is linked to object data or the object block"},
{USER_MAT_ON_OB, "OBJECT", 0, "Object", "Toggle whether the material is linked to object data or the object block"},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem object_align_items[]= {
+ static const EnumPropertyItem object_align_items[] = {
{0, "WORLD", 0, "World", "Align newly added objects to the world coordinate system"},
{USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects facing the active 3D View direction"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "UserPreferencesEdit", NULL);
+ srna = RNA_def_struct(brna, "UserPreferencesEdit", NULL);
RNA_def_struct_sdna(srna, "UserDef");
RNA_def_struct_nested(brna, srna, "UserPreferences");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
@@ -2538,171 +2538,171 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
/* Edit Methods */
- prop= RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, material_link_items);
RNA_def_property_ui_text(prop, "Material Link To",
"Toggle whether the material is linked to object data or the object block");
- prop= RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, object_align_items);
RNA_def_property_ui_text(prop, "Align Object To",
"When adding objects from a 3D View menu, either align them with that view or with the world");
- prop= RNA_def_property(srna, "use_enter_edit_mode", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_enter_edit_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_EDITMODE);
RNA_def_property_ui_text(prop, "Enter Edit Mode", "Enter Edit Mode automatically after adding a new object");
- prop= RNA_def_property(srna, "use_drag_immediately", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_drag_immediately", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELEASECONFIRM);
RNA_def_property_ui_text(prop, "Release confirms", "Moving things with a mouse drag confirms when releasing the button");
/* Undo */
- prop= RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "undosteps");
RNA_def_property_range(prop, 0, 64);
RNA_def_property_ui_text(prop, "Undo Steps", "Number of undo steps available (smaller values conserve memory)");
- prop= RNA_def_property(srna, "undo_memory_limit", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "undo_memory_limit", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "undomemory");
RNA_def_property_range(prop, 0, 32767);
RNA_def_property_ui_text(prop, "Undo Memory Size", "Maximum memory usage in megabytes (0 means unlimited)");
- prop= RNA_def_property(srna, "use_global_undo", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_global_undo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_GLOBALUNDO);
RNA_def_property_ui_text(prop, "Global Undo",
"Global undo works by keeping a full copy of the file itself in memory, so takes extra memory");
/* auto keyframing */
- prop= RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
RNA_def_property_ui_text(prop, "Auto Keying Enable",
"Automatic keyframe insertion for Objects and Bones (default setting used for new Scenes)");
RNA_def_property_ui_icon(prop, ICON_REC, 0);
- prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, auto_key_modes);
RNA_def_property_enum_funcs(prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set", NULL);
RNA_def_property_ui_text(prop, "Auto Keying Mode",
"Mode of automatic keyframe insertion for Objects and Bones "
"(default setting used for new Scenes)");
- prop= RNA_def_property(srna, "use_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL);
RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available F-Curves");
/* keyframing settings */
- prop= RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTNEEDED);
RNA_def_property_ui_text(prop, "Keyframe Insert Needed", "Keyframe insertion only when keyframe needed");
- prop= RNA_def_property(srna, "use_visual_keying", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_visual_keying", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_AUTOMATKEY);
RNA_def_property_ui_text(prop, "Visual Keying", "Use Visual keying automatically for constrained objects");
- prop= RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_XYZ2RGB);
RNA_def_property_ui_text(prop, "New F-Curve Colors - XYZ to RGB",
"Color for newly added transformation F-Curves (Location, Rotation, Scale) "
"and also Color is based on the transform axis");
- prop= RNA_def_property(srna, "keyframe_new_interpolation_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "keyframe_new_interpolation_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items);
RNA_def_property_enum_sdna(prop, NULL, "ipo_new");
RNA_def_property_ui_text(prop, "New Interpolation Type",
"Interpolation mode used for first keyframe on newly added F-Curves "
"(subsequent keyframes take interpolation from preceeding keyframe)");
- prop= RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, keyframe_handle_type_items);
RNA_def_property_enum_sdna(prop, NULL, "keyhandles_new");
RNA_def_property_ui_text(prop, "New Handles Type", "Handle type for handles of new keyframes");
/* frame numbers */
- prop= RNA_def_property(srna, "use_negative_frames", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_negative_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_NONEGFRAMES);
RNA_def_property_ui_text(prop, "Allow Negative Frames", "Current frame number can be manually set to a negative value");
/* grease pencil */
- prop= RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gp_manhattendist");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Grease Pencil Manhattan Distance", "Pixels moved by mouse per axis when drawing stroke");
- prop= RNA_def_property(srna, "grease_pencil_euclidean_distance", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "grease_pencil_euclidean_distance", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gp_euclideandist");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Grease Pencil Euclidean Distance",
"Distance moved by mouse when drawing stroke (in pixels) to include");
- prop= RNA_def_property(srna, "use_grease_pencil_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_grease_pencil_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSMOOTH);
RNA_def_property_ui_text(prop, "Grease Pencil Smooth Stroke", "Smooth the final stroke");
- prop= RNA_def_property(srna, "use_grease_pencil_simplify_stroke", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_grease_pencil_simplify_stroke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSIMPLIFY);
RNA_def_property_ui_text(prop, "Grease Pencil Simplify Stroke", "Simplify the final stroke");
- prop= RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gp_eraser");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Grease Pencil Eraser Radius", "Radius of eraser 'brush'");
/* sculpt and paint */
- prop= RNA_def_property(srna, "sculpt_paint_overlay_color", PROP_FLOAT, PROP_COLOR_GAMMA);
+ prop = RNA_def_property(srna, "sculpt_paint_overlay_color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "sculpt_paint_overlay_col");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Sculpt/Paint Overlay Color", "Color of texture overlay");
/* duplication linking */
- prop= RNA_def_property(srna, "use_duplicate_mesh", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_duplicate_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MESH);
RNA_def_property_ui_text(prop, "Duplicate Mesh", "Causes mesh data to be duplicated with the object");
- prop= RNA_def_property(srna, "use_duplicate_surface", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_duplicate_surface", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_SURF);
RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with the object");
- prop= RNA_def_property(srna, "use_duplicate_curve", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_duplicate_curve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_CURVE);
RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with the object");
- prop= RNA_def_property(srna, "use_duplicate_text", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_duplicate_text", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_FONT);
RNA_def_property_ui_text(prop, "Duplicate Text", "Causes text data to be duplicated with the object");
- prop= RNA_def_property(srna, "use_duplicate_metaball", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_duplicate_metaball", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MBALL);
RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with the object");
- prop= RNA_def_property(srna, "use_duplicate_armature", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_duplicate_armature", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ARM);
RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with the object");
- prop= RNA_def_property(srna, "use_duplicate_lamp", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_duplicate_lamp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_LAMP);
RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with the object");
- prop= RNA_def_property(srna, "use_duplicate_material", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_duplicate_material", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MAT);
RNA_def_property_ui_text(prop, "Duplicate Material", "Causes material data to be duplicated with the object");
- prop= RNA_def_property(srna, "use_duplicate_texture", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_duplicate_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_TEX);
RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with the object");
- // xxx
- prop= RNA_def_property(srna, "use_duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
+ /* xxx */
+ prop = RNA_def_property(srna, "use_duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO);
RNA_def_property_ui_text(prop, "Duplicate F-Curve", "Causes F-curve data to be duplicated with the object");
- // xxx
- prop= RNA_def_property(srna, "use_duplicate_action", PROP_BOOLEAN, PROP_NONE);
+ /* xxx */
+ prop = RNA_def_property(srna, "use_duplicate_action", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT);
RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with the object");
- prop= RNA_def_property(srna, "use_duplicate_particle", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_duplicate_particle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS);
RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object");
}
@@ -2723,7 +2723,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{128, "CLAMP_128", 0, "128", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem anisotropic_items[] ={
+ static EnumPropertyItem anisotropic_items[] = {
{1, "FILTER_0", 0, "Off", ""},
{2, "FILTER_2", 0, "2x", ""},
{4, "FILTER_4", 0, "4x", ""},
@@ -2756,14 +2756,14 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem audio_rate_items[] = {
-// {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second"},
-// {11025, "RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second"},
-// {16000, "RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second"},
-// {22050, "RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second"},
-// {32000, "RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second"},
+/* {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second"}, */
+/* {11025, "RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second"}, */
+/* {16000, "RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second"}, */
+/* {22050, "RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second"}, */
+/* {32000, "RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second"}, */
{44100, "RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second"},
{48000, "RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second"},
-// {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"},
+/* {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"}, */
{96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"},
{192000, "RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second"},
{0, NULL, 0, NULL, NULL}};
@@ -2852,7 +2852,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{ 0, NULL, 0, NULL, NULL}};
#endif
- srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
+ srna = RNA_def_struct(brna, "UserPreferencesSystem", NULL);
RNA_def_struct_sdna(srna, "UserDef");
RNA_def_struct_nested(brna, srna, "UserPreferences");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
@@ -2860,134 +2860,134 @@ static void rna_def_userdef_system(BlenderRNA *brna)
/* Language */
- prop= RNA_def_property(srna, "use_international_fonts", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_international_fonts", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE);
RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts");
RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
- prop= RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dpi");
RNA_def_property_range(prop, 48, 128);
RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display");
RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
- prop= RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "scrollback");
RNA_def_property_range(prop, 32, 32768);
RNA_def_property_ui_text(prop, "Scrollback", "Maximum number of lines to store for the console buffer");
- prop= RNA_def_property(srna, "author", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "author", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "author");
RNA_def_property_string_maxlength(prop, 80);
RNA_def_property_ui_text(prop, "Author", "Name that will be used in exported files when format supports such feature");
/* Language Selection */
- prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, language_items);
RNA_def_property_ui_text(prop, "Language", "Language used for translation");
RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
- prop= RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS);
RNA_def_property_ui_text(prop, "Translate Tooltips", "Translate Tooltips");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "use_translate_interface", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_translate_interface", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_IFACE);
RNA_def_property_ui_text(prop, "Translate Interface", "Translate Interface");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_USETEXTUREFONT);
RNA_def_property_ui_text(prop, "Textured Fonts", "Use textures for drawing international fonts");
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* System & OpenGL */
- prop= RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "light", "");
RNA_def_property_struct_type(prop, "UserSolidLight");
RNA_def_property_ui_text(prop, "Solid Lights", "Lights user to display objects in solid draw mode");
- prop= RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_CUSTOM_RANGE);
RNA_def_property_ui_text(prop, "Use Weight Color Range",
"Enable color range used for weight visualization in weight painting mode");
RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
- prop= RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba_weight");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Weight Color Range", "Color range used for weight visualization in weight painting mode");
RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
- prop= RNA_def_property(srna, "color_picker_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "color_picker_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, color_picker_types);
RNA_def_property_enum_sdna(prop, NULL, "color_picker_type");
RNA_def_property_ui_text(prop, "Color Picker Type", "Different styles of displaying the color picker widget");
- prop= RNA_def_property(srna, "use_preview_images", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_preview_images", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ALLWINCODECS);
RNA_def_property_ui_text(prop, "Enable All Codecs",
"Allow user to choose any codec (Windows only, might generate instability)");
- prop= RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE);
RNA_def_property_ui_text(prop, "Auto Run Python Scripts",
"Allow any .blend file to run scripts automatically "
"(unsafe with blend files from an untrusted source)");
RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
- prop= RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
RNA_def_property_ui_text(prop, "Tabs as Spaces",
"Automatically convert all new tabs into spaces for new and loaded text files");
- prop= RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "prefetchframes");
RNA_def_property_range(prop, 0, 500);
RNA_def_property_ui_text(prop, "Prefetch Frames", "Number of frames to render ahead during playback");
- prop= RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "memcachelimit");
- RNA_def_property_range(prop, 0, (sizeof(void *) ==8)? 1024*16: 1024); /* 32 bit 2 GB, 64 bit 16 GB */
+ RNA_def_property_range(prop, 0, (sizeof(void *) == 8)? 1024*16: 1024); /* 32 bit 2 GB, 64 bit 16 GB */
RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit in sequencer (megabytes)");
RNA_def_property_update(prop, 0, "rna_Userdef_memcache_update");
- prop= RNA_def_property(srna, "frame_server_port", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "frame_server_port", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "frameserverport");
RNA_def_property_range(prop, 0, 32727);
RNA_def_property_ui_text(prop, "Frame Server Port", "Frameserver Port for Frameserver Rendering");
- prop= RNA_def_property(srna, "gl_clip_alpha", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "gl_clip_alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "glalphaclip");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Clip Alpha", "Clip alpha below this threshold in the 3D textured view");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "use_mipmaps", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mipmaps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_MIPMAP);
RNA_def_property_ui_text(prop, "Mipmaps",
"Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading)");
RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update");
- prop= RNA_def_property(srna, "use_16bit_textures", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_16bit_textures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_16bit_textures", 1);
RNA_def_property_ui_text(prop, "16 Bit Float Textures", "Use 16 bit per component texture for float images");
RNA_def_property_update(prop, 0, "rna_userdef_gl_use_16bit_textures");
- prop= RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
RNA_def_property_update(prop, NC_WINDOW, NULL); /* this isnt essential but nice to check if VBO draws any differently */
- prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_AA);
RNA_def_property_ui_text(prop, "Anti-aliasing", "Use anti-aliasing for the 3D view (may impact redraw performance)");
- prop= RNA_def_property(srna, "anisotropic_filter", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "anisotropic_filter", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "anisotropic_filter");
RNA_def_property_enum_items(prop, anisotropic_items);
RNA_def_property_enum_default(prop, 1);
@@ -2995,85 +2995,85 @@ static void rna_def_userdef_system(BlenderRNA *brna)
"Quality of the anisotropic filtering (values greater than 1.0 enable anisotropic filtering)");
RNA_def_property_update(prop, 0, "rna_userdef_anisotropic_update");
- prop= RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "glreslimit");
RNA_def_property_enum_items(prop, gl_texture_clamp_items);
RNA_def_property_ui_text(prop, "GL Texture Limit", "Limit the texture size to save graphics memory");
RNA_def_property_update(prop, 0, "rna_userdef_gl_texture_limit_update");
- prop= RNA_def_property(srna, "texture_time_out", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_time_out", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "textimeout");
RNA_def_property_range(prop, 0, 3600);
RNA_def_property_ui_text(prop, "Texture Time Out",
"Time since last access of a GL texture in seconds after which it is freed "
"(set to 0 to keep textures allocated)");
- prop= RNA_def_property(srna, "texture_collection_rate", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_collection_rate", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "texcollectrate");
RNA_def_property_range(prop, 1, 3600);
RNA_def_property_ui_text(prop, "Texture Collection Rate",
"Number of seconds between each run of the GL texture garbage collector");
- prop= RNA_def_property(srna, "window_draw_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "window_draw_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "wmdrawmethod");
RNA_def_property_enum_items(prop, draw_method_items);
RNA_def_property_ui_text(prop, "Window Draw Method", "Drawing method used by the window manager");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mixbufsize");
RNA_def_property_enum_items(prop, audio_mixing_samples_items);
RNA_def_property_ui_text(prop, "Audio Mixing Buffer", "Number of samples used by the audio mixing buffer");
RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
- prop= RNA_def_property(srna, "audio_device", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "audio_device", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "audiodevice");
RNA_def_property_enum_items(prop, audio_device_items);
RNA_def_property_ui_text(prop, "Audio Device", "Audio output device");
RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
- prop= RNA_def_property(srna, "audio_sample_rate", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "audio_sample_rate", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "audiorate");
RNA_def_property_enum_items(prop, audio_rate_items);
RNA_def_property_ui_text(prop, "Audio Sample Rate", "Audio sample rate");
RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
- prop= RNA_def_property(srna, "audio_sample_format", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "audio_sample_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "audioformat");
RNA_def_property_enum_items(prop, audio_format_items);
RNA_def_property_ui_text(prop, "Audio Sample Format", "Audio sample format");
RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
- prop= RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "audiochannels");
RNA_def_property_enum_items(prop, audio_channel_items);
RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
- prop= RNA_def_property(srna, "screencast_fps", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "screencast_fps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "scrcastfps");
RNA_def_property_range(prop, 10, 50);
RNA_def_property_ui_text(prop, "FPS", "Frame rate for the screencast to be played back");
- prop= RNA_def_property(srna, "screencast_wait_time", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "screencast_wait_time", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "scrcastwait");
RNA_def_property_range(prop, 50, 1000);
RNA_def_property_ui_text(prop, "Wait Timer (ms)", "Time in milliseconds between each frame recorded for screencast");
- prop= RNA_def_property(srna, "use_text_antialiasing", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_text_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "text_render", USER_TEXT_DISABLE_AA);
RNA_def_property_ui_text(prop, "Text Anti-aliasing", "Draw user interface text anti-aliased");
RNA_def_property_update(prop, 0, "rna_userdef_text_update");
#ifdef WITH_CYCLES
- prop= RNA_def_property(srna, "compute_device_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "compute_device_type", PROP_ENUM, PROP_NONE);
RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT);
RNA_def_property_enum_sdna(prop, NULL, "compute_device_type");
RNA_def_property_enum_items(prop, compute_device_type_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_userdef_compute_device_type_itemf");
RNA_def_property_ui_text(prop, "Compute Device Type", "Device to use for computation (rendering with Cycles)");
- prop= RNA_def_property(srna, "compute_device", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "compute_device", PROP_ENUM, PROP_NONE);
RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT);
RNA_def_property_enum_sdna(prop, NULL, "compute_device_id");
RNA_def_property_enum_items(prop, compute_device_items);
@@ -3108,142 +3108,142 @@ static void rna_def_userdef_input(BlenderRNA *brna)
{USER_ZOOM_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zoom in and out based on horizontal mouse movement"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "UserPreferencesInput", NULL);
+ srna = RNA_def_struct(brna, "UserPreferencesInput", NULL);
RNA_def_struct_sdna(srna, "UserDef");
RNA_def_struct_nested(brna, srna, "UserPreferences");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Input", "Settings for input devices");
- prop= RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, select_mouse_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_select_mouse_set", NULL);
RNA_def_property_ui_text(prop, "Select Mouse", "Mouse button used for selection");
- prop= RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "viewzoom");
RNA_def_property_enum_items(prop, view_zoom_styles);
RNA_def_property_ui_text(prop, "Zoom Style", "Which style to use for viewport scaling");
- prop= RNA_def_property(srna, "view_zoom_axis", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "view_zoom_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "uiflag");
RNA_def_property_enum_items(prop, view_zoom_axes);
RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on");
- prop= RNA_def_property(srna, "invert_mouse_zoom", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_mouse_zoom", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_INVERT);
RNA_def_property_ui_text(prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming");
- prop= RNA_def_property(srna, "view_rotate_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "view_rotate_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, view_rotation_items);
RNA_def_property_ui_text(prop, "View Rotation", "Rotation style in the viewport");
- prop= RNA_def_property(srna, "use_mouse_continuous", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mouse_continuous", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE);
RNA_def_property_ui_text(prop, "Continuous Grab",
"Allow moving the mouse outside the view on some manipulations (transform, ui control drag)");
/* tweak tablet & mouse preset */
- prop= RNA_def_property(srna, "drag_threshold", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "drag_threshold", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dragthreshold");
RNA_def_property_range(prop, 3, 40);
RNA_def_property_ui_text(prop, "Drag Threshold", "Amount of pixels you have to drag before dragging UI items happens");
- prop= RNA_def_property(srna, "tweak_threshold", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "tweak_threshold", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tweak_threshold");
RNA_def_property_range(prop, 3, 1024);
RNA_def_property_ui_text(prop, "Tweak Threshold", "Number of pixels you have to drag before tweak event is triggered");
/* 3D mouse settings */
/* global options */
- prop= RNA_def_property(srna, "ndof_sensitivity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "ndof_sensitivity", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.25f, 4.0f);
RNA_def_property_ui_text(prop, "Sensitivity", "Overall sensitivity of the 3D Mouse");
- prop= RNA_def_property(srna, "ndof_zoom_updown", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "ndof_zoom_updown", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_UPDOWN);
RNA_def_property_ui_text(prop, "Zoom = Up/Down", "Zoom using up/down on the device (otherwise forward/backward)");
- prop= RNA_def_property(srna, "ndof_zoom_invert", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "ndof_zoom_invert", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_INVERT);
RNA_def_property_ui_text(prop, "Invert Zoom", "Zoom using opposite direction");
/* 3D view */
- prop= RNA_def_property(srna, "ndof_show_guide", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "ndof_show_guide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_SHOW_GUIDE);
RNA_def_property_ui_text(prop, "Show Navigation Guide", "Display the center and axis during rotation");
/* TODO: update description when fly-mode visuals are in place ("projected position in fly mode")*/
/* 3D view: roll */
- prop= RNA_def_property(srna, "ndof_roll_invert_axis", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "ndof_roll_invert_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ROLL_INVERT_AXIS);
RNA_def_property_ui_text(prop, "Invert roll Axis", "Invert roll axis");
/* 3D view: tilt */
- prop= RNA_def_property(srna, "ndof_tilt_invert_axis", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "ndof_tilt_invert_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_TILT_INVERT_AXIS);
RNA_def_property_ui_text(prop, "Invert tilt Axis", "Invert tilt axis");
/* 3D view: rotate */
- prop= RNA_def_property(srna, "ndof_rotate_invert_axis", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "ndof_rotate_invert_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ROTATE_INVERT_AXIS);
RNA_def_property_ui_text(prop, "Invert rotation Axis", "Invert rotation axis");
/* 3D view: pan x */
- prop= RNA_def_property(srna, "ndof_panx_invert_axis", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "ndof_panx_invert_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_PANX_INVERT_AXIS);
RNA_def_property_ui_text(prop, "Invert x Axis", "Invert x axis");
/* 3D view: pan y */
- prop= RNA_def_property(srna, "ndof_pany_invert_axis", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "ndof_pany_invert_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_PANY_INVERT_AXIS);
RNA_def_property_ui_text(prop, "Invert y Axis", "Invert y axis");
/* 3D view: pan z */
- prop= RNA_def_property(srna, "ndof_panz_invert_axis", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "ndof_panz_invert_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_PANZ_INVERT_AXIS);
RNA_def_property_ui_text(prop, "Invert z Axis", "Invert z axis");
/* 3D view: fly */
- prop= RNA_def_property(srna, "ndof_lock_horizon", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "ndof_lock_horizon", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_LOCK_HORIZON);
RNA_def_property_ui_text(prop, "Lock Horizon", "Keep horizon level while flying with 3D Mouse");
- prop= RNA_def_property(srna, "ndof_fly_helicopter", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "ndof_fly_helicopter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_FLY_HELICOPTER);
RNA_def_property_ui_text(prop, "Helicopter Mode", "Device up/down directly controls your Z position");
- prop= RNA_def_property(srna, "mouse_double_click_time", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "mouse_double_click_time", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dbl_click_time");
RNA_def_property_range(prop, 1, 1000);
RNA_def_property_ui_text(prop, "Double Click Timeout", "Time/delay (in ms) for a double click");
- prop= RNA_def_property(srna, "use_mouse_emulate_3_button", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mouse_emulate_3_button", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TWOBUTTONMOUSE);
RNA_def_property_ui_text(prop, "Emulate 3 Button Mouse",
"Emulate Middle Mouse with Alt+Left Mouse (doesn't work with Left Mouse Select option)");
- prop= RNA_def_property(srna, "use_emulate_numpad", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_emulate_numpad", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_NONUMPAD);
RNA_def_property_ui_text(prop, "Emulate Numpad", "Main 1 to 0 keys act as the numpad ones (useful for laptops)");
/* middle mouse button */
- prop= RNA_def_property(srna, "use_mouse_mmb_paste", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mouse_mmb_paste", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MMB_PASTE);
RNA_def_property_ui_text(prop, "Middle Mouse Paste", "In text window, paste with middle mouse button instead of panning");
- prop= RNA_def_property(srna, "invert_zoom_wheel", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "invert_zoom_wheel", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_WHEELZOOMDIR);
RNA_def_property_ui_text(prop, "Wheel Invert Zoom", "Swap the Mouse Wheel zoom direction");
- prop= RNA_def_property(srna, "wheel_scroll_lines", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "wheel_scroll_lines", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "wheellinescroll");
RNA_def_property_range(prop, 0, 32);
RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "Number of lines scrolled at a time with the mouse wheel");
- prop= RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "keyconfigstr");
RNA_def_property_ui_text(prop, "Key Config", "The name of the active key configuration");
}
@@ -3254,7 +3254,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
StructRNA *srna;
static EnumPropertyItem anim_player_presets[] = {
- //{0, "INTERNAL", 0, "Internal", "Built-in animation player"}, // doesn't work yet!
+ /*{0, "INTERNAL", 0, "Internal", "Built-in animation player"}, *//* doesn't work yet! */
{1, "BLENDER24", 0, "Blender 2.4", "Blender command line animation playback - path to Blender 2.4"},
{2, "DJV", 0, "Djv", "Open source frame player: http://djv.sourceforge.net"},
{3, "FRAMECYCLER", 0, "FrameCycler", "Frame player from IRIDAS"},
@@ -3263,85 +3263,85 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
{50, "CUSTOM", 0, "Custom", "Custom animation player executable path"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "UserPreferencesFilePaths", NULL);
+ srna = RNA_def_struct(brna, "UserPreferencesFilePaths", NULL);
RNA_def_struct_sdna(srna, "UserDef");
RNA_def_struct_nested(brna, srna, "UserPreferences");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external files");
- prop= RNA_def_property(srna, "show_hidden_files_datablocks", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_hidden_files_datablocks", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT);
RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot (.*)");
- prop= RNA_def_property(srna, "use_filter_files", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_filter_files", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
RNA_def_property_ui_text(prop, "Filter File Extensions", "Display only files with extensions in the image select window");
- prop= RNA_def_property(srna, "hide_recent_locations", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "hide_recent_locations", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_RECENT);
RNA_def_property_ui_text(prop, "Hide Recent Locations", "Hide recent locations in the file selector");
- prop= RNA_def_property(srna, "show_thumbnails", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_thumbnails", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_THUMBNAILS);
RNA_def_property_ui_text(prop, "Show Thumbnails", "Open in thumbnail view for images and movies");
- prop= RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELPATHS);
RNA_def_property_ui_text(prop, "Relative Paths", "Default relative path option for the file selector");
- prop= RNA_def_property(srna, "use_file_compression", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_file_compression", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FILECOMPRESS);
RNA_def_property_ui_text(prop, "Compress File", "Enable file compression when saving .blend files");
- prop= RNA_def_property(srna, "use_load_ui", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_load_ui", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_FILENOUI);
RNA_def_property_ui_text(prop, "Load UI", "Load user interface setup when loading .blend files");
- prop= RNA_def_property(srna, "font_directory", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "font_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "fontdir");
RNA_def_property_ui_text(prop, "Fonts Directory", "The default directory to search for loading fonts");
- prop= RNA_def_property(srna, "texture_directory", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "texture_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "textudir");
RNA_def_property_ui_text(prop, "Textures Directory", "The default directory to search for textures");
- prop= RNA_def_property(srna, "texture_plugin_directory", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "texture_plugin_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "plugtexdir");
RNA_def_property_ui_text(prop, "Texture Plugin Directory", "The default directory to search for texture plugins");
- prop= RNA_def_property(srna, "sequence_plugin_directory", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "sequence_plugin_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "plugseqdir");
RNA_def_property_ui_text(prop, "Sequence Plugin Directory", "The default directory to search for sequence plugins");
- prop= RNA_def_property(srna, "render_output_directory", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "render_output_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "renderdir");
RNA_def_property_ui_text(prop, "Render Output Directory", "The default directory for rendering output, for new scenes");
- prop= RNA_def_property(srna, "script_directory", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "script_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "pythondir");
RNA_def_property_ui_text(prop, "Python Scripts Directory",
"Alternate script path, matching the default layout with subdirs: "
"startup, addons & modules (requires restart)");
/* TODO, editing should reset sys.path! */
- prop= RNA_def_property(srna, "sound_directory", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "sound_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "sounddir");
RNA_def_property_ui_text(prop, "Sounds Directory", "The default directory to search for sounds");
- prop= RNA_def_property(srna, "temporary_directory", PROP_STRING, PROP_DIRPATH);
+ prop = RNA_def_property(srna, "temporary_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "tempdir");
RNA_def_property_ui_text(prop, "Temporary Directory", "The directory for storing temporary save files");
RNA_def_property_update(prop, 0, "rna_userdef_temp_update");
- prop= RNA_def_property(srna, "image_editor", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "image_editor", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "image_editor");
RNA_def_property_ui_text(prop, "Image Editor", "Path to an image editor");
- prop= RNA_def_property(srna, "animation_player", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "animation_player", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "anim_player");
RNA_def_property_ui_text(prop, "Animation Player", "Path to a custom animation/frame sequence player");
- prop= RNA_def_property(srna, "animation_player_preset", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "animation_player_preset", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "anim_player_preset");
RNA_def_property_enum_items(prop, anim_player_presets);
RNA_def_property_ui_text(prop, "Animation Player Preset", "Preset configs for external animation players");
@@ -3349,29 +3349,29 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
/* Autosave */
- prop= RNA_def_property(srna, "save_version", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "save_version", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "versions");
RNA_def_property_range(prop, 0, 32);
RNA_def_property_ui_text(prop, "Save Versions",
"The number of old versions to maintain in the current directory, when manually saving");
- prop= RNA_def_property(srna, "use_auto_save_temporary_files", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_auto_save_temporary_files", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOSAVE);
RNA_def_property_ui_text(prop, "Auto Save Temporary Files",
"Automatic saving of temporary files in temp directory, uses process ID");
RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
- prop= RNA_def_property(srna, "auto_save_time", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "auto_save_time", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "savetime");
RNA_def_property_range(prop, 1, 60);
RNA_def_property_ui_text(prop, "Auto Save Time", "The time (in minutes) to wait between automatic temporary saves");
RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
- prop= RNA_def_property(srna, "recent_files", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "recent_files", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 30);
RNA_def_property_ui_text(prop, "Recent Files", "Maximum number of recently opened files to remember");
- prop= RNA_def_property(srna, "use_save_preview_images", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_save_preview_images", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SAVE_PREVIEWS);
RNA_def_property_ui_text(prop, "Save Preview Images", "Enables automatic saving of preview images in the .blend file");
}
@@ -3383,21 +3383,21 @@ void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm;
RNA_def_property_srna(cprop, "Addons");
- srna= RNA_def_struct(brna, "Addons", NULL);
+ srna = RNA_def_struct(brna, "Addons", NULL);
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "User Addons", "Collection of addons");
- func= RNA_def_function(srna, "new", "rna_userdef_addon_new");
+ func = RNA_def_function(srna, "new", "rna_userdef_addon_new");
RNA_def_function_flag(func, FUNC_NO_SELF);
RNA_def_function_ui_description(func, "Add a new addon");
/* return type */
- parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon datablock");
+ parm = RNA_def_pointer(func, "addon", "Addon", "", "Addon datablock");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "rna_userdef_addon_remove");
+ func = RNA_def_function(srna, "remove", "rna_userdef_addon_remove");
RNA_def_function_flag(func, FUNC_NO_SELF);
RNA_def_function_ui_description(func, "Remove addon");
- parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon to remove");
+ parm = RNA_def_pointer(func, "addon", "Addon", "", "Addon to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -3419,28 +3419,28 @@ void RNA_def_userdef(BlenderRNA *brna)
rna_def_userdef_dothemes(brna);
rna_def_userdef_solidlight(brna);
- srna= RNA_def_struct(brna, "UserPreferences", NULL);
+ srna = RNA_def_struct(brna, "UserPreferences", NULL);
RNA_def_struct_sdna(srna, "UserDef");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "User Preferences", "Global user preferences");
- prop= RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "userpref");
RNA_def_property_enum_items(prop, user_pref_sections);
RNA_def_property_ui_text(prop, "Active Section", "Active section of the user preferences shown in the user interface");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "themes", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "themes", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "themes", NULL);
RNA_def_property_struct_type(prop, "Theme");
RNA_def_property_ui_text(prop, "Themes", "");
- prop= RNA_def_property(srna, "ui_styles", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "ui_styles", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "uistyles", NULL);
RNA_def_property_struct_type(prop, "ThemeStyle");
RNA_def_property_ui_text(prop, "Styles", "");
- prop= RNA_def_property(srna, "addons", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "addons", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "addons", NULL);
RNA_def_property_struct_type(prop, "Addon");
RNA_def_property_ui_text(prop, "Addon", "");
@@ -3448,31 +3448,31 @@ void RNA_def_userdef(BlenderRNA *brna)
/* nested structs */
- prop= RNA_def_property(srna, "view", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "view", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UserPreferencesView");
RNA_def_property_pointer_funcs(prop, "rna_UserDef_view_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "View & Controls", "Preferences related to viewing data");
- prop= RNA_def_property(srna, "edit", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "edit", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UserPreferencesEdit");
RNA_def_property_pointer_funcs(prop, "rna_UserDef_edit_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Edit Methods", "Settings for interacting with Blender data");
- prop= RNA_def_property(srna, "inputs", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "inputs", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UserPreferencesInput");
RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Inputs", "Settings for input devices");
- prop= RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UserPreferencesFilePaths");
RNA_def_property_pointer_funcs(prop, "rna_UserDef_filepaths_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files");
- prop= RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UserPreferencesSystem");
RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL, NULL);
diff --git a/source/blender/makesrna/intern/rna_vfont.c b/source/blender/makesrna/intern/rna_vfont.c
index e5ea4809cd9..aca25252d2e 100644
--- a/source/blender/makesrna/intern/rna_vfont.c
+++ b/source/blender/makesrna/intern/rna_vfont.c
@@ -42,17 +42,17 @@ void RNA_def_vfont(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "VectorFont", "ID");
+ srna = RNA_def_struct(brna, "VectorFont", "ID");
RNA_def_struct_ui_text(srna, "Vector Font", "Vector font for Text objects");
RNA_def_struct_sdna(srna, "VFont");
RNA_def_struct_ui_icon(srna, ICON_FILE_FONT);
- prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "File Path", "");
- prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
RNA_def_property_ui_text(prop, "Packed File", "");
}
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 44dc90787fa..18d599ca283 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -48,7 +48,7 @@ EnumPropertyItem event_keymouse_value_items[] = {
{KM_DBL_CLICK, "DOUBLE_CLICK", 0, "Double Click", ""},
{0, NULL, 0, NULL, NULL}};
-EnumPropertyItem event_tweak_value_items[]= {
+EnumPropertyItem event_tweak_value_items[] = {
{KM_ANY, "ANY", 0, "Any", ""},
{EVT_GESTURE_N, "NORTH", 0, "North", ""},
{EVT_GESTURE_NE, "NORTH_EAST", 0, "North-East", ""},
@@ -77,7 +77,7 @@ EnumPropertyItem event_value_items[] = {
{EVT_GESTURE_NW, "NORTH_WEST", 0, "North-West", ""},
{0, NULL, 0, NULL, NULL}};
-EnumPropertyItem event_tweak_type_items[]= {
+EnumPropertyItem event_tweak_type_items[] = {
{EVT_TWEAK_L, "EVT_TWEAK_L", 0, "Left", ""},
{EVT_TWEAK_M, "EVT_TWEAK_M", 0, "Middle", ""},
{EVT_TWEAK_R, "EVT_TWEAK_R", 0, "Right", ""},
@@ -85,7 +85,7 @@ EnumPropertyItem event_tweak_type_items[]= {
{EVT_TWEAK_S, "EVT_TWEAK_S", 0, "Select", ""},
{0, NULL, 0, NULL, NULL}};
-EnumPropertyItem event_mouse_type_items[]= {
+EnumPropertyItem event_mouse_type_items[] = {
{LEFTMOUSE, "LEFTMOUSE", 0, "Left", ""},
{MIDDLEMOUSE, "MIDDLEMOUSE", 0, "Middle", ""},
{RIGHTMOUSE, "RIGHTMOUSE", 0, "Right", ""},
@@ -105,14 +105,14 @@ EnumPropertyItem event_mouse_type_items[]= {
{WHEELOUTMOUSE, "WHEELOUTMOUSE", 0, "Wheel Out", ""},
{0, NULL, 0, NULL, NULL}};
-EnumPropertyItem event_timer_type_items[]= {
+EnumPropertyItem event_timer_type_items[] = {
{TIMER, "TIMER", 0, "Timer", ""},
{TIMER0, "TIMER0", 0, "Timer 0", ""},
{TIMER1, "TIMER1", 0, "Timer 1", ""},
{TIMER2, "TIMER2", 0, "Timer 2", ""},
{0, NULL, 0, NULL, NULL}};
-EnumPropertyItem event_ndof_type_items[]= {
+EnumPropertyItem event_ndof_type_items[] = {
/* buttons on all 3dconnexion devices */
{NDOF_BUTTON_MENU, "NDOF_BUTTON_MENU", 0, "Menu", ""},
{NDOF_BUTTON_FIT, "NDOF_BUTTON_FIT", 0, "Fit", ""},
@@ -386,7 +386,7 @@ EnumPropertyItem operator_return_items[] = {
{OPERATOR_RUNNING_MODAL, "RUNNING_MODAL", 0, "Running Modal", "Keep the operator running with blender"},
{OPERATOR_CANCELLED, "CANCELLED", 0, "Cancelled", "When no action has been taken, operator exits"},
{OPERATOR_FINISHED, "FINISHED", 0, "Finished", "When the operator is complete, operator exits"},
- {OPERATOR_PASS_THROUGH, "PASS_THROUGH", 0, "Pass Through", "Do nothing and pass the event on"}, // used as a flag
+ {OPERATOR_PASS_THROUGH, "PASS_THROUGH", 0, "Pass Through", "Do nothing and pass the event on"}, /* used as a flag */
{0, NULL, 0, NULL, NULL}};
/* flag/enum */
@@ -420,13 +420,13 @@ EnumPropertyItem wm_report_items[] = {
static wmOperator *rna_OperatorProperties_find_operator(PointerRNA *ptr)
{
- wmWindowManager *wm= ptr->id.data;
- IDProperty *properties= (IDProperty*)ptr->data;
+ wmWindowManager *wm = ptr->id.data;
+ IDProperty *properties = (IDProperty*)ptr->data;
wmOperator *op;
- if(wm)
- for(op=wm->operators.first; op; op=op->next)
- if(op->properties == properties)
+ if (wm)
+ for (op = wm->operators.first; op; op = op->next)
+ if (op->properties == properties)
return op;
return NULL;
@@ -434,9 +434,9 @@ static wmOperator *rna_OperatorProperties_find_operator(PointerRNA *ptr)
static StructRNA *rna_OperatorProperties_refine(PointerRNA *ptr)
{
- wmOperator *op= rna_OperatorProperties_find_operator(ptr);
+ wmOperator *op = rna_OperatorProperties_find_operator(ptr);
- if(op)
+ if (op)
return op->type->srna;
else
return ptr->type;
@@ -444,9 +444,9 @@ static StructRNA *rna_OperatorProperties_refine(PointerRNA *ptr)
static IDProperty *rna_OperatorProperties_idprops(PointerRNA *ptr, int create)
{
- if(create && !ptr->data) {
+ if (create && !ptr->data) {
IDPropertyTemplate val = {0};
- ptr->data= IDP_New(IDP_GROUP, &val, "RNA_OperatorProperties group");
+ ptr->data = IDP_New(IDP_GROUP, &val, "RNA_OperatorProperties group");
}
return ptr->data;
@@ -454,53 +454,53 @@ static IDProperty *rna_OperatorProperties_idprops(PointerRNA *ptr, int create)
static void rna_Operator_name_get(PointerRNA *ptr, char *value)
{
- wmOperator *op= (wmOperator*)ptr->data;
+ wmOperator *op = (wmOperator*)ptr->data;
strcpy(value, op->type->name);
}
static int rna_Operator_name_length(PointerRNA *ptr)
{
- wmOperator *op= (wmOperator*)ptr->data;
+ wmOperator *op = (wmOperator*)ptr->data;
return strlen(op->type->name);
}
static int rna_Operator_has_reports_get(PointerRNA *ptr)
{
- wmOperator *op= (wmOperator*)ptr->data;
+ wmOperator *op = (wmOperator*)ptr->data;
return (op->reports && op->reports->list.first);
}
static PointerRNA rna_Operator_properties_get(PointerRNA *ptr)
{
- wmOperator *op= (wmOperator*)ptr->data;
+ wmOperator *op = (wmOperator*)ptr->data;
return rna_pointer_inherit_refine(ptr, op->type->srna, op->properties);
}
static PointerRNA rna_OperatorMacro_properties_get(PointerRNA *ptr)
{
- wmOperatorTypeMacro *otmacro= (wmOperatorTypeMacro*)ptr->data;
+ wmOperatorTypeMacro *otmacro = (wmOperatorTypeMacro*)ptr->data;
wmOperatorType *ot = WM_operatortype_find(otmacro->idname, TRUE);
return rna_pointer_inherit_refine(ptr, ot->srna, otmacro->properties);
}
static void rna_Event_ascii_get(PointerRNA *ptr, char *value)
{
- wmEvent *event= (wmEvent*)ptr->data;
- value[0]= event->ascii;
- value[1]= '\0';
+ wmEvent *event = (wmEvent*)ptr->data;
+ value[0] = event->ascii;
+ value[1] = '\0';
}
static int rna_Event_ascii_length(PointerRNA *ptr)
{
- wmEvent *event= (wmEvent*)ptr->data;
+ wmEvent *event = (wmEvent*)ptr->data;
return (event->ascii)? 1 : 0;
}
static void rna_Event_unicode_get(PointerRNA *ptr, char *value)
{
/* utf8 buf isnt \0 terminated */
- wmEvent *event= (wmEvent*)ptr->data;
- size_t len= 0;
+ wmEvent *event = (wmEvent*)ptr->data;
+ size_t len = 0;
if (event->utf8_buf[0]) {
BLI_str_utf8_as_unicode_and_size(event->utf8_buf, &len);
@@ -509,13 +509,13 @@ static void rna_Event_unicode_get(PointerRNA *ptr, char *value)
}
}
- value[len]= '\0';
+ value[len] = '\0';
}
static int rna_Event_unicode_length(PointerRNA *ptr)
{
- wmEvent *event= (wmEvent*)ptr->data;
+ wmEvent *event = (wmEvent*)ptr->data;
if (event->utf8_buf[0]) {
return BLI_str_utf8_size(event->utf8_buf); /* invalid value is checked on assignment so we dont need to account for this */
}
@@ -526,77 +526,77 @@ static int rna_Event_unicode_length(PointerRNA *ptr)
static void rna_Window_screen_set(PointerRNA *ptr, PointerRNA value)
{
- wmWindow *win= (wmWindow*)ptr->data;
+ wmWindow *win = (wmWindow*)ptr->data;
- if(value.data == NULL)
+ if (value.data == NULL)
return;
/* exception: can't set screens inside of area/region handers */
- win->newscreen= value.data;
+ win->newscreen = value.data;
}
static void rna_Window_screen_update(bContext *C, PointerRNA *ptr)
{
- wmWindow *win= (wmWindow*)ptr->data;
+ wmWindow *win = (wmWindow*)ptr->data;
/* exception: can't set screens inside of area/region handers, and must
- use context so notifier gets to the right window */
- if(win->newscreen) {
+ * use context so notifier gets to the right window */
+ if (win->newscreen) {
WM_event_add_notifier(C, NC_SCREEN|ND_SCREENBROWSE, win->newscreen);
- win->newscreen= NULL;
+ win->newscreen = NULL;
}
}
static PointerRNA rna_KeyMapItem_properties_get(PointerRNA *ptr)
{
- wmKeyMapItem *kmi= ptr->data;
+ wmKeyMapItem *kmi = ptr->data;
- if(kmi->ptr)
+ if (kmi->ptr)
return *(kmi->ptr);
- //return rna_pointer_inherit_refine(ptr, &RNA_OperatorProperties, op->properties);
+ /*return rna_pointer_inherit_refine(ptr, &RNA_OperatorProperties, op->properties); */
return PointerRNA_NULL;
}
static int rna_wmKeyMapItem_map_type_get(PointerRNA *ptr)
{
- wmKeyMapItem *kmi= ptr->data;
+ wmKeyMapItem *kmi = ptr->data;
- if(ISTIMER(kmi->type)) return KMI_TYPE_TIMER;
- if(ISKEYBOARD(kmi->type)) return KMI_TYPE_KEYBOARD;
- if(ISTWEAK(kmi->type)) return KMI_TYPE_TWEAK;
- if(ISMOUSE(kmi->type)) return KMI_TYPE_MOUSE;
- if(ISNDOF(kmi->type)) return KMI_TYPE_NDOF;
- if(kmi->type == KM_TEXTINPUT) return KMI_TYPE_TEXTINPUT;
+ if (ISTIMER(kmi->type)) return KMI_TYPE_TIMER;
+ if (ISKEYBOARD(kmi->type)) return KMI_TYPE_KEYBOARD;
+ if (ISTWEAK(kmi->type)) return KMI_TYPE_TWEAK;
+ if (ISMOUSE(kmi->type)) return KMI_TYPE_MOUSE;
+ if (ISNDOF(kmi->type)) return KMI_TYPE_NDOF;
+ if (kmi->type == KM_TEXTINPUT) return KMI_TYPE_TEXTINPUT;
return KMI_TYPE_KEYBOARD;
}
static void rna_wmKeyMapItem_map_type_set(PointerRNA *ptr, int value)
{
- wmKeyMapItem *kmi= ptr->data;
- int map_type= rna_wmKeyMapItem_map_type_get(ptr);
+ wmKeyMapItem *kmi = ptr->data;
+ int map_type = rna_wmKeyMapItem_map_type_get(ptr);
- if(value != map_type) {
- switch(value) {
+ if (value != map_type) {
+ switch (value) {
case KMI_TYPE_KEYBOARD:
- kmi->type= AKEY;
- kmi->val= KM_PRESS;
+ kmi->type = AKEY;
+ kmi->val = KM_PRESS;
break;
case KMI_TYPE_TWEAK:
- kmi->type= EVT_TWEAK_L;
- kmi->val= KM_ANY;
+ kmi->type = EVT_TWEAK_L;
+ kmi->val = KM_ANY;
break;
case KMI_TYPE_MOUSE:
- kmi->type= LEFTMOUSE;
- kmi->val= KM_PRESS;
+ kmi->type = LEFTMOUSE;
+ kmi->val = KM_PRESS;
break;
case KMI_TYPE_TEXTINPUT:
- kmi->type= KM_TEXTINPUT;
- kmi->val= KM_NOTHING;
+ kmi->type = KM_TEXTINPUT;
+ kmi->val = KM_NOTHING;
break;
case KMI_TYPE_TIMER:
- kmi->type= TIMER;
- kmi->val= KM_NOTHING;
+ kmi->type = TIMER;
+ kmi->val = KM_NOTHING;
break;
case KMI_TYPE_NDOF:
kmi->type = NDOF_BUTTON_MENU;
@@ -608,21 +608,21 @@ static void rna_wmKeyMapItem_map_type_set(PointerRNA *ptr, int value)
static EnumPropertyItem *rna_KeyMapItem_type_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
- int map_type= rna_wmKeyMapItem_map_type_get(ptr);
+ int map_type = rna_wmKeyMapItem_map_type_get(ptr);
- if(map_type == KMI_TYPE_MOUSE) return event_mouse_type_items;
- if(map_type == KMI_TYPE_TWEAK) return event_tweak_type_items;
- if(map_type == KMI_TYPE_TIMER) return event_timer_type_items;
- if(map_type == KMI_TYPE_NDOF) return event_ndof_type_items;
+ if (map_type == KMI_TYPE_MOUSE) return event_mouse_type_items;
+ if (map_type == KMI_TYPE_TWEAK) return event_tweak_type_items;
+ if (map_type == KMI_TYPE_TIMER) return event_timer_type_items;
+ if (map_type == KMI_TYPE_NDOF) return event_ndof_type_items;
else return event_type_items;
}
static EnumPropertyItem *rna_KeyMapItem_value_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
- int map_type= rna_wmKeyMapItem_map_type_get(ptr);
+ int map_type = rna_wmKeyMapItem_map_type_get(ptr);
- if(map_type == KMI_TYPE_MOUSE || map_type == KMI_TYPE_KEYBOARD || map_type == KMI_TYPE_NDOF) return event_keymouse_value_items;
- if(map_type == KMI_TYPE_TWEAK) return event_tweak_value_items;
+ if (map_type == KMI_TYPE_MOUSE || map_type == KMI_TYPE_KEYBOARD || map_type == KMI_TYPE_NDOF) return event_keymouse_value_items;
+ if (map_type == KMI_TYPE_TWEAK) return event_tweak_value_items;
else return event_value_items;
}
@@ -632,12 +632,12 @@ static EnumPropertyItem *rna_KeyMapItem_propvalue_itemf(bContext *C, PointerRNA
wmKeyConfig *kc;
wmKeyMap *km;
- for(kc=wm->keyconfigs.first; kc; kc=kc->next) {
- for(km=kc->keymaps.first; km; km=km->next) {
+ for (kc = wm->keyconfigs.first; kc; kc = kc->next) {
+ for (km = kc->keymaps.first; km; km = km->next) {
/* only check if it's a modal keymap */
if (km->modal_items) {
wmKeyMapItem *kmi;
- for (kmi=km->items.first; kmi; kmi=kmi->next) {
+ for (kmi = km->items.first; kmi; kmi = kmi->next) {
if (kmi == ptr->data) {
return km->modal_items;
}
@@ -668,48 +668,48 @@ static void rna_KeyMapItem_any_setf(PointerRNA *ptr, int value)
{
wmKeyMapItem *kmi = (wmKeyMapItem*)ptr->data;
- if(value) {
- kmi->shift= kmi->ctrl= kmi->alt= kmi->oskey= KM_ANY;
+ if (value) {
+ kmi->shift = kmi->ctrl = kmi->alt = kmi->oskey = KM_ANY;
}
else {
- kmi->shift= kmi->ctrl= kmi->alt= kmi->oskey= 0;
+ kmi->shift = kmi->ctrl = kmi->alt = kmi->oskey = 0;
}
}
static PointerRNA rna_WindowManager_active_keyconfig_get(PointerRNA *ptr)
{
- wmWindowManager *wm= ptr->data;
+ wmWindowManager *wm = ptr->data;
wmKeyConfig *kc;
- for(kc=wm->keyconfigs.first; kc; kc=kc->next)
- if(strcmp(kc->idname, U.keyconfigstr) == 0)
+ for (kc = wm->keyconfigs.first; kc; kc = kc->next)
+ if (strcmp(kc->idname, U.keyconfigstr) == 0)
break;
- if(!kc)
- kc= wm->defaultconf;
+ if (!kc)
+ kc = wm->defaultconf;
return rna_pointer_inherit_refine(ptr, &RNA_KeyConfig, kc);
}
static void rna_WindowManager_active_keyconfig_set(PointerRNA *ptr, PointerRNA value)
{
- wmWindowManager *wm= ptr->data;
- wmKeyConfig *kc= value.data;
+ wmWindowManager *wm = ptr->data;
+ wmKeyConfig *kc = value.data;
- if(kc)
+ if (kc)
WM_keyconfig_set_active(wm, kc->idname);
}
static void rna_wmKeyMapItem_idname_get(PointerRNA *ptr, char *value)
{
- wmKeyMapItem *kmi= ptr->data;
+ wmKeyMapItem *kmi = ptr->data;
WM_operator_py_idname(value, kmi->idname);
}
static int rna_wmKeyMapItem_idname_length(PointerRNA *ptr)
{
- wmKeyMapItem *kmi= ptr->data;
+ wmKeyMapItem *kmi = ptr->data;
char pyname[OP_MAX_TYPENAME];
WM_operator_py_idname(pyname, kmi->idname);
@@ -718,12 +718,12 @@ static int rna_wmKeyMapItem_idname_length(PointerRNA *ptr)
static void rna_wmKeyMapItem_idname_set(PointerRNA *ptr, const char *value)
{
- wmKeyMapItem *kmi= ptr->data;
+ wmKeyMapItem *kmi = ptr->data;
char idname[OP_MAX_TYPENAME];
WM_operator_bl_idname(idname, value);
- if(strcmp(idname, kmi->idname) != 0) {
+ if (strcmp(idname, kmi->idname) != 0) {
BLI_strncpy(kmi->idname, idname, sizeof(kmi->idname));
WM_keymap_properties_reset(kmi, NULL);
@@ -732,21 +732,21 @@ static void rna_wmKeyMapItem_idname_set(PointerRNA *ptr, const char *value)
static void rna_wmKeyMapItem_name_get(PointerRNA *ptr, char *value)
{
- wmKeyMapItem *kmi= ptr->data;
- wmOperatorType *ot= WM_operatortype_find(kmi->idname, 1);
+ wmKeyMapItem *kmi = ptr->data;
+ wmOperatorType *ot = WM_operatortype_find(kmi->idname, 1);
strcpy(value, ot ? ot->name : kmi->idname);
}
static int rna_wmKeyMapItem_name_length(PointerRNA *ptr)
{
- wmKeyMapItem *kmi= ptr->data;
- wmOperatorType *ot= WM_operatortype_find(kmi->idname, 1);
+ wmKeyMapItem *kmi = ptr->data;
+ wmOperatorType *ot = WM_operatortype_find(kmi->idname, 1);
return strlen(ot ? ot->name : kmi->idname);
}
static int rna_KeyMapItem_userdefined_get(PointerRNA *ptr)
{
- wmKeyMapItem *kmi= ptr->data;
+ wmKeyMapItem *kmi = ptr->data;
return kmi->id < 0;
}
@@ -754,13 +754,13 @@ static void rna_wmClipboard_get(PointerRNA *UNUSED(ptr), char *value)
{
char *pbuf;
- pbuf= WM_clipboard_text_get(FALSE);
- if(pbuf) {
+ pbuf = WM_clipboard_text_get(FALSE);
+ if (pbuf) {
strcpy(value, pbuf);
MEM_freeN(pbuf);
}
else {
- value[0]= '\0';
+ value[0] = '\0';
}
}
@@ -770,12 +770,12 @@ static int rna_wmClipboard_length(PointerRNA *UNUSED(ptr))
int length;
pbuf = WM_clipboard_text_get(FALSE);
- if(pbuf) {
+ if (pbuf) {
length = strlen(pbuf);
MEM_freeN(pbuf);
}
else {
- length= 0;
+ length = 0;
}
@@ -791,21 +791,21 @@ static void rna_wmClipboard_set(PointerRNA *UNUSED(ptr), const char *value)
static void rna_Operator_unregister(struct Main *bmain, StructRNA *type)
{
const char *idname;
- wmOperatorType *ot= RNA_struct_blender_type_get(type);
+ wmOperatorType *ot = RNA_struct_blender_type_get(type);
wmWindowManager *wm;
- if(!ot)
+ if (!ot)
return;
/* update while blender is running */
- wm= bmain->wm.first;
- if(wm)
+ wm = bmain->wm.first;
+ if (wm)
WM_operator_stack_clear(wm);
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
RNA_struct_free_extension(type, &ot->ext);
- idname= ot->idname;
+ idname = ot->idname;
WM_operatortype_remove(ot->idname);
MEM_freeN((void *)idname);
@@ -824,14 +824,14 @@ static int operator_poll(bContext *C, wmOperatorType *ot)
int visible;
RNA_pointer_create(NULL, ot->ext.srna, NULL, &ptr); /* dummy */
- func= &rna_Operator_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
+ func = &rna_Operator_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
ot->ext.call(C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret);
- visible= *(int*)ret;
+ visible = *(int*)ret;
RNA_parameter_list_free(&list);
@@ -849,14 +849,14 @@ static int operator_execute(bContext *C, wmOperator *op)
int result;
RNA_pointer_create(NULL, op->type->ext.srna, op, &opr);
- func= &rna_Operator_execute_func; /* RNA_struct_find_function(&opr, "execute"); */
+ func = &rna_Operator_execute_func; /* RNA_struct_find_function(&opr, "execute"); */
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
op->type->ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret);
- result= *(int*)ret;
+ result = *(int*)ret;
RNA_parameter_list_free(&list);
@@ -875,14 +875,14 @@ static int operator_check(bContext *C, wmOperator *op)
int result;
RNA_pointer_create(NULL, op->type->ext.srna, op, &opr);
- func= &rna_Operator_check_func; /* RNA_struct_find_function(&opr, "check"); */
+ func = &rna_Operator_check_func; /* RNA_struct_find_function(&opr, "check"); */
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
op->type->ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret);
- result= *(int*)ret;
+ result = *(int*)ret;
RNA_parameter_list_free(&list);
@@ -900,7 +900,7 @@ static int operator_invoke(bContext *C, wmOperator *op, wmEvent *event)
int result;
RNA_pointer_create(NULL, op->type->ext.srna, op, &opr);
- func= &rna_Operator_invoke_func; /* RNA_struct_find_function(&opr, "invoke"); */
+ func = &rna_Operator_invoke_func; /* RNA_struct_find_function(&opr, "invoke"); */
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -908,7 +908,7 @@ static int operator_invoke(bContext *C, wmOperator *op, wmEvent *event)
op->type->ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret);
- result= *(int*)ret;
+ result = *(int*)ret;
RNA_parameter_list_free(&list);
@@ -927,7 +927,7 @@ static int operator_modal(bContext *C, wmOperator *op, wmEvent *event)
int result;
RNA_pointer_create(NULL, op->type->ext.srna, op, &opr);
- func= &rna_Operator_modal_func; /* RNA_struct_find_function(&opr, "modal"); */
+ func = &rna_Operator_modal_func; /* RNA_struct_find_function(&opr, "modal"); */
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -935,7 +935,7 @@ static int operator_modal(bContext *C, wmOperator *op, wmEvent *event)
op->type->ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret);
- result= *(int*)ret;
+ result = *(int*)ret;
RNA_parameter_list_free(&list);
@@ -951,7 +951,7 @@ static void operator_draw(bContext *C, wmOperator *op)
FunctionRNA *func;
RNA_pointer_create(NULL, op->type->ext.srna, op, &opr);
- func= &rna_Operator_draw_func; /* RNA_struct_find_function(&opr, "draw"); */
+ func = &rna_Operator_draw_func; /* RNA_struct_find_function(&opr, "draw"); */
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -972,14 +972,14 @@ static int operator_cancel(bContext *C, wmOperator *op)
int result;
RNA_pointer_create(NULL, op->type->ext.srna, op, &opr);
- func= &rna_Operator_cancel_func; /* RNA_struct_find_function(&opr, "cancel"); */
+ func = &rna_Operator_cancel_func; /* RNA_struct_find_function(&opr, "cancel"); */
RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C);
op->type->ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret);
- result= *(int*)ret;
+ result = *(int*)ret;
RNA_parameter_list_free(&list);
@@ -995,22 +995,22 @@ static char _operator_descr[RNA_DYN_DESCR_MAX];
static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
wmOperatorType dummyot = {NULL};
- wmOperator dummyop= {NULL};
+ wmOperator dummyop = {NULL};
PointerRNA dummyotr;
int have_function[7];
/* setup dummy operator & operator type to store static properties in */
- dummyop.type= &dummyot;
- dummyot.idname= _operator_idname; /* only assigne the pointer, string is NULL'd */
- dummyot.name= _operator_name; /* only assigne the pointer, string is NULL'd */
- dummyot.description= _operator_descr; /* only assigne the pointer, string is NULL'd */
+ dummyop.type = &dummyot;
+ dummyot.idname = _operator_idname; /* only assigne the pointer, string is NULL'd */
+ dummyot.name = _operator_name; /* only assigne the pointer, string is NULL'd */
+ dummyot.description = _operator_descr; /* only assigne the pointer, string is NULL'd */
RNA_pointer_create(NULL, &RNA_Operator, &dummyop, &dummyotr);
- /* clear incase they are left unset */
- _operator_idname[0]= _operator_name[0]= _operator_descr[0]= '\0';
+ /* clear in case they are left unset */
+ _operator_idname[0] = _operator_name[0] = _operator_descr[0] = '\0';
/* validate the python class */
- if(validate(&dummyotr, data, have_function) != 0)
+ if (validate(&dummyotr, data, have_function) != 0)
return NULL;
{ /* convert foo.bar to FOO_OT_bar
@@ -1018,14 +1018,14 @@ static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *
/* inconveniently long name sanity check */
{
- char *ch= _operator_idname;
+ char *ch = _operator_idname;
int i;
- int dot= 0;
- for(i=0; *ch; i++) {
- if((*ch >= 'a' && *ch <= 'z') || (*ch >= '0' && *ch <= '9') || *ch == '_') {
+ int dot = 0;
+ for (i = 0; *ch; i++) {
+ if ((*ch >= 'a' && *ch <= 'z') || (*ch >= '0' && *ch <= '9') || *ch == '_') {
/* pass */
}
- else if(*ch == '.') {
+ else if (*ch == '.') {
dot++;
}
else {
@@ -1036,14 +1036,14 @@ static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *
ch++;
}
- if(i > ((int)sizeof(dummyop.idname)) - 3) {
+ if (i > ((int)sizeof(dummyop.idname)) - 3) {
BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', "
"is too long, maximum length is %d", identifier, _operator_idname,
(int)sizeof(dummyop.idname) - 3);
return NULL;
}
- if(dot != 1) {
+ if (dot != 1) {
BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', "
"must contain 1 '.' character", identifier, _operator_idname);
return NULL;
@@ -1056,9 +1056,9 @@ static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *
int namelen = strlen(_operator_name) + 1;
int desclen = strlen(_operator_descr) + 1;
char *ch;
- ch= MEM_callocN(sizeof(char) * (idlen + namelen + desclen), "_operator_idname"); /* 2 terminators and 3 to convert a.b -> A_OT_b */
+ ch = MEM_callocN(sizeof(char) * (idlen + namelen + desclen), "_operator_idname"); /* 2 terminators and 3 to convert a.b -> A_OT_b */
WM_operator_bl_idname(ch, _operator_idname); /* convert the idname from python */
- dummyot.idname= ch;
+ dummyot.idname = ch;
ch += idlen;
strcpy(ch, _operator_name);
dummyot.name = ch;
@@ -1070,8 +1070,8 @@ static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *
/* check if we have registered this operator type before, and remove it */
{
- wmOperatorType *ot= WM_operatortype_find(dummyot.idname, TRUE);
- if(ot && ot->ext.srna)
+ wmOperatorType *ot = WM_operatortype_find(dummyot.idname, TRUE);
+ if (ot && ot->ext.srna)
rna_Operator_unregister(bmain, ot->ext.srna);
}
@@ -1079,19 +1079,19 @@ static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *
* for now just remove from dir(bpy.types) */
/* create a new operator type */
- dummyot.ext.srna= RNA_def_struct(&BLENDER_RNA, dummyot.idname, "Operator");
+ dummyot.ext.srna = RNA_def_struct(&BLENDER_RNA, dummyot.idname, "Operator");
RNA_def_struct_flag(dummyot.ext.srna, STRUCT_NO_IDPROPERTIES); /* operator properties are registered separately */
- dummyot.ext.data= data;
- dummyot.ext.call= call;
- dummyot.ext.free= free;
-
- dummyot.pyop_poll= (have_function[0])? operator_poll: NULL;
- dummyot.exec= (have_function[1])? operator_execute: NULL;
- dummyot.check= (have_function[2])? operator_check: NULL;
- dummyot.invoke= (have_function[3])? operator_invoke: NULL;
- dummyot.modal= (have_function[4])? operator_modal: NULL;
- dummyot.ui= (have_function[5])? operator_draw: NULL;
- dummyot.cancel= (have_function[6])? operator_cancel: NULL;
+ dummyot.ext.data = data;
+ dummyot.ext.call = call;
+ dummyot.ext.free = free;
+
+ dummyot.pyop_poll = (have_function[0])? operator_poll: NULL;
+ dummyot.exec = (have_function[1])? operator_execute: NULL;
+ dummyot.check = (have_function[2])? operator_check: NULL;
+ dummyot.invoke = (have_function[3])? operator_invoke: NULL;
+ dummyot.modal = (have_function[4])? operator_modal: NULL;
+ dummyot.ui = (have_function[5])? operator_draw: NULL;
+ dummyot.cancel = (have_function[6])? operator_cancel: NULL;
WM_operatortype_append_ptr(operator_wrapper, (void *)&dummyot);
/* update while blender is running */
@@ -1109,19 +1109,19 @@ void **rna_Operator_instance(PointerRNA *ptr)
static StructRNA *rna_MacroOperator_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
wmOperatorType dummyot = {NULL};
- wmOperator dummyop= {NULL};
+ wmOperator dummyop = {NULL};
PointerRNA dummyotr;
int have_function[4];
/* setup dummy operator & operator type to store static properties in */
- dummyop.type= &dummyot;
- dummyot.idname= _operator_idname; /* only assigne the pointer, string is NULL'd */
- dummyot.name= _operator_name; /* only assigne the pointer, string is NULL'd */
- dummyot.description= _operator_descr; /* only assigne the pointer, string is NULL'd */
+ dummyop.type = &dummyot;
+ dummyot.idname = _operator_idname; /* only assigne the pointer, string is NULL'd */
+ dummyot.name = _operator_name; /* only assigne the pointer, string is NULL'd */
+ dummyot.description = _operator_descr; /* only assigne the pointer, string is NULL'd */
RNA_pointer_create(NULL, &RNA_Macro, &dummyop, &dummyotr);
/* validate the python class */
- if(validate(&dummyotr, data, have_function) != 0)
+ if (validate(&dummyotr, data, have_function) != 0)
return NULL;
{ /* convert foo.bar to FOO_OT_bar
@@ -1130,9 +1130,9 @@ static StructRNA *rna_MacroOperator_register(Main *bmain, ReportList *reports, v
int namelen = strlen(_operator_name) + 1;
int desclen = strlen(_operator_descr) + 1;
char *ch;
- ch= MEM_callocN(sizeof(char) * (idlen + namelen + desclen), "_operator_idname"); /* 2 terminators and 3 to convert a.b -> A_OT_b */
+ ch = MEM_callocN(sizeof(char) * (idlen + namelen + desclen), "_operator_idname"); /* 2 terminators and 3 to convert a.b -> A_OT_b */
WM_operator_bl_idname(ch, _operator_idname); /* convert the idname from python */
- dummyot.idname= ch;
+ dummyot.idname = ch;
ch += idlen;
strcpy(ch, _operator_name);
dummyot.name = ch;
@@ -1141,7 +1141,7 @@ static StructRNA *rna_MacroOperator_register(Main *bmain, ReportList *reports, v
dummyot.description = ch;
}
- if(strlen(identifier) >= sizeof(dummyop.idname)) {
+ if (strlen(identifier) >= sizeof(dummyop.idname)) {
BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s' is too long, maximum length is %d",
identifier, (int)sizeof(dummyop.idname));
return NULL;
@@ -1149,8 +1149,8 @@ static StructRNA *rna_MacroOperator_register(Main *bmain, ReportList *reports, v
/* check if we have registered this operator type before, and remove it */
{
- wmOperatorType *ot= WM_operatortype_find(dummyot.idname, TRUE);
- if(ot && ot->ext.srna)
+ wmOperatorType *ot = WM_operatortype_find(dummyot.idname, TRUE);
+ if (ot && ot->ext.srna)
rna_Operator_unregister(bmain, ot->ext.srna);
}
@@ -1158,13 +1158,13 @@ static StructRNA *rna_MacroOperator_register(Main *bmain, ReportList *reports, v
* for now just remove from dir(bpy.types) */
/* create a new operator type */
- dummyot.ext.srna= RNA_def_struct(&BLENDER_RNA, dummyot.idname, "Operator");
- dummyot.ext.data= data;
- dummyot.ext.call= call;
- dummyot.ext.free= free;
+ dummyot.ext.srna = RNA_def_struct(&BLENDER_RNA, dummyot.idname, "Operator");
+ dummyot.ext.data = data;
+ dummyot.ext.call = call;
+ dummyot.ext.free = free;
- dummyot.pyop_poll= (have_function[0])? operator_poll: NULL;
- dummyot.ui= (have_function[3])? operator_draw: NULL;
+ dummyot.pyop_poll = (have_function[0])? operator_poll: NULL;
+ dummyot.ui = (have_function[3])? operator_draw: NULL;
WM_operatortype_append_macro_ptr(macro_wrapper, (void *)&dummyot);
@@ -1177,44 +1177,44 @@ static StructRNA *rna_MacroOperator_register(Main *bmain, ReportList *reports, v
static StructRNA* rna_Operator_refine(PointerRNA *opr)
{
- wmOperator *op= (wmOperator*)opr->data;
+ wmOperator *op = (wmOperator*)opr->data;
return (op->type && op->type->ext.srna)? op->type->ext.srna: &RNA_Operator;
}
static StructRNA* rna_MacroOperator_refine(PointerRNA *opr)
{
- wmOperator *op= (wmOperator*)opr->data;
+ wmOperator *op = (wmOperator*)opr->data;
return (op->type && op->type->ext.srna)? op->type->ext.srna: &RNA_Macro;
}
/* just to work around 'const char *' warning and to ensure this is a python op */
static void rna_Operator_bl_idname_set(PointerRNA *ptr, const char *value)
{
- wmOperator *data= (wmOperator*)(ptr->data);
- char *str= (char *)data->type->idname;
- if(!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
+ wmOperator *data = (wmOperator*)(ptr->data);
+ char *str = (char *)data->type->idname;
+ if (!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
else assert(!"setting the bl_idname on a non-builtin operator");
}
static void rna_Operator_bl_label_set(PointerRNA *ptr, const char *value)
{
- wmOperator *data= (wmOperator*)(ptr->data);
- char *str= (char *)data->type->name;
- if(!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
+ wmOperator *data = (wmOperator*)(ptr->data);
+ char *str = (char *)data->type->name;
+ if (!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
else assert(!"setting the bl_label on a non-builtin operator");
}
static void rna_Operator_bl_description_set(PointerRNA *ptr, const char *value)
{
- wmOperator *data= (wmOperator*)(ptr->data);
- char *str= (char *)data->type->description;
- if(!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
+ wmOperator *data = (wmOperator*)(ptr->data);
+ char *str = (char *)data->type->description;
+ if (!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
else assert(!"setting the bl_description on a non-builtin operator");
}
static void rna_KeyMapItem_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- wmKeyMapItem *kmi= ptr->data;
+ wmKeyMapItem *kmi = ptr->data;
WM_keyconfig_update_tag(NULL, kmi);
}
@@ -1225,7 +1225,7 @@ static void rna_def_operator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Operator", NULL);
+ srna = RNA_def_struct(brna, "Operator", NULL);
RNA_def_struct_ui_text(srna, "Operator", "Storage of an operator being executed, or registered after execution");
RNA_def_struct_sdna(srna, "wmOperator");
RNA_def_struct_refine_func(srna, "rna_Operator_refine");
@@ -1233,52 +1233,52 @@ static void rna_def_operator(BlenderRNA *brna)
RNA_def_struct_register_funcs(srna, "rna_Operator_register", "rna_Operator_unregister", "rna_Operator_instance");
#endif
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Operator_name_get", "rna_Operator_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "");
- prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "OperatorProperties");
RNA_def_property_ui_text(prop, "Properties", "");
RNA_def_property_pointer_funcs(prop, "rna_Operator_properties_get", NULL, NULL, NULL);
- prop= RNA_def_property(srna, "has_reports", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "has_reports", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* this is 'virtual' property */
RNA_def_property_boolean_funcs(prop, "rna_Operator_has_reports_get", NULL);
RNA_def_property_ui_text(prop, "Has Reports", "Operator has a set of reports (warnings and errors) from last execution");
- prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "UILayout");
/* Registration */
- prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME-3); /* else it uses the pointer size!. -3 because '.' -> '_OT_' */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_idname_set");
- // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_struct_name_property(srna, prop);
/* operator's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
* when drawing panel and having this flag set will make runtime switching of language much more tricky
* because label will be stored translated */
- prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_label_set");
- // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_flag(prop, PROP_REGISTER);
- prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE);
+ prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "type->description");
RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_description_set");
- // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
- prop= RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->flag");
RNA_def_property_enum_items(prop, operator_flag_items);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL|PROP_ENUM_FLAG);
@@ -1286,7 +1286,7 @@ static void rna_def_operator(BlenderRNA *brna)
RNA_api_operator(srna);
- srna= RNA_def_struct(brna, "OperatorProperties", NULL);
+ srna = RNA_def_struct(brna, "OperatorProperties", NULL);
RNA_def_struct_ui_text(srna, "Operator Properties", "Input properties of an Operator");
RNA_def_struct_refine_func(srna, "rna_OperatorProperties_refine");
RNA_def_struct_idprops_func(srna, "rna_OperatorProperties_idprops");
@@ -1297,7 +1297,7 @@ static void rna_def_macro_operator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Macro", NULL);
+ srna = RNA_def_struct(brna, "Macro", NULL);
RNA_def_struct_ui_text(srna, "Macro Operator", "Storage of a macro operator being executed, or registered after execution");
RNA_def_struct_sdna(srna, "wmOperator");
RNA_def_struct_refine_func(srna, "rna_MacroOperator_refine");
@@ -1305,44 +1305,44 @@ static void rna_def_macro_operator(BlenderRNA *brna)
RNA_def_struct_register_funcs(srna, "rna_MacroOperator_register", "rna_Operator_unregister", "rna_Operator_instance");
#endif
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Operator_name_get", "rna_Operator_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "");
- prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "OperatorProperties");
RNA_def_property_ui_text(prop, "Properties", "");
RNA_def_property_pointer_funcs(prop, "rna_Operator_properties_get", NULL, NULL, NULL);
/* Registration */
- prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_idname_set");
- // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_struct_name_property(srna, prop);
/* menu's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
* when drawing panel and having this flag set will make runtime switching of language much more tricky
* because label will be stored translated */
- prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_label_set");
- // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_flag(prop, PROP_REGISTER);
- prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE);
+ prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "type->description");
RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_description_set");
- // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
- prop= RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->flag");
RNA_def_property_enum_items(prop, operator_flag_items);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL|PROP_ENUM_FLAG);
@@ -1356,17 +1356,17 @@ static void rna_def_operator_type_macro(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "OperatorMacro", NULL);
+ srna = RNA_def_struct(brna, "OperatorMacro", NULL);
RNA_def_struct_ui_text(srna, "Operator Macro", "Storage of a sub operator in a macro after it has been added");
RNA_def_struct_sdna(srna, "wmOperatorTypeMacro");
-// prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
-// RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-// RNA_def_property_string_sdna(prop, NULL, "idname");
-// RNA_def_property_ui_text(prop, "Name", "Name of the sub operator");
-// RNA_def_struct_name_property(srna, prop);
+/* prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); */
+/* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
+/* RNA_def_property_string_sdna(prop, NULL, "idname"); */
+/* RNA_def_property_ui_text(prop, "Name", "Name of the sub operator"); */
+/* RNA_def_struct_name_property(srna, prop); */
- prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "OperatorProperties");
RNA_def_property_ui_text(prop, "Properties", "");
@@ -1378,15 +1378,15 @@ static void rna_def_operator_utils(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "OperatorMousePath", "PropertyGroup");
+ srna = RNA_def_struct(brna, "OperatorMousePath", "PropertyGroup");
RNA_def_struct_ui_text(srna, "Operator Mouse Path", "Mouse path values for operators that record such paths");
- prop= RNA_def_property(srna, "loc", PROP_FLOAT, PROP_XYZ);
+ prop = RNA_def_property(srna, "loc", PROP_FLOAT, PROP_XYZ);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_array(prop, 2);
RNA_def_property_ui_text(prop, "Location", "Mouse location");
- prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_ui_text(prop, "Time", "Time of mouse location");
}
@@ -1396,11 +1396,11 @@ static void rna_def_operator_filelist_element(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "OperatorFileListElement", "PropertyGroup");
+ srna = RNA_def_struct(brna, "OperatorFileListElement", "PropertyGroup");
RNA_def_struct_ui_text(srna, "Operator File List Element", "");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_FILENAME);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_FILENAME);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_ui_text(prop, "Name", "Name of a file or directory within a file list");
}
@@ -1410,32 +1410,32 @@ static void rna_def_event(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Event", NULL);
+ srna = RNA_def_struct(brna, "Event", NULL);
RNA_def_struct_ui_text(srna, "Event", "Window Manager Event");
RNA_def_struct_sdna(srna, "wmEvent");
- RNA_define_verify_sdna(0); // not in sdna
+ RNA_define_verify_sdna(0); /* not in sdna */
/* strings */
- prop= RNA_def_property(srna, "ascii", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "ascii", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Event_ascii_get", "rna_Event_ascii_length", NULL);
RNA_def_property_ui_text(prop, "ASCII", "Single ASCII character for this event");
- prop= RNA_def_property(srna, "unicode", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "unicode", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Event_unicode_get", "rna_Event_unicode_length", NULL);
RNA_def_property_ui_text(prop, "Unicode", "Single unicode character for this event");
/* enums */
- prop= RNA_def_property(srna, "value", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "value", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "val");
RNA_def_property_enum_items(prop, event_value_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Value", "The type of event, only applies to some");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -1443,59 +1443,59 @@ static void rna_def_event(BlenderRNA *brna)
/* mouse */
- prop= RNA_def_property(srna, "mouse_x", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "mouse_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "x");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mouse X Position", "The window relative vertical location of the mouse");
- prop= RNA_def_property(srna, "mouse_y", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "mouse_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "y");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mouse Y Position", "The window relative horizontal location of the mouse");
- prop= RNA_def_property(srna, "mouse_region_x", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "mouse_region_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "mval[0]");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mouse X Position", "The region relative vertical location of the mouse");
- prop= RNA_def_property(srna, "mouse_region_y", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "mouse_region_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "mval[1]");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mouse Y Position", "The region relative horizontal location of the mouse");
- prop= RNA_def_property(srna, "mouse_prev_x", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "mouse_prev_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "prevx");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mouse Previous X Position", "The window relative vertical location of the mouse");
- prop= RNA_def_property(srna, "mouse_prev_y", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "mouse_prev_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "prevy");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mouse Previous Y Position", "The window relative horizontal location of the mouse");
/* modifiers */
- prop= RNA_def_property(srna, "shift", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "shift", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shift", 1);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Shift", "True when the Shift key is held");
- prop= RNA_def_property(srna, "ctrl", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "ctrl", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ctrl", 1);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Ctrl", "True when the Ctrl key is held");
- prop= RNA_def_property(srna, "alt", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "alt", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "alt", 1);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Alt", "True when the Alt/Option key is held");
- prop= RNA_def_property(srna, "oskey", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "oskey", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "oskey", 1);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "OS Key", "True when the Cmd key is held");
- RNA_define_verify_sdna(1); // not in sdna
+ RNA_define_verify_sdna(1); /* not in sdna */
}
static void rna_def_timer(BlenderRNA *brna)
@@ -1503,29 +1503,29 @@ static void rna_def_timer(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Timer", NULL);
+ srna = RNA_def_struct(brna, "Timer", NULL);
RNA_def_struct_ui_text(srna, "Timer", "Window event timer");
RNA_def_struct_sdna(srna, "wmTimer");
- RNA_define_verify_sdna(0); // not in sdna
+ RNA_define_verify_sdna(0); /* not in sdna */
/* could wrap more, for now this is enough */
- prop= RNA_def_property(srna, "time_step", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "time_step", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "timestep");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Time Step", "");
- prop= RNA_def_property(srna, "time_delta", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "time_delta", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "delta");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Delta", "Time since last step in seconds");
- prop= RNA_def_property(srna, "time_duration", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "time_duration", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "duration");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Delta", "Time since last step in seconds");
- RNA_define_verify_sdna(1); // not in sdna
+ RNA_define_verify_sdna(1); /* not in sdna */
}
static void rna_def_window(BlenderRNA *brna)
@@ -1533,11 +1533,11 @@ static void rna_def_window(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Window", NULL);
+ srna = RNA_def_struct(brna, "Window", NULL);
RNA_def_struct_ui_text(srna, "Window", "Open window");
RNA_def_struct_sdna(srna, "wmWindow");
- prop= RNA_def_property(srna, "screen", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "screen", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "Screen");
RNA_def_property_ui_text(prop, "Screen", "Active screen showing in the window");
@@ -1554,27 +1554,27 @@ static void rna_def_wm_keyconfigs(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
RNA_def_property_srna(cprop, "KeyConfigurations");
- srna= RNA_def_struct(brna, "KeyConfigurations", NULL);
+ srna = RNA_def_struct(brna, "KeyConfigurations", NULL);
RNA_def_struct_sdna(srna, "wmWindowManager");
RNA_def_struct_ui_text(srna, "KeyConfigs", "Collection of KeyConfigs");
- prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyConfig");
RNA_def_property_pointer_funcs(prop, "rna_WindowManager_active_keyconfig_get", "rna_WindowManager_active_keyconfig_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active KeyConfig", "Active key configuration (preset)");
- prop= RNA_def_property(srna, "default", PROP_POINTER, PROP_NEVER_NULL);
+ prop = RNA_def_property(srna, "default", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "defaultconf");
RNA_def_property_struct_type(prop, "KeyConfig");
RNA_def_property_ui_text(prop, "Default Key Configuration", "Default builtin key configuration");
- prop= RNA_def_property(srna, "addon", PROP_POINTER, PROP_NEVER_NULL);
+ prop = RNA_def_property(srna, "addon", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "addonconf");
RNA_def_property_struct_type(prop, "KeyConfig");
RNA_def_property_ui_text(prop, "Addon Key Configuration", "Key configuration that can be extended by addons, and is added to the active configuration when handling events");
- prop= RNA_def_property(srna, "user", PROP_POINTER, PROP_NEVER_NULL);
+ prop = RNA_def_property(srna, "user", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "userconf");
RNA_def_property_struct_type(prop, "KeyConfig");
RNA_def_property_ui_text(prop, "User Key Configuration", "Final key configuration that combines keymaps from the active and addon configurations, and can be edited by the user");
@@ -1587,25 +1587,25 @@ static void rna_def_windowmanager(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "WindowManager", "ID");
+ srna = RNA_def_struct(brna, "WindowManager", "ID");
RNA_def_struct_ui_text(srna, "Window Manager", "Window manager datablock defining open windows and other user interface data");
RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
RNA_def_struct_sdna(srna, "wmWindowManager");
- prop= RNA_def_property(srna, "operators", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "operators", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Operator");
RNA_def_property_ui_text(prop, "Operators", "Operator registry");
- prop= RNA_def_property(srna, "windows", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "windows", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Window");
RNA_def_property_ui_text(prop, "Windows", "Open windows");
- prop= RNA_def_property(srna, "keyconfigs", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "keyconfigs", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyConfig");
RNA_def_property_ui_text(prop, "Key Configurations", "Registered key configurations");
rna_def_wm_keyconfigs(brna, prop);
- prop= RNA_def_property(srna, "clipboard", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "clipboard", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_wmClipboard_get", "rna_wmClipboard_length", "rna_wmClipboard_set");
RNA_def_property_ui_text(prop, "Text Clipboard", "");
@@ -1618,7 +1618,7 @@ static void rna_def_keymap_items(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna;
RNA_def_property_srna(cprop, "KeyMapItems");
- srna= RNA_def_struct(brna, "KeyMapItems", NULL);
+ srna = RNA_def_struct(brna, "KeyMapItems", NULL);
RNA_def_struct_sdna(srna, "wmKeyMap");
RNA_def_struct_ui_text(srna, "KeyMap Items", "Collection of keymap items");
@@ -1630,7 +1630,7 @@ static void rna_def_wm_keymaps(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna;
RNA_def_property_srna(cprop, "KeyMaps");
- srna= RNA_def_struct(brna, "KeyMaps", NULL);
+ srna = RNA_def_struct(brna, "KeyMaps", NULL);
RNA_def_struct_sdna(srna, "wmKeyConfig");
RNA_def_struct_ui_text(srna, "Key Maps", "Collection of keymaps");
@@ -1652,21 +1652,21 @@ static void rna_def_keyconfig(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
/* KeyConfig */
- srna= RNA_def_struct(brna, "KeyConfig", NULL);
+ srna = RNA_def_struct(brna, "KeyConfig", NULL);
RNA_def_struct_sdna(srna, "wmKeyConfig");
RNA_def_struct_ui_text(srna, "Key Configuration", "Input configuration, including keymaps");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "idname");
RNA_def_property_ui_text(prop, "Name", "Name of the key configuration");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "keymaps", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "keymaps", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyMap");
RNA_def_property_ui_text(prop, "Key Maps", "Key maps configured as part of this configuration");
rna_def_wm_keymaps(brna, prop);
- prop= RNA_def_property(srna, "is_user_defined", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_user_defined", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYCONF_USER);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "User Defined", "Indicates that a keyconfig was defined by the user");
@@ -1674,49 +1674,49 @@ static void rna_def_keyconfig(BlenderRNA *brna)
RNA_api_keyconfig(srna);
/* KeyMap */
- srna= RNA_def_struct(brna, "KeyMap", NULL);
+ srna = RNA_def_struct(brna, "KeyMap", NULL);
RNA_def_struct_sdna(srna, "wmKeyMap");
RNA_def_struct_ui_text(srna, "Key Map", "Input configuration, including keymaps");
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "idname");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Name", "Name of the key map");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "space_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "space_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "spaceid");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, space_type_items);
RNA_def_property_ui_text(prop, "Space Type", "Optional space type keymap is associated with");
- prop= RNA_def_property(srna, "region_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "region_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "regionid");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, region_type_items);
RNA_def_property_ui_text(prop, "Region Type", "Optional region type keymap is associated with");
- prop= RNA_def_property(srna, "keymap_items", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(srna, "keymap_items", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "items", NULL);
RNA_def_property_struct_type(prop, "KeyMapItem");
RNA_def_property_ui_text(prop, "Items", "Items in the keymap, linking an operator to an input event");
rna_def_keymap_items(brna, prop);
- prop= RNA_def_property(srna, "is_user_modified", PROP_BOOLEAN, PROP_NEVER_NULL);
+ prop = RNA_def_property(srna, "is_user_modified", PROP_BOOLEAN, PROP_NEVER_NULL);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYMAP_USER_MODIFIED);
RNA_def_property_ui_text(prop, "User Defined", "Keymap is defined by the user");
- prop= RNA_def_property(srna, "is_modal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_modal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYMAP_MODAL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Modal Keymap", "Indicates that a keymap is used for translate modal events for an operator");
- prop= RNA_def_property(srna, "show_expanded_items", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_expanded_items", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYMAP_EXPANDED);
RNA_def_property_ui_text(prop, "Items Expanded", "Expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
- prop= RNA_def_property(srna, "show_expanded_children", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_expanded_children", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYMAP_CHILDREN_EXPANDED);
RNA_def_property_ui_text(prop, "Children Expanded", "Children expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
@@ -1725,11 +1725,11 @@ static void rna_def_keyconfig(BlenderRNA *brna)
RNA_api_keymap(srna);
/* KeyMapItem */
- srna= RNA_def_struct(brna, "KeyMapItem", NULL);
+ srna = RNA_def_struct(brna, "KeyMapItem", NULL);
RNA_def_struct_sdna(srna, "wmKeyMapItem");
RNA_def_struct_ui_text(srna, "Key Map Item", "Item in a Key Map");
- prop= RNA_def_property(srna, "idname", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "idname");
RNA_def_property_ui_text(prop, "Identifier", "Identifier of operator to call on input event");
RNA_def_property_string_funcs(prop, "rna_wmKeyMapItem_idname_get", "rna_wmKeyMapItem_idname_length", "rna_wmKeyMapItem_idname_set");
@@ -1738,107 +1738,107 @@ static void rna_def_keyconfig(BlenderRNA *brna)
/* this is infact the operator name, but if the operator can't be found we
* fallback on the operator ID */
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Name", "Name of operator to call on input event");
RNA_def_property_string_funcs(prop, "rna_wmKeyMapItem_name_get", "rna_wmKeyMapItem_name_length", NULL);
- prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "OperatorProperties");
RNA_def_property_pointer_funcs(prop, "rna_KeyMapItem_properties_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Properties", "Properties to set when the operator is called");
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
- prop= RNA_def_property(srna, "map_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "map_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "maptype");
RNA_def_property_enum_items(prop, map_type_items);
RNA_def_property_enum_funcs(prop, "rna_wmKeyMapItem_map_type_get", "rna_wmKeyMapItem_map_type_set", NULL);
RNA_def_property_ui_text(prop, "Map Type", "Type of event mapping");
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_KeyMapItem_type_itemf");
RNA_def_property_ui_text(prop, "Type", "Type of event");
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
- prop= RNA_def_property(srna, "value", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "value", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "val");
RNA_def_property_enum_items(prop, event_value_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_KeyMapItem_value_itemf");
RNA_def_property_ui_text(prop, "Value", "");
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
- prop= RNA_def_property(srna, "id", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "id", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "id");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "ID", "ID of the item");
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
- prop= RNA_def_property(srna, "any", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "any", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_KeyMapItem_any_getf", "rna_KeyMapItem_any_setf");
RNA_def_property_ui_text(prop, "Any", "Any modifier keys pressed");
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
- prop= RNA_def_property(srna, "shift", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "shift", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shift", 0);
-// RNA_def_property_enum_sdna(prop, NULL, "shift");
-// RNA_def_property_enum_items(prop, keymap_modifiers_items);
+/* RNA_def_property_enum_sdna(prop, NULL, "shift"); */
+/* RNA_def_property_enum_items(prop, keymap_modifiers_items); */
RNA_def_property_ui_text(prop, "Shift", "Shift key pressed");
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
- prop= RNA_def_property(srna, "ctrl", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "ctrl", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ctrl", 0);
-// RNA_def_property_enum_sdna(prop, NULL, "ctrl");
-// RNA_def_property_enum_items(prop, keymap_modifiers_items);
+/* RNA_def_property_enum_sdna(prop, NULL, "ctrl"); */
+/* RNA_def_property_enum_items(prop, keymap_modifiers_items); */
RNA_def_property_ui_text(prop, "Ctrl", "Control key pressed");
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
- prop= RNA_def_property(srna, "alt", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "alt", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "alt", 0);
-// RNA_def_property_enum_sdna(prop, NULL, "alt");
-// RNA_def_property_enum_items(prop, keymap_modifiers_items);
+/* RNA_def_property_enum_sdna(prop, NULL, "alt"); */
+/* RNA_def_property_enum_items(prop, keymap_modifiers_items); */
RNA_def_property_ui_text(prop, "Alt", "Alt key pressed");
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
- prop= RNA_def_property(srna, "oskey", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "oskey", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "oskey", 0);
-// RNA_def_property_enum_sdna(prop, NULL, "oskey");
-// RNA_def_property_enum_items(prop, keymap_modifiers_items);
+/* RNA_def_property_enum_sdna(prop, NULL, "oskey"); */
+/* RNA_def_property_enum_items(prop, keymap_modifiers_items); */
RNA_def_property_ui_text(prop, "OS Key", "Operating system key pressed");
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
- prop= RNA_def_property(srna, "key_modifier", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "key_modifier", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "keymodifier");
RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_ui_text(prop, "Key Modifier", "Regular key pressed as a modifier");
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
- prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KMI_EXPANDED);
RNA_def_property_ui_text(prop, "Expanded", "Show key map event and property details in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
- prop= RNA_def_property(srna, "propvalue", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "propvalue", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "propvalue");
RNA_def_property_enum_items(prop, keymap_propvalue_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_KeyMapItem_propvalue_itemf");
RNA_def_property_ui_text(prop, "Property Value", "The value this event translates to in a modal keymap");
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
- prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", KMI_INACTIVE);
RNA_def_property_ui_text(prop, "Active", "Activate or deactivate item");
RNA_def_property_ui_icon(prop, ICON_CHECKBOX_DEHLT, 1);
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
- prop= RNA_def_property(srna, "is_user_modified", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_user_modified", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KMI_USER_MODIFIED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "User Modified", "Is this keymap item modified by the user");
- prop= RNA_def_property(srna, "is_user_defined", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "is_user_defined", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "User Defined", "Is this keymap item user defined (doesn't just replace a builtin item)");
RNA_def_property_boolean_funcs(prop, "rna_KeyMapItem_userdefined_get", NULL);
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 35f12114a4e..bfe0f1cba65 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -84,9 +84,9 @@ void rna_event_timer_remove(struct wmWindowManager *wm, wmTimer *timer)
static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, const char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
{
-// wmWindowManager *wm = CTX_wm_manager(C);
+/* wmWindowManager *wm = CTX_wm_manager(C); */
char idname_bl[OP_MAX_TYPENAME];
- int modifier= 0;
+ int modifier = 0;
/* only on non-modal maps */
if (km->flag & KEYMAP_MODAL) {
@@ -96,19 +96,19 @@ static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, cons
WM_operator_bl_idname(idname_bl, idname);
- if(shift) modifier |= KM_SHIFT;
- if(ctrl) modifier |= KM_CTRL;
- if(alt) modifier |= KM_ALT;
- if(oskey) modifier |= KM_OSKEY;
+ if (shift) modifier |= KM_SHIFT;
+ if (ctrl) modifier |= KM_CTRL;
+ if (alt) modifier |= KM_ALT;
+ if (oskey) modifier |= KM_OSKEY;
- if(any) modifier = KM_ANY;
+ if (any) modifier = KM_ANY;
return WM_keymap_add_item(km, idname_bl, type, value, modifier, keymodifier);
}
static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, ReportList *reports, const char *propvalue_str, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
{
- int modifier= 0;
+ int modifier = 0;
int propvalue = 0;
/* only modal maps */
@@ -123,16 +123,16 @@ static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, ReportList *reports
}
- if(RNA_enum_value_from_id(km->modal_items, propvalue_str, &propvalue)==0) {
+ if (RNA_enum_value_from_id(km->modal_items, propvalue_str, &propvalue) == 0) {
BKE_report(reports, RPT_WARNING, "Property value not in enumeration");
}
- if(shift) modifier |= KM_SHIFT;
- if(ctrl) modifier |= KM_CTRL;
- if(alt) modifier |= KM_ALT;
- if(oskey) modifier |= KM_OSKEY;
+ if (shift) modifier |= KM_SHIFT;
+ if (ctrl) modifier |= KM_CTRL;
+ if (alt) modifier |= KM_ALT;
+ if (oskey) modifier |= KM_OSKEY;
- if(any) modifier = KM_ANY;
+ if (any) modifier = KM_ANY;
return WM_modalkeymap_add_item(km, type, value, modifier, keymodifier, propvalue);
}
@@ -172,21 +172,21 @@ static void rna_generic_op_invoke(FunctionRNA *func, int flag)
PropertyRNA *parm;
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call");
+ parm = RNA_def_pointer(func, "operator", "Operator", "", "Operator to call");
RNA_def_property_flag(parm, PROP_REQUIRED);
- if(flag & WM_GEN_INVOKE_EVENT) {
- parm= RNA_def_pointer(func, "event", "Event", "", "Event");
+ if (flag & WM_GEN_INVOKE_EVENT) {
+ parm = RNA_def_pointer(func, "event", "Event", "", "Event");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
- if(flag & WM_GEN_INVOKE_SIZE) {
+ if (flag & WM_GEN_INVOKE_SIZE) {
RNA_def_int(func, "width", 300, 0, INT_MAX, "", "Width of the popup", 0, INT_MAX);
RNA_def_int(func, "height", 20, 0, INT_MAX, "", "Height of the popup", 0, INT_MAX);
}
- if(flag & WM_GEN_INVOKE_RETURN) {
- parm= RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", "");
+ if (flag & WM_GEN_INVOKE_RETURN) {
+ parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", "");
RNA_def_function_return(func, parm);
}
}
@@ -196,54 +196,54 @@ void RNA_api_wm(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "fileselect_add", "WM_event_add_fileselect");
+ func = RNA_def_function(srna, "fileselect_add", "WM_event_add_fileselect");
RNA_def_function_ui_description(func, "Opens a file selector with an operator. "
"The string properties 'filepath', 'filename', 'directory' and a 'files' collection "
"are assigned when present in the operator");
rna_generic_op_invoke(func, 0);
- func= RNA_def_function(srna, "modal_handler_add", "rna_event_modal_handler_add");
+ func = RNA_def_function(srna, "modal_handler_add", "rna_event_modal_handler_add");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call");
+ parm = RNA_def_pointer(func, "operator", "Operator", "", "Operator to call");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_function_return(func, RNA_def_boolean(func, "handle", 1, "", ""));
- func= RNA_def_function(srna, "event_timer_add", "rna_event_timer_add");
- parm= RNA_def_property(func, "time_step", PROP_FLOAT, PROP_NONE);
+ func = RNA_def_function(srna, "event_timer_add", "rna_event_timer_add");
+ parm = RNA_def_property(func, "time_step", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_range(parm, 0.0, FLT_MAX);
RNA_def_property_ui_text(parm, "Time Step", "Interval in seconds between timer events");
RNA_def_pointer(func, "window", "Window", "", "Window to attach the timer to or None");
- parm= RNA_def_pointer(func, "result", "Timer", "", "");
+ parm = RNA_def_pointer(func, "result", "Timer", "", "");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "event_timer_remove", "rna_event_timer_remove");
- parm= RNA_def_pointer(func, "timer", "Timer", "", "");
+ func = RNA_def_function(srna, "event_timer_remove", "rna_event_timer_remove");
+ parm = RNA_def_pointer(func, "timer", "Timer", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* invoke functions, for use with python */
- func= RNA_def_function(srna, "invoke_props_popup", "WM_operator_props_popup");
+ func = RNA_def_function(srna, "invoke_props_popup", "WM_operator_props_popup");
RNA_def_function_ui_description(func, "Operator popup invoke");
rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT|WM_GEN_INVOKE_RETURN);
/* invoked dialog opens popup with OK button, does not auto-exec operator. */
- func= RNA_def_function(srna, "invoke_props_dialog", "WM_operator_props_dialog_popup");
+ func = RNA_def_function(srna, "invoke_props_dialog", "WM_operator_props_dialog_popup");
RNA_def_function_ui_description(func, "Operator dialog (non-autoexec popup) invoke");
rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE|WM_GEN_INVOKE_RETURN);
/* invoke enum */
- func= RNA_def_function(srna, "invoke_search_popup", "rna_Operator_enum_search_invoke");
+ func = RNA_def_function(srna, "invoke_search_popup", "rna_Operator_enum_search_invoke");
rna_generic_op_invoke(func, 0);
/* invoke functions, for use with python */
- func= RNA_def_function(srna, "invoke_popup", "WM_operator_ui_popup");
+ func = RNA_def_function(srna, "invoke_popup", "WM_operator_ui_popup");
RNA_def_function_ui_description(func, "Operator popup invoke");
rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE|WM_GEN_INVOKE_RETURN);
- func= RNA_def_function(srna, "invoke_confirm", "WM_operator_confirm");
+ func = RNA_def_function(srna, "invoke_confirm", "WM_operator_confirm");
RNA_def_function_ui_description(func, "Operator confirmation");
rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT|WM_GEN_INVOKE_RETURN);
@@ -255,81 +255,81 @@ void RNA_api_operator(StructRNA *srna)
PropertyRNA *parm;
/* utility, not for registering */
- func= RNA_def_function(srna, "report", "rna_Operator_report");
- parm= RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", "");
+ func = RNA_def_function(srna, "report", "rna_Operator_report");
+ parm = RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_string(func, "message", "", 0, "Report Message", "");
+ parm = RNA_def_string(func, "message", "", 0, "Report Message", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* Registration */
/* poll */
- func= RNA_def_function(srna, "poll", NULL);
+ func = RNA_def_function(srna, "poll", NULL);
RNA_def_function_ui_description(func, "Test if the operator can be called or not");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* exec */
- func= RNA_def_function(srna, "execute", NULL);
+ func = RNA_def_function(srna, "execute", NULL);
RNA_def_function_ui_description(func, "Execute the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); // better name?
+ parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); /* better name? */
RNA_def_function_return(func, parm);
/* check */
- func= RNA_def_function(srna, "check", NULL);
+ func = RNA_def_function(srna, "check", NULL);
RNA_def_function_ui_description(func, "Check the operator settings, return True to signal a change to redraw");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_boolean(func, "result", 0, "result", ""); // better name?
+ parm = RNA_def_boolean(func, "result", 0, "result", ""); /* better name? */
RNA_def_function_return(func, parm);
/* invoke */
- func= RNA_def_function(srna, "invoke", NULL);
+ func = RNA_def_function(srna, "invoke", NULL);
RNA_def_function_ui_description(func, "Invoke the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_pointer(func, "event", "Event", "", "");
+ parm = RNA_def_pointer(func, "event", "Event", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); // better name?
+ parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); /* better name? */
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "modal", NULL); /* same as invoke */
+ func = RNA_def_function(srna, "modal", NULL); /* same as invoke */
RNA_def_function_ui_description(func, "Modal operator function");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_pointer(func, "event", "Event", "", "");
+ parm = RNA_def_pointer(func, "event", "Event", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); // better name?
+ parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); /* better name? */
RNA_def_function_return(func, parm);
/* draw */
- func= RNA_def_function(srna, "draw", NULL);
+ func = RNA_def_function(srna, "draw", NULL);
RNA_def_function_ui_description(func, "Draw function for the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* cancel */
- func= RNA_def_function(srna, "cancel", NULL);
- RNA_def_function_ui_description(func, "Called when the operator is cancelled");
+ func = RNA_def_function(srna, "cancel", NULL);
+ RNA_def_function_ui_description(func, "Called when the operator is canceled");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); // better name?
+ parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); /* better name? */
RNA_def_function_return(func, parm);
}
@@ -339,35 +339,35 @@ void RNA_api_macro(StructRNA *srna)
PropertyRNA *parm;
/* utility, not for registering */
- func= RNA_def_function(srna, "report", "rna_Operator_report");
- parm= RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", "");
+ func = RNA_def_function(srna, "report", "rna_Operator_report");
+ parm = RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_string(func, "message", "", 0, "Report Message", "");
+ parm = RNA_def_string(func, "message", "", 0, "Report Message", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* Registration */
/* poll */
- func= RNA_def_function(srna, "poll", NULL);
+ func = RNA_def_function(srna, "poll", NULL);
RNA_def_function_ui_description(func, "Test if the operator can be called or not");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* draw */
- func= RNA_def_function(srna, "draw", NULL);
+ func = RNA_def_function(srna, "draw", NULL);
RNA_def_function_ui_description(func, "Draw function for the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
- parm= RNA_def_pointer(func, "context", "Context", "", "");
+ parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
void RNA_api_keyconfig(StructRNA *srna)
{
- // FunctionRNA *func;
- // PropertyRNA *parm;
+ /* FunctionRNA *func; */
+ /* PropertyRNA *parm; */
}
void RNA_api_keymap(StructRNA *srna)
@@ -375,17 +375,17 @@ void RNA_api_keymap(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "active", "rna_keymap_active");
+ func = RNA_def_function(srna, "active", "rna_keymap_active");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Active key map");
+ parm = RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Active key map");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "restore_to_default", "WM_keymap_restore_to_default");
+ func = RNA_def_function(srna, "restore_to_default", "WM_keymap_restore_to_default");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- func= RNA_def_function(srna, "restore_item_to_default", "rna_keymap_restore_item_to_default");
+ func = RNA_def_function(srna, "restore_item_to_default", "rna_keymap_restore_item_to_default");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
+ parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -394,10 +394,10 @@ void RNA_api_keymapitem(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "compare", "WM_keymap_item_compare");
- parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
+ func = RNA_def_function(srna, "compare", "WM_keymap_item_compare");
+ parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_boolean(func, "result", 0, "Comparison result", "");
+ parm = RNA_def_boolean(func, "result", 0, "Comparison result", "");
RNA_def_function_return(func, parm);
}
@@ -406,13 +406,13 @@ void RNA_api_keymapitems(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "new", "rna_KeyMap_item_new");
+ func = RNA_def_function(srna, "new", "rna_KeyMap_item_new");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_string(func, "idname", "", 0, "Operator Identifier", "");
+ parm = RNA_def_string(func, "idname", "", 0, "Operator Identifier", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_enum(func, "type", event_type_items, 0, "Type", "");
+ parm = RNA_def_enum(func, "type", event_type_items, 0, "Type", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_enum(func, "value", event_value_items, 0, "Value", "");
+ parm = RNA_def_enum(func, "value", event_value_items, 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_boolean(func, "any", 0, "Any", "");
RNA_def_boolean(func, "shift", 0, "Shift", "");
@@ -420,16 +420,16 @@ void RNA_api_keymapitems(StructRNA *srna)
RNA_def_boolean(func, "alt", 0, "Alt", "");
RNA_def_boolean(func, "oskey", 0, "OS Key", "");
RNA_def_enum(func, "key_modifier", event_type_items, 0, "Key Modifier", "");
- parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item");
+ parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "new_modal", "rna_KeyMap_item_new_modal");
+ func = RNA_def_function(srna, "new_modal", "rna_KeyMap_item_new_modal");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_string(func, "propvalue", "", 0, "Property Value", "");
+ parm = RNA_def_string(func, "propvalue", "", 0, "Property Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_enum(func, "type", event_type_items, 0, "Type", "");
+ parm = RNA_def_enum(func, "type", event_type_items, 0, "Type", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_enum(func, "value", event_value_items, 0, "Value", "");
+ parm = RNA_def_enum(func, "value", event_value_items, 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_boolean(func, "any", 0, "Any", "");
RNA_def_boolean(func, "shift", 0, "Shift", "");
@@ -437,18 +437,18 @@ void RNA_api_keymapitems(StructRNA *srna)
RNA_def_boolean(func, "alt", 0, "Alt", "");
RNA_def_boolean(func, "oskey", 0, "OS Key", "");
RNA_def_enum(func, "key_modifier", event_type_items, 0, "Key Modifier", "");
- parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item");
+ parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "WM_keymap_remove_item");
- parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
+ func = RNA_def_function(srna, "remove", "WM_keymap_remove_item");
+ parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "from_id", "WM_keymap_item_find_id");
- parm= RNA_def_property(func, "id", PROP_INT, PROP_NONE);
+ func = RNA_def_function(srna, "from_id", "WM_keymap_item_find_id");
+ parm = RNA_def_property(func, "id", PROP_INT, PROP_NONE);
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_ui_text(parm, "id", "ID of the item");
- parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
+ parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
RNA_def_function_return(func, parm);
}
@@ -457,27 +457,27 @@ void RNA_api_keymaps(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "new", "rna_keymap_new"); // add_keymap
- parm= RNA_def_string(func, "name", "", 0, "Name", "");
+ func = RNA_def_function(srna, "new", "rna_keymap_new"); /* add_keymap */
+ parm = RNA_def_string(func, "name", "", 0, "Name", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", "");
RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", "");
RNA_def_boolean(func, "modal", 0, "Modal", "");
- parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Added key map");
+ parm = RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Added key map");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "find", "rna_keymap_find"); // find_keymap
- parm= RNA_def_string(func, "name", "", 0, "Name", "");
+ func = RNA_def_function(srna, "find", "rna_keymap_find"); /* find_keymap */
+ parm = RNA_def_string(func, "name", "", 0, "Name", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", "");
RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", "");
- parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map");
+ parm = RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "find_modal", "rna_keymap_find_modal"); // find_keymap_modal
- parm= RNA_def_string(func, "name", "", 0, "Operator Name", "");
+ func = RNA_def_function(srna, "find_modal", "rna_keymap_find_modal"); /* find_keymap_modal */
+ parm = RNA_def_string(func, "name", "", 0, "Operator Name", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map");
+ parm = RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map");
RNA_def_function_return(func, parm);
}
@@ -486,14 +486,14 @@ void RNA_api_keyconfigs(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "new", "WM_keyconfig_new_user"); // add_keyconfig
- parm= RNA_def_string(func, "name", "", 0, "Name", "");
+ func = RNA_def_function(srna, "new", "WM_keyconfig_new_user"); /* add_keyconfig */
+ parm = RNA_def_string(func, "name", "", 0, "Name", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Added key configuration");
+ parm = RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Added key configuration");
RNA_def_function_return(func, parm);
- func= RNA_def_function(srna, "remove", "WM_keyconfig_remove"); // remove_keyconfig
- parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Removed key configuration");
+ func = RNA_def_function(srna, "remove", "WM_keyconfig_remove"); /* remove_keyconfig */
+ parm = RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Removed key configuration");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
index 279cda535b1..4c641062954 100644
--- a/source/blender/makesrna/intern/rna_world.c
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -67,29 +67,29 @@ static PointerRNA rna_World_mist_get(PointerRNA *ptr)
static void rna_World_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- World *wo= (World*)ptr->data;
+ World *wo = (World*)ptr->data;
rna_iterator_array_begin(iter, (void*)wo->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL);
}
static PointerRNA rna_World_active_texture_get(PointerRNA *ptr)
{
- World *wo= (World*)ptr->data;
+ World *wo = (World*)ptr->data;
Tex *tex;
- tex= give_current_world_texture(wo);
+ tex = give_current_world_texture(wo);
return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
}
static void rna_World_active_texture_set(PointerRNA *ptr, PointerRNA value)
{
- World *wo= (World*)ptr->data;
+ World *wo = (World*)ptr->data;
set_current_world_texture(wo, value.data);
}
static void rna_World_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- World *wo= ptr->id.data;
+ World *wo = ptr->id.data;
DAG_id_tag_update(&wo->id, 0);
WM_main_add_notifier(NC_WORLD, wo);
@@ -97,7 +97,7 @@ static void rna_World_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
static void rna_World_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- World *wo= ptr->id.data;
+ World *wo = ptr->id.data;
DAG_id_tag_update(&wo->id, 0);
WM_main_add_notifier(NC_WORLD|ND_WORLD_DRAW, wo);
@@ -106,7 +106,7 @@ static void rna_World_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi
/* so camera mist limits redraw */
static void rna_World_draw_mist_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- World *wo= ptr->id.data;
+ World *wo = ptr->id.data;
DAG_id_tag_update(&wo->id, 0);
WM_main_add_notifier(NC_WORLD|ND_WORLD_DRAW, wo);
@@ -115,7 +115,7 @@ static void rna_World_draw_mist_update(Main *UNUSED(bmain), Scene *UNUSED(scene)
static void rna_World_stars_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- World *wo= ptr->id.data;
+ World *wo = ptr->id.data;
DAG_id_tag_update(&wo->id, 0);
WM_main_add_notifier(NC_WORLD|ND_WORLD_STARS, wo);
@@ -123,9 +123,9 @@ static void rna_World_stars_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po
static void rna_World_use_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- World *wrld= (World*)ptr->data;
+ World *wrld = (World*)ptr->data;
- if(wrld->use_nodes && wrld->nodetree==NULL)
+ if (wrld->use_nodes && wrld->nodetree == NULL)
ED_node_shader_default(scene, &wrld->id);
rna_World_update(bmain, scene, ptr);
@@ -148,63 +148,63 @@ static void rna_def_world_mtex(BlenderRNA *brna)
{TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "WorldTextureSlot", "TextureSlot");
+ srna = RNA_def_struct(brna, "WorldTextureSlot", "TextureSlot");
RNA_def_struct_sdna(srna, "MTex");
RNA_def_struct_ui_text(srna, "World Texture Slot", "Texture slot for textures in a World datablock");
/* map to */
- prop= RNA_def_property(srna, "use_map_blend", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_blend", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_BLEND);
RNA_def_property_ui_text(prop, "Blend", "Affect the color progression of the background");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "use_map_horizon", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_horizon", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_HORIZ);
RNA_def_property_ui_text(prop, "Horizon", "Affect the color of the horizon");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "use_map_zenith_up", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_zenith_up", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENUP);
RNA_def_property_ui_text(prop, "Zenith Up", "Affect the color of the zenith above");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "use_map_zenith_down", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_map_zenith_down", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENDOWN);
RNA_def_property_ui_text(prop, "Zenith Down", "Affect the color of the zenith below");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texco");
RNA_def_property_enum_items(prop, texco_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", "Texture coordinates used to map the texture onto the background");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "blendfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Blend Factor", "Amount texture affects color progression of the background");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "horizon_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "horizon_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Horizon Factor", "Amount texture affects color of the horizon");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "zenith_up_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "zenith_up_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zenupfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Zenith Up Factor", "Amount texture affects color of the zenith above");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "zenith_down_factor", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "zenith_down_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zendownfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Zenith Down Factor", "Amount texture affects color of the zenith below");
@@ -238,138 +238,138 @@ static void rna_def_lighting(BlenderRNA *brna)
{WO_AOGATHER_APPROX, "APPROXIMATE", 0, "Approximate", "Inaccurate, but faster and without noise"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "WorldLighting", NULL);
+ srna = RNA_def_struct(brna, "WorldLighting", NULL);
RNA_def_struct_sdna(srna, "World");
RNA_def_struct_nested(brna, srna, "World");
RNA_def_struct_ui_text(srna, "Lighting", "Lighting for a World datablock");
/* ambient occlusion */
- prop= RNA_def_property(srna, "use_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_AMB_OCC);
RNA_def_property_ui_text(prop, "Use Ambient Occlusion", "Use Ambient Occlusion to add shadowing based on distance between objects");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "ao_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "ao_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "aoenergy");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
RNA_def_property_ui_text(prop, "Factor", "Factor for ambient occlusion blending");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "ao_blend_type", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "ao_blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "aomix");
RNA_def_property_enum_items(prop, blend_mode_items);
RNA_def_property_ui_text(prop, "Blend Mode", "Defines how AO mixes with material shading");
RNA_def_property_update(prop, 0, "rna_World_update");
/* environment lighting */
- prop= RNA_def_property(srna, "use_environment_light", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_environment_light", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_ENV_LIGHT);
RNA_def_property_ui_text(prop, "Use Environment Lighting", "Add light coming from the environment");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "environment_energy", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "environment_energy", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_env_energy");
RNA_def_property_ui_range(prop, 0, FLT_MAX, 1, 3);
RNA_def_property_ui_text(prop, "Environment Color", "Defines the strength of environment light");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "environment_color", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "environment_color", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "aocolor");
RNA_def_property_enum_items(prop, prop_color_items);
RNA_def_property_ui_text(prop, "Environment Color", "Defines where the color of the environment light comes from");
RNA_def_property_update(prop, 0, "rna_World_update");
/* indirect lighting */
- prop= RNA_def_property(srna, "use_indirect_light", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_indirect_light", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_INDIRECT_LIGHT);
RNA_def_property_ui_text(prop, "Use Indirect Lighting", "Add indirect light bouncing of surrounding objects");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "indirect_factor", PROP_FLOAT, PROP_FACTOR);
+ prop = RNA_def_property(srna, "indirect_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "ao_indirect_energy");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
RNA_def_property_ui_text(prop, "Indirect Factor", "Factor for how much surrounding objects contribute to light");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "indirect_bounces", PROP_INT, PROP_UNSIGNED);
+ prop = RNA_def_property(srna, "indirect_bounces", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "ao_indirect_bounces");
RNA_def_property_range(prop, 1, SHRT_MAX);
RNA_def_property_ui_text(prop, "Bounces", "Number of indirect diffuse light bounces");
RNA_def_property_update(prop, 0, "rna_World_update");
/* gathering parameters */
- prop= RNA_def_property(srna, "gather_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "gather_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ao_gather_method");
RNA_def_property_enum_items(prop, prop_gather_method_items);
RNA_def_property_ui_text(prop, "Gather Method", "");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "passes", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "passes", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ao_approx_passes");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Passes", "Number of preprocessing passes to reduce overocclusion");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "aodist");
RNA_def_property_ui_text(prop, "Distance", "Length of rays, defines how far away other faces give occlusion effect");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "falloff_strength", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aodistfac");
RNA_def_property_ui_text(prop, "Strength", "Attenuation falloff strength, the higher, the less influence distant objects have");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aobias");
RNA_def_property_range(prop, 0, 0.5);
RNA_def_property_ui_text(prop, "Bias", "Bias (in radians) to prevent smoothed faces from showing banding (for Raytrace Constant Jittered)");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_adapt_thresh");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Threshold", "Samples below this threshold will be considered fully shadowed/unshadowed and skipped (for Raytrace Adaptive QMC)");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "adapt_to_speed", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "adapt_to_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_adapt_speed_fac");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Adapt To Speed", "Use the speed vector pass to reduce AO samples in fast moving pixels. Higher values result in more aggressive sample reduction. Requires Vec pass enabled (for Raytrace Adaptive QMC)");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "error_threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "error_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_approx_error");
RNA_def_property_range(prop, 0.0001, 10);
RNA_def_property_ui_text(prop, "Error Tolerance", "Low values are slower and higher quality");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "correction", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "correction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_approx_correction");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
RNA_def_property_ui_text(prop, "Correction", "Ad-hoc correction for over-occlusion due to the approximation");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "use_falloff", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_falloff", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AODIST);
RNA_def_property_ui_text(prop, "Falloff", "Distance will be used to attenuate shadows");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "use_cache", PROP_BOOLEAN, PROP_NONE);
+ 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 neighboring pixels for speedup");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "aosamp");
RNA_def_property_range(prop, 1, 128);
RNA_def_property_ui_text(prop, "Samples", "Amount of ray samples. Higher values give smoother results and longer rendering times");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "sample_method", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "sample_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ao_samp_method");
RNA_def_property_enum_items(prop, prop_sample_method_items);
RNA_def_property_ui_text(prop, "Sample Method", "Method for generating shadow samples (for Raytrace)");
@@ -387,43 +387,43 @@ static void rna_def_world_mist(BlenderRNA *brna)
{2, "INVERSE_QUADRATIC", 0, "Inverse Quadratic", "Use inverse quadratic progression"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "WorldMistSettings", NULL);
+ srna = RNA_def_struct(brna, "WorldMistSettings", NULL);
RNA_def_struct_sdna(srna, "World");
RNA_def_struct_nested(brna, srna, "World");
RNA_def_struct_ui_text(srna, "World Mist", "Mist settings for a World data-block");
- prop= RNA_def_property(srna, "use_mist", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_mist", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_MIST);
RNA_def_property_ui_text(prop, "Use Mist", "Occlude objects with the environment color as they are further away");
RNA_def_property_update(prop, 0, "rna_World_draw_update");
- prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "misi");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Minimum", "Overall minimum intensity of the mist effect");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "miststa");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist, measured from the camera");
RNA_def_property_update(prop, 0, "rna_World_draw_mist_update");
- prop= RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "mistdist");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Depth", "Distance over which the mist effect fades in");
RNA_def_property_update(prop, 0, "rna_World_draw_mist_update");
- prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "misthi");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Height", "Control how much mist density decreases with height");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mistype");
RNA_def_property_enum_items(prop, falloff_items);
RNA_def_property_ui_text(prop, "Falloff", "Type of transition used to fade mist");
@@ -435,35 +435,35 @@ static void rna_def_world_stars(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "WorldStarsSettings", NULL);
+ srna = RNA_def_struct(brna, "WorldStarsSettings", NULL);
RNA_def_struct_sdna(srna, "World");
RNA_def_struct_nested(brna, srna, "World");
RNA_def_struct_ui_text(srna, "World Stars", "Stars settings for a World data-block");
- prop= RNA_def_property(srna, "use_stars", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_stars", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_STARS);
RNA_def_property_ui_text(prop, "Use Stars", "Enable starfield generation");
RNA_def_property_update(prop, 0, "rna_World_stars_update");
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "starsize");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Size", "Average screen dimension of stars");
RNA_def_property_update(prop, 0, "rna_World_draw_update"); /* use normal update since this isnt visualized */
- prop= RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_DISTANCE);
+ prop = RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "starmindist");
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance to the camera for stars");
RNA_def_property_update(prop, 0, "rna_World_stars_update");
- prop= RNA_def_property(srna, "average_separation", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "average_separation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stardist");
RNA_def_property_range(prop, 2, 1000);
RNA_def_property_ui_text(prop, "Average Separation", "Average distance between any two stars");
RNA_def_property_update(prop, 0, "rna_World_stars_update");
- prop= RNA_def_property(srna, "color_random", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "color_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "starcolnoise");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Color Randomization", "Randomize star colors");
@@ -475,18 +475,18 @@ void RNA_def_world(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
-/*
+#if 0
static EnumPropertyItem physics_engine_items[] = {
{WOPHY_NONE, "NONE", 0, "None", ""},
- //{WOPHY_ENJI, "ENJI", 0, "Enji", ""},
- //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""},
- //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""},
- //{WOPHY_ODE, "ODE", 0, "ODE", ""},
+ /*{WOPHY_ENJI, "ENJI", 0, "Enji", ""}, */
+ /*{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""}, */
+ /*{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""}, */
+ /*{WOPHY_ODE, "ODE", 0, "ODE", ""}, */
{WOPHY_BULLET, "BULLET", 0, "Bullet", ""},
{0, NULL, 0, NULL, NULL}};
-*/
+#endif
- srna= RNA_def_struct(brna, "World", "ID");
+ srna = RNA_def_struct(brna, "World", "ID");
RNA_def_struct_ui_text(srna, "World", "World datablock describing the environment and ambient lighting of a scene");
RNA_def_struct_ui_icon(srna, ICON_WORLD_DATA);
@@ -495,7 +495,7 @@ void RNA_def_world(BlenderRNA *brna)
"rna_World_active_texture_set", NULL, "WorldTextureSlot", "WorldTextureSlots", "rna_World_update");
/* colors */
- prop= RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "horr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon");
@@ -504,72 +504,72 @@ void RNA_def_world(BlenderRNA *brna)
RNA_def_property_update(prop, NC_WORLD|ND_WORLD_DRAW, "rna_World_update");
- prop= RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "zenr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Zenith Color", "Color at the zenith");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR);
+ prop = RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "ambr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Ambient Color", "Ambient color of the world");
RNA_def_property_update(prop, 0, "rna_World_update");
/* exp, range */
- prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "exp");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Exposure", "Amount of exponential color correction for light");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "color_range", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "color_range", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "range");
RNA_def_property_range(prop, 0.2, 5.0);
RNA_def_property_ui_text(prop, "Range", "The color range that will be mapped to 0-1");
RNA_def_property_update(prop, 0, "rna_World_update");
/* sky type */
- prop= RNA_def_property(srna, "use_sky_blend", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_sky_blend", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYBLEND);
RNA_def_property_ui_text(prop, "Blend Sky", "Render background with natural progression from horizon to zenith");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "use_sky_paper", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_sky_paper", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYPAPER);
RNA_def_property_ui_text(prop, "Paper Sky", "Flatten blend or texture coordinates");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "use_sky_real", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_sky_real", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYREAL);
RNA_def_property_ui_text(prop, "Real Sky", "Render background with a real horizon, relative to the camera angle");
RNA_def_property_update(prop, 0, "rna_World_update");
/* nested structs */
- prop= RNA_def_property(srna, "light_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "light_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "WorldLighting");
RNA_def_property_pointer_funcs(prop, "rna_World_lighting_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Lighting", "World lighting settings");
- prop= RNA_def_property(srna, "mist_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "mist_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "WorldMistSettings");
RNA_def_property_pointer_funcs(prop, "rna_World_mist_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Mist", "World mist settings");
- prop= RNA_def_property(srna, "star_settings", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "star_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "WorldStarsSettings");
RNA_def_property_pointer_funcs(prop, "rna_World_stars_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Stars", "World stars settings");
/* nodes */
- prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based worlds");
- prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the world");
diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c
index 9eeffcc1488..2fbec392b1e 100644
--- a/source/blender/modifiers/intern/MOD_array.c
+++ b/source/blender/modifiers/intern/MOD_array.c
@@ -66,8 +66,8 @@ static void initData(ModifierData *md)
ArrayModifierData *amd = (ArrayModifierData*) md;
/* default to 2 duplicates distributed along the x-axis by an
- offset of 1 object-width
- */
+ * offset of 1 object-width
+ */
amd->start_cap = amd->end_cap = amd->curve_ob = amd->offset_ob = NULL;
amd->count = 2;
amd->offset[0] = amd->offset[1] = amd->offset[2] = 0;
@@ -264,14 +264,14 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
}
/* calculate the maximum number of copies which will fit within the
- prescribed length */
+ * prescribed length */
if(amd->fit_type == MOD_ARR_FITLENGTH
|| amd->fit_type == MOD_ARR_FITCURVE) {
float dist = sqrt(dot_v3v3(offset[3], offset[3]));
if(dist > 1e-6f)
/* this gives length = first copy start to last copy end
- add a tiny offset for floating point rounding errors */
+ * add a tiny offset for floating point rounding errors */
count = (length + 1e-6f) / dist;
else
/* if the offset has no translation, just make one copy */
@@ -282,11 +282,11 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
count = 1;
/* BMESH_TODO: bumping up the stack level avoids computing the normals
- after every top-level operator execution (and this modifier has the
- potential to execute a *lot* of top-level BMOps. There should be a
- cleaner way to do this. One possibility: a "mirror" BMOp would
- certainly help by compressing it all into one top-level BMOp that
- executes a lot of second-level BMOps. */
+ * after every top-level operator execution (and this modifier has the
+ * potential to execute a *lot* of top-level BMOps. There should be a
+ * cleaner way to do this. One possibility: a "mirror" BMOp would
+ * certainly help by compressing it all into one top-level BMOp that
+ * executes a lot of second-level BMOps. */
BMO_push(em->bm, NULL);
bmesh_edit_begin(em->bm, 0);
@@ -349,8 +349,8 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
BMO_op_finish(em->bm, &findop);
}
- /*generate merge mappping using index map. we do this by using the
- operator slots as lookup arrays.*/
+ /* generate merge mappping using index map. we do this by using the
+ * operator slots as lookup arrays.*/
#define E(i) (i) < s1->len ? _E(s1, i) : _E(s2, (i)-s1->len)
for (i=0; i<indexLen; i++) {
diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c
index 92584800f98..3e110909702 100644
--- a/source/blender/modifiers/intern/MOD_bevel.c
+++ b/source/blender/modifiers/intern/MOD_bevel.c
@@ -173,12 +173,14 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
options = bmd->flags|bmd->val_flags|bmd->lim_flags|bmd->e_flags;
- /*if ((options & BME_BEVEL_VWEIGHT) && bmd->defgrp_name[0]) {
+#if 0
+ if ((options & BME_BEVEL_VWEIGHT) && bmd->defgrp_name[0]) {
defgrp_index = defgroup_name_index(ob, bmd->defgrp_name);
if (defgrp_index < 0) {
options &= ~BME_BEVEL_VWEIGHT;
}
- }*/
+ }
+#endif
bm = BME_derivedmesh_to_bmesh(derivedData);
BME_bevel(bm,bmd->value,bmd->res,options,defgrp_index,bmd->bevel_angle,NULL);
diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c
index 72e54754498..76560d14e3b 100644
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@ -133,8 +133,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *result;
/* when one of objects is empty (has got no faces) we could speed up
- calculation a bit returning one of objects' derived meshes (or empty one)
- Returning mesh is depended on modifieier's operation (sergey) */
+ * calculation a bit returning one of objects' derived meshes (or empty one)
+ * Returning mesh is depended on modifieier's operation (sergey) */
result = get_quick_derivedMesh(derivedData, dm, bmd->operation);
if(result == NULL) {
@@ -151,7 +151,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
/* if new mesh returned, return it; otherwise there was
- * an error, so delete the modifier object */
+ * an error, so delete the modifier object */
if(result)
return result;
else
diff --git a/source/blender/modifiers/intern/MOD_boolean_util.c b/source/blender/modifiers/intern/MOD_boolean_util.c
index fe2a074bf87..3fd4119c915 100644
--- a/source/blender/modifiers/intern/MOD_boolean_util.c
+++ b/source/blender/modifiers/intern/MOD_boolean_util.c
@@ -333,7 +333,7 @@ static void InterpCSGFace(
}
/* Iterate over the CSG Output Descriptors and create a new DerivedMesh
- from them */
+ * from them */
static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
CSG_FaceIteratorDescriptor *face_it,
CSG_VertexIteratorDescriptor *vertex_it,
@@ -586,9 +586,11 @@ int NewBooleanMesh(Scene *scene, Base *base, Base *base_select, int int_op_type)
mat= (Material**)MEM_mallocN(sizeof(Material*)*maxmat, "NewBooleanMeshMat");
/* put some checks in for nice user feedback */
- if (dm == NULL || dm_select == NULL) return 0;
- if (!dm->getNumTessFaces(dm) || !dm_select->getNumTessFaces(dm_select))
- {
+ if (dm == NULL || dm_select == NULL) {
+ return 0;
+ }
+
+ if (!dm->getNumTessFaces(dm) || !dm_select->getNumTessFaces(dm_select)) {
MEM_freeN(mat);
return -1;
}
diff --git a/source/blender/modifiers/intern/MOD_boolean_util.h b/source/blender/modifiers/intern/MOD_boolean_util.h
index 8e3617cf74e..6ba4940a4e9 100644
--- a/source/blender/modifiers/intern/MOD_boolean_util.h
+++ b/source/blender/modifiers/intern/MOD_boolean_util.h
@@ -39,15 +39,15 @@ struct Base;
struct DerivedMesh;
/* Performs a boolean between two mesh objects, it is assumed that both objects
- are in fact a mesh object. On success returns 1 and creates a new mesh object
- into blender data structures. On failure returns 0 and reports an error. */
+ * are in fact a mesh object. On success returns 1 and creates a new mesh object
+ * into blender data structures. On failure returns 0 and reports an error. */
int NewBooleanMesh(struct Scene *scene, struct Base *base, struct Base *base_select, int op);
/* Performs a boolean between two mesh objects, it is assumed that both objects
- are in fact mesh object. On success returns a DerivedMesh. On failure
- returns NULL and reports an error. */
-
+ * are in fact mesh object. On success returns a DerivedMesh. On failure
+ * returns NULL and reports an error. */
+
struct DerivedMesh *NewBooleanDerivedMesh(struct DerivedMesh *dm, struct Object *ob, struct DerivedMesh *dm_select, struct Object *ob_select, int int_op_type);
#endif // MOD_BOOLEAN_UTILS
diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c
index 2399f6e8fc4..a268f475bc8 100644
--- a/source/blender/modifiers/intern/MOD_build.c
+++ b/source/blender/modifiers/intern/MOD_build.c
@@ -88,7 +88,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
int *vertMap, *edgeMap, *faceMap;
float frac;
MPoly *mpoly_dst;
- MLoop *ml_dst, *ml_src, *mloop_dst;
+ MLoop *ml_dst, *ml_src /*, *mloop_dst */;
GHashIterator *hashIter;
/* maps vert indices in old mesh to indices in new mesh */
GHash *vertHash = BLI_ghash_new(BLI_ghashutil_inthash,
@@ -192,8 +192,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
}
}
- /* get the set of edges that will be in the new mesh
- */
+ /* get the set of edges that will be in the new mesh */
for (i = 0; i < numEdges_dst; i++) {
j = BLI_ghash_size(edgeHash);
@@ -261,7 +260,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
}
mpoly_dst = CDDM_get_polys(result);
- mloop_dst = ml_dst = CDDM_get_loops(result);
+ /* mloop_dst = */ ml_dst = CDDM_get_loops(result);
/* copy the faces across, remapping indices */
k = 0;
diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c
index 75aecc4f5af..6ca3a82dd0e 100644
--- a/source/blender/modifiers/intern/MOD_cast.c
+++ b/source/blender/modifiers/intern/MOD_cast.c
@@ -154,8 +154,8 @@ static void sphere_do(
ctrl_ob = cmd->object;
/* spherify's center is {0, 0, 0} (the ob's own center in its local
- * space), by default, but if the user defined a control object,
- * we use its location, transformed to ob's local space */
+ * space), by default, but if the user defined a control object,
+ * we use its location, transformed to ob's local space */
if (ctrl_ob) {
if(flag & MOD_CAST_USE_OB_TRANSFORM) {
invert_m4_m4(ctrl_ob->imat, ctrl_ob->obmat);
@@ -171,11 +171,11 @@ static void sphere_do(
/* 1) (flag was checked in the "if (ctrl_ob)" block above) */
/* 2) cmd->radius > 0.0f: only the vertices within this radius from
- * the center of the effect should be deformed */
+ * the center of the effect should be deformed */
if (cmd->radius > FLT_EPSILON) has_radius = 1;
/* 3) if we were given a vertex group name,
- * only those vertices should be affected */
+ * only those vertices should be affected */
modifier_get_vgroup(ob, dm, cmd->defgrp_name, &dvert, &defgrp_index);
if(flag & MOD_CAST_SIZE_FROM_RADIUS) {
@@ -195,10 +195,10 @@ static void sphere_do(
}
/* ready to apply the effect, one vertex at a time;
- * tiny optimization: the code is separated (with parts repeated)
+ * tiny optimization: the code is separated (with parts repeated)
* in two possible cases:
- * with or w/o a vgroup. With lots of if's in the code below,
- * further optimizations are possible, if needed */
+ * with or w/o a vgroup. With lots of if's in the code below,
+ * further optimization's are possible, if needed */
if (dvert) { /* with a vgroup */
MDeformVert *dv= dvert;
float fac_orig = fac;
@@ -321,11 +321,11 @@ static void cuboid_do(
/* 1) (flag was checked in the "if (ctrl_ob)" block above) */
/* 2) cmd->radius > 0.0f: only the vertices within this radius from
- * the center of the effect should be deformed */
+ * the center of the effect should be deformed */
if (cmd->radius > FLT_EPSILON) has_radius = 1;
/* 3) if we were given a vertex group name,
- * only those vertices should be affected */
+ * only those vertices should be affected */
modifier_get_vgroup(ob, dm, cmd->defgrp_name, &dvert, &defgrp_index);
if (ctrl_ob) {
@@ -352,12 +352,12 @@ static void cuboid_do(
} else {
/* get bound box */
/* We can't use the object's bound box because other modifiers
- * may have changed the vertex data. */
+ * may have changed the vertex data. */
INIT_MINMAX(min, max);
/* Cast's center is the ob's own center in its local space,
- * by default, but if the user defined a control object, we use
- * its location, transformed to ob's local space. */
+ * by default, but if the user defined a control object, we use
+ * its location, transformed to ob's local space. */
if (ctrl_ob) {
float vec[3];
@@ -393,10 +393,10 @@ static void cuboid_do(
bb[4][2] = bb[5][2] = bb[6][2] = bb[7][2] = max[2];
/* ready to apply the effect, one vertex at a time;
- * tiny optimization: the code is separated (with parts repeated)
+ * tiny optimization: the code is separated (with parts repeated)
* in two possible cases:
- * with or w/o a vgroup. With lots of if's in the code below,
- * further optimizations are possible, if needed */
+ * with or w/o a vgroup. With lots of if's in the code below,
+ * further optimization's are possible, if needed */
if (dvert) { /* with a vgroup */
float fac_orig = fac;
for (i = 0; i < numVerts; i++) {
@@ -434,10 +434,10 @@ static void cuboid_do(
/* The algo used to project the vertices to their
* bounding box (bb) is pretty simple:
* for each vertex v:
- * 1) find in which octant v is in;
- * 2) find which outer "wall" of that octant is closer to v;
- * 3) calculate factor (var fbb) to project v to that wall;
- * 4) project. */
+ * 1) find in which octant v is in;
+ * 2) find which outer "wall" of that octant is closer to v;
+ * 3) calculate factor (var fbb) to project v to that wall;
+ * 4) project. */
/* find in which octant this vertex is in */
octant = 0;
@@ -471,7 +471,7 @@ static void cuboid_do(
continue;
/* finally, this is the factor we wanted, to project the vertex
- * to its bounding box (bb) */
+ * to its bounding box (bb) */
fbb = apex[coord] / tmp_co[coord];
/* calculate the new vertex position */
diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c
index 51ba9103976..f23690454c0 100644
--- a/source/blender/modifiers/intern/MOD_cloth.c
+++ b/source/blender/modifiers/intern/MOD_cloth.c
@@ -75,8 +75,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
DerivedMesh *result=NULL;
/* check for alloc failing */
- if(!clmd->sim_parms || !clmd->coll_parms)
- {
+ if (!clmd->sim_parms || !clmd->coll_parms) {
initData(md);
if(!clmd->sim_parms || !clmd->coll_parms)
@@ -101,24 +100,18 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
dm->release(dm);
}
-static void updateDepgraph(
- ModifierData *md, DagForest *forest, Scene *scene, Object *ob,
- DagNode *obNode)
+static void updateDepgraph(ModifierData *md, DagForest *forest, Scene *scene, Object *ob, DagNode *obNode)
{
ClothModifierData *clmd = (ClothModifierData*) md;
Base *base;
- if(clmd)
- {
- for(base = scene->base.first; base; base= base->next)
- {
+ if(clmd) {
+ for(base = scene->base.first; base; base= base->next) {
Object *ob1= base->object;
- if(ob1 != ob)
- {
+ if (ob1 != ob) {
CollisionModifierData *coll_clmd = (CollisionModifierData *)modifiers_findByType(ob1, eModifierType_Collision);
- if(coll_clmd)
- {
+ if (coll_clmd) {
DagNode *curNode = dag_get_node(forest, ob1);
dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Cloth Collision");
}
@@ -175,8 +168,7 @@ static void freeData(ModifierData *md)
{
ClothModifierData *clmd = (ClothModifierData*) md;
- if (clmd)
- {
+ if (clmd) {
if(G.rt > 0)
printf("clothModifier_freeData\n");
diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c
index 1476c792169..a1467c55ecf 100644
--- a/source/blender/modifiers/intern/MOD_collision.c
+++ b/source/blender/modifiers/intern/MOD_collision.c
@@ -176,8 +176,7 @@ static void deformVerts(ModifierData *md, Object *ob,
collmd->time_x = collmd->time_xnew = current_time;
}
- else if(numverts == collmd->numverts)
- {
+ else if(numverts == collmd->numverts) {
// put positions to old positions
tempVert = collmd->x;
collmd->x = collmd->xnew;
@@ -186,8 +185,7 @@ static void deformVerts(ModifierData *md, Object *ob,
memcpy(collmd->xnew, dm->getVertArray(dm), numverts*sizeof(MVert));
- for ( i = 0; i < numverts; i++ )
- {
+ for (i = 0; i < numverts; i++) {
// we save global positions
mul_m4_v3( ob->obmat, collmd->xnew[i].co );
}
@@ -196,10 +194,8 @@ static void deformVerts(ModifierData *md, Object *ob,
memcpy(collmd->current_x, collmd->x, numverts*sizeof(MVert));
/* check if GUI setting has changed for bvh */
- if(collmd->bvhtree)
- {
- if(ob->pd->pdef_sboft != BLI_bvhtree_getepsilon(collmd->bvhtree))
- {
+ if(collmd->bvhtree) {
+ if(ob->pd->pdef_sboft != BLI_bvhtree_getepsilon(collmd->bvhtree)) {
BLI_bvhtree_free(collmd->bvhtree);
collmd->bvhtree = bvhtree_build_from_mvert(collmd->mfaces, collmd->numfaces, collmd->current_x, numverts, ob->pd->pdef_sboft);
}
@@ -207,32 +203,26 @@ static void deformVerts(ModifierData *md, Object *ob,
}
/* happens on file load (ONLY when i decomment changes in readfile.c) */
- if(!collmd->bvhtree)
- {
+ if (!collmd->bvhtree) {
collmd->bvhtree = bvhtree_build_from_mvert(collmd->mfaces, collmd->numfaces, collmd->current_x, numverts, ob->pd->pdef_sboft);
}
- else
- {
+ else {
// recalc static bounding boxes
bvhtree_update_from_mvert ( collmd->bvhtree, collmd->mfaces, collmd->numfaces, collmd->current_x, collmd->current_xnew, collmd->numverts, 1 );
}
collmd->time_xnew = current_time;
}
- else if(numverts != collmd->numverts)
- {
+ else if(numverts != collmd->numverts) {
freeData((ModifierData *)collmd);
}
}
- else if(current_time < collmd->time_xnew)
- {
+ else if(current_time < collmd->time_xnew) {
freeData((ModifierData *)collmd);
}
- else
- {
- if(numverts != collmd->numverts)
- {
+ else {
+ if (numverts != collmd->numverts) {
freeData((ModifierData *)collmd);
}
}
diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c
index e0972ff2d32..55971e358a9 100644
--- a/source/blender/modifiers/intern/MOD_displace.c
+++ b/source/blender/modifiers/intern/MOD_displace.c
@@ -99,12 +99,10 @@ static int dependsOnTime(ModifierData *md)
{
DisplaceModifierData *dmd = (DisplaceModifierData *)md;
- if(dmd->texture)
- {
+ if(dmd->texture) {
return BKE_texture_dependsOnTime(dmd->texture);
}
- else
- {
+ else {
return 0;
}
}
diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c
index c7b4d41e646..e567765d61b 100644
--- a/source/blender/modifiers/intern/MOD_dynamicpaint.c
+++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c
@@ -119,15 +119,13 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
DynamicPaintModifierData *pmd = (DynamicPaintModifierData*) md;
/* add relation from canvases to all brush objects */
- if(pmd && pmd->canvas)
- {
+ if (pmd && pmd->canvas) {
Base *base = scene->base.first;
- for(; base; base = base->next) {
+ for (; base; base = base->next) {
DynamicPaintModifierData *pmd2 = (DynamicPaintModifierData *)modifiers_findByType(base->object, eModifierType_DynamicPaint);
- if(pmd2 && pmd2->brush && ob!=base->object)
- {
+ if (pmd2 && pmd2->brush && ob!=base->object) {
DagNode *brushNode = dag_get_node(forest, base->object);
dag_add_relation(forest, brushNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Dynamic Paint Brush");
}
diff --git a/source/blender/modifiers/intern/MOD_edgesplit.c b/source/blender/modifiers/intern/MOD_edgesplit.c
index 1e275862b5c..481ab805c5a 100644
--- a/source/blender/modifiers/intern/MOD_edgesplit.c
+++ b/source/blender/modifiers/intern/MOD_edgesplit.c
@@ -88,8 +88,13 @@ static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd, Obj
if (emd->flags & MOD_EDGESPLIT_FROMFLAG) {
BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
- if (!BM_elem_flag_test(e, BM_ELEM_SMOOTH)) {
- BMO_elem_flag_enable(bm, e, EDGE_MARK);
+ /* check for 2 or more edge users */
+ if ((e->l) &&
+ (e->l->next != e->l))
+ {
+ if (!BM_elem_flag_test(e, BM_ELEM_SMOOTH)) {
+ BMO_elem_flag_enable(bm, e, EDGE_MARK);
+ }
}
}
}
@@ -110,8 +115,7 @@ static void initData(ModifierData *md)
{
EdgeSplitModifierData *emd = (EdgeSplitModifierData*) md;
- /* default to 30-degree split angle, sharpness from both angle & flag
- */
+ /* default to 30-degree split angle, sharpness from both angle & flag */
emd->split_angle = 30;
emd->flags = MOD_EDGESPLIT_FROMANGLE | MOD_EDGESPLIT_FROMFLAG;
}
diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c
index 89e47094108..05230abdcf5 100644
--- a/source/blender/modifiers/intern/MOD_explode.c
+++ b/source/blender/modifiers/intern/MOD_explode.c
@@ -818,13 +818,13 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
vertpahash= BLI_edgehash_new();
for (i=0; i<totface; i++) {
- if(facepa[i]!=totpart)
- {
- pa=pars+facepa[i];
+ if (facepa[i] != totpart) {
+ pa = pars + facepa[i];
- if((pa->alive==PARS_UNBORN && (emd->flag&eExplodeFlag_Unborn)==0)
- || (pa->alive==PARS_ALIVE && (emd->flag&eExplodeFlag_Alive)==0)
- || (pa->alive==PARS_DEAD && (emd->flag&eExplodeFlag_Dead)==0)) {
+ if ((pa->alive == PARS_UNBORN && (emd->flag & eExplodeFlag_Unborn) == 0) ||
+ (pa->alive == PARS_ALIVE && (emd->flag & eExplodeFlag_Alive) == 0) ||
+ (pa->alive == PARS_DEAD && (emd->flag & eExplodeFlag_Dead) == 0))
+ {
delface++;
continue;
}
@@ -915,8 +915,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
MFace source;
int orig_v4;
- if(facepa[i]!=totpart)
- {
+ if (facepa[i]!=totpart) {
pa=pars+facepa[i];
if(pa->alive==PARS_UNBORN && (emd->flag&eExplodeFlag_Unborn)==0) continue;
diff --git a/source/blender/modifiers/intern/MOD_fluidsim.c b/source/blender/modifiers/intern/MOD_fluidsim.c
index 8bf56193a28..3df8718a7c1 100644
--- a/source/blender/modifiers/intern/MOD_fluidsim.c
+++ b/source/blender/modifiers/intern/MOD_fluidsim.c
@@ -85,12 +85,12 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *result = NULL;
/* check for alloc failing */
- if(!fluidmd->fss)
- {
+ if(!fluidmd->fss) {
initData(md);
- if(!fluidmd->fss)
+ if (!fluidmd->fss) {
return dm;
+ }
}
result= fluidsimModifier_do(fluidmd, md->scene, ob, dm, useRenderParams, isFinalCalc);
@@ -105,20 +105,15 @@ static void updateDepgraph(
FluidsimModifierData *fluidmd= (FluidsimModifierData*) md;
Base *base;
- if(fluidmd && fluidmd->fss)
- {
- if(fluidmd->fss->type == OB_FLUIDSIM_DOMAIN)
- {
- for(base = scene->base.first; base; base= base->next)
- {
+ if(fluidmd && fluidmd->fss) {
+ if(fluidmd->fss->type == OB_FLUIDSIM_DOMAIN) {
+ for(base = scene->base.first; base; base= base->next) {
Object *ob1= base->object;
- if(ob1 != ob)
- {
+ if(ob1 != ob) {
FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(ob1, eModifierType_Fluidsim);
// only put dependancies from NON-DOMAIN fluids in here
- if(fluidmdtmp && fluidmdtmp->fss && (fluidmdtmp->fss->type!=OB_FLUIDSIM_DOMAIN))
- {
+ if(fluidmdtmp && fluidmdtmp->fss && (fluidmdtmp->fss->type!=OB_FLUIDSIM_DOMAIN)) {
DagNode *curNode = dag_get_node(forest, ob1);
dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Fluidsim Object");
}
diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c
index 9dc560afb0f..42a6f74aba5 100644
--- a/source/blender/modifiers/intern/MOD_fluidsim_util.c
+++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c
@@ -131,11 +131,11 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
fss->cpsQuality = 10.0; // 1.0 / 10.0 => means 0.1 width
/*
- BAD TODO: this is done in buttons_object.c in the moment
- Mesh *mesh = ob->data;
- // calculate bounding box
- fluid_get_bb(mesh->mvert, mesh->totvert, ob->obmat, fss->bbStart, fss->bbSize);
- */
+ * BAD TODO: this is done in buttons_object.c in the moment
+ * Mesh *mesh = ob->data;
+ * // calculate bounding box
+ * fluid_get_bb(mesh->mvert, mesh->totvert, ob->obmat, fss->bbStart, fss->bbSize);
+ */
fss->meshVelocities = NULL;
@@ -152,9 +152,8 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
void fluidsim_free(FluidsimModifierData *fluidmd)
{
- if(fluidmd) {
- if(fluidmd->fss->meshVelocities)
- {
+ if (fluidmd && fluidmd->fss) {
+ if (fluidmd->fss->meshVelocities) {
MEM_freeN(fluidmd->fss->meshVelocities);
fluidmd->fss->meshVelocities = NULL;
}
@@ -506,12 +505,10 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim
// load vertex velocities, if they exist...
// TODO? use generate flag as loading flag as well?
// warning, needs original .bobj.gz mesh loading filename
- if(displaymode==3)
- {
+ if (displaymode==3) {
fluidsim_read_vel_cache(fluidmd, dm, targetFile);
}
- else
- {
+ else {
if(fss->meshVelocities)
MEM_freeN(fss->meshVelocities);
@@ -548,8 +545,7 @@ DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene,
// clmd->sim_parms->timescale= timescale;
// support reversing of baked fluid frames here
- if((fss->flag & OB_FLUIDSIM_REVERSE) && (fss->lastgoodframe >= 0))
- {
+ if ((fss->flag & OB_FLUIDSIM_REVERSE) && (fss->lastgoodframe >= 0)) {
framenr = fss->lastgoodframe - framenr + 1;
CLAMP(framenr, 1, fss->lastgoodframe);
}
diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c
index edef19fd032..b9768ff9999 100644
--- a/source/blender/modifiers/intern/MOD_mask.c
+++ b/source/blender/modifiers/intern/MOD_mask.c
@@ -85,12 +85,10 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
{
MaskModifierData *mmd = (MaskModifierData *)md;
- if (mmd->ob_arm)
- {
+ if (mmd->ob_arm) {
DagNode *armNode = dag_get_node(forest, mmd->ob_arm);
- dag_add_relation(forest, armNode, obNode,
- DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Mask Modifier");
+ dag_add_relation(forest, armNode, obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Mask Modifier");
}
}
@@ -140,8 +138,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
/* if mode is to use selected armature bones, aggregate the bone groups */
- if (mmd->mode == MOD_MASK_MODE_ARM) /* --- using selected bones --- */
- {
+ if (mmd->mode == MOD_MASK_MODE_ARM) { /* --- using selected bones --- */
GHash *vgroupHash;
Object *oba= mmd->ob_arm;
bPoseChannel *pchan;
@@ -156,10 +153,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
bone_select_array= MEM_mallocN(defbase_tot * sizeof(char), "mask array");
- for (i = 0, def = ob->defbase.first; def; def = def->next, i++)
- {
- if (((pchan= get_pose_channel(oba->pose, def->name)) && pchan->bone && (pchan->bone->flag & BONE_SELECTED)))
- {
+ for (i = 0, def = ob->defbase.first; def; def = def->next, i++) {
+ pchan = get_pose_channel(oba->pose, def->name);
+ if (pchan && pchan->bone && (pchan->bone->flag & BONE_SELECTED)) {
bone_select_array[i]= TRUE;
bone_select_tot++;
}
@@ -179,8 +175,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
BLI_ghash_insert(vgroupHash, def->name, SET_INT_IN_POINTER(i));
/* if no bones selected, free hashes and return original mesh */
- if (bone_select_tot == 0)
- {
+ if (bone_select_tot == 0) {
BLI_ghash_free(vgroupHash, NULL, NULL);
MEM_freeN(bone_select_array);
@@ -189,8 +184,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* repeat the previous check, but for dverts */
dvert= dm->getVertDataArray(dm, CD_MDEFORMVERT);
- if (dvert == NULL)
- {
+ if (dvert == NULL) {
BLI_ghash_free(vgroupHash, NULL, NULL);
MEM_freeN(bone_select_array);
@@ -311,8 +305,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
/* all verts must be available */
- if (ok)
- {
+ if (ok) {
BLI_ghash_insert(polyHash, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(numPolys));
loop_mapping[numPolys] = numLoops;
numPolys++;
diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c
index 6552ff38645..51e65e2387a 100644
--- a/source/blender/modifiers/intern/MOD_mirror.c
+++ b/source/blender/modifiers/intern/MOD_mirror.c
@@ -128,7 +128,7 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
invert_m4_m4(tmp, mmd->mirror_ob->obmat);
mult_m4_m4m4(tmp, tmp, ob->obmat);
- /* itmp is the reverse transform back to origin-relative coordiantes */
+ /* itmp is the reverse transform back to origin-relative coordinates */
invert_m4_m4(itmp, tmp);
/* combine matrices to get a single matrix that translates coordinates into
diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c
index 769ad864d98..00572eaad86 100644
--- a/source/blender/modifiers/intern/MOD_multires.c
+++ b/source/blender/modifiers/intern/MOD_multires.c
@@ -96,7 +96,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm,
}
else if(sculpting) {
/* would be created on the fly too, just nicer this
- way on first stroke after e.g. switching levels */
+ * way on first stroke after e.g. switching levels */
ss->pbvh= result->getPBVH(ob, result);
}
diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c
index 10e43afebe2..ad8642497fb 100644
--- a/source/blender/modifiers/intern/MOD_particlesystem.c
+++ b/source/blender/modifiers/intern/MOD_particlesystem.c
@@ -111,7 +111,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
}
/* particles only need this if they are after a non deform modifier, and
- * the modifier stack will only create them in that case. */
+ * the modifier stack will only create them in that case. */
dataMask |= CD_MASK_ORIGSPACE_MLOOP|CD_MASK_ORIGINDEX;
dataMask |= CD_MASK_ORCO;
diff --git a/source/blender/modifiers/intern/MOD_remesh.c b/source/blender/modifiers/intern/MOD_remesh.c
index ec893a3bf44..a608defc434 100644
--- a/source/blender/modifiers/intern/MOD_remesh.c
+++ b/source/blender/modifiers/intern/MOD_remesh.c
@@ -90,7 +90,7 @@ static void init_dualcon_mesh(DualConInput *mesh, DerivedMesh *dm)
}
/* simple structure to hold the output: a CDDM and two counters to
- keep track of the current elements */
+ * keep track of the current elements */
typedef struct {
DerivedMesh *dm;
int curvert, curface;
diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c
index 34957670080..f88c49fc6d7 100644
--- a/source/blender/modifiers/intern/MOD_screw.c
+++ b/source/blender/modifiers/intern/MOD_screw.c
@@ -345,7 +345,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* Notice!
*
* Since we are only ordering the edges here it can avoid mallocing the
- * extra space by abusing the vert array berfore its filled with new verts.
+ * extra space by abusing the vert array before its filled with new verts.
* The new array for vert_connect must be at least sizeof(ScrewVertConnect) * totvert
* and the size of our resulting meshes array is sizeof(MVert) * totvert * 3
* so its safe to use the second 2 thrids of MVert the array for vert_connect,
@@ -543,19 +543,22 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
ed_loop_flip= 0;
}
- }/* else {
+ }
+#if 0
+ else {
printf("No Connected ___\n");
- }*/
+ }
+#endif
/*printf("flip direction %i\n", ed_loop_flip);*/
/* switch the flip option if set
* note: flip is now done at face level so copying vgroup slizes is easier */
- /*
+#if 0
if (do_flip)
ed_loop_flip= !ed_loop_flip;
- */
+#endif
if (angle < 0.0f)
ed_loop_flip= !ed_loop_flip;
diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c
index 4485346bf55..9fb72bb4abc 100644
--- a/source/blender/modifiers/intern/MOD_simpledeform.c
+++ b/source/blender/modifiers/intern/MOD_simpledeform.c
@@ -74,8 +74,7 @@ static void simpleDeform_taper(const float factor, const float dcut[3], float *c
co[1] = y + y*scale;
co[2] = z;
- if(dcut)
- {
+ if (dcut) {
co[0] += dcut[0];
co[1] += dcut[1];
co[2] += dcut[2];
@@ -93,9 +92,7 @@ static void simpleDeform_stretch(const float factor, const float dcut[3], float
co[1] = y*scale;
co[2] = z*(1.0f+factor);
-
- if(dcut)
- {
+ if (dcut) {
co[0] += dcut[0];
co[1] += dcut[1];
co[2] += dcut[2];
@@ -115,8 +112,7 @@ static void simpleDeform_twist(const float factor, const float *dcut, float *co)
co[1] = x*sint + y*cost;
co[2] = z;
- if(dcut)
- {
+ if(dcut) {
co[0] += dcut[0];
co[1] += dcut[1];
co[2] += dcut[2];
@@ -132,16 +128,13 @@ static void simpleDeform_bend(const float factor, const float dcut[3], float *co
sint = sin(theta);
cost = cos(theta);
- if(fabsf(factor) > 1e-7f)
- {
+ if (fabsf(factor) > 1e-7f) {
co[0] = -(y-1.0f/factor)*sint;
co[1] = (y-1.0f/factor)*cost + 1.0f/factor;
co[2] = z;
}
-
- if(dcut)
- {
+ if (dcut) {
co[0] += cost*dcut[0];
co[1] += sint*dcut[0];
co[2] += dcut[2];
@@ -172,16 +165,13 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object
smd->limit[0] = MIN2(smd->limit[0], smd->limit[1]); //Upper limit >= than lower limit
//Calculate matrixs do convert between coordinate spaces
- if(smd->origin)
- {
+ if(smd->origin) {
transf = &tmp_transf;
- if(smd->originOpts & MOD_SIMPLEDEFORM_ORIGIN_LOCAL)
- {
+ if (smd->originOpts & MOD_SIMPLEDEFORM_ORIGIN_LOCAL) {
space_transform_from_matrixs(transf, ob->obmat, smd->origin->obmat);
}
- else
- {
+ else {
copy_m4_m4(transf->local2target, smd->origin->obmat);
invert_m4_m4(transf->target2local, transf->local2target);
}
@@ -230,17 +220,17 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object
{
float weight = defvert_array_find_weight_safe(dvert, i, vgroup);
- if(weight != 0.0f)
- {
+ if (weight != 0.0f) {
float co[3], dcut[3] = {0.0f, 0.0f, 0.0f};
- if(transf) space_transform_apply(transf, vertexCos[i]);
+ if(transf) {
+ space_transform_apply(transf, vertexCos[i]);
+ }
copy_v3_v3(co, vertexCos[i]);
- //Apply axis limits
- if(smd->mode != MOD_SIMPLEDEFORM_MODE_BEND) //Bend mode shoulnt have any lock axis
- {
+ /* Apply axis limits */
+ if(smd->mode != MOD_SIMPLEDEFORM_MODE_BEND) { /* Bend mode shoulnt have any lock axis */
if(smd->axis & MOD_SIMPLEDEFORM_LOCK_AXIS_X) axis_limit(0, lock_axis, co, dcut);
if(smd->axis & MOD_SIMPLEDEFORM_LOCK_AXIS_Y) axis_limit(1, lock_axis, co, dcut);
}
@@ -325,7 +315,7 @@ static void deformVerts(ModifierData *md, Object *ob,
CustomDataMask dataMask = requiredDataMask(ob, md);
/* we implement requiredDataMask but thats not really useful since
- mesh_calc_modifiers pass a NULL derivedData */
+ * mesh_calc_modifiers pass a NULL derivedData */
if(dataMask)
dm= get_dm(ob, NULL, dm, NULL, 0);
@@ -345,7 +335,7 @@ static void deformVertsEM(ModifierData *md, Object *ob,
CustomDataMask dataMask = requiredDataMask(ob, md);
/* we implement requiredDataMask but thats not really useful since
- mesh_calc_modifiers pass a NULL derivedData */
+ * mesh_calc_modifiers pass a NULL derivedData */
if(dataMask)
dm= get_dm(ob, editData, dm, NULL, 0);
diff --git a/source/blender/modifiers/intern/MOD_smoke.c b/source/blender/modifiers/intern/MOD_smoke.c
index 9b03816ed04..1472639739e 100644
--- a/source/blender/modifiers/intern/MOD_smoke.c
+++ b/source/blender/modifiers/intern/MOD_smoke.c
@@ -109,21 +109,16 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
{
SmokeModifierData *smd = (SmokeModifierData *) md;
- if(smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
- {
- if(smd->domain->fluid_group)
- {
+ if (smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) {
+ if (smd->domain->fluid_group) {
GroupObject *go = NULL;
- for(go = smd->domain->fluid_group->gobject.first; go; go = go->next)
- {
- if(go->ob)
- {
+ for (go = smd->domain->fluid_group->gobject.first; go; go = go->next) {
+ if (go->ob) {
SmokeModifierData *smd2 = (SmokeModifierData *)modifiers_findByType(go->ob, eModifierType_Smoke);
// check for initialized smoke object
- if(smd2 && (((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) || ((smd->type & MOD_SMOKE_TYPE_COLL) && smd2->coll)))
- {
+ if (smd2 && (((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) || ((smd->type & MOD_SMOKE_TYPE_COLL) && smd2->coll))) {
DagNode *curNode = dag_get_node(forest, go->ob);
dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Smoke Flow");
}
@@ -133,11 +128,10 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
else {
Base *base = scene->base.first;
- for(; base; base = base->next) {
+ for ( ; base; base = base->next) {
SmokeModifierData *smd2 = (SmokeModifierData *)modifiers_findByType(base->object, eModifierType_Smoke);
- if(smd2 && (((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) || ((smd->type & MOD_SMOKE_TYPE_COLL) && smd2->coll)))
- {
+ if (smd2 && (((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) || ((smd->type & MOD_SMOKE_TYPE_COLL) && smd2->coll))) {
DagNode *curNode = dag_get_node(forest, base->object);
dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Smoke Flow");
}
diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c
index 01b012655d0..7b7597af6d6 100644
--- a/source/blender/modifiers/intern/MOD_smooth.c
+++ b/source/blender/modifiers/intern/MOD_smooth.c
@@ -124,7 +124,7 @@ static void smoothModifier_do(
modifier_get_vgroup(ob, dm, smd->defgrp_name, &dvert, &defgrp_index);
/* NOTICE: this can be optimized a little bit by moving the
- * if (dvert) out of the loop, if needed */
+ * if (dvert) out of the loop, if needed */
for (j = 0; j < smd->repeat; j++) {
for (i = 0; i < numDMEdges; i++) {
float fvec[3];
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 78178387ee9..b7c820991f1 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -77,11 +77,11 @@ static void dm_calc_normal(DerivedMesh *dm, float (*temp_nors)[3])
/* we don't want to overwrite any referenced layers */
- /*
- Doesn't work here!
+ /* Doesn't work here! */
+#if 0
mv = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MVERT, numVerts);
cddm->mvert = mv;
- */
+#endif
face_nors = CustomData_get_layer(&dm->polyData, CD_NORMAL);
if(!face_nors) {
diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c
index 7e85acd47e9..ccb6e79eb64 100644
--- a/source/blender/modifiers/intern/MOD_surface.c
+++ b/source/blender/modifiers/intern/MOD_surface.c
@@ -59,9 +59,8 @@ static void initData(ModifierData *md)
static void freeData(ModifierData *md)
{
SurfaceModifierData *surmd = (SurfaceModifierData*) md;
-
- if (surmd)
- {
+
+ if (surmd) {
if(surmd->bvhtree) {
free_bvhtree_from_mesh(surmd->bvhtree);
MEM_freeN(surmd->bvhtree);
@@ -102,14 +101,12 @@ static void deformVerts(ModifierData *md, Object *ob,
if(derivedData) surmd->dm = CDDM_copy(derivedData);
else surmd->dm = get_dm(ob, NULL, NULL, NULL, 0);
- if(!ob->pd)
- {
+ if (!ob->pd) {
printf("SurfaceModifier deformVerts: Should not happen!\n");
return;
}
-
- if(surmd->dm)
- {
+
+ if(surmd->dm) {
unsigned int numverts = 0, i = 0;
int init = 0;
float *vec;
diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c
index 5f8c29944bd..11bf5bc6edf 100644
--- a/source/blender/modifiers/intern/MOD_util.c
+++ b/source/blender/modifiers/intern/MOD_util.c
@@ -65,9 +65,9 @@ void get_texture_value(Tex *texture, float *tex_co, TexResult *texres)
result_type = multitex_ext_safe(texture, tex_co, texres);
/* if the texture gave an RGB value, we assume it didn't give a valid
- * intensity, so calculate one (formula from do_material_tex).
- * if the texture didn't give an RGB value, copy the intensity across
- */
+ * intensity, so calculate one (formula from do_material_tex).
+ * if the texture didn't give an RGB value, copy the intensity across
+ */
if(result_type & TEX_RGB)
texres->tin = (0.35f * texres->tr + 0.45f * texres->tg
+ 0.2f * texres->tb);
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c
index e5fa0a323df..cd4858fcb4d 100644
--- a/source/blender/modifiers/intern/MOD_uvproject.c
+++ b/source/blender/modifiers/intern/MOD_uvproject.c
@@ -315,9 +315,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
} while (fidx--);
}
} else {
- /* multiple projectors, select the closest to face normal
- * direction
- */
+ /* multiple projectors, select the closest to face normal direction */
float face_no[3];
int j;
Projector *best_projector;
@@ -327,8 +325,8 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
mesh_calc_poly_normal_coords(mp, mloop + mp->loopstart, (const float (*)[3])coords, face_no);
/* find the projector which the face points at most directly
- * (projector normal with largest dot product is best)
- */
+ * (projector normal with largest dot product is best)
+ */
best_dot = dot_v3v3(projectors[0].normal, face_no);
best_projector = &projectors[0];
diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c
index 54baa9f9b18..3bc6c318d9f 100644
--- a/source/blender/modifiers/intern/MOD_weightvg_util.c
+++ b/source/blender/modifiers/intern/MOD_weightvg_util.c
@@ -225,7 +225,7 @@ void weightvg_do_mask(int num, const int *indices, float *org_w, const float *ne
-/* Applies weights to given vgroup (defgroup), and optionnaly add/remove vertices from the group.
+/* Applies weights to given vgroup (defgroup), and optionally add/remove vertices from the group.
* If dws is not NULL, it must be an array of MDeformWeight pointers of same length as weights (and
* defgrp_idx can then have any value).
* If indices is not NULL, it must be an array of same length as weights, mapping to the real
diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.h b/source/blender/modifiers/intern/MOD_weightvg_util.h
index ff5727cd403..a723d0f02e5 100644
--- a/source/blender/modifiers/intern/MOD_weightvg_util.h
+++ b/source/blender/modifiers/intern/MOD_weightvg_util.h
@@ -77,7 +77,7 @@ void weightvg_do_mask(int num, const int *indices, float *org_w, const float *ne
int tex_use_channel, int tex_mapping, Object *tex_map_object,
const char *tex_uvlayer_name);
-/* Applies weights to given vgroup (defgroup), and optionnaly add/remove vertices from the group.
+/* Applies weights to given vgroup (defgroup), and optionally add/remove vertices from the group.
* If indices is not NULL, it must be a table of same length as weights, mapping to the real
* vertex index (in case the weight table does not cover the whole vertices...).
*/
diff --git a/source/blender/nodes/composite/nodes/node_composite_brightness.c b/source/blender/nodes/composite/nodes/node_composite_brightness.c
index d935d9af7f7..83607ac66b3 100644
--- a/source/blender/nodes/composite/nodes/node_composite_brightness.c
+++ b/source/blender/nodes/composite/nodes/node_composite_brightness.c
@@ -61,13 +61,11 @@ static void do_brightnesscontrast(bNode *UNUSED(node), float *out, float *in, fl
* (http://visca.com/ffactory/archives/5-99/msg00021.html)
* Extracted of OpenCV demhist.c
*/
- if( contrast > 0 )
-{
+ if (contrast > 0) {
a = 1.0f / a;
b = a * (brightness - delta);
}
- else
- {
+ else {
delta *= -1;
b = a * (brightness + delta);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_movieclip.c b/source/blender/nodes/composite/nodes/node_composite_movieclip.c
index 1f449f8c16a..6ec64ef7c09 100644
--- a/source/blender/nodes/composite/nodes/node_composite_movieclip.c
+++ b/source/blender/nodes/composite/nodes/node_composite_movieclip.c
@@ -44,20 +44,23 @@ static bNodeSocketTemplate cmp_node_movieclip_out[]= {
static CompBuf *node_composit_get_movieclip(RenderData *rd, MovieClip *clip, MovieClipUser *user)
{
- ImBuf *ibuf;
+ ImBuf *orig_ibuf, *ibuf;
CompBuf *stackbuf;
int type;
float *rect;
int alloc= FALSE;
- ibuf= BKE_movieclip_get_ibuf(clip, user);
+ orig_ibuf= BKE_movieclip_get_ibuf(clip, user);
- if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) {
- IMB_freeImBuf(ibuf);
+ if(orig_ibuf==NULL || (orig_ibuf->rect==NULL && orig_ibuf->rect_float==NULL)) {
+ IMB_freeImBuf(orig_ibuf);
return NULL;
}
+ ibuf= IMB_dupImBuf(orig_ibuf);
+ IMB_freeImBuf(orig_ibuf);
+
if (ibuf->rect_float == NULL || ibuf->userflags&IB_RECT_INVALID) {
IMB_float_from_rect(ibuf);
ibuf->userflags&= ~IB_RECT_INVALID;
diff --git a/source/blender/nodes/composite/nodes/node_composite_normal.c b/source/blender/nodes/composite/nodes/node_composite_normal.c
index fbbd58932ea..638f67c4207 100644
--- a/source/blender/nodes/composite/nodes/node_composite_normal.c
+++ b/source/blender/nodes/composite/nodes/node_composite_normal.c
@@ -51,7 +51,7 @@ static void do_normal(bNode *node, float *out, float *in)
float *nor= ((bNodeSocketValueVector*)sock->default_value)->value;
/* render normals point inside... the widget points outside */
- out[0]= -INPR(nor, in);
+ out[0]= -dot_v3v3(nor, in);
}
/* generates normal, does dot product */
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c
index e4f21a474c0..e12ac4dee49 100644
--- a/source/blender/nodes/shader/node_shader_tree.c
+++ b/source/blender/nodes/shader/node_shader_tree.c
@@ -248,10 +248,10 @@ void ntreeShaderEndExecTree(bNodeTreeExec *exec, int use_tree_data)
void ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr)
{
ShaderCallData scd;
- /*
- \note: preserve material from ShadeInput for material id, nodetree execs change it
- fix for bug "[#28012] Mat ID messy with shader nodes"
- */
+ /**
+ * \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;
bNodeThreadStack *nts = NULL;
bNodeTreeExec *exec = ntree->execdata;
diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c
index 1a9a0fc4b3e..6e79c4acbeb 100644
--- a/source/blender/nodes/shader/node_shader_util.c
+++ b/source/blender/nodes/shader/node_shader_util.c
@@ -210,7 +210,7 @@ void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, bNodeStack *ns)
gs->name = "";
gs->hasinput= ns->hasinput && ns->data;
- /* XXX Commented out the ns->data check here, as it seems it’s not alwas set,
+ /* XXX Commented out the ns->data check here, as it seems it's not alwas set,
* even though there *is* a valid connection/output... But that might need
* further investigation.
*/
diff --git a/source/blender/nodes/shader/nodes/node_shader_dynamic.c b/source/blender/nodes/shader/nodes/node_shader_dynamic.c
index e55b1b164df..0c6c53b38e4 100644
--- a/source/blender/nodes/shader/nodes/node_shader_dynamic.c
+++ b/source/blender/nodes/shader/nodes/node_shader_dynamic.c
@@ -654,7 +654,7 @@ static void node_dynamic_setup(bNode *node)
* 0: for loaded empty nodes
* NODE_DYNAMIC_MENU: for the default Dynamic node type
* > NODE_DYNAMIC_MENU: for the new types defined by scripts
-*/
+ */
static void node_dynamic_init_cb(bNode *node)
{
int type = node->custom2;
@@ -718,8 +718,10 @@ static void node_dynamic_exec_cb(void *data, bNode *node, bNodeStack **in, bNode
if (!node->id)
return;
- /*if (G.scene->r.threads > 1)
- return;*/
+#if 0
+ if (G.scene->r.threads > 1)
+ return;
+#endif
if (BTST2(node->custom1, NODE_DYNAMIC_NEW, NODE_DYNAMIC_REPARSE)) {
node_dynamic_setup(node);
diff --git a/source/blender/nodes/shader/nodes/node_shader_normal.c b/source/blender/nodes/shader/nodes/node_shader_normal.c
index 8515c99ba81..34213558317 100644
--- a/source/blender/nodes/shader/nodes/node_shader_normal.c
+++ b/source/blender/nodes/shader/nodes/node_shader_normal.c
@@ -68,7 +68,7 @@ static void node_shader_exec_normal(void *UNUSED(data), bNode *node, bNodeStack
copy_v3_v3(out[0]->vec, ((bNodeSocketValueVector*)sock->default_value)->value);
/* render normals point inside... the widget points outside */
- out[1]->vec[0]= -INPR(out[0]->vec, vec);
+ out[1]->vec[0]= -dot_v3v3(out[0]->vec, vec);
}
static int gpu_shader_normal(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
diff --git a/source/blender/nodes/shader/nodes/node_shader_output.c b/source/blender/nodes/shader/nodes/node_shader_output.c
index 4a4a2010d59..8b0e9a5803b 100644
--- a/source/blender/nodes/shader/nodes/node_shader_output.c
+++ b/source/blender/nodes/shader/nodes/node_shader_output.c
@@ -69,8 +69,10 @@ static int gpu_shader_output(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack
{
GPUNodeLink *outlink;
- /*if(in[1].hasinput)
- GPU_material_enable_alpha(mat);*/
+#if 0
+ if(in[1].hasinput)
+ GPU_material_enable_alpha(mat);
+#endif
GPU_stack_link(mat, "output_node", in, out, &outlink);
GPU_material_output_link(mat, outlink);
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c
index dbdd6a8619b..8ecff6e3767 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c
@@ -44,7 +44,8 @@ static void node_shader_init_tex_environment(bNodeTree *UNUSED(ntree), bNode* no
NodeTexEnvironment *tex = MEM_callocN(sizeof(NodeTexEnvironment), "NodeTexEnvironment");
default_tex_mapping(&tex->base.tex_mapping);
default_color_mapping(&tex->base.color_mapping);
- tex->color_space = SHD_COLORSPACE_SRGB;
+ tex->color_space = SHD_COLORSPACE_COLOR;
+ tex->projection = SHD_PROJ_EQUIRECTANGULAR;
node->storage = tex;
}
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_image.c b/source/blender/nodes/shader/nodes/node_shader_tex_image.c
index aa679b4e04e..aa7ff279178 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_image.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.c
@@ -44,7 +44,7 @@ static void node_shader_init_tex_image(bNodeTree *UNUSED(ntree), bNode* node, bN
NodeTexImage *tex = MEM_callocN(sizeof(NodeTexImage), "NodeTexImage");
default_tex_mapping(&tex->base.tex_mapping);
default_color_mapping(&tex->base.color_mapping);
- tex->color_space = SHD_COLORSPACE_SRGB;
+ tex->color_space = SHD_COLORSPACE_COLOR;
node->storage = tex;
}
diff --git a/source/blender/nodes/texture/node_texture_util.c b/source/blender/nodes/texture/node_texture_util.c
index c3d298d1ecd..a528f8cb7a7 100644
--- a/source/blender/nodes/texture/node_texture_util.c
+++ b/source/blender/nodes/texture/node_texture_util.c
@@ -82,13 +82,12 @@ void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread)
{
tex_input(out, 4, in, params, thread);
- if(in->hasoutput && in->sockettype == SOCK_FLOAT)
- {
+ if (in->hasoutput && in->sockettype == SOCK_FLOAT) {
out[1] = out[2] = out[0];
out[3] = 1;
}
- if(in->hasoutput && in->sockettype == SOCK_VECTOR) {
+ if (in->hasoutput && in->sockettype == SOCK_VECTOR) {
out[0] = out[0] * .5f + .5f;
out[1] = out[1] * .5f + .5f;
out[2] = out[2] * .5f + .5f;
@@ -148,8 +147,7 @@ void ntreeTexCheckCyclics(struct bNodeTree *ntree)
bNode *node;
for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type == TEX_NODE_TEXTURE && node->id)
- {
+ if(node->type == TEX_NODE_TEXTURE && node->id) {
/* custom2 stops the node from rendering */
if(node->custom1) {
node->custom2 = 1;
diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c
index b6064c452fe..3990005d139 100644
--- a/source/blender/python/bmesh/bmesh_py_api.c
+++ b/source/blender/python/bmesh/bmesh_py_api.c
@@ -40,13 +40,36 @@
#include "BLI_utildefines.h"
#include "BKE_tessmesh.h"
+#include "BKE_depsgraph.h"
#include "DNA_mesh_types.h"
+#include "DNA_object_types.h"
#include "../generic/py_capi_utils.h"
#include "bmesh_py_api.h" /* own include */
+
+
+PyDoc_STRVAR(bpy_bm_new_doc,
+".. method:: new()\n"
+"\n"
+" :return: Retyrn a new, empty mesh.\n"
+" :rtype: :class:`BMesh`\n"
+);
+
+static PyObject *bpy_bm_new(PyObject *UNUSED(self))
+{
+ BPy_BMesh *py_bmesh;
+ BMesh *bm;
+
+ bm = BM_mesh_create(NULL, &bm_mesh_allocsize_default);
+
+ py_bmesh = (BPy_BMesh *)BPy_BMesh_CreatePyObject(bm);
+ py_bmesh->py_owns = TRUE;
+ return (PyObject *)py_bmesh;
+}
+
PyDoc_STRVAR(bpy_bm_from_mesh_doc,
".. method:: from_mesh(mesh)\n"
"\n"
@@ -58,25 +81,88 @@ PyDoc_STRVAR(bpy_bm_from_mesh_doc,
static PyObject *bpy_bm_from_mesh(PyObject *UNUSED(self), PyObject *value)
{
+ BPy_BMesh *py_bmesh;
+ BMesh *bm;
Mesh *me = PyC_RNA_AsPointer(value, "Mesh");
+ int py_owns;
+
+ if (me == NULL) {
+ return NULL;
+ }
/* temp! */
if (!me->edit_btmesh) {
- PyErr_SetString(PyExc_ValueError,
- "Mesh is not in editmode");
+ bm = BM_mesh_create(NULL, &bm_mesh_allocsize_default);
+ BM_mesh_to_bmesh(bm, me, 0, 0); /* BMESH_TODO add args */
+ py_owns = TRUE;
+ }
+ else {
+ bm = me->edit_btmesh->bm;
+ py_owns = FALSE;
+ }
+
+ py_bmesh = (BPy_BMesh *)BPy_BMesh_CreatePyObject(bm);
+ py_bmesh->py_owns = py_owns;
+ return (PyObject *)py_bmesh;
+}
+
+PyDoc_STRVAR(bpy_bm_to_mesh_doc,
+".. method:: to_mesh(mesh, bmesh)\n"
+"\n"
+" Return a BMesh from this mesh, currently the mesh must already be in editmode.\n"
+"\n"
+" :return: the BMesh assosiated with this mesh.\n"
+" :rtype: :class:`bmesh.types.BMesh`\n"
+);
+
+static PyObject *bpy_bm_to_mesh(PyObject *UNUSED(self), PyObject *args)
+{
+ PyObject *py_mesh;
+ BPy_BMesh *py_bmesh;
+ Mesh *me;
+ BMesh *bm;
+
+ if (!PyArg_ParseTuple(args, "OO!:to_mesh", &py_mesh, &BPy_BMesh_Type, &py_bmesh) ||
+ !(me = PyC_RNA_AsPointer(py_mesh, "Mesh")))
+ {
+ return NULL;
+ }
+
+ BPY_BM_CHECK_OBJ(py_bmesh);
+
+ if (me->edit_btmesh) {
+ PyErr_Format(PyExc_ValueError,
+ "to_mesh(): Mesh '%s' is in editmode", me->id.name + 2);
return NULL;
}
- return BPy_BMesh_CreatePyObject(me->edit_btmesh->bm);
+ bm = py_bmesh->bm;
+
+ BM_mesh_from_bmesh(bm, me, FALSE);
+
+ /* we could have the user do this but if they forget blender can easy crash
+ * since the references arrays for the objects derived meshes are now invalid */
+ DAG_id_tag_update(&me->id, OB_RECALC_DATA);
+
+ Py_RETURN_NONE;
}
static struct PyMethodDef BPy_BM_methods[] = {
- {"from_mesh", (PyCFunction)bpy_bm_from_mesh, METH_O, bpy_bm_from_mesh_doc},
- {NULL, NULL, 0, NULL}
+ /* THESE NAMES MAY CHANGE! */
+ {"new", (PyCFunction)bpy_bm_new, METH_NOARGS, bpy_bm_new_doc},
+ {"from_mesh", (PyCFunction)bpy_bm_from_mesh, METH_O, bpy_bm_from_mesh_doc},
+ {"to_mesh", (PyCFunction)bpy_bm_to_mesh, METH_VARARGS, bpy_bm_to_mesh_doc},
+ {NULL, NULL, 0, NULL}
};
PyDoc_STRVAR(BPy_BM_doc,
-"This module provides access to blenders bmesh data structures."
+"This module provides access to blenders bmesh data structures.\n"
+"\n"
+"\n"
+"Submodules:\n"
+"\n"
+"* :mod:`bmesh.utils`\n"
+"* :mod:`bmesh.types`\n"
);
static struct PyModuleDef BPy_BM_module_def = {
PyModuleDef_HEAD_INIT,
diff --git a/source/blender/python/bmesh/bmesh_py_select.c b/source/blender/python/bmesh/bmesh_py_select.c
index 5630b4ac712..c5c66c0aaaa 100644
--- a/source/blender/python/bmesh/bmesh_py_select.c
+++ b/source/blender/python/bmesh/bmesh_py_select.c
@@ -23,10 +23,11 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/python/bmesh/bmesh_py_api.c
+/** \file blender/python/bmesh/bmesh_py_select.c
* \ingroup pybmesh
*
- * This file defines the 'bmesh' module.
+ * This file defines the types for 'BMesh.select_history'
+ * sequence and iterator.
*/
#include <Python.h>
@@ -47,9 +48,24 @@
#include "bmesh_py_api.h" /* own include */
-static PyGetSetDef bpy_bmeditselseq_getseters[] = {
- // {(char *)"verts", (getter)bpy_bmeditselseq_get, (setter)NULL, (char *)bpy_bmesh_verts_doc, (void *)BM_VERTS_OF_MESH},
+PyDoc_STRVAR(bpy_bmeditselseq_active_doc,
+"The last selected element or None (read-only).\n\n:type: :class:`BMVert`, :class:`BMEdge` or :class:`BMFace`"
+);
+static PyObject *bpy_bmeditselseq_active_get(BPy_BMEditSelSeq *self, void *UNUSED(closure))
+{
+ BMEditSelection *ese;
+ BPY_BM_CHECK_OBJ(self);
+
+ if ((ese = self->bm->selected.last)) {
+ return BPy_BMElem_CreatePyObject(self->bm, &ese->ele->head);
+ }
+ else {
+ Py_RETURN_NONE;
+ }
+}
+static PyGetSetDef bpy_bmeditselseq_getseters[] = {
+ {(char *)"active", (getter)bpy_bmeditselseq_active_get, (setter)NULL, (char *)bpy_bmeditselseq_active_doc, NULL},
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
@@ -71,19 +87,25 @@ static Py_ssize_t bpy_bmeditselseq_length(BPy_BMEditSelSeq *self)
static PyObject *bpy_bmeditselseq_subscript_int(BPy_BMEditSelSeq *self, int keynum)
{
+ BMEditSelection *ese;
+
BPY_BM_CHECK_OBJ(self);
- if (keynum < 0) keynum += bpy_bmeditselseq_length(self); /* only get length on negative value, may loop entire seq */
- if (keynum >= 0) {
- BMEditSelection *ese = BLI_findlink(&self->bm->selected, keynum);
- if (ese) {
- return BPy_BMElem_CreatePyObject(self->bm, &ese->ele->head);
- }
+ if (keynum < 0) {
+ ese = BLI_rfindlink(&self->bm->selected, -1 - keynum);
+ }
+ else {
+ ese = BLI_findlink(&self->bm->selected, keynum);
}
- PyErr_Format(PyExc_IndexError,
- "BMElemSeq[index]: index %d out of range", keynum);
- return NULL;
+ if (ese) {
+ return BPy_BMElem_CreatePyObject(self->bm, &ese->ele->head);
+ }
+ else {
+ PyErr_Format(PyExc_IndexError,
+ "BMElemSeq[index]: index %d out of range", keynum);
+ return NULL;
+ }
}
static PyObject *bpy_bmeditselseq_subscript_slice(BPy_BMEditSelSeq *self, Py_ssize_t start, Py_ssize_t stop)
@@ -206,21 +228,21 @@ static int bpy_bmeditselseq_contains(BPy_BMEditSelSeq *self, PyObject *value)
}
static PySequenceMethods bpy_bmeditselseq_as_sequence = {
- (lenfunc)bpy_bmeditselseq_length, /* sq_length */
+ (lenfunc)bpy_bmeditselseq_length, /* sq_length */
NULL, /* sq_concat */
NULL, /* sq_repeat */
- (ssizeargfunc)bpy_bmeditselseq_subscript_int, /* sq_item */ /* Only set this so PySequence_Check() returns True */
+ (ssizeargfunc)bpy_bmeditselseq_subscript_int,/* sq_item */ /* Only set this so PySequence_Check() returns True */
NULL, /* sq_slice */
(ssizeobjargproc)NULL, /* sq_ass_item */
NULL, /* *was* sq_ass_slice */
- (objobjproc)bpy_bmeditselseq_contains, /* sq_contains */
+ (objobjproc)bpy_bmeditselseq_contains, /* sq_contains */
(binaryfunc) NULL, /* sq_inplace_concat */
(ssizeargfunc) NULL, /* sq_inplace_repeat */
};
static PyMappingMethods bpy_bmeditselseq_as_mapping = {
- (lenfunc)bpy_bmeditselseq_length, /* mp_length */
- (binaryfunc)bpy_bmeditselseq_subscript, /* mp_subscript */
+ (lenfunc)bpy_bmeditselseq_length, /* mp_length */
+ (binaryfunc)bpy_bmeditselseq_subscript, /* mp_subscript */
(objobjargproc)NULL, /* mp_ass_subscript */
};
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index 65bce912963..c15323186ac 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -839,6 +839,10 @@ static PyObject *bpy_bmvert_copy_from_vert_interp(BPy_BMVert *self, PyObject *ar
&vert_seq_len, &BPy_BMVert_Type,
TRUE, TRUE, "BMVert.copy_from_vert_interp(...)");
+ if (vert_array == NULL) {
+ return NULL;
+ }
+
BM_data_interp_from_verts(bm, vert_array[0], vert_array[1], self->v, CLAMPIS(fac, 0.0f, 1.0f));
PyMem_FREE(vert_array);
@@ -957,7 +961,7 @@ static PyObject *bpy_bmedge_other_vert(BPy_BMEdge *self, BPy_BMVert *value)
BPY_BM_CHECK_OBJ(value);
if (self->bm != value->bm) {
- PyErr_SetString(PyExc_TypeError,
+ PyErr_SetString(PyExc_ValueError,
"BMEdge.other_vert(vert): vert is from another mesh");
return NULL;
}
@@ -1279,6 +1283,10 @@ static PyObject *bpy_bmedgeseq_new(BPy_BMElemSeq *self, PyObject *args)
&vert_seq_len, &BPy_BMVert_Type,
TRUE, TRUE, "edges.new(...)");
+ if (vert_array == NULL) {
+ return NULL;
+ }
+
if (BM_edge_exists(vert_array[0], vert_array[1])) {
PyErr_SetString(PyExc_ValueError,
"edges.new(): this edge exists");
@@ -1342,6 +1350,10 @@ static PyObject *bpy_bmfaceseq_new(BPy_BMElemSeq *self, PyObject *args)
&vert_seq_len, &BPy_BMVert_Type,
TRUE, TRUE, "faces.new(...)");
+ if (vert_array == NULL) {
+ return NULL;
+ }
+
/* check if the face exists */
if (BM_face_exists(bm, vert_array, vert_seq_len, NULL)) {
PyErr_SetString(PyExc_ValueError,
@@ -1564,7 +1576,7 @@ static PyObject *bpy_bmedgeseq_get(BPy_BMElemSeq *self, PyObject *args)
return NULL;
}
- if ((e=BM_edge_exists(vert_array[0], vert_array[1]))) {
+ if ((e = BM_edge_exists(vert_array[0], vert_array[1]))) {
ret = BPy_BMEdge_CreatePyObject(bm, e);
}
else {
@@ -2050,6 +2062,10 @@ static void bpy_bmesh_dealloc(BPy_BMesh *self)
bm->py_handle = NULL;
}
+ if (self->py_owns) {
+ BM_mesh_free(bm);
+ }
+
PyObject_DEL(self);
}
@@ -2297,6 +2313,7 @@ void BPy_BM_init_types(void)
/* only 1 iteratir so far */
BPy_BMIter_Type.tp_iternext = (iternextfunc)bpy_bmiter_next;
+ BPy_BMIter_Type.tp_iter = PyObject_SelfIter;
BPy_BMesh_Type.tp_dealloc = (destructor)bpy_bmesh_dealloc;
BPy_BMVert_Type.tp_dealloc = (destructor)bpy_bmvert_dealloc;
@@ -2307,14 +2324,14 @@ void BPy_BM_init_types(void)
BPy_BMIter_Type.tp_dealloc = NULL;
/*
- BPy_BMesh_Type.
- BPy_BMVert_Type.
- BPy_BMEdge_Type.
- BPy_BMFace_Type.
- BPy_BMLoop_Type.
- BPy_BMElemSeq_Type.
- BPy_BMIter_Type.
- */
+ * BPy_BMesh_Type.
+ * BPy_BMVert_Type.
+ * BPy_BMEdge_Type.
+ * BPy_BMFace_Type.
+ * BPy_BMLoop_Type.
+ * BPy_BMElemSeq_Type.
+ * BPy_BMIter_Type.
+ */
BPy_BMesh_Type.tp_flags = Py_TPFLAGS_DEFAULT;
BPy_BMVert_Type.tp_flags = Py_TPFLAGS_DEFAULT;
@@ -2572,7 +2589,7 @@ void *BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_
PyObject *seq_fast;
*r_size = 0;
- if (!(seq_fast=PySequence_Fast(seq, error_prefix))) {
+ if (!(seq_fast = PySequence_Fast(seq, error_prefix))) {
return NULL;
}
else {
@@ -2600,7 +2617,7 @@ void *BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_
if (Py_TYPE(item) != type) {
PyErr_Format(PyExc_TypeError,
- "%s: expected '%.200', not '%.200s'",
+ "%s: expected '%.200s', not '%.200s'",
error_prefix, type->tp_name, Py_TYPE(item)->tp_name);
goto err_cleanup;
}
@@ -2613,7 +2630,7 @@ void *BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_
/* trick so we can ensure all items have the same mesh,
* and allows us to pass the 'bm' as NULL. */
else if (do_bm_check && (bm && bm != item->bm)) {
- PyErr_Format(PyExc_TypeError,
+ PyErr_Format(PyExc_ValueError,
"%s: %d %s is from another mesh",
error_prefix, i, type->tp_name);
goto err_cleanup;
@@ -2661,3 +2678,15 @@ err_cleanup:
return NULL;
}
}
+
+
+PyObject *BPy_BMElem_Array_As_Tuple(BMesh *bm, BMHeader **elem, Py_ssize_t elem_len)
+{
+ Py_ssize_t i;
+ PyObject *ret = PyTuple_New(elem_len);
+ for (i = 0; i < elem_len; i++) {
+ PyTuple_SET_ITEM(ret, i, BPy_BMElem_CreatePyObject(bm, elem[i]));
+ }
+
+ return ret;
+}
diff --git a/source/blender/python/bmesh/bmesh_py_types.h b/source/blender/python/bmesh/bmesh_py_types.h
index d7deb41c4e3..52a82c50dd1 100644
--- a/source/blender/python/bmesh/bmesh_py_types.h
+++ b/source/blender/python/bmesh/bmesh_py_types.h
@@ -62,6 +62,7 @@ typedef struct BPy_BMElem {
typedef struct BPy_BMesh {
PyObject_VAR_HEAD
struct BMesh *bm; /* keep first */
+ char py_owns;
} BPy_BMesh;
/* element types */
@@ -101,7 +102,7 @@ typedef struct BPy_BMElemSeq {
* If this veriable is set, it will be used */
/* we hold a reference to this.
- * check incase the owner becomes invalid on access */
+ * check in case the owner becomes invalid on access */
/* TODO - make this a GC'd object!, will function OK without this though */
BPy_BMElem *py_ele;
@@ -137,6 +138,9 @@ void *BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_
const char do_unique_check, const char do_bm_check,
const char *error_prefix);
+PyObject *BPy_BMElem_Array_As_Tuple(BMesh *bm, BMHeader **elem, Py_ssize_t elem_len);
+
+
#define BPY_BM_CHECK_OBJ(obj) if (UNLIKELY(bpy_bm_generic_valid_check((BPy_BMGeneric *)obj) == -1)) { return NULL; } (void)0
#define BPY_BM_CHECK_INT(obj) if (UNLIKELY(bpy_bm_generic_valid_check((BPy_BMGeneric *)obj) == -1)) { return -1; } (void)0
diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c
index a8d90522c15..8e9537f1d86 100644
--- a/source/blender/python/bmesh/bmesh_py_utils.c
+++ b/source/blender/python/bmesh/bmesh_py_utils.c
@@ -38,6 +38,8 @@
#include "BLI_utildefines.h"
+#include "MEM_guardedalloc.h"
+
#include "bmesh_py_utils.h" /* own include */
@@ -196,6 +198,67 @@ static PyObject *bpy_bm_utils_vert_dissolve(PyObject *UNUSED(self), PyObject *ar
return PyBool_FromLong((BM_vert_dissolve(bm, py_vert->v)));
}
+PyDoc_STRVAR(bpy_bm_utils_vert_separate_doc,
+".. method:: vert_separate(vert, edges)\n"
+"\n"
+" Separate this vertex at every edge.\n"
+"\n"
+" :arg vert: The vert to be separated.\n"
+" :type vert: :class:`BMVert`\n"
+" :arg edges: The edges to separated.\n"
+" :type edges: :class:`BMEdge`\n"
+" :return: The newly separated verts (including the vertex passed).\n"
+" :rtype: tuple of :class:`BMVert`\n"
+);
+static PyObject *bpy_bm_utils_vert_separate(PyObject *UNUSED(self), PyObject *args)
+{
+ BPy_BMVert *py_vert;
+ PyObject *edge_seq;
+
+ BMesh *bm;
+ BMVert **elem;
+ int elem_len;
+
+ /* edges to split */
+ BMEdge **edge_array;
+ Py_ssize_t edge_array_len;
+
+ PyObject *ret;
+
+
+ if (!PyArg_ParseTuple(args, "O!O:vert_separate",
+ &BPy_BMVert_Type, &py_vert,
+ &edge_seq))
+ {
+ return NULL;
+ }
+
+ BPY_BM_CHECK_OBJ(py_vert);
+
+ bm = py_vert->bm;
+
+ edge_array = BPy_BMElem_PySeq_As_Array(&bm, edge_seq, 0, PY_SSIZE_T_MAX,
+ &edge_array_len, &BPy_BMEdge_Type,
+ TRUE, TRUE, "vert_separate(...)");
+
+ if (edge_array == NULL) {
+ return NULL;
+ }
+
+ if (BM_vert_separate(bm, py_vert->v, &elem, &elem_len, edge_array, edge_array_len)) {
+ /* return collected verts */
+ ret = BPy_BMElem_Array_As_Tuple(bm, (BMHeader **)elem, elem_len);
+ MEM_freeN(elem);
+ }
+ else {
+ ret = PyTuple_New(0);
+ }
+
+ PyMem_FREE(edge_array);
+
+ return ret;
+}
+
PyDoc_STRVAR(bpy_bm_utils_edge_split_doc,
".. method:: edge_split(edge, vert, fac)\n"
@@ -291,7 +354,7 @@ static PyObject *bpy_bm_utils_edge_rotate(PyObject *UNUSED(self), PyObject *args
bm = py_edge->bm;
- e_new = BM_edge_rotate(bm, py_edge->e, do_ccw);
+ e_new = BM_edge_rotate(bm, py_edge->e, do_ccw, 0); /* BMESH_TODO - expose to API */
if (e_new) {
return BPy_BMEdge_CreatePyObject(bm, e_new);
@@ -363,7 +426,7 @@ static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args)
f_new = BM_face_split(bm, py_face->f,
py_vert_a->v, py_vert_b->v,
- &l_new, py_edge_example ? py_edge_example->e : NULL);
+ &l_new, py_edge_example ? py_edge_example->e : NULL, FALSE); /* BMESH_TODO, make arg */
if (f_new && l_new) {
PyObject *ret = PyTuple_New(2);
@@ -408,6 +471,8 @@ static PyObject *bpy_bm_utils_face_join(PyObject *UNUSED(self), PyObject *value)
* --------------------------- */
f_new = BM_faces_join(bm, face_array, (int)face_seq_len);
+ PyMem_FREE(face_array);
+
if (f_new) {
return BPy_BMFace_CreatePyObject(bm, f_new);
}
@@ -417,6 +482,68 @@ static PyObject *bpy_bm_utils_face_join(PyObject *UNUSED(self), PyObject *value)
}
+PyDoc_STRVAR(bpy_bm_utils_face_vert_separate_doc,
+".. method:: face_vert_separate(face, vert)\n"
+"\n"
+" Rip a vertex in a face away and add a new vertex.\n"
+"\n"
+" :arg face: The face to separate.\n"
+" :type face: :class:`BMFace`\n"
+" :arg vert: A vertex in the face to separate.\n"
+" :type vert: :class:`BMVert`\n"
+" :return vert: The newly created vertex or None of failure.\n"
+" :rtype vert: :class:`BMVert`\n"
+"\n"
+" .. note::\n"
+"\n"
+" This is the same as loop_separate, and has only been added for convenience.\n"
+);
+static PyObject *bpy_bm_utils_face_vert_separate(PyObject *UNUSED(self), PyObject *args)
+{
+ BPy_BMFace *py_face;
+ BPy_BMVert *py_vert;
+
+ BMesh *bm;
+ BMLoop *l;
+ BMVert *v_new;
+
+ if (!PyArg_ParseTuple(args, "O!O!:face_vert_separate",
+ &BPy_BMFace_Type, &py_face,
+ &BPy_BMVert_Type, &py_vert))
+ {
+ return NULL;
+ }
+
+ BPY_BM_CHECK_OBJ(py_face);
+ BPY_BM_CHECK_OBJ(py_vert);
+
+ bm = py_face->bm;
+
+ if (bm != py_vert->bm) {
+ PyErr_SetString(PyExc_ValueError,
+ "mesh elements are from different meshes");
+ return NULL;
+ }
+
+ l = BM_face_vert_share_loop(py_face->f, py_vert->v);
+
+ if (l == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "vertex not found in face");
+ return NULL;
+ }
+
+ v_new = BM_face_loop_separate(bm, l);
+
+ if (v_new != l->v) {
+ return BPy_BMVert_CreatePyObject(bm, v_new);
+ }
+ else {
+ Py_RETURN_NONE;
+ }
+}
+
+
PyDoc_STRVAR(bpy_bm_utils_face_flip_doc,
".. method:: face_flip(faces)\n"
"\n"
@@ -442,15 +569,56 @@ static PyObject *bpy_bm_utils_face_flip(PyObject *UNUSED(self), BPy_BMFace *valu
}
+
+PyDoc_STRVAR(bpy_bm_utils_loop_separate_doc,
+".. method:: loop_separate(loop)\n"
+"\n"
+" Rip a vertex in a face away and add a new vertex.\n"
+"\n"
+" :arg loop: The to separate.\n"
+" :type loop: :class:`BMFace`\n"
+" :return vert: The newly created vertex or None of failure.\n"
+" :rtype vert: :class:`BMVert`\n"
+);
+static PyObject *bpy_bm_utils_loop_separate(PyObject *UNUSED(self), BPy_BMLoop *value)
+{
+ BMesh *bm;
+ BMVert *v_new;
+
+ if (!BPy_BMLoop_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "loop_separate(loop): BMLoop expected, not '%.200s'",
+ Py_TYPE(value)->tp_name);
+ return NULL;
+ }
+
+ BPY_BM_CHECK_OBJ(value);
+
+ bm = value->bm;
+
+ v_new = BM_face_loop_separate(bm, value->l);
+
+ if (v_new != value->l->v) {
+ return BPy_BMVert_CreatePyObject(bm, v_new);
+ }
+ else {
+ Py_RETURN_NONE;
+ }
+}
+
+
static struct PyMethodDef BPy_BM_utils_methods[] = {
{"vert_collapse_edge", (PyCFunction)bpy_bm_utils_vert_collapse_edge, METH_VARARGS, bpy_bm_utils_vert_collapse_edge_doc},
{"vert_collapse_faces", (PyCFunction)bpy_bm_utils_vert_collapse_faces, METH_VARARGS, bpy_bm_utils_vert_collapse_faces_doc},
- {"vert_dissolve", (PyCFunction)bpy_bm_utils_vert_dissolve, METH_VARARGS, bpy_bm_utils_vert_dissolve_doc},
+ {"vert_dissolve", (PyCFunction)bpy_bm_utils_vert_dissolve, METH_VARARGS, bpy_bm_utils_vert_dissolve_doc}, /* could use METH_O */
+ {"vert_separate", (PyCFunction)bpy_bm_utils_vert_separate, METH_VARARGS, bpy_bm_utils_vert_separate_doc},
{"edge_split", (PyCFunction)bpy_bm_utils_edge_split, METH_VARARGS, bpy_bm_utils_edge_split_doc},
{"edge_rotate", (PyCFunction)bpy_bm_utils_edge_rotate, METH_VARARGS, bpy_bm_utils_edge_rotate_doc},
{"face_split", (PyCFunction)bpy_bm_utils_face_split, METH_VARARGS, bpy_bm_utils_face_split_doc},
{"face_join", (PyCFunction)bpy_bm_utils_face_join, METH_O, bpy_bm_utils_face_join_doc},
+ {"face_vert_separate", (PyCFunction)bpy_bm_utils_face_vert_separate, METH_VARARGS, bpy_bm_utils_face_vert_separate_doc},
{"face_flip", (PyCFunction)bpy_bm_utils_face_flip, METH_O, bpy_bm_utils_face_flip_doc},
+ {"loop_separate", (PyCFunction)bpy_bm_utils_loop_separate, METH_O, bpy_bm_utils_loop_separate_doc},
{NULL, NULL, 0, NULL}
};
diff --git a/source/blender/python/generic/bgl.h b/source/blender/python/generic/bgl.h
index e23f4c2e86d..9df08882b8a 100644
--- a/source/blender/python/generic/bgl.h
+++ b/source/blender/python/generic/bgl.h
@@ -75,7 +75,7 @@ extern PyTypeObject BGL_bufferType;
/*@ By golly George! It looks like fancy pants macro time!!! */
-/*
+#if 0 /* unused so far */
#define int_str "i"
#define int_var(number) bgl_int##number
#define int_ref(number) &bgl_int##number
@@ -85,7 +85,7 @@ extern PyTypeObject BGL_bufferType;
#define float_var(number) bgl_float##number
#define float_ref(number) &bgl_float##number
#define float_def(number) float float_var(number)
-*/
+#endif
/* TYPE_str is the string to pass to Py_ArgParse (for the format) */
/* TYPE_var is the name to pass to the GL function */
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c
index ecf65275483..36308cdc3e5 100644
--- a/source/blender/python/generic/bpy_internal_import.c
+++ b/source/blender/python/generic/bpy_internal_import.c
@@ -244,7 +244,7 @@ static PyObject *blender_import(PyObject *UNUSED(self), PyObject *args, PyObject
if (newmodule)
return newmodule;
- PyErr_Fetch(&exception, &err, &tb); /* get the python error incase we cant import as blender text either */
+ PyErr_Fetch(&exception, &err, &tb); /* get the python error in case we cant import as blender text either */
/* importing from existing modules failed, see if we have this module as blender text */
newmodule = bpy_text_import_name(name, &found);
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index 4cff5cbca95..33c5d3bd06d 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -399,9 +399,9 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
if ((val.array.type= idp_sequence_type(ob)) == -1)
return "only floats, ints and dicts are allowed in ID property arrays";
- /*validate sequence and derive type.
- we assume IDP_INT unless we hit a float
- number; then we assume it's */
+ /* validate sequence and derive type.
+ * we assume IDP_INT unless we hit a float
+ * number; then we assume it's */
val.array.len = PySequence_Size(ob);
@@ -443,8 +443,8 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
keys = PyMapping_Keys(ob);
vals = PyMapping_Values(ob);
- /*we allocate the group first; if we hit any invalid data,
- we can delete it easily enough.*/
+ /* we allocate the group first; if we hit any invalid data,
+ * we can delete it easily enough.*/
prop = IDP_New(IDP_GROUP, &val, name);
len = PyMapping_Length(ob);
for (i=0; i<len; i++) {
@@ -666,9 +666,9 @@ static PyObject *BPy_IDGroup_Pop(BPy_IDProperty *self, PyObject *value)
pyform = BPy_IDGroup_MapDataToPy(idprop);
if (!pyform) {
- /*ok something bad happened with the pyobject,
- so don't remove the prop from the group. if pyform is
- NULL, then it already should have raised an exception.*/
+ /* ok something bad happened with the pyobject,
+ * so don't remove the prop from the group. if pyform is
+ * NULL, then it already should have raised an exception.*/
return NULL;
}
@@ -1324,12 +1324,6 @@ PyTypeObject BPy_IDArray_Type = {
/*********** ID Property Group iterator ********/
-static PyObject *IDGroup_Iter_iterself(PyObject *self)
-{
- Py_XINCREF(self);
- return self;
-}
-
static PyObject *IDGroup_Iter_repr(BPy_IDGroup_Iter *self)
{
return PyUnicode_FromFormat("(ID Property Group Iter \"%s\")", self->group->prop->name);
@@ -1412,7 +1406,7 @@ PyTypeObject BPy_IDGroup_Iter_Type = {
/*** Added in release 2.2 ***/
/* Iterators */
- IDGroup_Iter_iterself, /* getiterfunc tp_iter; */
+ PyObject_SelfIter, /* getiterfunc tp_iter; */
(iternextfunc) BPy_Group_Iter_Next, /* iternextfunc tp_iternext; */
};
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index e63e0146330..9e373fc8048 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -50,11 +50,11 @@ int PyC_AsArray(void *array, PyObject *value, const Py_ssize_t length,
Py_ssize_t value_len;
Py_ssize_t i;
- if (!(value_fast=PySequence_Fast(value, error_prefix))) {
+ if (!(value_fast = PySequence_Fast(value, error_prefix))) {
return -1;
}
- value_len= PySequence_Fast_GET_SIZE(value_fast);
+ value_len = PySequence_Fast_GET_SIZE(value_fast);
if (value_len != length) {
Py_DECREF(value);
@@ -69,13 +69,13 @@ int PyC_AsArray(void *array, PyObject *value, const Py_ssize_t length,
if (is_double) {
double *array_double= array;
for (i=0; i<length; i++) {
- array_double[i]= PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value_fast, i));
+ array_double[i] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value_fast, i));
}
}
else {
float *array_float= array;
for (i=0; i<length; i++) {
- array_float[i]= PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value_fast, i));
+ array_float[i] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value_fast, i));
}
}
}
@@ -83,13 +83,13 @@ int PyC_AsArray(void *array, PyObject *value, const Py_ssize_t length,
/* could use is_double for 'long int' but no use now */
int *array_int= array;
for (i=0; i<length; i++) {
- array_int[i]= PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value_fast, i));
+ array_int[i] = PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value_fast, i));
}
}
else if (type == &PyBool_Type) {
int *array_bool= array;
for (i=0; i<length; i++) {
- array_bool[i]= (PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value_fast, i)) != 0);
+ array_bool[i] = (PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value_fast, i)) != 0);
}
}
else {
@@ -332,7 +332,7 @@ PyObject *PyC_ExceptionBuffer(void)
Py_INCREF(stdout_backup); // since these were borrowed we dont want them freed when replaced.
Py_INCREF(stderr_backup);
- PySys_SetObject("stdout", string_io); // both of these are free'd when restoring
+ PySys_SetObject("stdout", string_io); // both of these are freed when restoring
PySys_SetObject("stderr", string_io);
PyErr_Restore(error_type, error_value, error_traceback);
@@ -419,17 +419,17 @@ PyObject *PyC_UnicodeFromByte(const char *str)
}
/*****************************************************************************
-* Description: This function creates a new Python dictionary object.
-* note: dict is owned by sys.modules["__main__"] module, reference is borrowed
-* note: important we use the dict from __main__, this is what python expects
- for 'pickle' to work as well as strings like this...
- >> foo = 10
- >> print(__import__("__main__").foo)
-*
-* note: this overwrites __main__ which gives problems with nested calles.
-* be sure to run PyC_MainModule_Backup & PyC_MainModule_Restore if there is
-* any chance that python is in the call stack.
-*****************************************************************************/
+ * Description: This function creates a new Python dictionary object.
+ * note: dict is owned by sys.modules["__main__"] module, reference is borrowed
+ * note: important we use the dict from __main__, this is what python expects
+ * for 'pickle' to work as well as strings like this...
+ * >> foo = 10
+ * >> print(__import__("__main__").foo)
+ *
+ * note: this overwrites __main__ which gives problems with nested calles.
+ * be sure to run PyC_MainModule_Backup & PyC_MainModule_Restore if there is
+ * any chance that python is in the call stack.
+ ****************************************************************************/
PyObject *PyC_DefaultNameSpace(const char *filename)
{
PyInterpreterState *interp= PyThreadState_GET()->interp;
@@ -475,7 +475,7 @@ void PyC_SetHomePath(const char *py_path_bundle)
#ifdef __APPLE__
/* OSX allow file/directory names to contain : character (represented as / in the Finder)
- but current Python lib (release 3.1.1) doesn't handle these correctly */
+ * but current Python lib (release 3.1.1) doesn't handle these correctly */
if (strchr(py_path_bundle, ':'))
printf("Warning : Blender application is located in a path containing : or / chars\
\nThis may make python import function fail\n");
@@ -483,7 +483,7 @@ void PyC_SetHomePath(const char *py_path_bundle)
#ifdef _WIN32
/* cmake/MSVC debug build crashes without this, why only
- in this case is unknown.. */
+ * in this case is unknown.. */
{
BLI_setenv("PYTHONPATH", py_path_bundle);
}
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index b6e0897f626..8a74153646c 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -229,9 +229,9 @@ static PyObject *bpy_import_test(const char *modname)
return mod;
}
-/*****************************************************************************
-* Description: Creates the bpy module and adds it to sys.modules for importing
-*****************************************************************************/
+/******************************************************************************
+ * Description: Creates the bpy module and adds it to sys.modules for importing
+ ******************************************************************************/
void BPy_init_modules(void)
{
extern BPy_StructRNA *bpy_context_module;
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index 0641c220001..7cd672ba0c5 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -108,6 +108,8 @@ static PyObject *make_app_info(void)
PyStructSequence_SET_ITEM(app_info, pos++, PyLong_FromLong(flag))
#define SetStrItem(str) \
PyStructSequence_SET_ITEM(app_info, pos++, PyUnicode_FromString(str))
+#define SetBytesItem(str) \
+ PyStructSequence_SET_ITEM(app_info, pos++, PyBytes_FromString(str))
#define SetObjItem(obj) \
PyStructSequence_SET_ITEM(app_info, pos++, obj)
@@ -121,27 +123,28 @@ static PyObject *make_app_info(void)
SetStrItem(BLI_program_path());
SetObjItem(PyBool_FromLong(G.background));
- /* build info */
+ /* build info, use bytes since we can't assume _any_ encoding:
+ * see patch [#30154] for issue */
#ifdef BUILD_DATE
- SetStrItem(build_date);
- SetStrItem(build_time);
- SetStrItem(build_rev);
- SetStrItem(build_platform);
- SetStrItem(build_type);
- SetStrItem(build_cflags);
- SetStrItem(build_cxxflags);
- SetStrItem(build_linkflags);
- SetStrItem(build_system);
+ SetBytesItem(build_date);
+ SetBytesItem(build_time);
+ SetBytesItem(build_rev);
+ SetBytesItem(build_platform);
+ SetBytesItem(build_type);
+ SetBytesItem(build_cflags);
+ SetBytesItem(build_cxxflags);
+ SetBytesItem(build_linkflags);
+ SetBytesItem(build_system);
#else
- SetStrItem("Unknown");
- SetStrItem("Unknown");
- SetStrItem("Unknown");
- SetStrItem("Unknown");
- SetStrItem("Unknown");
- SetStrItem("Unknown");
- SetStrItem("Unknown");
- SetStrItem("Unknown");
- SetStrItem("Unknown");
+ SetBytesItem("Unknown");
+ SetBytesItem("Unknown");
+ SetBytesItem("Unknown");
+ SetBytesItem("Unknown");
+ SetBytesItem("Unknown");
+ SetBytesItem("Unknown");
+ SetBytesItem("Unknown");
+ SetBytesItem("Unknown");
+ SetBytesItem("Unknown");
#endif
SetObjItem(BPY_app_ffmpeg_struct());
@@ -149,6 +152,7 @@ static PyObject *make_app_info(void)
#undef SetIntItem
#undef SetStrItem
+#undef SetBytesItem
#undef SetObjItem
if (PyErr_Occurred()) {
diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c
index 721bce51693..f4962cd39b6 100644
--- a/source/blender/python/intern/bpy_app_handlers.c
+++ b/source/blender/python/intern/bpy_app_handlers.c
@@ -68,11 +68,11 @@ static PyStructSequence_Desc app_cb_info_desc = {
(sizeof(app_cb_info_fields) / sizeof(PyStructSequence_Field)) - 1
};
-/*
-#if (BLI_CB_EVT_TOT != ((sizeof(app_cb_info_fields)/sizeof(PyStructSequence_Field))))
-# error "Callbacks are out of sync"
+#if 0
+# if (BLI_CB_EVT_TOT != ((sizeof(app_cb_info_fields)/sizeof(PyStructSequence_Field))))
+# error "Callbacks are out of sync"
+# endif
#endif
-*/
/* --------------------------------------------------------------------------*/
/* permanent tagging code */
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 413b29e7e2d..1ef9c0d3214 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -77,7 +77,7 @@
/* for internal use, when starting and ending python scripts */
-/* incase a python script triggers another python call, stop bpy_context_clear from invalidating */
+/* in case a python script triggers another python call, stop bpy_context_clear from invalidating */
static int py_call_level = 0;
BPy_StructRNA *bpy_context_module = NULL; /* for fast access */
@@ -671,11 +671,11 @@ int BPY_context_member_get(bContext *C, const char *member, bContextDataResult *
PyObject *list_item = PySequence_Fast_GET_ITEM(seq_fast, i);
if (BPy_StructRNA_Check(list_item)) {
- /*
+#if 0
CollectionPointerLink *link = MEM_callocN(sizeof(CollectionPointerLink), "bpy_context_get");
link->ptr = ((BPy_StructRNA *)item)->ptr;
BLI_addtail(&result->list, link);
- */
+#endif
ptr = &(((BPy_StructRNA *)list_item)->ptr);
CTX_data_list_add(result, ptr->id.data, ptr->type, ptr->data);
}
diff --git a/source/blender/python/intern/bpy_interface_atexit.c b/source/blender/python/intern/bpy_interface_atexit.c
index 53775e7d893..536cb7785e4 100644
--- a/source/blender/python/intern/bpy_interface_atexit.c
+++ b/source/blender/python/intern/bpy_interface_atexit.c
@@ -92,5 +92,5 @@ void BPY_atexit_unregister(void)
BLI_assert(func_bpy_atregister != NULL);
atexit_func_call("unregister", func_bpy_atregister);
- func_bpy_atregister = NULL; /* don't really need to set but just incase */
+ func_bpy_atregister = NULL; /* don't really need to set but just in case */
}
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index 6a6e6595ed4..140e2f3ad7c 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -257,8 +257,7 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
}
BKE_reports_clear(reports);
- if ((reports->flag & RPT_FREE) == 0)
- {
+ if ((reports->flag & RPT_FREE) == 0) {
MEM_freeN(reports);
}
}
@@ -434,7 +433,7 @@ static PyObject *pyop_getinstance(PyObject *UNUSED(self), PyObject *value)
op = PyMem_MALLOC(sizeof(wmOperator));
memset(op, 0, sizeof(wmOperator));
#endif
- BLI_strncpy(op->idname, op->idname, sizeof(op->idname)); /* incase its needed */
+ BLI_strncpy(op->idname, op->idname, sizeof(op->idname)); /* in case its needed */
op->type = ot;
RNA_pointer_create(NULL, &RNA_Operator, op, &ptr);
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index 414ebe47e97..ac832611ded 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -59,13 +59,13 @@ extern BPy_StructRNA *bpy_context_module;
static EnumPropertyItem property_flag_items[] = {
{PROP_HIDDEN, "HIDDEN", 0, "Hidden", ""},
{PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""},
- {PROP_ANIMATABLE, "ANIMATABLE", 0, "Animateable", ""},
+ {PROP_ANIMATABLE, "ANIMATABLE", 0, "Animatable", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem property_flag_enum_items[] = {
{PROP_HIDDEN, "HIDDEN", 0, "Hidden", ""},
{PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""},
- {PROP_ANIMATABLE, "ANIMATABLE", 0, "Animateable", ""},
+ {PROP_ANIMATABLE, "ANIMATABLE", 0, "Animatable", ""},
{PROP_ENUM_FLAG, "ENUM_FLAG", 0, "Enum Flag", ""},
{0, NULL, 0, NULL, NULL}};
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index ab6d23ba4db..b543f426751 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -121,7 +121,7 @@ int pyrna_prop_validity_check(BPy_PropertyRNA *self)
static void pyrna_invalidate(BPy_DummyPointerRNA *self)
{
self->ptr.type = NULL; /* this is checked for validity */
- self->ptr.id.data = NULL; /* should not be needed but prevent bad pointer access, just incase */
+ self->ptr.id.data = NULL; /* should not be needed but prevent bad pointer access, just in case */
}
#endif
@@ -1284,7 +1284,7 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val)
else {
const char *ptr_name = RNA_struct_name_get_alloc(ptr, NULL, 0, NULL);
- /* prefer not fail silently incase of api errors, maybe disable it later */
+ /* prefer not fail silently in case of api errors, maybe disable it later */
printf("RNA Warning: Current value \"%d\" "
"matches no enum in '%s', '%s', '%s'\n",
val, RNA_struct_identifier(ptr->type),
@@ -1309,11 +1309,11 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val)
if (free)
MEM_freeN(enum_item);
- /*
+#if 0
PyErr_Format(PyExc_AttributeError,
"RNA Error: Current value \"%d\" matches no enum", val);
ret = NULL;
- */
+#endif
}
}
@@ -2549,10 +2549,12 @@ static PyObject *pyrna_prop_array_subscript(BPy_PropertyArrayRNA *self, PyObject
{
PYRNA_PROP_CHECK_OBJ((BPy_PropertyRNA *)self);
- /*if (PyUnicode_Check(key)) {
+#if 0
+ if (PyUnicode_Check(key)) {
return pyrna_prop_array_subscript_str(self, _PyUnicode_AsString(key));
}
- else */
+ else
+#endif
if (PyIndex_Check(key)) {
Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError);
if (i == -1 && PyErr_Occurred())
@@ -2619,7 +2621,7 @@ static int prop_subscript_ass_array_slice(PointerRNA *ptr, PropertyRNA *prop,
if (PySequence_Fast_GET_SIZE(value) != stop-start) {
Py_DECREF(value);
PyErr_SetString(PyExc_TypeError,
- "bpy_prop_array[slice] = value: resizing bpy_struct arrays isn't supported");
+ "bpy_prop_array[slice] = value: re-sizing bpy_struct arrays isn't supported");
return -1;
}
@@ -3359,7 +3361,7 @@ static PyObject *pyrna_struct_dir(BPy_StructRNA *self)
PYRNA_STRUCT_CHECK_OBJ(self);
- /* Include this incase this instance is a subtype of a python class
+ /* Include this in case this instance is a subtype of a python class
* In these instances we may want to return a function or variable provided by the subtype
* */
ret = PyList_New(0);
@@ -3496,7 +3498,7 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname)
name);
ret = NULL;
#endif
- /* Include this incase this instance is a subtype of a python class
+ /* Include this in case this instance is a subtype of a python class
* In these instances we may want to return a function or variable provided by the subtype
*
* Also needed to return methods when its not a subtype
@@ -3576,14 +3578,14 @@ static int pyrna_struct_meta_idprop_setattro(PyObject *cls, PyObject *attr, PyOb
if (srna == NULL) {
/* allow setting on unregistered classes which can be registered later on */
- /*
+#if 0
if (value && is_deferred_prop) {
PyErr_Format(PyExc_AttributeError,
"pyrna_struct_meta_idprop_setattro() unable to get srna from class '%.200s'",
((PyTypeObject *)cls)->tp_name);
return -1;
}
- */
+#endif
/* srna_from_self may set an error */
PyErr_Clear();
return PyType_Type.tp_setattro(cls, attr, value);
@@ -3693,7 +3695,7 @@ static PyObject *pyrna_prop_dir(BPy_PropertyRNA *self)
PyObject *ret;
PointerRNA r_ptr;
- /* Include this incase this instance is a subtype of a python class
+ /* Include this in case this instance is a subtype of a python class
* In these instances we may want to return a function or variable provided by the subtype
* */
ret = PyList_New(0);
@@ -4571,14 +4573,14 @@ static PyObject *pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject *
else if (PyType_IsSubtype(Py_TYPE(base), &pyrna_struct_Type)) {
/* this almost never runs, only when using user defined subclasses of built-in object.
* this isn't common since its NOT related to registerable subclasses. eg:
-
- >>> class MyObSubclass(bpy.types.Object):
- ... def test_func(self):
- ... print(100)
- ...
- >>> myob = MyObSubclass(bpy.context.object)
- >>> myob.test_func()
- 100
+ *
+ * >>> class MyObSubclass(bpy.types.Object):
+ * ... def test_func(self):
+ * ... print(100)
+ * ...
+ * >>> myob = MyObSubclass(bpy.context.object)
+ * >>> myob.test_func()
+ * 100
*
* Keep this since it could be useful.
*/
@@ -4866,7 +4868,7 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject
}
/* for testing */
- /*
+#if 0
{
const char *fn;
int lineno;
@@ -4874,7 +4876,7 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject
printf("pyrna_func_call > %.200s.%.200s : %.200s:%d\n",
RNA_struct_identifier(self_ptr->type), RNA_function_identifier(self_func), fn, lineno);
}
- */
+#endif
/* include the ID pointer for pyrna_param_to_py() so we can include the
* ID pointer on return values, this only works when returned values have
@@ -5104,14 +5106,14 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject
#ifdef DEBUG_STRING_FREE
- /*
+#if 0
if (PyList_GET_SIZE(string_free_ls)) {
printf("%.200s.%.200s(): has %d strings\n",
RNA_struct_identifier(self_ptr->type),
RNA_function_identifier(self_func),
(int)PyList_GET_SIZE(string_free_ls));
}
- */
+#endif
Py_DECREF(string_free_ls);
#undef DEBUG_STRING_FREE
#endif
@@ -6018,10 +6020,10 @@ static PyObject* pyrna_srna_Subtype(StructRNA *srna)
* mainly for the purposing of matching the C/rna type hierarchy */
else {
/* subclass equivalents
- - class myClass(myBase):
- some = 'value' # or ...
- - myClass = type(name='myClass', bases=(myBase,), dict={'__module__':'bpy.types'})
- */
+ * - class myClass(myBase):
+ * some = 'value' # or ...
+ * - myClass = type(name='myClass', bases=(myBase,), dict={'__module__':'bpy.types'})
+ */
/* Assume RNA_struct_py_type_get(srna) was already checked */
PyObject *py_base = pyrna_srna_PyBase(srna);
@@ -6523,8 +6525,10 @@ static int deferred_register_prop(StructRNA *srna, PyObject *key, PyObject *item
/* Since this is a class dict, ignore args that can't be passed */
/* for testing only */
- /* PyC_ObSpit("Why doesn't this work??", item);
- PyErr_Print(); */
+#if 0
+ PyC_ObSpit("Why doesn't this work??", item);
+ PyErr_Print();
+#endif
PyErr_Clear();
}
}
@@ -6886,9 +6890,12 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
rna_disallow_writes = TRUE;
/* 'almost' all the time calling the class isn't needed.
- * We could just do...
+ * We could just do... */
+#if 0
py_class_instance = py_srna;
Py_INCREF(py_class_instance);
+#endif
+ /*
* This would work fine but means __init__ functions wouldnt run.
* none of blenders default scripts use __init__ but its nice to call it
* for general correctness. just to note why this is here when it could be safely removed.
@@ -7230,14 +7237,14 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class
return NULL;
/* fails in cases, cant use this check but would like to :| */
- /*
+#if 0
if (RNA_struct_py_type_get(srna)) {
PyErr_Format(PyExc_ValueError,
"register_class(...): %.200s's parent class %.200s is already registered, this is not allowed",
((PyTypeObject *)py_class)->tp_name, RNA_struct_identifier(srna));
return NULL;
}
- */
+#endif
/* check that we have a register callback for this type */
reg = RNA_struct_register(srna);
@@ -7271,7 +7278,7 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class
pyrna_subtype_set_rna(py_class, srna_new); /* takes a ref to py_class */
- /* old srna still references us, keep the check incase registering somehow can free it */
+ /* old srna still references us, keep the check in case registering somehow can free it */
if (RNA_struct_py_type_get(srna)) {
RNA_struct_py_type_set(srna, NULL);
// Py_DECREF(py_class); // should be able to do this XXX since the old rna adds a new ref.
@@ -7352,11 +7359,13 @@ static PyObject *pyrna_unregister_class(PyObject *UNUSED(self), PyObject *py_cla
return NULL;
}
- /*if (PyDict_GetItem(((PyTypeObject *)py_class)->tp_dict, bpy_intern_str_bl_rna) == NULL) {
+#if 0
+ if (PyDict_GetItem(((PyTypeObject *)py_class)->tp_dict, bpy_intern_str_bl_rna) == NULL) {
PWM_cursor_wait(0);
PyErr_SetString(PyExc_ValueError, "unregister_class(): not a registered as a subclass");
return NULL;
- }*/
+ }
+#endif
if (!pyrna_write_check()) {
PyErr_Format(PyExc_RuntimeError,
diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c
index a74d0417ca2..187db194c36 100644
--- a/source/blender/python/intern/bpy_rna_array.c
+++ b/source/blender/python/intern/bpy_rna_array.c
@@ -50,17 +50,17 @@ typedef void (*RNA_SetArrayFunc)(PointerRNA *, PropertyRNA *, const char *);
typedef void (*RNA_SetIndexFunc)(PointerRNA *, PropertyRNA *, int index, void *);
/*
- arr[3][4][5]
- 0 1 2 <- dimension index
-*/
+ * arr[3][4][5]
+ * 0 1 2 <- dimension index
+ */
/*
- arr[2] = x
-
- py_to_array_index(arraydim=0, arrayoffset=0, index=2)
- validate_array(lvalue_dim=0)
- ... make real index ...
-*/
+ * arr[2] = x
+ *
+ * py_to_array_index(arraydim=0, arrayoffset=0, index=2)
+ * validate_array(lvalue_dim=0)
+ * ... make real index ...
+ */
/* arr[3] = x, self->arraydim is 0, lvalue_dim is 1 */
/* Ensures that a python sequence has expected number of items/sub-items and items are of desired type. */
@@ -101,8 +101,8 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[]
* dim = 0 */
else if (PySequence_Size(item) != dimsize[dim + 1]) {
/* BLI_snprintf(error_str, error_str_size,
- "sequences of dimension %d should contain %d items",
- (int)dim + 1, (int)dimsize[dim + 1]); */
+ * "sequences of dimension %d should contain %d items",
+ * (int)dim + 1, (int)dimsize[dim + 1]); */
PyErr_Format(PyExc_ValueError, "%s sequences of dimension %d should contain %d items",
error_prefix, (int)dim + 1, (int)dimsize[dim + 1]);
ok = 0;
@@ -205,8 +205,8 @@ static int validate_array_length(PyObject *rvalue, PointerRNA *ptr, PropertyRNA
/* length is flexible */
if (!RNA_property_dynamic_array_set_length(ptr, prop, tot)) {
/* BLI_snprintf(error_str, error_str_size,
- "%s.%s: array length cannot be changed to %d",
- RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), tot); */
+ * "%s.%s: array length cannot be changed to %d",
+ * RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), tot); */
PyErr_Format(PyExc_ValueError, "%s %s.%s: array length cannot be changed to %d",
error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), tot);
return -1;
@@ -232,18 +232,18 @@ static int validate_array_length(PyObject *rvalue, PointerRNA *ptr, PropertyRNA
len = 1;
/* arr[3][4][5]
-
- arr[2] = x
- dimsize = {4, 5}
- dimsize[1] = 4
- dimsize[2] = 5
- lvalue_dim = 0, totdim = 3
-
- arr[2][3] = x
- lvalue_dim = 1
-
- arr[2][3][4] = x
- lvalue_dim = 2 */
+ *
+ * arr[2] = x
+ * dimsize = {4, 5}
+ * dimsize[1] = 4
+ * dimsize[2] = 5
+ * lvalue_dim = 0, totdim = 3
+ *
+ * arr[2][3] = x
+ * lvalue_dim = 1
+ *
+ * arr[2][3][4] = x
+ * lvalue_dim = 2 */
for (i = lvalue_dim; i < totdim; i++)
len *= dimsize[i];
}
@@ -462,12 +462,12 @@ static int py_to_array_index(PyObject *py, PointerRNA *ptr, PropertyRNA *prop,
/* convert index */
/* arr[3][4][5]
-
- arr[2] = x
- lvalue_dim = 0, index = 0 + 2 * 4 * 5
-
- arr[2][3] = x
- lvalue_dim = 1, index = 40 + 3 * 5 */
+ *
+ * arr[2] = x
+ * lvalue_dim = 0, index = 0 + 2 * 4 * 5
+ *
+ * arr[2][3] = x
+ * lvalue_dim = 1, index = 40 + 3 * 5 */
lvalue_dim++;
@@ -677,12 +677,12 @@ PyObject *pyrna_py_from_array_index(BPy_PropertyArrayRNA *self, PointerRNA *ptr,
ret->arraydim = arraydim + 1;
/* arr[3][4][5]
-
- x = arr[2]
- index = 0 + 2 * 4 * 5
-
- x = arr[2][3]
- index = offset + 3 * 5 */
+ *
+ * x = arr[2]
+ * index = 0 + 2 * 4 * 5
+ *
+ * x = arr[2][3]
+ * index = offset + 3 * 5 */
for (i = arraydim + 1; i < totdim; i++)
index *= dimsize[i];
diff --git a/source/blender/python/intern/bpy_traceback.c b/source/blender/python/intern/bpy_traceback.c
index e3272c9da1a..01eb2653681 100644
--- a/source/blender/python/intern/bpy_traceback.c
+++ b/source/blender/python/intern/bpy_traceback.c
@@ -29,6 +29,9 @@
#include <Python.h>
#include <frameobject.h>
+#include "BLI_path_util.h"
+#include "BLI_string.h"
+
#include "bpy_traceback.h"
static const char *traceback_filepath(PyTracebackObject *tb, PyObject **coerce)
@@ -127,8 +130,8 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset)
if (parse_syntax_error(value, &message, &filename, lineno, offset, &text)) {
/* python adds a '/', prefix, so check for both */
- if ((strcmp(filename, filepath) == 0) ||
- ((filename[0] == '\\' || filename[0] == '/') && strcmp(filename + 1, filepath) == 0)
+ if ((BLI_path_cmp(filename, filepath) == 0) ||
+ ((filename[0] == '\\' || filename[0] == '/') && BLI_path_cmp(filename + 1, filepath) == 0)
) {
/* good */
}
@@ -152,7 +155,7 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset)
{
PyObject *coerce;
const char *tb_filepath = traceback_filepath(tb, &coerce);
- const int match = strcmp(tb_filepath, filepath) != 0;
+ const int match = BLI_path_cmp(tb_filepath, filepath) != 0;
Py_DECREF(coerce);
if (match) {
diff --git a/source/blender/python/intern/gpu.c b/source/blender/python/intern/gpu.c
index 9c1fc07108a..552abaaf414 100644
--- a/source/blender/python/intern/gpu.c
+++ b/source/blender/python/intern/gpu.c
@@ -70,7 +70,7 @@ static struct PyModuleDef gpumodule = {
"gpu", /* name of module */
M_gpu_doc, /* module documentation */
-1, /* size of per-interpreter state of the module,
- or -1 if the module keeps state in global variables. */
+ * or -1 if the module keeps state in global variables. */
NULL, NULL, NULL, NULL, NULL
};
diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c
index e6be81f88a3..8e4d3955c80 100644
--- a/source/blender/python/mathutils/mathutils.c
+++ b/source/blender/python/mathutils/mathutils.c
@@ -163,7 +163,7 @@ int mathutils_array_parse_alloc(float **array, int array_min, PyObject *value, c
#endif
{
PyObject *value_fast = NULL;
- //*array = NULL;
+ // *array = NULL;
/* non list/tuple cases */
if (!(value_fast = PySequence_Fast(value, error_prefix))) {
@@ -257,7 +257,7 @@ int EXPP_FloatsAreEqual(float af, float bf, int maxDiff)
}
/*---------------------- EXPP_VectorsAreEqual -------------------------
- Builds on EXPP_FloatsAreEqual to test vectors */
+ * Builds on EXPP_FloatsAreEqual to test vectors */
int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps)
{
int x;
diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c
index 7f3f811c41a..e925b115178 100644
--- a/source/blender/python/mathutils/mathutils_Color.c
+++ b/source/blender/python/mathutils/mathutils_Color.c
@@ -619,7 +619,7 @@ static PyObject *Color_idiv(PyObject *v1, PyObject *v2)
}
/* -obj
- returns the negative of this object */
+ * returns the negative of this object */
static PyObject *Color_neg(ColorObject *self)
{
float tcol[COLOR_SIZE];
@@ -848,10 +848,10 @@ PyTypeObject color_Type = {
};
//------------------------Color_CreatePyObject (internal)-------------
//creates a new color object
-/*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
- (i.e. it was allocated elsewhere by MEM_mallocN())
- pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
- (i.e. it must be created here with PyMEM_malloc())*/
+/* pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
+ * (i.e. it was allocated elsewhere by MEM_mallocN())
+ * pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
+ * (i.e. it must be created here with PyMEM_malloc())*/
PyObject *Color_CreatePyObject(float *col, int type, PyTypeObject *base_type)
{
ColorObject *self;
diff --git a/source/blender/python/mathutils/mathutils_Color.h b/source/blender/python/mathutils/mathutils_Color.h
index 786afeed5da..cfa83a9630e 100644
--- a/source/blender/python/mathutils/mathutils_Color.h
+++ b/source/blender/python/mathutils/mathutils_Color.h
@@ -42,10 +42,10 @@ typedef struct {
BASE_MATH_MEMBERS(col);
} ColorObject;
-/*struct data contains a pointer to the actual data that the
-object uses. It can use either PyMem allocated data (which will
-be stored in py_data) or be a wrapper for data allocated through
-blender (stored in blend_data). This is an either/or struct not both*/
+/* struct data contains a pointer to the actual data that the
+ * object uses. It can use either PyMem allocated data (which will
+ * be stored in py_data) or be a wrapper for data allocated through
+ * blender (stored in blend_data). This is an either/or struct not both*/
//prototypes
PyObject *Color_CreatePyObject( float *col, int type, PyTypeObject *base_type);
diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c
index 66caed50aa9..17e4115233b 100644
--- a/source/blender/python/mathutils/mathutils_Euler.c
+++ b/source/blender/python/mathutils/mathutils_Euler.c
@@ -691,10 +691,10 @@ PyTypeObject euler_Type = {
};
//------------------------Euler_CreatePyObject (internal)-------------
//creates a new euler object
-/*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
- (i.e. it was allocated elsewhere by MEM_mallocN())
- pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
- (i.e. it must be created here with PyMEM_malloc())*/
+/* pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
+ * (i.e. it was allocated elsewhere by MEM_mallocN())
+ * pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
+ * (i.e. it must be created here with PyMEM_malloc())*/
PyObject *Euler_CreatePyObject(float *eul, short order, int type, PyTypeObject *base_type)
{
EulerObject *self;
diff --git a/source/blender/python/mathutils/mathutils_Euler.h b/source/blender/python/mathutils/mathutils_Euler.h
index 3656aa14461..d9ed86401dc 100644
--- a/source/blender/python/mathutils/mathutils_Euler.h
+++ b/source/blender/python/mathutils/mathutils_Euler.h
@@ -44,10 +44,10 @@ typedef struct {
} EulerObject;
-/*struct data contains a pointer to the actual data that the
-object uses. It can use either PyMem allocated data (which will
-be stored in py_data) or be a wrapper for data allocated through
-blender (stored in blend_data). This is an either/or struct not both */
+/* struct data contains a pointer to the actual data that the
+ * object uses. It can use either PyMem allocated data (which will
+ * be stored in py_data) or be a wrapper for data allocated through
+ * blender (stored in blend_data). This is an either/or struct not both */
//prototypes
PyObject *Euler_CreatePyObject( float *eul, short order, int type, PyTypeObject *base_type);
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index d4f07def6d1..ea329b17013 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -1218,8 +1218,6 @@ static PyObject *Matrix_invert(MatrixObject *self)
z++;
}
}
- /*transpose
- Matrix_transpose(self);*/
}
else {
PyErr_SetString(PyExc_ValueError,
@@ -1631,15 +1629,15 @@ static PyObject *Matrix_richcmpr(PyObject *a, PyObject *b, int op)
}
/*---------------------SEQUENCE PROTOCOLS------------------------
- ----------------------------len(object)------------------------
- sequence length */
+ * ----------------------------len(object)------------------------
+ * sequence length */
static int Matrix_len(MatrixObject *self)
{
return (self->num_row);
}
/*----------------------------object[]---------------------------
- sequence accessor (get)
- the wrapped vector gives direct access to the matrix data */
+ * sequence accessor (get)
+ * the wrapped vector gives direct access to the matrix data */
static PyObject *Matrix_item_row(MatrixObject *self, int row)
{
if (BaseMath_ReadCallback(self) == -1)
@@ -1669,7 +1667,7 @@ static PyObject *Matrix_item_col(MatrixObject *self, int col)
}
/*----------------------------object[]-------------------------
- sequence accessor (set) */
+ * sequence accessor (set) */
static int Matrix_ass_item_row(MatrixObject *self, int row, PyObject *value)
{
@@ -1724,7 +1722,7 @@ static int Matrix_ass_item_col(MatrixObject *self, int col, PyObject *value)
/*----------------------------object[z:y]------------------------
- sequence slice (get)*/
+ * sequence slice (get)*/
static PyObject *Matrix_slice(MatrixObject *self, int begin, int end)
{
@@ -1748,7 +1746,7 @@ static PyObject *Matrix_slice(MatrixObject *self, int begin, int end)
return tuple;
}
/*----------------------------object[z:y]------------------------
- sequence slice (set)*/
+ * sequence slice (set)*/
static int Matrix_ass_slice(MatrixObject *self, int begin, int end, PyObject *value)
{
PyObject *value_fast = NULL;
@@ -1807,7 +1805,7 @@ static int Matrix_ass_slice(MatrixObject *self, int begin, int end, PyObject *va
}
}
/*------------------------NUMERIC PROTOCOLS----------------------
- ------------------------obj + obj------------------------------*/
+ *------------------------obj + obj------------------------------*/
static PyObject *Matrix_add(PyObject *m1, PyObject *m2)
{
float mat[16];
@@ -1839,7 +1837,7 @@ static PyObject *Matrix_add(PyObject *m1, PyObject *m2)
return Matrix_CreatePyObject(mat, mat1->num_col, mat1->num_row, Py_NEW, Py_TYPE(mat1));
}
/*------------------------obj - obj------------------------------
- subtraction*/
+ * subtraction */
static PyObject *Matrix_sub(PyObject *m1, PyObject *m2)
{
float mat[16];
@@ -1872,7 +1870,7 @@ static PyObject *Matrix_sub(PyObject *m1, PyObject *m2)
return Matrix_CreatePyObject(mat, mat1->num_col, mat1->num_row, Py_NEW, Py_TYPE(mat1));
}
/*------------------------obj * obj------------------------------
- mulplication*/
+ * mulplication */
static PyObject *matrix_mul_float(MatrixObject *mat, const float scalar)
{
float tmat[16];
diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c
index c5159ce0fa2..b3767d2b8bb 100644
--- a/source/blender/python/mathutils/mathutils_Quaternion.c
+++ b/source/blender/python/mathutils/mathutils_Quaternion.c
@@ -854,7 +854,7 @@ static PyObject *Quaternion_mul(PyObject *q1, PyObject *q2)
}
/* -obj
- returns the negative of this object*/
+ * returns the negative of this object*/
static PyObject *Quaternion_neg(QuaternionObject *self)
{
float tquat[QUAT_SIZE];
@@ -1232,9 +1232,9 @@ PyTypeObject quaternion_Type = {
//------------------------Quaternion_CreatePyObject (internal)-------------
//creates a new quaternion object
/*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
- (i.e. it was allocated elsewhere by MEM_mallocN())
- pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
- (i.e. it must be created here with PyMEM_malloc())*/
+ * (i.e. it was allocated elsewhere by MEM_mallocN())
+ * pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
+ * (i.e. it must be created here with PyMEM_malloc())*/
PyObject *Quaternion_CreatePyObject(float *quat, int type, PyTypeObject *base_type)
{
QuaternionObject *self;
diff --git a/source/blender/python/mathutils/mathutils_Quaternion.h b/source/blender/python/mathutils/mathutils_Quaternion.h
index 8e91f26b08f..556e6d80948 100644
--- a/source/blender/python/mathutils/mathutils_Quaternion.h
+++ b/source/blender/python/mathutils/mathutils_Quaternion.h
@@ -42,10 +42,10 @@ typedef struct {
BASE_MATH_MEMBERS(quat);
} QuaternionObject;
-/*struct data contains a pointer to the actual data that the
-object uses. It can use either PyMem allocated data (which will
-be stored in py_data) or be a wrapper for data allocated through
-blender (stored in blend_data). This is an either/or struct not both*/
+/* struct data contains a pointer to the actual data that the
+ * object uses. It can use either PyMem allocated data (which will
+ * be stored in py_data) or be a wrapper for data allocated through
+ * blender (stored in blend_data). This is an either/or struct not both */
//prototypes
PyObject *Quaternion_CreatePyObject( float *quat, int type, PyTypeObject *base_type);
diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c
index 765df7afcf9..6a7ace9c2a4 100644
--- a/source/blender/python/mathutils/mathutils_Vector.c
+++ b/source/blender/python/mathutils/mathutils_Vector.c
@@ -40,8 +40,8 @@
#define MAX_DIMENSIONS 4
/* Swizzle axes get packed into a single value that is used as a closure. Each
- axis uses SWIZZLE_BITS_PER_AXIS bits. The first bit (SWIZZLE_VALID_AXIS) is
- used as a sentinel: if it is unset, the axis is not valid. */
+ * axis uses SWIZZLE_BITS_PER_AXIS bits. The first bit (SWIZZLE_VALID_AXIS) is
+ * used as a sentinel: if it is unset, the axis is not valid. */
#define SWIZZLE_BITS_PER_AXIS 3
#define SWIZZLE_VALID_AXIS 0x4
#define SWIZZLE_AXIS 0x3
@@ -439,8 +439,6 @@ static PyObject *Vector_resized(VectorObject *self, PyObject *value)
int size;
float *vec;
- /*if (!PyArg_ParseTuple(args, "i:resize", &size))
- return NULL;*/
if ((size = PyLong_AsLong(value)) == -1) {
return NULL;
}
@@ -788,9 +786,9 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
}
/*
- flip vector around, since vectoquat expect a vector from target to tracking object
- and the python function expects the inverse (a vector to the target).
- */
+ * flip vector around, since vectoquat expect a vector from target to tracking object
+ * and the python function expects the inverse (a vector to the target).
+ */
negate_v3_v3(vec, self->vec);
vec_to_quat(quat, vec, track, up);
@@ -1476,7 +1474,7 @@ static PyObject *Vector_isub(PyObject *v1, PyObject *v2)
}
/*------------------------obj * obj------------------------------
- mulplication*/
+ * mulplication*/
/* COLUMN VECTOR Multiplication (Matrix X Vector)
@@ -1643,7 +1641,7 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
return NULL;
/* only support vec*=float and vec*=mat
- vec*=vec result is a float so that wont work */
+ * vec*=vec result is a float so that wont work */
if (MatrixObject_Check(v2)) {
/* ------ to be removed ------*/
#if 1
@@ -1785,7 +1783,7 @@ static PyObject *Vector_idiv(PyObject *v1, PyObject *v2)
}
/* -obj
- returns the negative of this object*/
+ * returns the negative of this object*/
static PyObject *Vector_neg(VectorObject *self)
{
float *tvec;
@@ -1801,16 +1799,16 @@ static PyObject *Vector_neg(VectorObject *self)
/*------------------------vec_magnitude_nosqrt (internal) - for comparing only */
static double vec_magnitude_nosqrt(float *data, int size)
{
- /*return (double)sqrt(dot);*/
+ /* return (double)sqrt(dot);*/
/* warning, line above removed because we are not using the length,
- rather the comparing the sizes and for this we do not need the sqrt
- for the actual length, the dot must be sqrt'd */
+ * rather the comparing the sizes and for this we do not need the sqrt
+ * for the actual length, the dot must be sqrt'd */
return dot_vn_vn(data, data, size);
}
/*------------------------tp_richcmpr
- returns -1 execption, 0 false, 1 true */
+ * returns -1 execption, 0 false, 1 true */
static PyObject *Vector_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type)
{
VectorObject *vecA = NULL, *vecB = NULL;
@@ -2147,7 +2145,7 @@ static PyObject *Vector_swizzle_get(VectorObject *self, void *closure)
* - If the value is scalar, it is copied to all axes listed in the swizzle.
* - If an axis appears more than once in the swizzle, the final occurrence is
* the one that determines its value.
-
+ *
* Returns 0 on success and -1 on failure. On failure, the vector will be
* unchanged. */
static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure)
@@ -2719,10 +2717,10 @@ static struct PyMethodDef Vector_methods[] = {
/* Note
- Py_TPFLAGS_CHECKTYPES allows us to avoid casting all types to Vector when coercing
- but this means for eg that
- vec*mat and mat*vec both get sent to Vector_mul and it neesd to sort out the order
-*/
+ * Py_TPFLAGS_CHECKTYPES allows us to avoid casting all types to Vector when coercing
+ * but this means for eg that
+ * (vec * mat) and (mat * vec) both get sent to Vector_mul and it neesd to sort out the order
+ */
PyDoc_STRVAR(vector_doc,
"This object gives access to Vectors in Blender."
@@ -2809,11 +2807,11 @@ PyTypeObject vector_Type = {
};
/*------------------------Vector_CreatePyObject (internal)-------------
- creates a new vector object
- pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
- (i.e. it was allocated elsewhere by MEM_mallocN())
- pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
- (i.e. it must be created here with PyMEM_malloc())*/
+ * creates a new vector object
+ * pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
+ * (i.e. it was allocated elsewhere by MEM_mallocN())
+ * pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
+ * (i.e. it must be created here with PyMEM_malloc())*/
PyObject *Vector_CreatePyObject(float *vec, const int size, const int type, PyTypeObject *base_type)
{
VectorObject *self;
diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c
index b4f3f4e470e..bddd8027f93 100644
--- a/source/blender/python/mathutils/mathutils_geometry.c
+++ b/source/blender/python/mathutils/mathutils_geometry.c
@@ -1120,7 +1120,7 @@ static PyObject *M_Geometry_tesselate_polygon(PyObject *UNUSED(self), PyObject *
filldisplist(&dispbase, &dispbase, 0);
/* The faces are stored in a new DisplayList
- thats added to the head of the listbase */
+ * thats added to the head of the listbase */
dl = dispbase.first;
tri_list = PyList_New(dl->parts);
diff --git a/source/blender/python/mathutils/mathutils_noise.c b/source/blender/python/mathutils/mathutils_noise.c
index 47e93492e7a..8114e32a5fb 100644
--- a/source/blender/python/mathutils/mathutils_noise.c
+++ b/source/blender/python/mathutils/mathutils_noise.c
@@ -64,50 +64,50 @@
/*-----------------------------------------*/
/* 'mersenne twister' random number generator */
-/*
- A C-program for MT19937, with initialization improved 2002/2/10.
- Coded by Takuji Nishimura and Makoto Matsumoto.
- This is a faster version by taking Shawn Cokus's optimization,
- Matthe Bellew's simplification, Isaku Wada's real version.
-
- Before using, initialize the state by using init_genrand(seed)
- or init_by_array(init_key, key_length).
-
- Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. The names of its contributors may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
- Any feedback is very welcome.
- http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
- email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
-*/
+/*
+ * A C-program for MT19937, with initialization improved 2002/2/10.
+ * Coded by Takuji Nishimura and Makoto Matsumoto.
+ * This is a faster version by taking Shawn Cokus's optimization,
+ * Matthe Bellew's simplification, Isaku Wada's real version.
+ *
+ * Before using, initialize the state by using init_genrand(seed)
+ * or init_by_array(init_key, key_length).
+ *
+ * Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 3. The names of its contributors may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * Any feedback is very welcome.
+ * http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
+ * email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
+ */
/* Period parameters */
#define N 624
@@ -237,7 +237,7 @@ static float turb(float x, float y, float z, int oct, int hard, int nb,
}
/* Fills an array of length 3 with the turbulence vector for a given
-position (x, y, z) */
+ * position (x, y, z) */
static void vTurb(float x, float y, float z, int oct, int hard, int nb,
float ampscale, float freqscale, float v[3])
{
@@ -321,7 +321,7 @@ static PyObject *M_Noise_random_unit_vector(PyObject *UNUSED(self), PyObject *ar
return Vector_CreatePyObject(vec, size, Py_NEW, NULL);
}
/* This is dumb, most people will want a unit vector anyway, since this doesn't have uniform distribution over a sphere*/
-/*
+#if 0
PyDoc_STRVAR(M_Noise_random_vector_doc,
".. function:: random_vector(size=3)\n"
"\n"
@@ -349,7 +349,7 @@ static PyObject *M_Noise_random_vector(PyObject *UNUSED(self), PyObject *args)
return Vector_CreatePyObject(vec, size, Py_NEW, NULL);
}
-*/
+#endif
PyDoc_STRVAR(M_Noise_seed_set_doc,
".. function:: seed_set(seed)\n"
diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt
index 4ca8f6213bb..5be10f56d7a 100644
--- a/source/blender/render/CMakeLists.txt
+++ b/source/blender/render/CMakeLists.txt
@@ -27,6 +27,7 @@
set(INC
extern/include
intern/include
+ ../blenfont
../blenkernel
../blenlib
../blenloader
diff --git a/source/blender/render/SConscript b/source/blender/render/SConscript
index 5af2bf05ef3..46e483a7194 100644
--- a/source/blender/render/SConscript
+++ b/source/blender/render/SConscript
@@ -5,7 +5,7 @@ sources = env.Glob('intern/source/*.c')
raysources = env.Glob('intern/raytrace/*.cpp')
incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna ../makesrna'
-incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf'
+incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf ../blenfont'
incs += ' ../include ../blenloader ../../../intern/smoke/extern ../../../intern/mikktspace ../bmesh'
incs += ' ../freestyle'
diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h
index 8da4738eab7..6c64545a8c7 100644
--- a/source/blender/render/extern/include/RE_pipeline.h
+++ b/source/blender/render/extern/include/RE_pipeline.h
@@ -58,12 +58,12 @@ struct EnvMap;
typedef struct Render Render;
/* Render Result usage:
-
-- render engine allocates/frees and delivers raw floating point rects
-- right now it's full rects, but might become tiles or file
-- the display client has to allocate display rects, sort out what to display,
- and how it's converted
-*/
+ *
+ * - render engine allocates/frees and delivers raw floating point rects
+ * - right now it's full rects, but might become tiles or file
+ * - the display client has to allocate display rects, sort out what to display,
+ * and how it's converted
+ */
typedef struct RenderPass {
struct RenderPass *next, *prev;
diff --git a/source/blender/render/intern/include/pixelblending.h b/source/blender/render/intern/include/pixelblending.h
index 16d67fb95fe..97d41107856 100644
--- a/source/blender/render/intern/include/pixelblending.h
+++ b/source/blender/render/intern/include/pixelblending.h
@@ -33,7 +33,7 @@
/**
-* add 1 pixel to into filtered three lines
+ * add 1 pixel to into filtered three lines
* (float vecs to float vec)
*/
void add_filt_fmask(unsigned int mask, float *col, float *rowbuf, int row_w);
diff --git a/source/blender/render/intern/include/pixelshading.h b/source/blender/render/intern/include/pixelshading.h
index c0adc36f3a3..00d731912b6 100644
--- a/source/blender/render/intern/include/pixelshading.h
+++ b/source/blender/render/intern/include/pixelshading.h
@@ -25,15 +25,10 @@
/** \file blender/render/intern/include/pixelshading.h
* \ingroup render
+ *
+ * These functions determine what actual color a pixel will have.
*/
-
-/* pixelshading.h
-*
-* These functions determine what actual color a pixel will have.
-*/
-
-
#ifndef __PIXELSHADING_H__
#define __PIXELSHADING_H__
diff --git a/source/blender/render/intern/include/rayintersection.h b/source/blender/render/intern/include/rayintersection.h
index 934bf92db8f..4dceae56a4c 100644
--- a/source/blender/render/intern/include/rayintersection.h
+++ b/source/blender/render/intern/include/rayintersection.h
@@ -59,7 +59,7 @@ typedef struct RayHint {
typedef struct Isect {
/* ray start, direction (normalized vector), and max distance. on hit,
- the distance is modified to be the distance to the hit point. */
+ * the distance is modified to be the distance to the hit point. */
float start[3];
float dir[3];
float dist;
diff --git a/source/blender/render/intern/include/rayobject.h b/source/blender/render/intern/include/rayobject.h
index c43712ab95e..ce20ce4ea46 100644
--- a/source/blender/render/intern/include/rayobject.h
+++ b/source/blender/render/intern/include/rayobject.h
@@ -43,11 +43,10 @@ struct RayHint;
struct VlakRen;
/* RayObject
-
- Can be a face/triangle, bvh tree, object instance, etc. This is the
- public API used by the renderer, see rayobject_internal.h for the
- internal implementation details. */
-
+ * Can be a face/triangle, bvh tree, object instance, etc. This is the
+ * public API used by the renderer, see rayobject_internal.h for the
+ * internal implementation details.
+ * */
typedef struct RayObject RayObject;
/* Intersection, see rayintersection.h */
@@ -74,8 +73,8 @@ void RE_rayobject_free(RayObject *r);
void RE_rayobject_set_control(RayObject *r, void *data, int (*test_break)(void *data));
/* RayObject representing faces, all data is locally available instead
- of referring to some external data structure, for possibly faster
- intersection tests. */
+ * of referring to some external data structure, for possibly faster
+ * intersection tests. */
typedef struct RayFace {
float v1[4], v2[4], v3[4], v4[3];
@@ -89,8 +88,8 @@ 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 dependent on
- render structures. */
+ * allowing to save memory, but making code triangle intersection dependent on
+ * render structures. */
typedef struct VlakPrimitive {
struct ObjectInstanceRen *ob;
@@ -104,10 +103,10 @@ RayObject* RE_vlakprimitive_from_vlak(VlakPrimitive *face, struct ObjectInstance
/* extend min/max coords so that the rayobject is inside them */
void RE_rayobject_merge_bb(RayObject *ob, float *min, float *max);
-/* initializes an hint for optiming raycast where it is know that a ray will pass by the given BB often the origin point */
+/* initializes an hint for optimizing raycast where it is know that a ray will pass by the given BB often the origin point */
void RE_rayobject_hint_bb(RayObject *r, struct RayHint *hint, float *min, float *max);
-/* initializes an hint for optiming raycast where it is know that a ray will be contained inside the given cone*/
+/* initializes an hint for optimizing raycast where it is know that a ray will be contained inside the given cone*/
/* void RE_rayobject_hint_cone(RayObject *r, struct RayHint *hint, float *); */
/* Internals */
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h
index 9337dc63b62..fc64f0a6e1b 100644
--- a/source/blender/render/intern/include/render_types.h
+++ b/source/blender/render/intern/include/render_types.h
@@ -131,8 +131,8 @@ struct Render
/* a list of RenderResults, for fullsample */
ListBase fullresult;
/* read/write mutex, all internal code that writes to re->result must use a
- write lock, all external code must use a read lock. internal code is assumed
- to not conflict with writes, so no lock used for that */
+ * write lock, all external code must use a read lock. internal code is assumed
+ * to not conflict with writes, so no lock used for that */
ThreadRWMutex resultmutex;
/* window size, display rect, viewplane */
@@ -149,7 +149,7 @@ struct Render
/* real maximum amount of xparts/yparts after correction for minimum */
int xparts, yparts;
/* real maximum size of parts after correction for minimum
- partx*xparts can be larger than rectx, in that case last part is smaller */
+ * partx*xparts can be larger than rectx, in that case last part is smaller */
int partx, party;
/* values for viewing */
@@ -231,8 +231,8 @@ struct Render
ListBase freestyle_renders;
/* arena for allocating data for use during render, for
- * example dynamic TFaces to go in the VlakRen structure.
- */
+ * example dynamic TFaces to go in the VlakRen structure.
+ */
struct MemArena *memArena;
/* callbacks */
diff --git a/source/blender/render/intern/include/sunsky.h b/source/blender/render/intern/include/sunsky.h
index 5076a1541af..62b68484629 100644
--- a/source/blender/render/intern/include/sunsky.h
+++ b/source/blender/render/intern/include/sunsky.h
@@ -24,11 +24,6 @@
* \ingroup render
*/
-/**
- * This feature comes from Preetham paper on "A Practical Analytic Model for Daylight"
- * and example code from Brian Smits, another author of that paper in
- * http://www.cs.utah.edu/vissim/papers/sunsky/code/
- * */
#ifndef __SUNSKY_H__
#define __SUNSKY_H__
@@ -41,14 +36,14 @@ typedef struct SunSky
short effect_type, skyblendtype, sky_colorspace;
float turbidity;
float theta, phi;
-
+
float toSun[3];
/*float sunSpectralRaddata[SPECTRUM_MAX_COMPONENTS];*/
float sunSolidAngle;
float zenith_Y, zenith_x, zenith_y;
-
+
float perez_Y[5], perez_x[5], perez_y[5];
/* suggested by glome in
@@ -75,75 +70,16 @@ typedef struct SunSky
float atm_BetaMie[3];
float atm_BetaDashMie[3];
float atm_BetaRM[3];
-}SunSky;
+} SunSky;
-/**
- * InitSunSky:
- * this function compute some sun,sky parameters according to input parameters and also initiate some other sun, sky parameters
- * parameters:
- * sunSky, is a structure that contains informtion about sun, sky and atmosphere, in this function, most of its values initiated
- * turb, is atmosphere turbidity
- * toSun, contains sun direction
- * horizon_brighness, controls the brightness of the horizon colors
- * spread, controls colors spreed at horizon
- * sun_brightness, controls sun's brightness
- * sun_size, controls sun's size
- * back_scatter, controls back scatter light
- * */
void InitSunSky(struct SunSky *sunsky, float turb, float *toSun, float horizon_brightness,
- float spread,float sun_brightness, float sun_size, float back_scatter,
- float skyblendfac, short skyblendtype, float sky_exposure, float sky_colorspace);
-
-/**
- * GetSkyXYZRadiance:
- * this function compute sky radiance according to a view parameters `theta' and `phi'and sunSky values
- * parameters:
- * sunSky, sontains sun and sky parameters
- * theta, is sun's theta
- * phi, is sun's phi
- * color_out, is computed color that shows sky radiance in XYZ color format
- * */
-void GetSkyXYZRadiance(struct SunSky* sunsky, float theta, float phi, float color_out[3]);
+ float spread,float sun_brightness, float sun_size, float back_scatter,
+ float skyblendfac, short skyblendtype, float sky_exposure, float sky_colorspace);
-/**
- * GetSkyXYZRadiancef:
- * this function compute sky radiance according to a view direction `varg' and sunSky values
- * parameters:
- * sunSky, sontains sun and sky parameters
- * varg, shows direction
- * color_out, is computed color that shows sky radiance in XYZ color format
- * */
-void GetSkyXYZRadiancef(struct SunSky* sunsky, const float varg[3], float color_out[3]);
-
-/**
- * InitAtmosphere:
- * this function intiate sunSky structure with user input parameters.
- * parameters:
- * sunSky, contains information about sun, and in this function some atmosphere parameters will initiated
- * sun_intens, shows sun intensity value
- * mief, Mie scattering factor this factor currently call with 1.0
- * rayf, Rayleigh scattering factor, this factor currently call with 1.0
- * inscattf, inscatter light factor that range from 0.0 to 1.0, 0.0 means no inscatter light and 1.0 means full inscatter light
- * extincf, extinction light factor that range from 0.0 to 1.0, 0.0 means no extinction and 1.0 means full extinction
- * disf, is distance factor, multiplyed to pixle's z value to compute each pixle's distance to camera,
- * */
+void GetSkyXYZRadiance(struct SunSky *sunsky, float theta, float phi, float color_out[3]);
+void GetSkyXYZRadiancef(struct SunSky *sunsky, const float varg[3], float color_out[3]);
void InitAtmosphere(struct SunSky *sunSky, float sun_intens, float mief, float rayf, float inscattf, float extincf, float disf);
-
-/**
- * AtmospherePixleShader:
- * this function apply atmosphere effect on a pixle color `rgb' at distance `s'
- * parameters:
- * sunSky, contains information about sun parameters and user values
- * view, is camera view vector
- * s, is distance
- * rgb, contains rendered color value for a pixle
- * */
-void AtmospherePixleShader( struct SunSky* sunSky, float view[3], float s, float rgb[3]);
-
-/**
- * ClipColor:
- * clip a color to range [0,1];
- * */
+void AtmospherePixleShader( struct SunSky *sunSky, float view[3], float s, float rgb[3]);
void ClipColor(float c[3]);
#endif /*__SUNSKY_H__*/
diff --git a/source/blender/render/intern/raytrace/bvh.h b/source/blender/render/intern/raytrace/bvh.h
index 6eaad444ed4..ac86a65ff0b 100644
--- a/source/blender/render/intern/raytrace/bvh.h
+++ b/source/blender/render/intern/raytrace/bvh.h
@@ -267,7 +267,7 @@ static int bvh_node_stack_raycast_simd(Node *root, Isect *isec)
const __m128 Y2Z2Y3Z3 = _mm_shuffle_ps( _mm_load_ps(bb2+4), _mm_load_ps(bb3+4), _MM_SHUFFLE(1,0,1,0) );
t_bb[4] = _mm_shuffle_ps( Y0Z0Y1Z1, Y2Z2Y3Z3, _MM_SHUFFLE(2,0,2,0) );
t_bb[5] = _mm_shuffle_ps( Y0Z0Y1Z1, Y2Z2Y3Z3, _MM_SHUFFLE(3,1,3,1) );
-/*
+#if 0
for(int i=0; i<4; i++)
{
Node *t = stack[stack_pos+i];
@@ -282,7 +282,7 @@ static int bvh_node_stack_raycast_simd(Node *root, Isect *isec)
bb[4*5] = t->bb[5];
t_node[i] = t->child;
}
-*/
+#endif
RE_RC_COUNT(isec->raycounter->simd_bb.test);
int res = test_bb_group4( t_bb, isec );
@@ -333,7 +333,7 @@ static int bvh_node_stack_raycast_simd(Node *root, Isect *isec)
/*
* recursively transverse a BVH looking for a rayhit using system stack
*/
-/*
+#if 0
template<class Node>
static int bvh_node_raycast(Node *node, Isect *isec)
{
@@ -378,7 +378,7 @@ static int bvh_node_raycast(Node *node, Isect *isec)
}
return hit;
}
-*/
+#endif
template<class Node,class HintObject>
void bvh_dfs_make_hint(Node *node, LCTSHint *hint, int reserve_space, HintObject *hintObject)
diff --git a/source/blender/render/intern/raytrace/rayobject.cpp b/source/blender/render/intern/raytrace/rayobject.cpp
index 26c0105b624..3f675a1b9ab 100644
--- a/source/blender/render/intern/raytrace/rayobject.cpp
+++ b/source/blender/render/intern/raytrace/rayobject.cpp
@@ -45,10 +45,10 @@
#include "render_types.h"
/* RayFace
-
- note we force always inline here, because compiler refuses to otherwise
- because function is too long. Since this is code that is called billions
- of times we really do want to inline. */
+ *
+ * note we force always inline here, because compiler refuses to otherwise
+ * because function is too long. Since this is code that is called billions
+ * of times we really do want to inline. */
MALWAYS_INLINE RayObject* rayface_from_coords(RayFace *rayface, void *ob, void *face,
float *v1, float *v2, float *v3, float *v4)
@@ -283,7 +283,7 @@ MALWAYS_INLINE int isec_tri_quad_neighbour(float start[3], float dir[3], RayFace
}
/* RayFace intersection with checks and neighbor verifaction included,
- Isect is modified if the face is hit. */
+ * 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 neighbor 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)
@@ -330,8 +330,8 @@ MALWAYS_INLINE int intersect_rayface(RayObject *hit_obj, RayFace *face, Isect *i
VlakRen * b = (VlakRen*)face->face;
/* so there's a shared edge or vertex, let's intersect ray with
- face itself, if that's true we can safely return 1, otherwise
- we assume the intersection is invalid, 0 */
+ * face itself, if that's true we can safely return 1, otherwise
+ * we assume the intersection is invalid, 0 */
if(a->v1==b->v1 || a->v2==b->v1 || a->v3==b->v1 || a->v4==b->v1
|| a->v1==b->v2 || a->v2==b->v2 || a->v3==b->v2 || a->v4==b->v2
|| a->v1==b->v3 || a->v2==b->v3 || a->v3==b->v3 || a->v4==b->v3
diff --git a/source/blender/render/intern/raytrace/rayobject_hint.h b/source/blender/render/intern/raytrace/rayobject_hint.h
index 9e505b68101..3689aa8ac17 100644
--- a/source/blender/render/intern/raytrace/rayobject_hint.h
+++ b/source/blender/render/intern/raytrace/rayobject_hint.h
@@ -49,7 +49,7 @@ inline int hint_test_bb(HintBB *obj, float *Nmin, float *Nmax)
else
return HINT_ACCEPT;
}
-/*
+#if 0
struct HintFrustum
{
float co[3];
@@ -69,7 +69,6 @@ inline int hint_test_bb(HintFrustum &obj, float *Nmin, float *Nmax)
return HINT_ACCEPT;
}
-*/
-
#endif
+#endif /* __RAYOBJECT_HINT_H__ */
diff --git a/source/blender/render/intern/raytrace/rayobject_internal.h b/source/blender/render/intern/raytrace/rayobject_internal.h
index 8e39b687b34..8c8e432b6bd 100644
--- a/source/blender/render/intern/raytrace/rayobject_internal.h
+++ b/source/blender/render/intern/raytrace/rayobject_internal.h
@@ -33,40 +33,40 @@ typedef struct RayObjectControl {
int RE_rayobjectcontrol_test_break(RayObjectControl *c);
/* RayObject
-
- A ray object is everything where we can cast rays like:
- * a face/triangle
- * an octree
- * a bvh tree
- * an octree of bvh's
- * a bvh of bvh's
-
-
- All types of RayObjects can be created by implementing the
- callbacks of the RayObject.
-
- Due to high computing time evolved with casting on faces
- there is a special type of RayObject (named RayFace)
- which won't use callbacks like other generic nodes.
-
- In order to allow a mixture of RayFace+RayObjects,
- all RayObjects must be 4byte aligned, allowing us to use the
- 2 least significant bits (with the mask 0x03) to define the
- type of RayObject.
-
- This leads to 4 possible types of RayObject:
-
- addr&3 - type of object
- 0 Self (reserved for each structure)
- 1 RayFace (tri/quad primitive)
- 2 RayObject (generic with API callbacks)
- 3 VlakPrimitive
- (vlak primitive - to be used when we have a vlak describing the data
- eg.: on render code)
-
- 0 means it's reserved and has it own meaning inside each ray acceleration structure
- (this way each structure can use the allign offset to determine if a node represents a
- RayObject primitive, which can be used to save memory)
+ *
+ * A ray object is everything where we can cast rays like:
+ * * a face/triangle
+ * * an octree
+ * * a bvh tree
+ * * an octree of bvh's
+ * * a bvh of bvh's
+ *
+ *
+ * All types of RayObjects can be created by implementing the
+ * callbacks of the RayObject.
+ *
+ * Due to high computing time evolved with casting on faces
+ * there is a special type of RayObject (named RayFace)
+ * which won't use callbacks like other generic nodes.
+ *
+ * In order to allow a mixture of RayFace+RayObjects,
+ * all RayObjects must be 4byte aligned, allowing us to use the
+ * 2 least significant bits (with the mask 0x03) to define the
+ * type of RayObject.
+ *
+ * This leads to 4 possible types of RayObject:
+ *
+ * addr&3 - type of object
+ * 0 Self (reserved for each structure)
+ * 1 RayFace (tri/quad primitive)
+ * 2 RayObject (generic with API callbacks)
+ * 3 VlakPrimitive
+ * (vlak primitive - to be used when we have a vlak describing the data
+ * eg.: on render code)
+ *
+ * 0 means it's reserved and has it own meaning inside each ray acceleration structure
+ * (this way each structure can use the allign offset to determine if a node represents a
+ * RayObject primitive, which can be used to save memory)
*/
/* used to test the type of ray object */
diff --git a/source/blender/render/intern/raytrace/rayobject_octree.cpp b/source/blender/render/intern/raytrace/rayobject_octree.cpp
index 648cb940af4..3e2c60cfcc0 100644
--- a/source/blender/render/intern/raytrace/rayobject_octree.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_octree.cpp
@@ -29,7 +29,7 @@
/* IMPORTANT NOTE: this code must be independent of any other render code
- to use it outside the renderer! */
+ * to use it outside the renderer! */
#include <math.h>
#include <string.h>
@@ -805,9 +805,9 @@ static int cliptest(float p, float q, float *u1, float *u2)
}
/* extensive coherence checks/storage cancels out the benefit of it, and gives errors... we
- need better methods, sample code commented out below (ton) */
+ * need better methods, sample code commented out below (ton) */
-/*
+#if 0
in top: static int coh_nodes[16*16*16][6];
in makeoctree: memset(coh_nodes, 0, sizeof(coh_nodes));
@@ -832,7 +832,7 @@ static int do_coherence_test(int ocx1, int ocx2, int ocy1, int ocy2, int ocz1, i
return 0;
}
-*/
+#endif
/* return 1: found valid intersection */
/* starts with is->orig.face */
@@ -986,7 +986,7 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
vec2[2]= oz1;
/* this loop has been constructed to make sure the first and last node of ray
- are always included, even when ddalabda==1.0f or larger */
+ * are always included, even when ddalabda==1.0f or larger */
while(TRUE) {
@@ -1013,7 +1013,7 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
labdao= ddalabda;
/* traversing ocree nodes need careful detection of smallest values, with proper
- exceptions for equal labdas */
+ * exceptions for equal labdas */
eqval= (labdax==labday);
if(labday==labdaz) eqval += 2;
if(labdax==labdaz) eqval += 4;
diff --git a/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp b/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
index dc75ed5e37b..6988e3fcc38 100644
--- a/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
@@ -105,8 +105,8 @@ void rtbuild_add(RTBuilder *b, RayObject *o)
RE_rayobject_merge_bb(o, bb, bb+3);
/* skip objects with invalid bounding boxes, nan causes DO_MINMAX
- to do nothing, so we get these invalid values. this shouldn't
- happen usually, but bugs earlier in the pipeline can cause it. */
+ * to do nothing, so we get these invalid values. this shouldn't
+ * happen usually, but bugs earlier in the pipeline can cause it. */
if(bb[0] > bb[3] || bb[1] > bb[4] || bb[2] > bb[5])
return;
/* skip objects with inf bounding boxes */
@@ -115,7 +115,7 @@ void rtbuild_add(RTBuilder *b, RayObject *o)
if(!finite(bb[3]) || !finite(bb[4]) || !finite(bb[5]))
return;
/* skip objects with zero bounding box, they are of no use, and
- will give problems in rtbuild_heuristic_object_split later */
+ * will give problems in rtbuild_heuristic_object_split later */
if(bb[0] == bb[3] && bb[1] == bb[4] && bb[2] == bb[5])
return;
@@ -205,7 +205,7 @@ void rtbuild_merge_bb(RTBuilder *b, float *min, float *max)
DO_MAX(b->bb+3, max);
}
-/*
+#if 0
int rtbuild_get_largest_axis(RTBuilder *b)
{
rtbuild_calc_bb(b);
@@ -269,13 +269,13 @@ int rtbuild_mean_split_largest_axis(RTBuilder *b, int nchilds)
int axis = rtbuild_get_largest_axis(b);
return rtbuild_mean_split(b, nchilds, axis);
}
-*/
+#endif
/*
* "separators" is an array of dim NCHILDS-1
* and indicates where to cut the childs
*/
-/*
+#if 0
int rtbuild_median_split(RTBuilder *b, float *separators, int nchilds, int axis)
{
int size = rtbuild_size(b);
@@ -318,7 +318,7 @@ int rtbuild_median_split_largest_axis(RTBuilder *b, int nchilds)
return rtbuild_median_split(b, separators, nchilds, la);
}
-*/
+#endif
//Heuristics Object Splitter
@@ -454,7 +454,7 @@ int rtbuild_heuristic_object_split(RTBuilder *b, int nchilds)
* PARTITION code / used on mean-split
* basicly this a std::nth_element (like on C++ STL algorithm)
*/
-/*
+#if 0
static void split_leafs(RTBuilder *b, int *nth, int partitions, int split_axis)
{
int i;
@@ -469,7 +469,7 @@ static void split_leafs(RTBuilder *b, int *nth, int partitions, int split_axis)
if(split_axis == 2) std::nth_element(b, nth[i], nth[i+1], nth[partitions], obj_bb_compare<RTBuilder::Object,2>);
}
}
-*/
+#endif
/*
* Bounding Box utils
diff --git a/source/blender/render/intern/raytrace/vbvh.h b/source/blender/render/intern/raytrace/vbvh.h
index ab6a1bbfd33..7d4d25c8d00 100644
--- a/source/blender/render/intern/raytrace/vbvh.h
+++ b/source/blender/render/intern/raytrace/vbvh.h
@@ -65,14 +65,17 @@ inline static void bvh_node_push_childs(Node *node, Isect *UNUSED(isec), Node **
{
while(child)
{
- //Skips BB tests on primitives
-/*
- if(is_leaf(child->child))
+ /* Skips BB tests on primitives */
+#if 0
+ if(is_leaf(child->child)) {
stack[stack_pos++] = child->child;
+ }
else
-*/
+#endif
+ {
stack[stack_pos++] = child;
-
+ }
+
child = child->sibling;
}
}
@@ -197,7 +200,7 @@ struct BuildBinaryVBVH
}
};
-/*
+#if 0
template<class Tree,class OldNode>
struct Reorganize_VBVH
{
@@ -242,4 +245,4 @@ struct Reorganize_VBVH
return node;
}
};
-*/
+#endif
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index e5833604370..31bf6457385 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -127,7 +127,7 @@
/* ------------------------------------------------------------------------- */
/* Stuff for stars. This sits here because it uses gl-things. Part of
-this code may move down to the converter. */
+ * this code may move down to the converter. */
/* ------------------------------------------------------------------------- */
/* this is a bad beast, since it is misused by the 3d view drawing as well. */
@@ -150,10 +150,10 @@ static HaloRen *initstar(Render *re, ObjectRen *obr, float *vec, float hasize)
}
/* there must be a 'fixed' amount of stars generated between
-* near and far
-* all stars must by preference lie on the far and solely
-* differ in clarity/color
-*/
+ * near and far
+ * all stars must by preference lie on the far and solely
+ * differ in clarity/color
+ */
void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
void (*vertexfunc)(float*), void (*termfunc)(void))
@@ -200,10 +200,10 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
else unit_m4(mat);
/* BOUNDING BOX CALCULATION
- * bbox goes from z = loc_near_var | loc_far_var,
- * x = -z | +z,
- * y = -z | +z
- */
+ * bbox goes from z = loc_near_var | loc_far_var,
+ * x = -z | +z,
+ * y = -z | +z
+ */
camera= re ? RE_GetCamera(re) : scene->camera;
@@ -251,9 +251,9 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
mul_m4_v3(re->viewmat, vec);
/* in vec are global coordinates
- * calculate distance to camera
- * and using that, define the alpha
- */
+ * calculate distance to camera
+ * and using that, define the alpha
+ */
{
float tx, ty, tz;
@@ -322,7 +322,7 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
/* ------------------------------------------------------------------------- */
/* tool functions/defines for ad hoc simplification and possible future
- cleanup */
+ * cleanup */
/* ------------------------------------------------------------------------- */
#define UVTOINDEX(u,v) (startvlak + (u) * sizev + (v))
@@ -515,8 +515,8 @@ static void calc_tangent_vector(ObjectRen *obr, VertexTangent **vtangents, MemAr
/****************************************************************
-************ tangent space generation interface *****************
-****************************************************************/
+ ************ tangent space generation interface ****************
+ ****************************************************************/
typedef struct
{
@@ -609,7 +609,7 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, int do_tangen
}
/* calculate cos of angles and point-masses, use as weight factor to
- add face normal to vertex */
+ * add face normal to vertex */
for(a=0; a<obr->totvlak; a++) {
VlakRen *vlr= RE_findOrAddVlak(obr, a);
if(vlr->flag & ME_SMOOTH) {
@@ -664,8 +664,8 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, int do_tangen
}
}
- /* normalize vertex normals */
- for(a=0; a<obr->totvert; a++) {
+ /* normalize vertex normals */
+ for (a=0; a<obr->totvert; a++) {
VertRen *ver= RE_findOrAddVert(obr, a);
normalize_v3(ver->n);
if(do_tangent) {
@@ -681,8 +681,7 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, int do_tangen
}
}
- if(do_nmap_tangent!=0)
- {
+ if (do_nmap_tangent != 0) {
SRenderMeshToTangent mesh2tangent;
SMikkTSpaceContext sContext;
SMikkTSpaceInterface sInterface;
@@ -2318,7 +2317,7 @@ static void displace_render_vert(Render *re, ObjectRen *obr, ShadeInput *shi, Ve
//printf("after co=%f, %f, %f\n", vr->co[0], vr->co[1], vr->co[2]);
/* we just don't do this vertex again, bad luck for other face using same vertex with
- different material... */
+ * different material... */
vr->flag |= 1;
/* Pass sample back so displace_face can decide which way to split the quad */
@@ -2336,7 +2335,7 @@ static void displace_render_face(Render *re, ObjectRen *obr, VlakRen *vlr, float
ShadeInput shi;
/* Warning, This is not that nice, and possibly a bit slow,
- however some variables were not initialized properly in, unless using shade_input_initialize(...), we need to do a memset */
+ * however some variables were not initialized properly in, unless using shade_input_initialize(...), we need to do a memset */
memset(&shi, 0, sizeof(ShadeInput));
/* end warning! - Campbell */
@@ -2650,25 +2649,25 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar,
add_v3_v3(vlr->v4->n, vlr1->n);
}
}
+
/* last vertex is an extra case:
-
- ^ ()----()----()----()
- | | | || |
- u | |(0,n)||(0,0)|
- | | || |
- ()====()====[]====()
- | | || |
- | |(m,n)||(m,0)|
- | | || |
- ()----()----()----()
- v ->
-
- vertex [] is no longer shared, therefore distribute
- normals of the surrounding faces to all of the duplicates of []
- */
-
- if ((dl->flag & DL_CYCL_V) && (dl->flag & DL_CYCL_U))
- {
+ *
+ * ^ ()----()----()----()
+ * | | | || |
+ * u | |(0,n)||(0,0)|
+ * | | || |
+ * ()====()====[]====()
+ * | | || |
+ * | |(m,n)||(m,0)|
+ * | | || |
+ * ()----()----()----()
+ * v ->
+ *
+ * vertex [] is no longer shared, therefore distribute
+ * normals of the surrounding faces to all of the duplicates of []
+ */
+
+ if ((dl->flag & DL_CYCL_V) && (dl->flag & DL_CYCL_U)) {
vlr= RE_findOrAddVlak(obr, UVTOINDEX(sizeu - 1, sizev - 1)); /* (m,n) */
vlr1= RE_findOrAddVlak(obr, UVTOINDEX(0,0)); /* (0,0) */
add_v3_v3v3(n1, vlr->n, vlr1->n);
@@ -3517,10 +3516,8 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
for(vindex=0; vindex<nr_verts; vindex++)
mc[vindex]=mcol[a*4+rev_tab[vindex]];
}
- else if(layer->type == CD_TANGENT && mtng < 1)
- {
- if(need_nmap_tangent!=0)
- {
+ else if (layer->type == CD_TANGENT && mtng < 1) {
+ if (need_nmap_tangent != 0) {
const float * tangent = (const float *) layer->data;
float * ftang = RE_vlakren_get_nmap_tangent(obr, vlr, 1);
for(vindex=0; vindex<nr_verts; vindex++)
@@ -4101,8 +4098,8 @@ static void set_phong_threshold(ObjectRen *obr)
int tot=0, i;
/* Added check for 'pointy' situations, only dotproducts of 0.9 and larger
- are taken into account. This threshold is meant to work on smooth geometry, not
- for extreme cases (ton) */
+ * are taken into account. This threshold is meant to work on smooth geometry, not
+ / for extreme cases (ton) */
for(i=0; i<obr->totvlak; i++) {
vlr= RE_findOrAddVlak(obr, i);
@@ -4141,7 +4138,7 @@ static void set_phong_threshold(ObjectRen *obr)
}
/* per face check if all samples should be taken.
- if raytrace or multisample, do always for raytraced material, or when material full_osa set */
+ * if raytrace or multisample, do always for raytraced material, or when material full_osa set */
static void set_fullsample_trace_flag(Render *re, ObjectRen *obr)
{
VlakRen *vlr;
@@ -5116,7 +5113,7 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l
/* if no camera, viewmat should have been set! */
if(use_camera_view && camera) {
- /* called before but need to call again incase of lens animation from the
+ /* called before but need to call again in case of lens animation from the
* above call to scene_update_for_newframe, fixes bug. [#22702].
* following calls dont depend on 'RE_SetCamera' */
RE_SetCamera(re, camera);
@@ -5540,8 +5537,7 @@ static int load_fluidsimspeedvectors(Render *re, ObjectInstanceRen *obi, float *
for(j=0;j<3;j++) fsvec[j] = velarray[a].vel[j];
/* (bad) HACK insert average velocity if none is there (see previous comment) */
- if((fsvec[0] == 0.0f) && (fsvec[1] == 0.0f) && (fsvec[2] == 0.0f))
- {
+ if ((fsvec[0] == 0.0f) && (fsvec[1] == 0.0f) && (fsvec[2] == 0.0f)) {
fsvec[0] = avgvel[0];
fsvec[1] = avgvel[1];
fsvec[2] = avgvel[2];
diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c
index a45bb63ff06..f9641ed9fbe 100644
--- a/source/blender/render/intern/source/envmap.c
+++ b/source/blender/render/intern/source/envmap.c
@@ -295,8 +295,8 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode)
lar= go->lampren;
/* removed here some horrible code of someone in NaN who tried to fix
- prototypes... just solved by introducing a correct cmat[3][3] instead
- of using smat. this works, check square spots in reflections (ton) */
+ * prototypes... just solved by introducing a correct cmat[3][3] instead
+ * of using smat. this works, check square spots in reflections (ton) */
copy_m3_m3(cmat, lar->imat);
mul_m3_m3m3(lar->imat, cmat, imat);
@@ -330,12 +330,12 @@ static void env_layerflags(Render *re, unsigned int notlay)
int a;
/* invert notlay, so if face is in multiple layers it will still be visible,
- unless all 'notlay' bits match the face bits.
- face: 0110
- not: 0100
- ~not: 1011
- now (face & ~not) is true
- */
+ * unless all 'notlay' bits match the face bits.
+ * face: 0110
+ * not: 0100
+ * ~not: 1011
+ * now (face & ~not) is true
+ */
notlay= ~notlay;
diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c
index 703ca23c15b..335de2dd055 100644
--- a/source/blender/render/intern/source/external_engine.c
+++ b/source/blender/render/intern/source/external_engine.c
@@ -36,6 +36,8 @@
#include "MEM_guardedalloc.h"
+#include "BLF_translation.h"
+
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
@@ -60,7 +62,7 @@
static RenderEngineType internal_render_type = {
NULL, NULL,
- "BLENDER_RENDER", "Blender Render", RE_INTERNAL,
+ "BLENDER_RENDER", N_("Blender Render"), RE_INTERNAL,
NULL, NULL, NULL, NULL,
{NULL, NULL, NULL}};
@@ -68,7 +70,7 @@ static RenderEngineType internal_render_type = {
static RenderEngineType internal_game_type = {
NULL, NULL,
- "BLENDER_GAME", "Blender Game", RE_INTERNAL|RE_GAME,
+ "BLENDER_GAME", N_("Blender Game"), RE_INTERNAL|RE_GAME,
NULL, NULL, NULL, NULL,
{NULL, NULL, NULL}};
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 2d64828b6b3..4a6558474f0 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -455,7 +455,7 @@ static float clipy_rctf(rctf *rf, float y1, float y2)
static void boxsampleclip(struct ImBuf *ibuf, rctf *rf, TexResult *texres)
{
/* sample box, is clipped already, and minx etc. have been set at ibuf size.
- Enlarge with antialiased edges of the pixels */
+ * Enlarge with antialiased edges of the pixels */
float muly, mulx, div, col[4];
int x, y, startx, endx, starty, endy;
diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c
index c9729aecfae..47b13cd484d 100644
--- a/source/blender/render/intern/source/occlusion.c
+++ b/source/blender/render/intern/source/occlusion.c
@@ -235,9 +235,9 @@ static void occ_build_shade(Render *re, OcclusionTree *tree)
/* ------------------------- Spherical Harmonics --------------------------- */
/* Use 2nd order SH => 9 coefficients, stored in this order:
- 0 = (0,0),
- 1 = (1,-1), 2 = (1,0), 3 = (1,1),
- 4 = (2,-2), 5 = (2,-1), 6 = (2,0), 7 = (2,1), 8 = (2,2) */
+ * 0 = (0,0),
+ * 1 = (1,-1), 2 = (1,0), 3 = (1,1),
+ * 4 = (2,-2), 5 = (2,-1), 6 = (2,0), 7 = (2,1), 8 = (2,2) */
static void sh_copy(float *shresult, float *sh)
{
@@ -263,7 +263,7 @@ static void sh_add(float *shresult, float *sh1, float *sh2)
static void sh_from_disc(float *n, float area, float *shresult)
{
/* See formula (3) in:
- "An Efficient Representation for Irradiance Environment Maps" */
+ * "An Efficient Representation for Irradiance Environment Maps" */
float sh[9], x, y, z;
x= n[0];
@@ -289,7 +289,7 @@ static void sh_from_disc(float *n, float area, float *shresult)
static float sh_eval(float *sh, float *v)
{
/* See formula (13) in:
- "An Efficient Representation for Irradiance Environment Maps" */
+ * "An Efficient Representation for Irradiance Environment Maps" */
static const float c1 = 0.429043f, c2 = 0.511664f, c3 = 0.743125f;
static const float c4 = 0.886227f, c5 = 0.247708f;
float x, y, z, sum;
@@ -1307,12 +1307,14 @@ static void occ_lookup(OcclusionTree *tree, int thread, OccFace *exclude, float
if(occ) *occ= resultocc;
if(rad) copy_v3_v3(rad, resultrad);
- /*if(rad && exclude) {
+#if 0
+ if(rad && exclude) {
int a;
for(a=0; a<tree->totface; a++)
if((tree->face[a].obi == exclude->obi && tree->face[a].facenr == exclude->facenr))
copy_v3_v3(rad, tree->rad[a]);
- }*/
+ }
+#endif
if(bentn) normalize_v3(bentn);
}
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index daaf1b0c737..b0bcf793ce5 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -89,31 +89,30 @@
#include "pixelblending.h"
#include "zbuf.h"
-
/* render flow
-
-1) Initialize state
-- state data, tables
-- movie/image file init
-- everything that doesn't change during animation
-
-2) Initialize data
-- camera, world, matrices
-- make render verts, faces, halos, strands
-- everything can change per frame/field
-
-3) Render Processor
-- multiple layers
-- tiles, rect, baking
-- layers/tiles optionally to disk or directly in Render Result
-
-4) Composite Render Result
-- also read external files etc
-
-5) Image Files
-- save file or append in movie
-
-*/
+ *
+ * 1) Initialize state
+ * - state data, tables
+ * - movie/image file init
+ * - everything that doesn't change during animation
+ *
+ * 2) Initialize data
+ * - camera, world, matrices
+ * - make render verts, faces, halos, strands
+ * - everything can change per frame/field
+ *
+ * 3) Render Processor
+ * - multiple layers
+ * - tiles, rect, baking
+ * - layers/tiles optionally to disk or directly in Render Result
+ *
+ * 4) Composite Render Result
+ * - also read external files etc
+ *
+ * 5) Image Files
+ * - save file or append in movie
+ *
+ */
/* ********* globals ******** */
@@ -456,8 +455,7 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer *
re->r.scemode |= R_EXR_TILE_FILE; /* enable automatic */
/* Until use_border is made compatible with save_buffers/full_sample, render without the later instead of not rendering at all.*/
- if(re->r.mode & R_BORDER)
- {
+ if (re->r.mode & R_BORDER) {
re->r.scemode &= ~(R_EXR_TILE_FILE|R_FULL_SAMPLE);
}
@@ -1252,8 +1250,8 @@ static void do_render_fields_blur_3d(Render *re)
/* within context of current Render *re, render another scene.
- it uses current render image size and disprect, but doesn't execute composite
-*/
+ * it uses current render image size and disprect, but doesn't execute composite
+ */
static void render_scene(Render *re, Scene *sce, int cfra)
{
Render *resc= RE_NewRender(sce->id.name);
@@ -1721,7 +1719,7 @@ static void do_render_seq(Render * re)
if((re->r.mode & R_BORDER) && (re->r.mode & R_CROP)==0) {
/* if border rendering is used and cropping is disabled, final buffer should
- be as large as the whole frame */
+ * be as large as the whole frame */
context = seq_new_render_data(re->main, re->scene,
re->winx, re->winy,
100);
@@ -1996,7 +1994,7 @@ static int render_initialize_from_main(Render *re, Main *bmain, Scene *scene, Sc
rcti disprect;
/* r.xsch and r.ysch has the actual view window size
- r.border is the clipping rect */
+ * r.border is the clipping rect */
/* calculate actual render result and display size */
winx= (scene->r.size*scene->r.xsch)/100;
@@ -2034,7 +2032,7 @@ static int render_initialize_from_main(Render *re, Main *bmain, Scene *scene, Sc
* Disabled completely for now,
* can be later set as render profile option
* and default for background render.
- */
+ */
if(0) {
/* make sure dynamics are up to date */
update_physics_cache(re, scene, anim_init);
@@ -2083,7 +2081,7 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr
if(write_still && !G.afbreek) {
if(BKE_imtype_is_movie(scene->r.im_format.imtype)) {
- /* operator checks this but incase its called from elsewhere */
+ /* operator checks this but in case its called from elsewhere */
printf("Error: cant write single images with a movie format!\n");
}
else {
diff --git a/source/blender/render/intern/source/pixelblending.c b/source/blender/render/intern/source/pixelblending.c
index 11e8e792159..0a8a59a860c 100644
--- a/source/blender/render/intern/source/pixelblending.c
+++ b/source/blender/render/intern/source/pixelblending.c
@@ -233,18 +233,17 @@ void mask_array(unsigned int mask, float filt[][3])
}
-/*
-
-index ordering, scanline based:
-
- --- --- ---
-| 2,0 | 2,1 | 2,2 |
- --- --- ---
-| 1,0 | 1,1 | 1,2 |
- --- --- ---
-| 0,0 | 0,1 | 0,2 |
- --- --- ---
-*/
+/**
+ * Index ordering, scanline based:
+ *
+ * --- --- ---
+ * | 2,0 | 2,1 | 2,2 |
+ * --- --- ---
+ * | 1,0 | 1,1 | 1,2 |
+ * --- --- ---
+ * | 0,0 | 0,1 | 0,2 |
+ * --- --- ---
+ */
void add_filt_fmask_coord(float filt[][3], float *col, float *rowbuf, int row_w, int col_h, int x, int y)
{
diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c
index 223c56ef9d6..965abb361fd 100644
--- a/source/blender/render/intern/source/pixelshading.c
+++ b/source/blender/render/intern/source/pixelshading.c
@@ -142,7 +142,8 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
ShadeInput shi;
/* Warning, This is not that nice, and possibly a bit slow,
- however some variables were not initialized properly in, unless using shade_input_initialize(...), we need to do a memset */
+ * however some variables were not initialized properly in, unless using shade_input_initialize(...),
+ * we need to do a memset */
memset(&shi, 0, sizeof(ShadeInput));
/* end warning! - Campbell */
@@ -593,17 +594,17 @@ void shadeSunView(float col_r[3], const float view[3])
/*
- Stuff the sky color into the collector.
+ * Stuff the sky color into the collector.
*/
void shadeSkyPixel(float collector[4], float fx, float fy, short thread)
{
float view[3], dxyview[2];
/*
- The rules for sky:
- 1. Draw an image, if a background image was provided. Stop
- 2. get texture and color blend, and combine these.
- */
+ * The rules for sky:
+ * 1. Draw an image, if a background image was provided. Stop
+ * 2. get texture and color blend, and combine these.
+ */
float fac;
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
index ae3748755ff..1904d5dce63 100644
--- a/source/blender/render/intern/source/pointdensity.c
+++ b/source/blender/render/intern/source/pointdensity.c
@@ -346,9 +346,9 @@ static void accum_density(void *userdata, int index, float squared_dist)
float density = 0.0f;
if (pdr->point_data_used & POINT_DATA_VEL) {
- pdr->vec[0] += pdr->point_data[index*3 + 0]; //* density;
- pdr->vec[1] += pdr->point_data[index*3 + 1]; //* density;
- pdr->vec[2] += pdr->point_data[index*3 + 2]; //* density;
+ pdr->vec[0] += pdr->point_data[index*3 + 0]; // * density;
+ pdr->vec[1] += pdr->point_data[index*3 + 1]; // * density;
+ pdr->vec[2] += pdr->point_data[index*3 + 2]; // * density;
}
if (pdr->point_data_used & POINT_DATA_LIFE) {
*pdr->age += pdr->point_data[pdr->offset + index]; // * density;
@@ -515,9 +515,9 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
return retval;
- /*
+#if 0
if (texres->nor!=NULL) {
texres->nor[0] = texres->nor[1] = texres->nor[2] = 0.0f;
}
- */
+#endif
}
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index 38178db5dcb..9272dcf5b30 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -265,14 +265,12 @@ RayObject* makeraytree_object(Render *re, ObjectInstanceRen *obi)
VlakRen *vlr = obr->vlaknodes[v>>8].vlak + (v&255);
if(is_raytraceable_vlr(re, vlr))
{
- if( (re->r.raytrace_options & R_RAYTRACE_USE_LOCAL_COORDS) )
- {
+ if ((re->r.raytrace_options & R_RAYTRACE_USE_LOCAL_COORDS)) {
RE_rayobject_add( raytree, RE_vlakprimitive_from_vlak( vlakprimitive, obi, vlr ) );
vlakprimitive++;
}
- else
- {
- RE_rayface_from_vlak( face, obi, vlr );
+ else {
+ RE_rayface_from_vlak(face, obi, vlr);
RE_rayobject_add( raytree, RE_rayobject_unalignRayFace(face) );
face++;
}
@@ -336,12 +334,10 @@ static void makeraytree_single(Render *re)
ObjectRen *obr = obi->obr;
obs++;
- if(has_special_rayobject(re, obi))
- {
+ if (has_special_rayobject(re, obi)) {
special++;
}
- else
- {
+ else {
int v;
for(v=0;v<obr->totvlak;v++)
{
@@ -365,8 +361,7 @@ static void makeraytree_single(Render *re)
{
vlakprimitive = re->rayprimitives = (VlakPrimitive*)MEM_callocN(faces*sizeof(VlakPrimitive), "Raytrace vlak-primitives");
}
- else
- {
+ else {
face = re->rayfaces = (RayFace*)MEM_callocN(faces*sizeof(RayFace), "Render ray faces");
}
@@ -376,8 +371,7 @@ static void makeraytree_single(Render *re)
if(test_break(re))
break;
- if(has_special_rayobject(re, obi))
- {
+ if (has_special_rayobject(re, obi)) {
RayObject *obj = makeraytree_object(re, obi);
if(test_break(re))
@@ -386,8 +380,7 @@ static void makeraytree_single(Render *re)
if (obj)
RE_rayobject_add( re->raytree, obj );
}
- else
- {
+ else {
int v;
ObjectRen *obr = obi->obr;
@@ -399,16 +392,13 @@ static void makeraytree_single(Render *re)
for(v=0;v<obr->totvlak;v++)
{
VlakRen *vlr = obr->vlaknodes[v>>8].vlak + (v&255);
- if(is_raytraceable_vlr(re, vlr))
- {
- if( (re->r.raytrace_options & R_RAYTRACE_USE_LOCAL_COORDS) )
- {
+ if (is_raytraceable_vlr(re, vlr)) {
+ if ((re->r.raytrace_options & R_RAYTRACE_USE_LOCAL_COORDS)) {
RayObject *obj = RE_vlakprimitive_from_vlak( vlakprimitive, obi, vlr );
RE_rayobject_add( raytree, obj );
vlakprimitive++;
}
- else
- {
+ else {
RE_rayface_from_vlak(face, obi, vlr);
if((obi->flag & R_TRANSFORMED))
{
@@ -445,21 +435,19 @@ void makeraytree(Render *re)
re->stats_draw(re->sdh, &re->i);
/* disable options not yet supported by octree,
- they might actually never be supported (unless people really need it) */
+ * they might actually never be supported (unless people really need it) */
if(re->r.raytrace_structure == R_RAYSTRUCTURE_OCTREE)
re->r.raytrace_options &= ~( R_RAYTRACE_USE_INSTANCES | R_RAYTRACE_USE_LOCAL_COORDS);
makeraytree_single(re);
- if(test_break(re))
- {
+ if (test_break(re)) {
freeraytree(re);
re->i.infostr= "Raytree building canceled";
re->stats_draw(re->sdh, &re->i);
}
- else
- {
+ else {
//Calculate raytree max_size
//This is ONLY needed to kept a bogus behavior of SUN and HEMI lights
INIT_MINMAX(min, max);
@@ -1616,7 +1604,7 @@ static void addAlphaLight(float shadfac[4], const float col[3], float alpha, flo
static void ray_trace_shadow_tra(Isect *is, ShadeInput *origshi, int depth, int traflag, float col[4])
{
/* ray to lamp, find first face that intersects, check alpha properties,
- if it has col[3]>0.0f continue. so exit when alpha is full */
+ * if it has col[3]>0.0f continue. so exit when alpha is full */
const float initial_dist = is->dist;
if(RE_rayobject_raycast(R.raytree, is)) {
@@ -1721,7 +1709,7 @@ static int UNUSED_FUNCTION(ray_trace_shadow_rad)(ShadeInput *ship, ShadeResult *
float fac;
/* Warning, This is not that nice, and possibly a bit slow for every ray,
- however some variables were not initialized properly in, unless using shade_input_initialize(...), we need to do a memset */
+ * however some variables were not initialized properly in, unless using shade_input_initialize(...), we need to do a memset */
memset(&shi, 0, sizeof(ShadeInput));
/* end warning! - Campbell */
@@ -2087,7 +2075,7 @@ static void ray_ao_spheresamp(ShadeInput *shi, float ao[3], float env[3])
if(resol>32) resol= 32;
/* get sphere samples. for faces we get the same samples for sample x/y values,
- for strand render we always require a new sampler because x/y are not set */
+ * for strand render we always require a new sampler because x/y are not set */
vec= sphere_sampler(R.wrld.aomode, resol, shi->thread, shi->xs, shi->ys, shi->strand != NULL);
// warning: since we use full sphere now, and dotproduct is below, we do twice as much
diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c
index 266b71971d3..b6c93d9b15f 100644
--- a/source/blender/render/intern/source/render_result.c
+++ b/source/blender/render/intern/source/render_result.c
@@ -112,7 +112,7 @@ void render_result_free_list(ListBase *lb, RenderResult *rr)
/********************************* Names *************************************/
/* NOTE: OpenEXR only supports 32 chars for layer+pass names
- In blender we now use max 10 chars for pass, max 20 for layer */
+ * In blender we now use max 10 chars for pass, max 20 for layer */
static const char *get_pass_name(int passtype, int channel)
{
@@ -219,8 +219,7 @@ static const char *get_pass_name(int passtype, int channel)
if(channel==-1) return "Mist";
return "Mist.Z";
}
- if(passtype == SCE_PASS_RAYHITS)
- {
+ if(passtype == SCE_PASS_RAYHITS) {
if(channel==-1) return "Rayhits";
if(channel==0) return "Rayhits.R";
if(channel==1) return "Rayhits.G";
@@ -1073,7 +1072,7 @@ void render_result_rect_from_ibuf(RenderResult *rr, RenderData *rd, ImBuf *ibuf)
rr->rectx, rr->recty, rr->rectx, rr->rectx);
/* TSK! Since sequence render doesn't free the *rr render result, the old rect32
- can hang around when sequence render has rendered a 32 bits one before */
+ * can hang around when sequence render has rendered a 32 bits one before */
if(rr->rect32) {
MEM_freeN(rr->rect32);
rr->rect32= NULL;
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index 1e91738c77d..ede314a42e1 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -651,7 +651,7 @@ static float mg_distNoiseTex(Tex *tex, float *texvec, TexResult *texres)
static float voronoiTex(Tex *tex, float *texvec, TexResult *texres)
{
int rv = TEX_INT;
- float da[4], pa[12]; /* distance and point coordinate arrays of 4 nearest neighbours */
+ float da[4], pa[12]; /* distance and point coordinate arrays of 4 nearest neighbors */
float aw1 = fabs(tex->vn_w1);
float aw2 = fabs(tex->vn_w2);
float aw3 = fabs(tex->vn_w3);
@@ -1348,7 +1348,7 @@ int multitex_mtex(ShadeInput *shi, MTex *mtex, float *texvec, float *dxt, float
if(tex->use_nodes && tex->nodetree) {
/* stupid exception here .. but we have to pass shi and mtex to
- textures nodes for 2d mapping and color management for images */
+ * textures nodes for 2d mapping and color management for images */
return ntreeTexExecTree(tex->nodetree, texres, texvec, dxt, dyt, shi->osatex, shi->thread,
tex, mtex->which_output, R.r.cfra, (R.r.scemode & R_TEXNODE_PREVIEW) != 0, shi, mtex);
}
@@ -1965,10 +1965,10 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
texco_mapping(shi, tex, mtex, co, dx, dy, texvec, dxt, dyt);
rgbnor = multitex_mtex(shi, mtex, texvec, dxt, dyt, texres);
- if(shi->obr->ob->derivedFinal)
- {
+ if(shi->obr->ob->derivedFinal) {
auto_bump = shi->obr->ob->derivedFinal->auto_bump_scale;
}
+
{
float fVirtDim = sqrtf(fabsf((float) (dimx*dimy)*mtex->size[0]*mtex->size[1]));
auto_bump /= MAX2(fVirtDim, FLT_EPSILON);
@@ -2064,8 +2064,8 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
texres->nor = nvec;
/* replaced newbump with code based on listing 1 and 2 of
- [Mik10] Mikkelsen M. S.: Bump Mapping Unparametrized Surfaces on the GPU.
- -> http://jbit.net/~sparky/sfgrad_bump/mm_sfgrad_bump.pdf */
+ * [Mik10] Mikkelsen M. S.: Bump Mapping Unparametrized Surfaces on the GPU.
+ * -> http://jbit.net/~sparky/sfgrad_bump/mm_sfgrad_bump.pdf */
if( mtex->texflag & MTEX_BUMP_OBJECTSPACE )
iBumpSpace = 1;
@@ -2494,7 +2494,7 @@ void do_material_tex(ShadeInput *shi, Render *re)
found_nmapping = 1;
/* qdn: for normalmaps, to invert the normalmap vector,
- it is better to negate x & y instead of subtracting the vector as was done before */
+ * it is better to negate x & y instead of subtracting the vector as was done before */
if (norfac < 0.0f) {
texres.nor[0] = -texres.nor[0];
texres.nor[1] = -texres.nor[1];
@@ -3508,7 +3508,7 @@ void render_realtime_texture(ShadeInput *shi, Image *ima)
}
/* A modified part of shadeinput.c -> shade_input_set_uv()
-* Used for sampling UV mapped texture color */
+ * Used for sampling UV mapped texture color */
static void textured_face_generate_uv(float *uv, float *normal, float *hit, float *v1, float *v2, float *v3)
{
@@ -3647,15 +3647,15 @@ void RE_free_sample_material(Material *mat)
/*
-* Get material diffuse color and alpha (including linked textures) in given coordinates
-*
-* color,alpha : input/output color values
-* volume_co : sample coordinate in global space. used by volumetric materials
-* surface_co : sample surface coordinate in global space. used by "surface" materials
-* face_index : surface face index
-* hit_quad : whether point is on second "half" of a quad
-* orcoDm : orco state derived mesh
-*/
+ * Get material diffuse color and alpha (including linked textures) in given coordinates
+ *
+ * color,alpha : input/output color values
+ * volume_co : sample coordinate in global space. used by volumetric materials
+ * surface_co : sample surface coordinate in global space. used by "surface" materials
+ * face_index : surface face index
+ * hit_quad : whether point is on second "half" of a quad
+ * orcoDm : orco state derived mesh
+ */
void RE_sample_material_color(Material *mat, float color[3], float *alpha, const float volume_co[3], const float surface_co[3], int face_index, short hit_quad, DerivedMesh *orcoDm, Object *ob)
{
MFace *mface;
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 2d3837acbfa..28988af64c4 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -1469,7 +1469,7 @@ static void addps_sss(void *cb_handle, int obi, int facenr, int x, int y, int z)
RenderPart *pa= handle->pa;
/* extra border for filter gives double samples on part edges,
- don't use those */
+ * don't use those */
if(x<pa->crop || x>=pa->rectx-pa->crop)
return;
if(y<pa->crop || y>=pa->recty-pa->crop)
@@ -1528,9 +1528,9 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
sy = y + 0.5f;
/* we estimate the area here using shi->dxco and shi->dyco. we need to
- enabled shi->osatex these are filled. we compute two areas, one with
- the normal pointed at the camera and one with the original normal, and
- then clamp to avoid a too large contribution from a single pixel */
+ * enabled shi->osatex these are filled. we compute two areas, one with
+ * the normal pointed at the camera and one with the original normal, and
+ * then clamp to avoid a too large contribution from a single pixel */
shi->osatex= 1;
copy_v3_v3(nor, shi->facenor);
@@ -1559,7 +1559,7 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
}
/* if nodetree, use the material that we are currently preprocessing
- instead of the node material */
+ * instead of the node material */
if(shi->mat->nodetree && shi->mat->use_nodes)
shi->mat= mat;
@@ -2054,7 +2054,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
shade_input_set_shade_texco(shi);
/* only do AO for a full bake (and obviously AO bakes)
- AO for light bakes is a leftover and might not be needed */
+ * AO for light bakes is a leftover and might not be needed */
if( ELEM3(bs->type, RE_BAKE_ALL, RE_BAKE_AO, RE_BAKE_LIGHT))
shade_samples_do_AO(ssamp);
diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c
index 43761be9d71..c04daa11b3e 100644
--- a/source/blender/render/intern/source/renderdatabase.c
+++ b/source/blender/render/intern/source/renderdatabase.c
@@ -91,10 +91,10 @@
/* ------------------------------------------------------------------------- */
/* More dynamic allocation of options for render vertices and faces, so we dont
- have to reserve this space inside vertices.
- Important; vertices and faces, should have been created already (to get tables
- checked) that's a reason why the calls demand VertRen/VlakRen * as arg, not
- the index */
+ * have to reserve this space inside vertices.
+ * Important; vertices and faces, should have been created already (to get tables
+ * checked) that's a reason why the calls demand VertRen/VlakRen * as arg, not
+ * the index */
/* NOTE! the hardcoded table size 256 is used still in code for going quickly over vertices/faces */
@@ -460,7 +460,7 @@ void RE_vlakren_get_normal(Render *UNUSED(re), ObjectInstanceRen *obi, VlakRen *
void RE_set_customdata_names(ObjectRen *obr, CustomData *data)
{
/* CustomData layer names are stored per object here, because the
- DerivedMesh which stores the layers is freed */
+ * DerivedMesh which stores the layers is freed */
CustomDataLayer *layer;
int numtf = 0, numcol = 0, i, mtfn, mcn;
@@ -813,20 +813,20 @@ void free_renderdata_tables(Render *re)
int a=0;
for(obr=re->objecttable.first; obr; obr=obr->next) {
- if(obr->vertnodes) {
+ if (obr->vertnodes) {
free_renderdata_vertnodes(obr->vertnodes);
obr->vertnodes= NULL;
obr->vertnodeslen= 0;
}
- if(obr->vlaknodes) {
+ if (obr->vlaknodes) {
free_renderdata_vlaknodes(obr->vlaknodes);
obr->vlaknodes= NULL;
obr->vlaknodeslen= 0;
obr->totvlak= 0;
}
- if(obr->bloha) {
+ if (obr->bloha) {
for(a=0; obr->bloha[a]; a++)
MEM_freeN(obr->bloha[a]);
@@ -835,7 +835,7 @@ void free_renderdata_tables(Render *re)
obr->blohalen= 0;
}
- if(obr->strandnodes) {
+ if (obr->strandnodes) {
free_renderdata_strandnodes(obr->strandnodes);
obr->strandnodes= NULL;
obr->strandnodeslen= 0;
@@ -848,23 +848,23 @@ void free_renderdata_tables(Render *re)
MEM_freeN(strandbuf);
}
- if(obr->mtface)
+ if (obr->mtface)
MEM_freeN(obr->mtface);
- if(obr->mcol)
+
+ if (obr->mcol)
MEM_freeN(obr->mcol);
- if(obr->rayfaces)
- {
+ if (obr->rayfaces) {
MEM_freeN(obr->rayfaces);
obr->rayfaces = NULL;
}
- if(obr->rayprimitives)
- {
+
+ if (obr->rayprimitives) {
MEM_freeN(obr->rayprimitives);
obr->rayprimitives = NULL;
}
- if(obr->raytree)
- {
+
+ if (obr->raytree) {
RE_rayobject_free(obr->raytree);
obr->raytree = NULL;
}
@@ -1223,15 +1223,15 @@ static int panotestclip(Render *re, int do_pano, float *v)
return c;
}
-/*
- This adds the hcs coordinates to vertices. It iterates over all
- vertices, halos and faces. After the conversion, we clip in hcs.
-
- Elsewhere, all primites are converted to vertices.
- Called in
- - envmapping (envmap.c)
- - shadow buffering (shadbuf.c)
-*/
+/**
+ * This adds the hcs coordinates to vertices. It iterates over all
+ * vertices, halos and faces. After the conversion, we clip in hcs.
+ *
+ * Elsewhere, all primites are converted to vertices.
+ * Called in
+ * - envmapping (envmap.c)
+ * - shadow buffering (shadbuf.c)
+ */
void project_renderdata(Render *re, void (*projectfunc)(const float *, float mat[][4], float *), int do_pano, float xoffs, int UNUSED(do_buckets))
{
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index 0e90fbf7536..3ef62f7b383 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -59,8 +59,7 @@
#include "shading.h"
#include "zbuf.h"
-/* XXX, could be better implemented... this is for endian issues
-*/
+/* XXX, could be better implemented... this is for endian issues */
#ifdef __BIG_ENDIAN__
# define RCOMP 3
# define GCOMP 2
@@ -185,17 +184,19 @@ static int verg_deepsample(const void *poin1, const void *poin2)
static int compress_deepsamples(DeepSample *dsample, int tot, float epsilon)
{
/* uses doubles to avoid overflows and other numerical issues,
- could be improved */
+ * could be improved */
DeepSample *ds, *newds;
float v;
double slope, slopemin, slopemax, min, max, div, newmin, newmax;
int a, first, z, newtot= 0;
- /*if(print) {
+#if 0
+ if(print) {
for(a=0, ds=dsample; a<tot; a++, ds++)
printf("%lf,%f ", ds->z/(double)0x7FFFFFFF, ds->v);
printf("\n");
- }*/
+ }
+#endif
/* read from and write into same array */
ds= dsample;
@@ -212,7 +213,7 @@ static int compress_deepsamples(DeepSample *dsample, int tot, float epsilon)
//dz= ds->z - newds->z;
if(ds->z == newds->z) {
/* still in same z position, simply check
- visibility difference against epsilon */
+ * visibility difference against epsilon */
if(!(fabs(newds->v - ds->v) <= epsilon)) {
break;
}
@@ -274,11 +275,13 @@ static int compress_deepsamples(DeepSample *dsample, int tot, float epsilon)
if(newtot == 0 || (newds->v != (newds-1)->v))
newtot++;
- /*if(print) {
+#if 0
+ if(print) {
for(a=0, ds=dsample; a<newtot; a++, ds++)
printf("%lf,%f ", ds->z/(double)0x7FFFFFFF, ds->v);
printf("\n");
- }*/
+ }
+#endif
return newtot;
}
@@ -769,7 +772,7 @@ void makeshadowbuf(Render *re, LampRen *lar)
shb->size= 1024;
/* matrices and window: in winmat the transformation is being put,
- transforming from observer view to lamp view, including lamp window matrix */
+ * transforming from observer view to lamp view, including lamp window matrix */
angle= saacos(lar->spotsi);
temp= 0.5f*shb->size*cos(angle)/sin(angle);
@@ -1134,7 +1137,7 @@ float testshadowbuf(Render *re, ShadBuf *shb, const float co[3], const float dxc
shadowbuf_project_co(&xs1, &ys1, &zs1, shb, co);
/* clip z coordinate, z is projected so that (-1.0, 1.0) matches
- (clipstart, clipend), so we can do this simple test */
+ * (clipstart, clipend), so we can do this simple test */
if(zs1>=1.0f)
return 0.0f;
else if(zs1<= -1.0f)
@@ -1151,7 +1154,7 @@ float testshadowbuf(Render *re, ShadBuf *shb, const float co[3], const float dxc
if(mat_bias!=0.0f) biasf= shb->bias*mat_bias;
else biasf= shb->bias;
/* with inp==1.0, bias is half the size. correction value was 1.1, giving errors
- on cube edges, with one side being almost frontal lighted (ton) */
+ * on cube edges, with one side being almost frontal lighted (ton) */
bias= (1.5f-inp*inp)*biasf;
/* in case of no filtering we can do things simpler */
@@ -1416,12 +1419,12 @@ float shadow_halo(LampRen *lar, const float p1[3], const float p2[3])
/* ********** storage of all view samples in a raster of lists ***** */
/* based on several articles describing this method, like:
-The Irregular Z-Buffer and its Application to Shadow Mapping
-Gregory S. Johnson - William R. Mark - Christopher A. Burns
-and
-Alias-Free Shadow Maps
-Timo Aila and Samuli Laine
-*/
+ * The Irregular Z-Buffer and its Application to Shadow Mapping
+ * Gregory S. Johnson - William R. Mark - Christopher A. Burns
+ * and
+ * Alias-Free Shadow Maps
+ * Timo Aila and Samuli Laine
+ */
/* bsp structure (actually kd tree) */
diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c
index dd9e1df95cd..29c1318727c 100644
--- a/source/blender/render/intern/source/shadeinput.c
+++ b/source/blender/render/intern/source/shadeinput.c
@@ -66,30 +66,31 @@
extern struct Render R;
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-
-#define VECADDISFAC(v1,v3,fac) {*(v1)+= *(v3)*(fac); *(v1+1)+= *(v3+1)*(fac); *(v1+2)+= *(v3+2)*(fac);}
-
-
-
/* Shade Sample order:
+ *
+ * - shade_samples_fill_with_ps()
+ * - for each sample
+ * - shade_input_set_triangle() <- if prev sample-face is same, use shade_input_copy_triangle()
+ * - if vlr
+ * - shade_input_set_viewco() <- not for ray or bake
+ * - shade_input_set_uv() <- not for ray or bake
+ * - shade_input_set_normals()
+ * - shade_samples()
+ * - if AO
+ * - shade_samples_do_AO()
+ * - if shading happens
+ * - for each sample
+ * - shade_input_set_shade_texco()
+ * - shade_samples_do_shade()
+ * - OSA: distribute sample result with filter masking
+ *
+ */
-- shade_samples_fill_with_ps()
- - for each sample
- - shade_input_set_triangle() <- if prev sample-face is same, use shade_input_copy_triangle()
- - if vlr
- - shade_input_set_viewco() <- not for ray or bake
- - shade_input_set_uv() <- not for ray or bake
- - shade_input_set_normals()
-- shade_samples()
- - if AO
- - shade_samples_do_AO()
- - if shading happens
- - for each sample
- - shade_input_set_shade_texco()
- - shade_samples_do_shade()
-- OSA: distribute sample result with filter masking
-
- */
+#define VECADDISFAC(v1,v3,fac) { \
+ *(v1 + 0) += *(v3 + 0) * (fac); \
+ *(v1 + 1) += *(v3 + 1) * (fac); \
+ *(v1 + 2) += *(v3 + 2) * (fac); \
+}
/* initialize material variables in shadeinput,
* doing inverse gamma correction where applicable */
@@ -213,15 +214,15 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
shr->z= -shi->co[2];
/* RAYHITS */
-/*
- if(1 || shi->passflag & SCE_PASS_RAYHITS)
- {
+#if 0
+ if(1 || shi->passflag & SCE_PASS_RAYHITS) {
shr->rayhits[0] = (float)shi->raycounter.faces.test;
shr->rayhits[1] = (float)shi->raycounter.bb.hit;
shr->rayhits[2] = 0.0;
shr->rayhits[3] = 1.0;
}
- */
+#endif
+
RE_RC_MERGE(&re_rc_counter[shi->thread], &shi->raycounter);
}
@@ -294,7 +295,7 @@ void shade_input_set_triangle_i(ShadeInput *shi, ObjectInstanceRen *obi, VlakRen
}
}
-/* note, facenr declared volatile due to over-eager -O2 optimizations
+/* note, facenr declared volatile due to over-eager -O2 optimization's
* on cygwin (particularly -frerun-cse-after-loop)
*/
@@ -821,8 +822,7 @@ void shade_input_set_normals(ShadeInput *shi)
normalize_v3(shi->vn);
}
- else
- {
+ else {
copy_v3_v3(shi->vn, shi->facenor);
copy_v3_v3(shi->nmapnorm, shi->vn);
}
@@ -855,8 +855,7 @@ void shade_input_set_vertex_normals(ShadeInput *shi)
normalize_v3(shi->vn);
}
- else
- {
+ else {
copy_v3_v3(shi->vn, shi->facenor);
copy_v3_v3(shi->nmapnorm, shi->vn);
}
@@ -928,7 +927,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
else {
/* qdn: flat faces have tangents too,
- could pick either one, using average here */
+ * could pick either one, using average here */
tl= 1.0f/3.0f;
tu= -1.0f/3.0f;
tv= -1.0f/3.0f;
@@ -970,8 +969,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
// keeping tangents normalized at vertex level
// corresponds better to how it's done in game engines
- if(obi->flag & R_TRANSFORMED)
- {
+ if (obi->flag & R_TRANSFORMED) {
mul_mat3_m4_v3(obi->mat, c0); normalize_v3(c0);
mul_mat3_m4_v3(obi->mat, c1); normalize_v3(c1);
mul_mat3_m4_v3(obi->mat, c2); normalize_v3(c2);
@@ -1313,9 +1311,12 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
}
}
- } /* else {
- Note! For raytracing winco is not set, important because thus means all shader input's need to have their variables set to zero else in-initialized values are used
- */
+ }
+ /* else {
+ * Note! For raytracing winco is not set,
+ * important because thus means all shader input's need to have their variables set to zero
+ * else un-initialized values are used
+ */
if (shi->do_manage) {
if(mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE)) {
srgb_to_linearrgb_v3_v3(shi->vcol, shi->vcol);
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index fad117d0ea4..346f42eaab1 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -113,7 +113,7 @@ static void fogcolor(float *colf, float *rco, float *view)
hor[2]= hor[2]*alpha;
addAlphaOverFloat(colf, hor);
- VECSUB(vec, vec, dview);
+ sub_v3_v3(vec, dview);
}
}
#endif
@@ -173,17 +173,17 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens)
p1[1]= shi->co[1]-lar->co[1];
p1[2]= -lar->co[2];
mul_m3_v3(lar->imat, p1);
- VECCOPY(npos, p1); // npos is double!
+ copy_v3db_v3fl(npos, p1); // npos is double!
/* pre-scale */
npos[2] *= (double)lar->sh_zfac;
}
else {
- VECCOPY(npos, lar->sh_invcampos); /* in initlamp calculated */
+ copy_v3db_v3fl(npos, lar->sh_invcampos); /* in initlamp calculated */
}
/* rotate view */
- VECCOPY(nray, shi->view);
+ copy_v3db_v3fl(nray, shi->view);
mul_m3_v3_double(lar->imat, nray);
if(R.wrld.mode & WO_MIST) {
@@ -326,7 +326,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens)
*intens= c*( (1.0-a)+(1.0-b) );
/* WATCH IT: do not clip a,b en c at 1.0, this gives nasty little overflows
- at the edges (especially with narrow halos) */
+ * at the edges (especially with narrow halos) */
if(*intens<=0.0f) return;
/* soft area */
@@ -1771,8 +1771,8 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
shade_one_light(lar, shi, shr, passflag);
}
- /*this check is to prevent only shadow lamps from producing negative
- colors.*/
+ /* this check is to prevent only shadow lamps from producing negative
+ * colors.*/
if (shr->spec[0] < 0) shr->spec[0] = 0;
if (shr->spec[1] < 0) shr->spec[1] = 0;
if (shr->spec[2] < 0) shr->spec[2] = 0;
diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c
index 4192aaf42aa..a60db8a963f 100644
--- a/source/blender/render/intern/source/sss.c
+++ b/source/blender/render/intern/source/sss.c
@@ -32,16 +32,16 @@
/* Possible Improvements:
- - add fresnel terms
- - adapt Rd table to scale, now with small scale there are a lot of misses?
- - possible interesting method: perform sss on all samples in the tree,
- and then use those values interpolated somehow later. can also do this
- filtering on demand for speed. since we are doing things in screen
- space now there is an exact correspondence
- - avoid duplicate shading (filtering points in advance, irradiance cache
- like lookup?)
- - lower resolution samples
-*/
+ * - add fresnel terms
+ * - adapt Rd table to scale, now with small scale there are a lot of misses?
+ * - possible interesting method: perform sss on all samples in the tree,
+ * and then use those values interpolated somehow later. can also do this
+ * filtering on demand for speed. since we are doing things in screen
+ * space now there is an exact correspondence
+ * - avoid duplicate shading (filtering points in advance, irradiance cache
+ * like lookup?)
+ * - lower resolution samples
+ */
#include <math.h>
#include <string.h>
@@ -82,11 +82,11 @@ extern Render R; // meh
/* Generic Multiple Scattering API */
/* Relevant papers:
- [1] A Practical Model for Subsurface Light Transport
- [2] A Rapid Hierarchical Rendering Technique for Translucent Materials
- [3] Efficient Rendering of Local Subsurface Scattering
- [4] Implementing a skin BSSRDF (or several...)
-*/
+ * [1] A Practical Model for Subsurface Light Transport
+ * [2] A Rapid Hierarchical Rendering Technique for Translucent Materials
+ * [3] Efficient Rendering of Local Subsurface Scattering
+ * [4] Implementing a skin BSSRDF (or several...)
+ */
/* Defines */
@@ -164,7 +164,7 @@ typedef struct ScatterResult {
} ScatterResult;
/* Functions for BSSRDF reparametrization in to more intuitive parameters,
- see [2] section 4 for more info. */
+ * see [2] section 4 for more info. */
static float f_Rd(float alpha_, float A, float ro)
{
@@ -182,7 +182,7 @@ static float compute_reduced_albedo(ScatterSettings *ss)
int i;
/* use secant method to compute reduced albedo using Rd function inverse
- with a given reflectance */
+ * with a given reflectance */
fxn= f_Rd(xn, ss->A, ss->ro);
fxn_1= f_Rd(xn_1, ss->A, ss->ro);
@@ -232,10 +232,10 @@ static float Rd(ScatterSettings *ss, float r)
}
/* table lookups for Rd. this avoids expensive exp calls. we use two
- separate tables as well for lower and higher numbers to improve
- precision, since the number are poorly distributed because we do
- a lookup with the squared distance for smaller distances, saving
- another sqrt. */
+ * separate tables as well for lower and higher numbers to improve
+ * precision, since the number are poorly distributed because we do
+ * a lookup with the squared distance for smaller distances, saving
+ * another sqrt. */
static void approximate_Rd_rgb(ScatterSettings **ss, float rr, float *rd)
{
@@ -444,10 +444,10 @@ static void compute_radiance(ScatterTree *tree, float *co, float *rad)
traverse_octree(tree, tree->root, co, 1, &result);
/* the original paper doesn't do this, but we normalize over the
- sampled area and multiply with the reflectance. this is because
- our point samples are incomplete, there are no samples on parts
- of the mesh not visible from the camera. this can not only make
- it darker, but also lead to ugly color shifts */
+ * sampled area and multiply with the reflectance. this is because
+ * our point samples are incomplete, there are no samples on parts
+ * of the mesh not visible from the camera. this can not only make
+ * it darker, but also lead to ugly color shifts */
mul_v3_fl(result.rad, tree->ss[0]->frontweight);
mul_v3_fl(result.backrad, tree->ss[0]->backweight);
@@ -484,7 +484,7 @@ static void sum_leaf_radiance(ScatterTree *UNUSED(tree), ScatterNode *node)
node->backrad[0]= node->backrad[1]= node->backrad[2]= 0.0;
/* compute total rad, rad weighted average position,
- and total area */
+ * and total area */
for(i=0; i<node->totpoint; i++) {
p= &node->points[i];
@@ -532,7 +532,7 @@ static void sum_leaf_radiance(ScatterTree *UNUSED(tree), ScatterNode *node)
}
else {
/* make sure that if radiance is 0.0f, we still have these points in
- the tree at a good position, they count for rdsum too */
+ * the tree at a good position, they count for rdsum too */
for(i=0; i<node->totpoint; i++) {
p= &node->points[i];
@@ -558,7 +558,7 @@ static void sum_branch_radiance(ScatterTree *UNUSED(tree), ScatterNode *node)
node->backrad[0]= node->backrad[1]= node->backrad[2]= 0.0;
/* compute total rad, rad weighted average position,
- and total area */
+ * and total area */
for(i=0; i<8; i++) {
if(node->child[i] == NULL)
continue;
@@ -606,7 +606,7 @@ static void sum_branch_radiance(ScatterTree *UNUSED(tree), ScatterNode *node)
}
else {
/* make sure that if radiance is 0.0f, we still have these points in
- the tree at a good position, they count for rdsum too */
+ * the tree at a good position, they count for rdsum too */
totnode= 0;
for(i=0; i<8; i++) {
@@ -686,8 +686,8 @@ static void create_octree_node(ScatterTree *tree, ScatterNode *node, float *mid,
}
/* here we check if only one subnode is used. if this is the case, we don't
- create a new node, but rather call this function again, with different
- size and middle position for the same node. */
+ * create a new node, but rather call this function again, with different
+ * size and middle position for the same node. */
for(usedi=0, usednodes=0, i=0; i<8; i++) {
if(nsize[i]) {
usednodes++;
@@ -865,7 +865,7 @@ static void sss_create_tree_mat(Render *re, Material *mat)
points.first= points.last= NULL;
/* TODO: this is getting a bit ugly, copying all those variables and
- setting them back, maybe we need to create our own Render? */
+ * setting them back, maybe we need to create our own Render? */
/* do SSS preprocessing render */
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c
index cdc185160d5..5f034ee9aeb 100644
--- a/source/blender/render/intern/source/strand.c
+++ b/source/blender/render/intern/source/strand.c
@@ -680,7 +680,7 @@ static void strand_render(Render *re, StrandSegment *sseg, float winmat[][4], St
zbufclip4(re, &zspan[a], obi, index, p1->hoco2, p1->hoco1, p2->hoco1, p2->hoco2, p1->clip2, p1->clip1, p2->clip1, p2->clip2);
#endif
/* only render a line for now, which makes the shadow map more
- similiar across frames, and so reduces flicker */
+ * similiar across frames, and so reduces flicker */
zbufsinglewire(&zspan[a], obi, index, hoco1, hoco2);
}
}
diff --git a/source/blender/render/intern/source/sunsky.c b/source/blender/render/intern/source/sunsky.c
index 71ca2e056ac..1ecf197f694 100644
--- a/source/blender/render/intern/source/sunsky.c
+++ b/source/blender/render/intern/source/sunsky.c
@@ -20,6 +20,10 @@
/** \file blender/render/intern/source/sunsky.c
* \ingroup render
+ *
+ * This feature comes from Preetham paper on "A Practical Analytic Model for Daylight"
+ * and example code from Brian Smits, another author of that paper in
+ * http://www.cs.utah.edu/vissim/papers/sunsky/code/
*/
@@ -129,7 +133,7 @@ static float PerezFunction(struct SunSky *sunsky, const float *lam, float theta,
* InitSunSky:
* this function compute some sun,sky parameters according to input parameters and also initiate some other sun, sky parameters
* parameters:
- * sunSky, is a structure that contains informtion about sun, sky and atmosphere, in this function, most of its values initiated
+ * sunSky, is a structure that contains information about sun, sky and atmosphere, in this function, most of its values initiated
* turb, is atmosphere turbidity
* toSun, contains sun direction
* horizon_brighness, controls the brightness of the horizon colors
@@ -345,7 +349,7 @@ static void ComputeAttenuatedSunlight(float theta, int turbidity, float fTau[3])
/**
* InitAtmosphere:
- * this function intiate sunSky structure with user input parameters.
+ * this function initiate sunSky structure with user input parameters.
* parameters:
* sunSky, contains information about sun, and in this function some atmosphere parameters will initiated
* sun_intens, shows sun intensity value
diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c
index 8b3c3ec5c3d..f99eb0298bf 100644
--- a/source/blender/render/intern/source/volume_precache.c
+++ b/source/blender/render/intern/source/volume_precache.c
@@ -284,7 +284,7 @@ static inline int lc_to_ms_I(int x, int y, int z, int *n)
/* *** multiple scattering approximation *** */
-/* get the total amount of light energy in the light cache. used to normalise after multiple scattering */
+/* get the total amount of light energy in the light cache. used to normalize after multiple scattering */
static float total_ss_energy(Render *re, int do_test_break, VolumePrecache *vp)
{
int x, y, z;
@@ -437,7 +437,7 @@ static void multiple_scattering_diffusion(Render *re, VolumePrecache *vp, Materi
if (re->test_break(re->tbh)) break;
}
- /* normalisation factor to conserve energy */
+ /* normalization factor to conserve energy */
energy_ms = total_ms_energy(re, do_test_break, sr, sg, sb, n);
fac *= (energy_ss / energy_ms);
@@ -775,8 +775,7 @@ static void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *o
//tree= NULL;
}
- if (ELEM(ma->vol.shade_type, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SHADEDPLUSMULTIPLE))
- {
+ if (ELEM(ma->vol.shade_type, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SHADEDPLUSMULTIPLE)) {
/* this should be before the filtering */
multiple_scattering_diffusion(re, obi->volume_precache, ma);
}
diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c
index 66cbb18bc57..36895f8ad53 100644
--- a/source/blender/render/intern/source/volumetric.c
+++ b/source/blender/render/intern/source/volumetric.c
@@ -135,19 +135,20 @@ static int vol_get_bounds(ShadeInput *shi, const float co[3], const float vec[3]
isect->skip = RE_SKIP_VLR_NEIGHBOUR;
isect->orig.face = (void*)shi->vlr;
isect->orig.ob = (void*)shi->obi;
- } else { // if (intersect_type == VOL_BOUNDS_SS) {
+ }
+ else { // if (intersect_type == VOL_BOUNDS_SS) {
isect->skip= 0;
isect->orig.face= NULL;
isect->orig.ob = NULL;
}
- if(RE_rayobject_raycast(R.raytree, isect))
- {
+ if(RE_rayobject_raycast(R.raytree, isect)) {
hitco[0] = isect->start[0] + isect->dist*isect->dir[0];
hitco[1] = isect->start[1] + isect->dist*isect->dir[1];
hitco[2] = isect->start[2] + isect->dist*isect->dir[2];
return 1;
- } else {
+ }
+ else {
return 0;
}
}
@@ -365,7 +366,7 @@ static float vol_get_phasefunc(ShadeInput *UNUSED(shi), float g, const float w[3
const float normalize = 0.25f; // = 1.f/4.f = M_PI/(4.f*M_PI)
/* normalization constant is 1/4 rather than 1/4pi, since
- * Blender's shading system doesn't normalise for
+ * Blender's shading system doesn't normalize for
* energy conservation - eg. multiplying by pdf ( 1/pi for a lambert brdf ).
* This means that lambert surfaces in Blender are pi times brighter than they 'should be'
* and therefore, with correct energy conservation, volumes will darker than other solid objects,
@@ -382,8 +383,8 @@ static float vol_get_phasefunc(ShadeInput *UNUSED(shi), float g, const float w[3
return normalize * (1.f - k*k) / ((1.f - kcostheta) * (1.f - kcostheta));
}
- /*
- * not used, but here for reference:
+ /* not used, but here for reference: */
+#if 0
switch (phasefunc_type) {
case MA_VOL_PH_MIEHAZY:
return normalize * (0.5f + 4.5f * powf(0.5 * (1.f + costheta), 8.f));
@@ -403,7 +404,7 @@ static float vol_get_phasefunc(ShadeInput *UNUSED(shi), float g, const float w[3
default:
return normalize * 1.f;
}
- */
+#endif
}
/* Compute transmittance = e^(-attenuation) */
@@ -492,8 +493,7 @@ static void vol_shade_one_lamp(struct ShadeInput *shi, const float co[3], const
if (shi->mat->vol.shade_type == MA_VOL_SHADE_SHADOWED) {
mul_v3_fl(lacol, vol_get_shadow(shi, lar, co));
}
- else if (ELEM3(shi->mat->vol.shade_type, MA_VOL_SHADE_SHADED, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SHADEDPLUSMULTIPLE))
- {
+ else if (ELEM3(shi->mat->vol.shade_type, MA_VOL_SHADE_SHADED, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SHADEDPLUSMULTIPLE)) {
Isect is;
if (shi->mat->vol.shadeflag & MA_VOL_RECV_EXT_SHADOW) {
@@ -568,15 +568,15 @@ void vol_get_scattering(ShadeInput *shi, float scatter_col[3], const float co[3]
/*
-The main volumetric integrator, using an emission/absorption/scattering model.
-
-Incoming radiance =
-
-outgoing radiance from behind surface * beam transmittance/attenuation
-+ added radiance from all points along the ray due to participating media
- --> radiance for each segment =
- (radiance added by scattering + radiance added by emission) * beam transmittance/attenuation
-*/
+ * The main volumetric integrator, using an emission/absorption/scattering model.
+ *
+ * Incoming radiance =
+ *
+ * outgoing radiance from behind surface * beam transmittance/attenuation
+ * + added radiance from all points along the ray due to participating media
+ * --> radiance for each segment =
+ * (radiance added by scattering + radiance added by emission) * beam transmittance/attenuation
+ */
/* For ease of use, I've also introduced a 'reflection' and 'reflection color' parameter, which isn't
* physically correct. This works as an RGB tint/gain on out-scattered light, but doesn't affect the light
@@ -667,12 +667,12 @@ static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int in
int render_this=0;
/* don't render the backfaces of ztransp volume materials.
-
+ *
* volume shading renders the internal volume from between the
* ' view intersection of the solid volume to the
* intersection on the other side, as part of the shading of
* the front face.
-
+ *
* Because ztransp renders both front and back faces independently
* this will double up, so here we prevent rendering the backface as well,
* which would otherwise render the volume in between the camera and the backface
@@ -686,8 +686,7 @@ static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int in
}
- if (inside_volume == VOL_SHADE_INSIDE)
- {
+ if (inside_volume == VOL_SHADE_INSIDE) {
startco = shi->camera_co;
endco = shi->co;
@@ -706,8 +705,7 @@ static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int in
}
/* trace to find a backface, the other side bounds of the volume */
/* (ray intersect ignores front faces here) */
- else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH))
- {
+ else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) {
VlakRen *vlr = (VlakRen *)is.hit.face;
startco = shi->co;
diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c
index ebcc2ce997f..88571bb297b 100644
--- a/source/blender/render/intern/source/voxeldata.c
+++ b/source/blender/render/intern/source/voxeldata.c
@@ -228,8 +228,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
ob= vd->object;
/* draw code for smoke */
- if( (md = (ModifierData *)modifiers_findByType(ob, eModifierType_Smoke)) )
- {
+ if ((md = (ModifierData *)modifiers_findByType(ob, eModifierType_Smoke))) {
SmokeModifierData *smd = (SmokeModifierData *)md;
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index 0727fd6fdd7..d5ed5c7a824 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -244,7 +244,7 @@ int testclip(const float v[4])
short c=0;
/* if we set clip flags, the clipping should be at least larger than epsilon.
- prevents issues with vertices lying exact on borders */
+ * prevents issues with vertices lying exact on borders */
abs4= fabsf(v[3]) + FLT_EPSILON;
if( v[0] < -abs4) c+=1;
@@ -851,8 +851,8 @@ static int clipline(float v1[4], float v2[4]) /* return 0: do not draw */
dw= v2[3]-v1[3];
/* this 1.01 is for clipping x and y just a tinsy larger. that way it is
- filled in with zbufwire correctly when rendering in parts. otherwise
- you see line endings at edges... */
+ * filled in with zbufwire correctly when rendering in parts. otherwise
+ * you see line endings at edges... */
if(cliptestf(-dz, -dw, v1[3], v1[2], &u1,&u2)) {
if(cliptestf(dz, -dw, v1[3], -v1[2], &u1,&u2)) {
@@ -1591,8 +1591,7 @@ void zspan_scanconvert(ZSpan *zspan, void *handle, float *v1, float *v2, float *
/**
* (clip pyramid)
* Sets labda: flag, and parametrize the clipping of vertices in
- * viewspace coordinates. labda = -1 means no clipping, labda in [0,
- * 1] means a clipping.
+ * 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
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index eecc9cab028..21ea1bf909f 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -230,7 +230,7 @@ wmOperator *WM_operator_last_redo(const struct bContext *C);
#define WM_FILESEL_FILES (1 << 4)
- /* operator as a python command (resultuing string must be free'd) */
+ /* operator as a python command (resultuing string must be freed) */
char *WM_operator_pystring(struct bContext *C, struct wmOperatorType *ot, struct PointerRNA *opptr, int all_args);
void WM_operator_bl_idname(char *to, const char *from);
void WM_operator_py_idname(char *to, const char *from);
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 00c6cdbeb89..dbb000cef01 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -137,13 +137,13 @@ typedef struct wmNotifier {
} wmNotifier;
-/* 4 levels
-
-0xFF000000; category
-0x00FF0000; data
-0x0000FF00; data subtype (unused?)
-0x000000FF; action
-*/
+/* 4 levels
+ *
+ * 0xFF000000; category
+ * 0x00FF0000; data
+ * 0x0000FF00; data subtype (unused?)
+ * 0x000000FF; action
+ */
/* category */
#define NOTE_CATEGORY 0xFF000000
@@ -449,7 +449,7 @@ typedef struct wmOperatorType {
/* for modal temporary operators, initially invoke is called. then
* any further events are handled in modal. if the operation is
- * cancelled due to some external reason, cancel is called
+ * canceled due to some external reason, cancel is called
* - see defines below for return values */
int (*invoke)(struct bContext *, struct wmOperator *, struct wmEvent *);
int (*cancel)(struct bContext *, struct wmOperator *);
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index c6c67e22bfd..ea0a7388059 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -76,7 +76,7 @@ void WM_operator_free(wmOperator *op)
#ifdef WITH_PYTHON
if(op->py_instance) {
- /* do this first incase there are any __del__ functions or
+ /* do this first in case there are any __del__ functions or
* similar that use properties */
BPY_DECREF(op->py_instance);
}
@@ -217,10 +217,10 @@ void WM_keymap_init(bContext *C)
wm->userconf= WM_keyconfig_new(wm, "Blender User");
/* initialize only after python init is done, for keymaps that
- use python operators */
+ * use python operators */
if(CTX_py_init_get(C) && (wm->initialized & WM_INIT_KEYMAP) == 0) {
/* create default key config, only initialize once,
- it's persistent across sessions */
+ * it's persistent across sessions */
if(!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) {
wm_window_keymap(wm->defaultconf);
ED_spacetypes_keymap(wm->defaultconf);
@@ -255,7 +255,7 @@ void WM_check(bContext *C)
}
/* case: no open windows at all, for old file reads */
- wm_window_add_ghostwindows(C, wm);
+ wm_window_add_ghostwindows(wm);
}
/* case: fileread */
diff --git a/source/blender/windowmanager/intern/wm_apple.c b/source/blender/windowmanager/intern/wm_apple.c
index e17441873d5..1b2a4e490a4 100644
--- a/source/blender/windowmanager/intern/wm_apple.c
+++ b/source/blender/windowmanager/intern/wm_apple.c
@@ -40,15 +40,15 @@
#define ID ID_
#include <Carbon/Carbon.h>
-
/* To avoid killing small end comps, we want to allow
-blender to start maximised if all the followings are true :
-- Renderer is OpenGL capable
-- Hardware acceleration
-- VRAM > 16 Mo
+ * blender to start maximised if all the followings are true :
+ * - Renderer is OpenGL capable
+ * - Hardware acceleration
+ * - VRAM > 16 Mo
+ *
+ * We will bail out if VRAM is less than 8Mo
+ */
- We will bail out if VRAM is less than 8Mo
- */
/* bad global, used in wm_window.c to open windows */
int macPrefState = 0;
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index 0770faa8d47..e35a1a269ae 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -273,44 +273,44 @@ void WM_timecursor(wmWindow *win, int nr)
}
-/* ******************************************************************
-Custom Cursor Description:
-
-Each bit represents a pixel, so 1 byte = 8 pixels,
-the bytes go Left to Right. Top to bottom
-the bits in a byte go right to left
-(ie; 0x01, 0x80 represents a line of 16 pix with the first and last pix set.)
-
-A 0 in the bitmap = bg_color, a 1 fg_color
-a 0 in the mask = transparent pix.
-
-Until 32x32 cursors are supported on all platforms, the size of the
-small cursors MUST be 16x16.
-
-Large cursors have a MAXSIZE of 32x32.
-
-Other than that, the specified size of the cursors is just a guideline,
-However, the char array that defines the BM and MASK must be byte aligned.
-ie a 17x17 cursor needs 3 bytes (cols) * 17 bytes (rows)
-(3 bytes = 17 bits rounded up to nearest whole byte). Pad extra bits
-in mask with 0's.
-
-Setting big_bm=NULL disables the large version of the cursor.
-
-*******************************************************************
-
-There is a nice Python GUI utility that can be used for drawing cursors in
-this format in the Blender source distribution, in
-blender/source/tools/MakeCursor.py . Start it with $ python MakeCursor.py
-It will copy its output to the console when you press 'Do it'.
-
-*/
+/* ******************************************************************
+ * Custom Cursor Description:
+ *
+ * Each bit represents a pixel, so 1 byte = 8 pixels,
+ * the bytes go Left to Right. Top to bottom
+ * the bits in a byte go right to left
+ * (ie; 0x01, 0x80 represents a line of 16 pix with the first and last pix set.)
+ *
+ * A 0 in the bitmap = bg_color, a 1 fg_color
+ * a 0 in the mask = transparent pix.
+ *
+ * Until 32x32 cursors are supported on all platforms, the size of the
+ * small cursors MUST be 16x16.
+ *
+ * Large cursors have a MAXSIZE of 32x32.
+ *
+ * Other than that, the specified size of the cursors is just a guideline,
+ * However, the char array that defines the BM and MASK must be byte aligned.
+ * ie a 17x17 cursor needs 3 bytes (cols) * 17 bytes (rows)
+ * (3 bytes = 17 bits rounded up to nearest whole byte). Pad extra bits
+ * in mask with 0's.
+ *
+ * Setting big_bm=NULL disables the large version of the cursor.
+ *
+ * *******************************************************************
+ *
+ * There is a nice Python GUI utility that can be used for drawing cursors in
+ * this format in the Blender source distribution, in
+ * blender/source/tools/MakeCursor.py . Start it with $ python MakeCursor.py
+ * It will copy its output to the console when you press 'Do it'.
+ *
+ */
/* Because defining a cursor mixes declarations and executable code
-each cursor needs it's own scoping block or it would be split up
-over several hundred lines of code. To enforce/document this better
-I define 2 pretty braindead macros so it's obvious what the extra "[]"
-are for */
+ * each cursor needs it's own scoping block or it would be split up
+ * over several hundred lines of code. To enforce/document this better
+ * I define 2 pretty braindead macros so it's obvious what the extra "[]"
+ * are for */
#define BEGIN_CURSOR_BLOCK {
#define END_CURSOR_BLOCK }
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index df4ebfd9b9f..4751dbb87ff 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -576,8 +576,7 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win)
else {
win->drawdata= MEM_callocN(sizeof(wmDrawTriple), "wmDrawTriple");
- if(!wm_triple_gen_textures(win, win->drawdata))
- {
+ if(!wm_triple_gen_textures(win, win->drawdata)) {
wm_draw_triple_fail(C, win);
return;
}
@@ -702,9 +701,9 @@ static int wm_draw_update_test_window(wmWindow *win)
static int wm_automatic_draw_method(wmWindow *win)
{
/* Ideally all cards would work well with triple buffer, since if it works
- well gives the least redraws and is considerably faster at partial redraw
- for sculpting or drawing overlapping menus. For typically lower end cards
- copy to texture is slow though and so we use overlap instead there. */
+ * well gives the least redraws and is considerably faster at partial redraw
+ * for sculpting or drawing overlapping menus. For typically lower end cards
+ * copy to texture is slow though and so we use overlap instead there. */
if(win->drawmethod == USER_DRAW_AUTOMATIC) {
/* ATI opensource driver is known to be very slow at this */
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index d78faa76855..e15ed7b8929 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -537,8 +537,8 @@ static void wm_operator_finished(bContext *C, wmOperator *op, int repeat)
op->customdata= NULL;
/* we don't want to do undo pushes for operators that are being
- called from operators that already do an undo push. usually
- this will happen for python operators that call C operators */
+ * called from operators that already do an undo push. usually
+ * this will happen for python operators that call C operators */
if(wm->op_undo_depth == 0)
if(op->type->flag & OPTYPE_UNDO)
ED_undo_push_op(C, op);
@@ -690,8 +690,7 @@ static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, P
break;
/* skip invalid properties */
- if (strcmp(RNA_property_identifier(prop), otmacro->idname) == 0)
- {
+ if (strcmp(RNA_property_identifier(prop), otmacro->idname) == 0) {
wmOperatorType *otm= WM_operatortype_find(otmacro->idname, 0);
PointerRNA someptr = RNA_property_pointer_get(properties, prop);
wmOperator *opm= wm_operator_create(wm, otm, &someptr, NULL);
@@ -745,7 +744,7 @@ static int wm_operator_init_from_last(wmWindowManager *wm, wmOperator *op)
wmOperator *lastop;
for(lastop= wm->operators.last; lastop; lastop= lastop->prev) {
- /* equality check is a bit paranoid but just incase */
+ /* equality check is a bit paranoid but just in case */
if((op != lastop) && (op->type == (lastop->type))) {
break;
}
@@ -890,9 +889,9 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P
}
/* cancel UI handlers, typically tooltips that can hang around
- while dragging the view or worse, that stay there permanently
- after the modal operator has swallowed all events and passed
- none to the UI handler */
+ * while dragging the view or worse, that stay there permanently
+ * after the modal operator has swallowed all events and passed
+ * none to the UI handler */
wm_handler_ui_cancel(C);
}
else
@@ -1028,10 +1027,10 @@ int WM_operator_name_call(bContext *C, const char *opstring, int context, Pointe
}
/* Similar to WM_operator_name_call called with WM_OP_EXEC_DEFAULT context.
- - wmOperatorType is used instead of operator name since python already has the operator type
- - poll() must be called by python before this runs.
- - reports can be passed to this function (so python can report them as exceptions)
-*/
+ * - wmOperatorType is used instead of operator name since python already has the operator type
+ * - poll() must be called by python before this runs.
+ * - reports can be passed to this function (so python can report them as exceptions)
+ */
int WM_operator_call_py(bContext *C, wmOperatorType *ot, int context, PointerRNA *properties, ReportList *reports)
{
int retval= OPERATOR_CANCELLED;
@@ -1091,7 +1090,7 @@ static void wm_handler_op_context(bContext *C, wmEventHandler *handler)
break;
if(sa==NULL) {
/* when changing screen layouts with running modal handlers (like render display), this
- is not an error to print */
+ * is not an error to print */
if(handler->op==NULL)
printf("internal error: handler (%s) has invalid area\n", handler->op->type->idname);
}
@@ -1366,7 +1365,7 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
handler->op= NULL;
}
- /* remove modal handler, operator itself should have been cancelled and freed */
+ /* remove modal handler, operator itself should have been canceled and freed */
if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) {
WM_cursor_ungrab(CTX_wm_window(C));
@@ -1702,7 +1701,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
/* XXX code this for all modal ops, and ensure free only happens here */
/* modal ui handler can be tagged to be freed */
- if(BLI_findindex(handlers, handler) != -1) { /* could be free'd already by regular modal ops */
+ if(BLI_findindex(handlers, handler) != -1) { /* could be freed already by regular modal ops */
if(handler->flag & WM_HANDLER_DO_FREE) {
BLI_remlink(handlers, handler);
wm_event_free_handler(handler);
@@ -2029,7 +2028,7 @@ void wm_event_do_handlers(bContext *C)
}
/* XXX hrmf, this gives reliable previous mouse coord for area change, feels bad?
- doing it on ghost queue gives errors when mousemoves go over area borders */
+ * doing it on ghost queue gives errors when mousemoves go over area borders */
if(doit && win->screen && win->screen->subwinactive != win->screen->mainwin) {
win->eventstate->prevx= event->x;
win->eventstate->prevy= event->y;
@@ -2117,9 +2116,9 @@ void WM_event_fileselect_event(bContext *C, void *ophandle, int eventval)
/* optional property: filetype (XXX enum?) */
/* Idea is to keep a handler alive on window queue, owning the operator.
- The filewindow can send event to make it execute, thus ensuring
- executing happens outside of lower level queues, with UI refreshed.
- Should also allow multiwin solutions */
+ * The filewindow can send event to make it execute, thus ensuring
+ * executing happens outside of lower level queues, with UI refreshed.
+ * Should also allow multiwin solutions */
void WM_event_add_fileselect(bContext *C, wmOperator *op)
{
@@ -2338,7 +2337,7 @@ void WM_event_add_mousemove(bContext *C)
int WM_modal_tweak_exit(wmEvent *evt, int tweak_event)
{
/* if the release-confirm userpref setting is enabled,
- * tweak events can be cancelled when mouse is released
+ * tweak events can be canceled when mouse is released
*/
if (U.flag & USER_RELEASECONFIRM) {
/* option on, so can exit with km-release */
@@ -2486,8 +2485,7 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g
data->ry = s * ghost->ry;
data->rz = s * ghost->rz;
- if (U.ndof_flag & NDOF_ZOOM_UPDOWN)
- {
+ if (U.ndof_flag & NDOF_ZOOM_UPDOWN) {
/* rotate so Y is where Z was */
data->ty = s * ghost->tz;
data->tz = s * ghost->ty;
@@ -2502,8 +2500,7 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g
data->rz = s * ghost->ry;
#endif
}
- else
- {
+ else {
data->ty = s * ghost->ty;
data->tz = s * ghost->tz;
}
@@ -2585,8 +2582,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
event.type= MOUSEMOVE;
/* some painting operators want accurate mouse events, they can
- handle in between mouse move moves, others can happily ignore
- them for better performance */
+ * handle in between mouse move moves, others can happily ignore
+ * them for better performance */
if(lastevent && lastevent->type == MOUSEMOVE)
lastevent->type = INBETWEEN_MOUSEMOVE;
@@ -2757,14 +2754,14 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
}
/* this case happens on some systems that on holding a key pressed,
- generate press events without release, we still want to keep the
- modifier in win->eventstate, but for the press event of the same
- key we don't want the key modifier */
+ * generate press events without release, we still want to keep the
+ * modifier in win->eventstate, but for the press event of the same
+ * key we don't want the key modifier */
if(event.keymodifier == event.type)
event.keymodifier= 0;
/* this case happened with an external numpad, it's not really clear
- why, but it's also impossible to map a key modifier to an unknwon
- key, so it shouldn't harm */
+ * why, but it's also impossible to map a key modifier to an unknwon
+ * key, so it shouldn't harm */
if(event.keymodifier == UNKNOWNKEY)
event.keymodifier= 0;
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 41a77d65622..facc6136d3f 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -122,12 +122,12 @@
static void write_history(void);
-/* To be able to read files without windows closing, opening, moving
- we try to prepare for worst case:
- - active window gets active screen from file
- - restoring the screens from non-active windows
- Best case is all screens match, in that case they get assigned to proper window
-*/
+/* To be able to read files without windows closing, opening, moving
+ * we try to prepare for worst case:
+ * - active window gets active screen from file
+ * - restoring the screens from non-active windows
+ * Best case is all screens match, in that case they get assigned to proper window
+ */
static void wm_window_match_init(bContext *C, ListBase *wmlist)
{
wmWindowManager *wm;
@@ -175,11 +175,11 @@ static void wm_window_match_init(bContext *C, ListBase *wmlist)
}
/* match old WM with new, 4 cases:
- 1- no current wm, no read wm: make new default
- 2- no current wm, but read wm: that's OK, do nothing
- 3- current wm, but not in file: try match screen names
- 4- current wm, and wm in file: try match ghostwin
-*/
+ * 1- no current wm, no read wm: make new default
+ * 2- no current wm, but read wm: that's OK, do nothing
+ * 3- current wm, but not in file: try match screen names
+ * 4- current wm, and wm in file: try match ghostwin
+ */
static void wm_window_match_do(bContext *C, ListBase *oldwmlist)
{
@@ -334,13 +334,13 @@ static int wm_read_exotic(Scene *UNUSED(scene), const char *name)
}
else {
//XXX waitcursor(1);
- /*
+#if 0 /* historic stuff - no longer used */
if(is_foo_format(name)) {
read_foo(name);
retval= BKE_READ_EXOTIC_OK_OTHER;
}
else
- */
+#endif
{
retval= BKE_READ_EXOTIC_FAIL_FORMAT;
}
@@ -424,7 +424,12 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports)
/* important to do before NULL'ing the context */
BLI_exec_cb(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
- CTX_wm_window_set(C, NULL); /* exits queues */
+ if (!G.background) {
+ /* in background mode this makes it hard to load
+ * a blend file and do anything since the screen
+ * won't be set to a valid value again */
+ CTX_wm_window_set(C, NULL); /* exits queues */
+ }
#if 0
/* gives popups on windows but not linux, bug in report API
@@ -674,7 +679,7 @@ static ImBuf *blend_file_thumb(Scene *scene, int **thumb_pt)
/* gets scaled to BLEN_THUMB_SIZE */
ibuf= ED_view3d_draw_offscreen_imbuf_simple(scene, scene->camera,
BLEN_THUMB_SIZE * 2, BLEN_THUMB_SIZE * 2,
- IB_rect, OB_SOLID, err_out);
+ IB_rect, OB_SOLID, FALSE, err_out);
if(ibuf) {
float aspect= (scene->r.xsch*scene->r.xasp) / (scene->r.ysch*scene->r.yasp);
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 1ae03ca9f6f..f5dec4dbcd3 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -162,7 +162,7 @@ void WM_init(bContext *C, int argc, const char **argv)
BPY_driver_reset();
BPY_app_handlers_reset(FALSE); /* causes addon callbacks to be freed [#28068],
- * but this is actually what we want. */
+ * but this is actually what we want. */
BPY_modules_load_user(C);
#else
(void)argc; /* unused */
@@ -192,10 +192,10 @@ void WM_init(bContext *C, int argc, const char **argv)
WM_read_history();
/* allow a path of "", this is what happens when making a new file */
- /*
+#if 0
if(G.main->name[0] == 0)
BLI_make_file_string("/", G.main->name, BLI_getDefaultDocumentFolder(), "untitled.blend");
- */
+#endif
BLI_strncpy(G.lib, G.main->name, FILE_MAX);
}
@@ -271,8 +271,7 @@ int WM_init_game(bContext *C)
ar->winx = ar->winrct.xmax + 1;
ar->winy = ar->winrct.ymax + 1;
}
- else
- {
+ else {
GHOST_RectangleHandle rect = GHOST_GetClientBounds(win->ghostwin);
ar->winrct.ymax = GHOST_GetHeightRectangle(rect);
ar->winrct.xmax = GHOST_GetWidthRectangle(rect);
@@ -287,8 +286,7 @@ int WM_init_game(bContext *C)
return 1;
}
- else
- {
+ else {
ReportTimerInfo *rti;
BKE_report(&wm->reports, RPT_ERROR, "No valid 3D View found. Game auto start is not possible.");
diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c
index f2ee5a328d6..5e09a701755 100644
--- a/source/blender/windowmanager/intern/wm_jobs.c
+++ b/source/blender/windowmanager/intern/wm_jobs.c
@@ -58,29 +58,29 @@
/* ********************** Threaded Jobs Manager ****************************** */
/*
-Add new job
-- register in WM
-- configure callbacks
-
-Start or re-run job
-- if job running
- - signal job to end
- - add timer notifier to verify when it has ended, to start it
-- else
- - start job
- - add timer notifier to handle progress
-
-Stop job
- - signal job to end
- on end, job will tag itself as sleeping
-
-Remove job
-- signal job to end
- on end, job will remove itself
-
-When job is done:
-- it puts timer to sleep (or removes?)
-
+ * Add new job
+ * - register in WM
+ * - configure callbacks
+ *
+ * Start or re-run job
+ * - if job running
+ * - signal job to end
+ * - add timer notifier to verify when it has ended, to start it
+ * - else
+ * - start job
+ * - add timer notifier to handle progress
+ *
+ * Stop job
+ * - signal job to end
+ * on end, job will tag itself as sleeping
+ *
+ * Remove job
+ * - signal job to end
+ * on end, job will remove itself
+ *
+ * When job is done:
+ * - it puts timer to sleep (or removes?)
+ *
*/
struct wmJob {
@@ -150,7 +150,7 @@ static wmJob *wm_job_find(wmWindowManager *wm, void *owner, const char *name)
/* returns current or adds new job, but doesnt run it */
/* every owner only gets a single job, adding a new one will stop running stop and
- when stopped it starts the new one */
+ * when stopped it starts the new one */
wmJob *WM_jobs_get(wmWindowManager *wm, wmWindow *win, void *owner, const char *name, int flag)
{
wmJob *steve= wm_job_find(wm, owner, name);
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index d603262227f..107ebd8699c 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -240,7 +240,7 @@ static wmKeyConfig *WM_keyconfig_active(wmWindowManager *wm)
void WM_keyconfig_set_active(wmWindowManager *wm, const char *idname)
{
/* setting a different key configuration as active: we ensure all is
- updated properly before and after making the change */
+ * updated properly before and after making the change */
WM_keyconfig_update(wm);
@@ -534,7 +534,7 @@ static wmKeyMap *wm_keymap_patch_update(ListBase *lb, wmKeyMap *defaultmap, wmKe
/* copy new keymap from an existing one */
if(usermap && !(usermap->flag & KEYMAP_DIFF)) {
/* for compatibiltiy with old user preferences with non-diff
- keymaps we override the original entirely */
+ * keymaps we override the original entirely */
wmKeyMapItem *kmi, *orig_kmi;
km = wm_keymap_copy(usermap);
@@ -620,8 +620,8 @@ static void wm_keymap_diff_update(ListBase *lb, wmKeyMap *defaultmap, wmKeyMap *
/* ****************** storage in WM ************ */
/* name id's are for storing general or multiple keymaps,
- space/region ids are same as DNA_space_types.h */
-/* gets free'd in wm.c */
+ * space/region ids are same as DNA_space_types.h */
+/* gets freed in wm.c */
wmKeyMap *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int regionid)
{
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 7f3fd9d1355..22e6d5be383 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -461,7 +461,7 @@ void WM_operator_py_idname(char *to, const char *from)
int ofs= (sep-from);
/* note, we use ascii tolower instead of system tolower, because the
- latter depends on the locale, and can lead to idname mistmatch */
+ * latter depends on the locale, and can lead to idname mistmatch */
memcpy(to, from, sizeof(char)*ofs);
BLI_ascii_strtolower(to, ofs);
@@ -469,7 +469,7 @@ void WM_operator_py_idname(char *to, const char *from)
BLI_strncpy(to+(ofs+1), sep+4, OP_MAX_TYPENAME);
}
else {
- /* should not happen but support just incase */
+ /* should not happen but support just in case */
BLI_strncpy(to, from, OP_MAX_TYPENAME);
}
}
@@ -490,7 +490,7 @@ void WM_operator_bl_idname(char *to, const char *from)
BLI_strncpy(to+(ofs+4), sep+1, OP_MAX_TYPENAME);
}
else {
- /* should not happen but support just incase */
+ /* should not happen but support just in case */
BLI_strncpy(to, from, OP_MAX_TYPENAME);
}
}
@@ -666,7 +666,7 @@ void WM_operator_properties_free(PointerRNA *ptr)
if(properties) {
IDP_FreeProperty(properties);
MEM_freeN(properties);
- ptr->data= NULL; /* just incase */
+ ptr->data= NULL; /* just in case */
}
}
@@ -692,7 +692,7 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
return retval;
}
else {
- pup= uiPupMenuBegin(C, op->type->name, ICON_NONE);
+ pup= uiPupMenuBegin(C, IFACE_(op->type->name), ICON_NONE);
layout= uiPupMenuLayout(pup);
uiItemsFullEnumO(layout, op->type->idname, RNA_property_identifier(prop), op->ptr->data, WM_OP_EXEC_REGION_WIN, 0);
uiPupMenuEnd(C, pup);
@@ -1228,10 +1228,11 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse
static void wm_block_splash_refreshmenu (bContext *UNUSED(C), void *UNUSED(arg_block), void *UNUSED(arg))
{
/* ugh, causes crashes in other buttons, disabling for now until
- * a better fix
+ * a better fix */
+#if 0
uiPupBlockClose(C, arg_block);
uiPupBlock(C, wm_block_create_splash, NULL);
- */
+#endif
}
static int wm_resource_check_prev(void)
@@ -1672,9 +1673,9 @@ int wm_link_append_poll(bContext *C)
{
if(WM_operator_winactive(C)) {
/* linking changes active object which is pretty useful in general,
- but which totally confuses edit mode (i.e. it becoming not so obvious
- to leave from edit mode and inwalid tools in toolbar might be displayed)
- so disable link/append when in edit mode (sergey) */
+ * but which totally confuses edit mode (i.e. it becoming not so obvious
+ * to leave from edit mode and inwalid tools in toolbar might be displayed)
+ * so disable link/append when in edit mode (sergey) */
if(CTX_data_edit_object(C))
return 0;
@@ -2272,10 +2273,10 @@ static void WM_OT_console_toggle(wmOperatorType *ot)
/* ************ default paint cursors, draw always around cursor *********** */
/*
- - returns handler to free
- - poll(bContext): returns 1 if draw should happen
- - draw(bContext): drawing callback for paint cursor
-*/
+ * - returns handler to free
+ * - poll(bContext): returns 1 if draw should happen
+ * - draw(bContext): drawing callback for paint cursor
+ */
void *WM_paint_cursor_activate(wmWindowManager *wm, int (*poll)(bContext *C),
wmPaintCursorDraw draw, void *customdata)
@@ -2312,11 +2313,11 @@ void WM_paint_cursor_end(wmWindowManager *wm, void *handle)
/* **************** Border gesture *************** */
/* Border gesture has two types:
- 1) WM_GESTURE_CROSS_RECT: starts a cross, on mouse click it changes to border
- 2) WM_GESTURE_RECT: starts immediate as a border, on mouse click or release it ends
-
- It stores 4 values (xmin, xmax, ymin, ymax) and event it ended with (event_type)
-*/
+ * 1) WM_GESTURE_CROSS_RECT: starts a cross, on mouse click it changes to border
+ * 2) WM_GESTURE_RECT: starts immediate as a border, on mouse click or release it ends
+ *
+ * It stores 4 values (xmin, xmax, ymin, ymax) and event it ended with (event_type)
+ */
static int border_apply_rect(wmOperator *op)
{
@@ -2726,7 +2727,7 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event)
y = (event->y - sy - lasso[1]);
/* make a simple distance check to get a smoother lasso
- add only when at least 2 pixels between this and previous location */
+ * add only when at least 2 pixels between this and previous location */
if((x*x+y*y) > 4) {
lasso += 2;
lasso[0] = event->x - sx;
@@ -3112,8 +3113,8 @@ typedef enum {
} RCPropFlags;
/* attempt to retrieve the rna pointer/property from an rna path;
- returns 0 for failure, 1 for success, and also 1 if property is not
- set */
+ * returns 0 for failure, 1 for success, and also 1 if property is not
+ * set */
static int radial_control_get_path(PointerRNA *ctx_ptr, wmOperator *op,
const char *name, PointerRNA *r_ptr,
PropertyRNA **r_prop, int req_length, RCPropFlags flags)
@@ -3326,8 +3327,8 @@ static int radial_control_cancel(bContext *C, wmOperator *op)
wm->paintcursors = rc->orig_paintcursors;
/* not sure if this is a good notifier to use;
- intended purpose is to update the UI so that the
- new value is displayed in sliders/numfields */
+ * intended purpose is to update the UI so that the
+ * new value is displayed in sliders/numfields */
WM_event_add_notifier(C, NC_WINDOW, NULL);
glDeleteTextures(1, &rc->gltex);
@@ -3387,7 +3388,7 @@ static int radial_control_modal(bContext *C, wmOperator *op, wmEvent *event)
case ESCKEY:
case RIGHTMOUSE:
- /* cancelled; restore original value */
+ /* canceled; restore original value */
radial_control_set_value(rc, rc->initial_value);
ret = OPERATOR_CANCELLED;
break;
@@ -3835,6 +3836,7 @@ static void gesture_border_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_assign(keymap, "SEQUENCER_OT_view_ghost_border");
WM_modalkeymap_assign(keymap, "UV_OT_select_border");
WM_modalkeymap_assign(keymap, "CLIP_OT_select_border");
+ WM_modalkeymap_assign(keymap, "CLIP_OT_graph_select_border");
WM_modalkeymap_assign(keymap, "VIEW2D_OT_zoom_border");
WM_modalkeymap_assign(keymap, "VIEW3D_OT_clip_border");
WM_modalkeymap_assign(keymap, "VIEW3D_OT_render_border");
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c
index 8a4dd3df134..5e11e31c045 100644
--- a/source/blender/windowmanager/intern/wm_subwindow.c
+++ b/source/blender/windowmanager/intern/wm_subwindow.c
@@ -58,14 +58,14 @@
/* wmSubWindow stored in wmWindow... but not exposed outside this C file */
/* it seems a bit redundant (area regions can store it too, but we keep it
- because we can store all kind of future opengl fanciness here */
+ * because we can store all kind of future opengl fanciness here */
/* we use indices and array because:
- - index has safety, no pointers from this C file hanging around
- - fast lookups of indices with array, list would give overhead
- - old code used it this way...
- - keep option open to have 2 screens using same window
-*/
+ * - index has safety, no pointers from this C file hanging around
+ * - fast lookups of indices with array, list would give overhead
+ * - old code used it this way...
+ * - keep option open to have 2 screens using same window
+ */
typedef struct wmSubWindow {
struct wmSubWindow *next, *prev;
@@ -207,17 +207,17 @@ void wm_subwindow_position(wmWindow *win, int swinid, rcti *winrct)
swin->winrct= *winrct;
/* CRITICAL, this clamping ensures that
- * the viewport never goes outside the screen
- * edges (assuming the x, y coords aren't
- * outside). This caused a hardware lock
- * on Matrox cards if it happens.
- *
- * Really Blender should never _ever_ try
- * to do such a thing, but just to be safe
- * clamp it anyway (or fix the bScreen
- * scaling routine, and be damn sure you
- * fixed it). - zr (2001!)
- */
+ * the viewport never goes outside the screen
+ * edges (assuming the x, y coords aren't
+ * outside). This caused a hardware lock
+ * on Matrox cards if it happens.
+ *
+ * Really Blender should never _ever_ try
+ * to do such a thing, but just to be safe
+ * clamp it anyway (or fix the bScreen
+ * scaling routine, and be damn sure you
+ * fixed it). - zr (2001!)
+ */
if (swin->winrct.xmax > win->sizex)
swin->winrct.xmax= win->sizex;
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 6842b6be497..ed1a5f9d577 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -85,7 +85,7 @@ static unsigned short useprefsize= 0;
/* ******** win open & close ************ */
/* XXX this one should correctly check for apple top header...
- done for Cocoa : returns window contents (and not frame) max size*/
+ * done for Cocoa : returns window contents (and not frame) max size*/
void wm_get_screensize(int *width_r, int *height_r)
{
unsigned int uiwidth;
@@ -141,7 +141,7 @@ static void wm_ghostwindow_destroy(wmWindow *win)
}
/* including window itself, C can be NULL.
- ED_screen_exit should have been called */
+ * ED_screen_exit should have been called */
void wm_window_free(bContext *C, wmWindowManager *wm, wmWindow *win)
{
wmTimer *wt, *wtnext;
@@ -290,8 +290,8 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win)
GHOST_SetTitle(win->ghostwin, "Blender");
/* Informs GHOST of unsaved changes, to set window modified visual indicator (MAC OS X)
- and to give hint of unsaved changes for a user warning mechanism
- in case of OS application terminate request (e.g. OS Shortcut Alt+F4, Cmd+Q, (...), or session end) */
+ * and to give hint of unsaved changes for a user warning mechanism
+ * in case of OS application terminate request (e.g. OS Shortcut Alt+F4, Cmd+Q, (...), or session end) */
GHOST_SetWindowModifiedState(win->ghostwin, (GHOST_TUns8)!wm->file_saved);
#if defined(__APPLE__) && !defined(GHOST_COCOA)
@@ -304,17 +304,10 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win)
}
/* belongs to below */
-static void wm_window_add_ghostwindow(bContext *C, const char *title, wmWindow *win)
+static void wm_window_add_ghostwindow(const char *title, wmWindow *win)
{
GHOST_WindowHandle ghostwin;
int scr_w, scr_h, posy;
- GHOST_TWindowState initial_state;
-
- /* when there is no window open uses the initial state */
- if(!CTX_wm_window(C))
- initial_state= initialstate;
- else
- initial_state= GHOST_kWindowStateNormal;
wm_get_screensize(&scr_w, &scr_h);
posy= (scr_h - win->posy - win->sizey);
@@ -326,10 +319,10 @@ static void wm_window_add_ghostwindow(bContext *C, const char *title, wmWindow *
}
#endif
/* Disable AA for now, as GL_SELECT (used for border, lasso, ... select)
- doesn't work well when AA is initialized, even if not used. */
+ * doesn't work well when AA is initialized, even if not used. */
ghostwin= GHOST_CreateWindow(g_system, title,
win->posx, posy, win->sizex, win->sizey,
- initial_state,
+ (GHOST_TWindowState)win->windowstate,
GHOST_kDrawingContextTypeOpenGL,
0 /* no stereo */,
0 /* no AA */);
@@ -339,7 +332,7 @@ static void wm_window_add_ghostwindow(bContext *C, const char *title, wmWindow *
GPU_extensions_init();
/* set the state*/
- GHOST_SetWindowState(ghostwin, initial_state);
+ GHOST_SetWindowState(ghostwin, (GHOST_TWindowState)win->windowstate);
win->ghostwin= ghostwin;
GHOST_SetWindowUserData(ghostwin, win); /* pointer back */
@@ -368,7 +361,7 @@ static void wm_window_add_ghostwindow(bContext *C, const char *title, wmWindow *
/* for wmWindows without ghostwin, open these and clear */
/* window size is read from window, if 0 it uses prefsize */
/* called in WM_check, also inits stuff after file read */
-void wm_window_add_ghostwindows(bContext* C, wmWindowManager *wm)
+void wm_window_add_ghostwindows(wmWindowManager *wm)
{
wmKeyMap *keymap;
wmWindow *win;
@@ -404,7 +397,7 @@ void wm_window_add_ghostwindows(bContext* C, wmWindowManager *wm)
win->windowstate= initialstate;
useprefsize= 0;
}
- wm_window_add_ghostwindow(C, "Blender", win);
+ wm_window_add_ghostwindow("Blender", win);
}
/* happens after fileread */
if(win->eventstate==NULL)
@@ -450,7 +443,7 @@ wmWindow *WM_window_open(bContext *C, rcti *rect)
}
/* uses screen->temp tag to define what to do, currently it limits
- to only one "temp" window for render out, preferences, filewindow, etc */
+ * to only one "temp" window for render out, preferences, filewindow, etc */
/* type is #define in WM_api.h */
void WM_window_open_temp(bContext *C, rcti *position, int type)
@@ -698,6 +691,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
case GHOST_kEventWindowMove: {
GHOST_TWindowState state;
state = GHOST_GetWindowState(win->ghostwin);
+ win->windowstate = state;
/* win32: gives undefined window size when minimized */
if(state!=GHOST_kWindowStateMinimized) {
@@ -777,7 +771,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
if (path) {
/* operator needs a valid window in context, ensures
- it is correctly set */
+ * it is correctly set */
oldWindow = CTX_wm_window(C);
CTX_wm_window_set(C, win);
@@ -860,11 +854,11 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
/* This timer system only gives maximum 1 timer event per redraw cycle,
- to prevent queues to get overloaded.
- Timer handlers should check for delta to decide if they just
- update, or follow real time.
- Timer handlers can also set duration to match frames passed
-*/
+ * to prevent queues to get overloaded.
+ * Timer handlers should check for delta to decide if they just
+ * update, or follow real time.
+ * Timer handlers can also set duration to match frames passed
+ */
static int wm_window_timer(const bContext *C)
{
wmWindowManager *wm= CTX_wm_manager(C);
@@ -931,8 +925,8 @@ void wm_window_testbreak(void)
double curtime= PIL_check_seconds_timer();
/* only check for breaks every 50 milliseconds
- * if we get called more often.
- */
+ * if we get called more often.
+ */
if ((curtime-ltime)>.05) {
int hasevent= GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */
diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h
index 02434d85c51..30f6c564688 100644
--- a/source/blender/windowmanager/wm_event_types.h
+++ b/source/blender/windowmanager/wm_event_types.h
@@ -78,8 +78,8 @@
/* NDOF (from SpaceNavigator & friends)
- These should be kept in sync with GHOST_NDOFManager.h
- Ordering matters, exact values do not. */
+ * These should be kept in sync with GHOST_NDOFManager.h
+ * Ordering matters, exact values do not. */
#define NDOF_MOTION 400
diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h
index 27eb4542877..6fd4ced9c23 100644
--- a/source/blender/windowmanager/wm_window.h
+++ b/source/blender/windowmanager/wm_window.h
@@ -46,7 +46,7 @@ void wm_window_free (bContext *C, wmWindowManager *wm, wmWindow *win);
void wm_window_close (bContext *C, wmWindowManager *wm, wmWindow *win);
void wm_window_title (wmWindowManager *wm, wmWindow *win);
-void wm_window_add_ghostwindows (bContext *C, wmWindowManager *wm);
+void wm_window_add_ghostwindows (wmWindowManager *wm);
void wm_window_process_events (const bContext *C);
void wm_window_process_events_nosleep(void);
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
index c38631ec94b..1724ac22773 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -296,6 +296,7 @@ void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist)
struct BGpic *ED_view3D_background_image_new(struct View3D *v3d){return (struct BGpic *) NULL;}
void ED_view3D_background_image_remove(struct View3D *v3d, struct BGpic *bgpic){}
void ED_view3D_background_image_clear(struct View3D *v3d){}
+void ED_view3d_update_viewmat(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, float viewmat[][4], float winmat[][4]){}
void view3d_apply_mat4(float mat[][4], float *ofs, float *quat, float *dist){}
int text_file_modified(struct Text *text){return 0;}
void ED_node_shader_default(struct Material *ma){}
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 68e72bb1611..68d95a39a5b 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -493,9 +493,9 @@ static int no_joystick(int UNUSED(argc), const char **UNUSED(argv), void *data)
SYS_SystemHandle *syshandle = data;
/**
- don't initialize joysticks if user doesn't want to use joysticks
- failed joystick initialization delays over 5 seconds, before game engine start
- */
+ * don't initialize joysticks if user doesn't want to use joysticks
+ * failed joystick initialization delays over 5 seconds, before game engine start
+ */
SYS_WriteCommandLineInt(*syshandle, "nojoystick",1);
if (G.f & G_DEBUG) printf("disabling nojoystick\n");
#endif
@@ -571,8 +571,7 @@ static int set_engine(int argc, const char **argv, void *data)
return 1;
}
- else
- {
+ else {
printf("\nEngine not specified, give 'help' for a list of available engines.\n");
return 0;
}
@@ -651,31 +650,28 @@ static int set_ge_parameters(int argc, const char **argv, void *data)
(void)data;
#endif
-/**
-gameengine parameters are automaticly put into system
--g [paramname = value]
--g [boolparamname]
-example:
--g novertexarrays
--g maxvertexarraysize = 512
-*/
-
- if(argc >= 1)
- {
+ /**
+ * gameengine parameters are automatically put into system
+ * -g [paramname = value]
+ * -g [boolparamname]
+ * example:
+ * -g novertexarrays
+ * -g maxvertexarraysize = 512
+ */
+
+ if (argc >= 1) {
const char *paramname = argv[a];
/* check for single value versus assignment */
- if (a+1 < argc && (*(argv[a+1]) == '='))
- {
+ if (a+1 < argc && (*(argv[a+1]) == '=')) {
a++;
- if (a+1 < argc)
- {
+ if (a+1 < argc) {
a++;
/* assignment */
#ifdef WITH_GAMEENGINE
SYS_WriteCommandLineString(syshandle,paramname,argv[a]);
#endif
- } else
- {
+ }
+ else {
printf("error: argument assignment (%s) without value.\n",paramname);
return 0;
}
@@ -686,13 +682,11 @@ example:
SYS_WriteCommandLineInt(syshandle,argv[a],1);
#endif
/* doMipMap */
- if (!strcmp(argv[a],"nomipmap"))
- {
+ if (!strcmp(argv[a],"nomipmap")) {
GPU_set_mipmap(0); //doMipMap = 0;
}
/* linearMipMap */
- if (!strcmp(argv[a],"linearmipmap"))
- {
+ if (!strcmp(argv[a],"linearmipmap")) {
GPU_set_linear_mipmap(1); //linearMipMap = 1;
}
@@ -757,7 +751,8 @@ static int render_animation(int UNUSED(argc), const char **UNUSED(argv), void *d
RE_SetReports(re, &reports);
RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, scene->r.sfra, scene->r.efra, scene->r.frame_step);
RE_SetReports(re, NULL);
- } else {
+ }
+ else {
printf("\nError: no blend loaded. cannot use '-a'.\n");
}
return 0;
@@ -939,8 +934,8 @@ static int load_file(int UNUSED(argc), const char **argv, void *data)
if (G.background) {
int retval = BKE_read_file(C, filename, NULL);
- /*we successfully loaded a blend file, get sure that
- pointcache works */
+ /* we successfully loaded a blend file, get sure that
+ * pointcache works */
if (retval != BKE_READ_FILE_FAIL) {
wmWindowManager *wm= CTX_wm_manager(C);
@@ -978,7 +973,7 @@ static int load_file(int UNUSED(argc), const char **argv, void *data)
// BKE_write_undo("original"); /* save current state */
} else {
/* we are not running in background mode here, but start blender in UI mode with
- a file - this should do everything a 'load file' does */
+ * a file - this should do everything a 'load file' does */
ReportList reports;
BKE_reports_init(&reports, RPT_PRINT);
WM_read_file(C, filename, &reports);
@@ -1207,7 +1202,7 @@ int main(int argc, const char **argv)
BKE_font_register_builtin(datatoc_Bfont, datatoc_Bfont_size);
/* Initialiaze ffmpeg if built in, also needed for bg mode if videos are
- rendered via ffmpeg */
+ * rendered via ffmpeg */
sound_init_once();
init_def_material();
@@ -1238,10 +1233,8 @@ int main(int argc, const char **argv)
/**
* NOTE: the U.pythondir string is NULL until WM_init() is executed,
* so we provide the BPY_ function below to append the user defined
- * pythondir to Python's sys.path at this point. Simply putting
- * WM_init() before BPY_python_start() crashes Blender at startup.
- * Update: now this function also inits the bpymenus, which also depend
- * on U.pythondir.
+ * python-dir to Python's sys.path at this point. Simply putting
+ * WM_init() before #BPY_python_start() crashes Blender at startup.
*/
// TODO - U.pythondir
@@ -1265,30 +1258,22 @@ int main(int argc, const char **argv)
return 0; /* keep blender in background mode running */
#endif
- if(G.background) {
+ if (G.background) {
/* actually incorrect, but works for now (ton) */
WM_exit(C);
}
-
else {
- if((G.fileflags & G_FILE_AUTOPLAY) && (G.f & G_SCRIPT_AUTOEXEC))
- {
+ if((G.fileflags & G_FILE_AUTOPLAY) && (G.f & G_SCRIPT_AUTOEXEC)) {
if(WM_init_game(C))
return 0;
}
- else if(!G.file_loaded)
+ else if(!G.file_loaded) {
WM_init_splash(C);
+ }
}
WM_main(C);
-
- /*XXX if (scr_init==0) {
- main_init_screen();
- }
-
- screenmain();*/ /* main display loop */
-
return 0;
} /* end of int main(argc,argv) */
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
index 493516aeef4..d8bb45707e5 100644
--- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
+++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
@@ -269,7 +269,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
draw_letterbox = 1;
}
else {
- camzoom = 1.0 / BKE_screen_view3d_zoom_to_fac(rv3d->camzoom);
+ camzoom = 1.0f / BKE_screen_view3d_zoom_to_fac(rv3d->camzoom);
}
}
else {
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderSystem.h b/source/gameengine/BlenderRoutines/KX_BlenderSystem.h
index 90685e426e6..2674c9a7aa1 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderSystem.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderSystem.h
@@ -45,7 +45,7 @@ class KX_BlenderSystem : public KX_ISystem
public:
KX_BlenderSystem();
- virtual ~KX_BlenderSystem() {};
+ virtual ~KX_BlenderSystem() {}
virtual double GetTimeInSeconds();
#ifdef WITH_CXX_GUARDEDALLOC
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp
index b06d85f2356..5d87e7fd969 100644
--- a/source/gameengine/Converter/BL_ActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ActionActuator.cpp
@@ -370,7 +370,7 @@ PyObject* BL_ActionActuator::PyGetChannel(PyObject* value)
obj->GetPose(&m_pose); /* Get the underlying pose from the armature */
}
- // get_pose_channel accounts for NULL pose, run on both incase one exists but
+ // get_pose_channel accounts for NULL pose, run on both in case one exists but
// the channel doesnt
if( !(pchan=get_pose_channel(m_userpose, string)) &&
!(pchan=get_pose_channel(m_pose, string)) )
@@ -401,12 +401,12 @@ PyObject* BL_ActionActuator::PyGetChannel(PyObject* value)
PyTuple_SET_ITEM(ret, 2, list);
return ret;
-/*
+#if 0
return Py_BuildValue("([fff][fff][ffff])",
pchan->loc[0], pchan->loc[1], pchan->loc[2],
pchan->size[0], pchan->size[1], pchan->size[2],
pchan->quat[0], pchan->quat[1], pchan->quat[2], pchan->quat[3] );
-*/
+#endif
}
/* setChannel */
diff --git a/source/gameengine/Converter/BL_ArmatureActuator.cpp b/source/gameengine/Converter/BL_ArmatureActuator.cpp
index 73403baa15e..3f4a261a972 100644
--- a/source/gameengine/Converter/BL_ArmatureActuator.cpp
+++ b/source/gameengine/Converter/BL_ArmatureActuator.cpp
@@ -53,7 +53,8 @@ BL_ArmatureActuator::BL_ArmatureActuator(SCA_IObject* obj,
const char *constraintname,
KX_GameObject* targetobj,
KX_GameObject* subtargetobj,
- float weight) :
+ float weight,
+ float influence) :
SCA_IActuator(obj, KX_ACT_ARMATURE),
m_constraint(NULL),
m_gametarget(targetobj),
@@ -61,6 +62,7 @@ BL_ArmatureActuator::BL_ArmatureActuator(SCA_IObject* obj,
m_posechannel(posechannel),
m_constraintname(constraintname),
m_weight(weight),
+ m_influence(influence),
m_type(type)
{
if (m_gametarget)
@@ -173,6 +175,10 @@ bool BL_ArmatureActuator::Update(double curtime, bool frame)
if (m_constraint)
m_constraint->SetWeight(m_weight);
break;
+ case ACT_ARM_SETINFLUENCE:
+ if (m_constraint)
+ m_constraint->SetInfluence(m_influence);
+ break;
}
}
return result;
@@ -216,6 +222,7 @@ PyAttributeDef BL_ArmatureActuator::Attributes[] = {
KX_PYATTRIBUTE_RW_FUNCTION("target", BL_ArmatureActuator, pyattr_get_object, pyattr_set_object),
KX_PYATTRIBUTE_RW_FUNCTION("subtarget", BL_ArmatureActuator, pyattr_get_object, pyattr_set_object),
KX_PYATTRIBUTE_FLOAT_RW("weight",0.0f,1.0f,BL_ArmatureActuator,m_weight),
+ KX_PYATTRIBUTE_FLOAT_RW("influence",0.0f,1.0f,BL_ArmatureActuator,m_influence),
KX_PYATTRIBUTE_INT_RW("type",0,ACT_ARM_MAXTYPE,false,BL_ArmatureActuator,m_type),
{ NULL } //Sentinel
};
diff --git a/source/gameengine/Converter/BL_ArmatureActuator.h b/source/gameengine/Converter/BL_ArmatureActuator.h
index 761d429f784..638640c27ce 100644
--- a/source/gameengine/Converter/BL_ArmatureActuator.h
+++ b/source/gameengine/Converter/BL_ArmatureActuator.h
@@ -54,7 +54,8 @@ public:
const char *constraintname,
KX_GameObject* targetobj,
KX_GameObject* subtargetobj,
- float weight);
+ float weight,
+ float influence);
virtual ~BL_ArmatureActuator();
@@ -88,6 +89,7 @@ private:
STR_String m_posechannel;
STR_String m_constraintname;
float m_weight;
+ float m_influence;
int m_type;
};
diff --git a/source/gameengine/Converter/BL_ArmatureChannel.h b/source/gameengine/Converter/BL_ArmatureChannel.h
index 3fd49c276ae..cd38ee2d531 100644
--- a/source/gameengine/Converter/BL_ArmatureChannel.h
+++ b/source/gameengine/Converter/BL_ArmatureChannel.h
@@ -72,8 +72,8 @@ public:
};
/* this is a factory class to access bBone data field in the GE.
- It's not supposed to be instantiated, we only need it for the Attributes and Method array.
- The actual proxy object will be manually created using NewProxyPtr */
+ * It's not supposed to be instantiated, we only need it for the Attributes and Method array.
+ * The actual proxy object will be manually created using NewProxyPtr */
class BL_ArmatureBone : public PyObjectPlus
{
// use Py_HeaderPtr since we use generic pointer in proxy
diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.h b/source/gameengine/Converter/BL_ArmatureConstraint.h
index 89bad520563..0d79bb1cfa7 100644
--- a/source/gameengine/Converter/BL_ArmatureConstraint.h
+++ b/source/gameengine/Converter/BL_ArmatureConstraint.h
@@ -104,6 +104,11 @@ public:
con->weight = weight;
}
}
+ void SetInfluence(float influence)
+ {
+ if (m_constraint)
+ m_constraint->enforce = influence;
+ }
void SetTarget(KX_GameObject* target);
void SetSubtarget(KX_GameObject* subtarget);
diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp
index 5a44e1022ff..dd2e29e4288 100644
--- a/source/gameengine/Converter/BL_ArmatureObject.cpp
+++ b/source/gameengine/Converter/BL_ArmatureObject.cpp
@@ -120,8 +120,10 @@ void game_copy_pose(bPose **dst, bPose *src, int copy_constraint)
}
// fails to link, props are not used in the BGE yet.
- /* if(pchan->prop)
- pchan->prop= IDP_CopyProperty(pchan->prop); */
+#if 0
+ if(pchan->prop)
+ pchan->prop= IDP_CopyProperty(pchan->prop);
+#endif
pchan->prop= NULL;
}
@@ -287,6 +289,7 @@ void BL_ArmatureObject::LoadConstraints(KX_BlenderSceneConverter* converter)
// which constraint should we support?
switch (pcon->type) {
case CONSTRAINT_TYPE_TRACKTO:
+ case CONSTRAINT_TYPE_DAMPTRACK:
case CONSTRAINT_TYPE_KINEMATIC:
case CONSTRAINT_TYPE_ROTLIKE:
case CONSTRAINT_TYPE_LOCLIKE:
@@ -545,11 +548,11 @@ void BL_ArmatureObject::GetPose(bPose **pose)
/* Otherwise, copy the armature's pose channels into the caller-supplied pose */
if (!*pose) {
- /* probably not to good of an idea to
- duplicate everying, but it clears up
- a crash and memory leakage when
- &BL_ActionActuator::m_pose is freed
- */
+ /* probably not to good of an idea to
+ * duplicate everything, but it clears up
+ * a crash and memory leakage when
+ * &BL_ActionActuator::m_pose is freed
+ */
game_copy_pose(pose, m_pose, 0);
}
else {
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 8fb87025fe8..89877261cd7 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -536,8 +536,8 @@ bool ConvertMaterial(
int valid_index = 0;
/* In Multitexture use the face texture if and only if
- * it is set in the buttons
- * In GLSL is not working yet :/ 3.2011 */
+ * it is set in the buttons
+ * In GLSL is not working yet :/ 3.2011 */
bool facetex = false;
if(validface && mat->mode &MA_FACETEXTURE)
facetex = true;
@@ -784,8 +784,8 @@ bool ConvertMaterial(
uv2[0]= uv2[1]= uv2[2]= uv2[3]= MT_Point2(0.0f, 0.0f);
- /* No material, what to do? let's see what is in the UV and set the material accordingly
- light and visible is always on */
+ /* No material, what to do? let's see what is in the UV and set the material accordingly
+ * light and visible is always on */
if( validface ) {
material->tile = tface->tile;
@@ -1071,15 +1071,16 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene,
* "Texture Face/Singletexture" we can then think about it */
/* Texture Face mode ignores texture but requires "Face Textures to be True "*/
- /**
+#if 0
if ((ma->mode &MA_FACETEXTURE)==0 && (ma->game.flag &GEMAT_TEXT)==0) {
bima = NULL;
imastr = "";
alpha_blend = GEMAT_SOLID;
}
- else
+ else {
alpha_blend = ma->game.alpha_blend;
- */
+ }
+#endif
}
/* check for tface tex to fallback on */
else {
diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h
index 48775d6031a..b7d527d83eb 100644
--- a/source/gameengine/Converter/BL_MeshDeformer.h
+++ b/source/gameengine/Converter/BL_MeshDeformer.h
@@ -63,16 +63,16 @@ public:
m_lastDeformUpdate(-1)
{};
virtual ~BL_MeshDeformer();
- virtual void SetSimulatedTime(double time){};
+ virtual void SetSimulatedTime(double time){}
virtual bool Apply(class RAS_IPolyMaterial *mat);
- virtual bool Update(void){ return false; };
- virtual bool UpdateBuckets(void){ return false; };
- virtual RAS_Deformer* GetReplica(){return NULL;};
+ virtual bool Update(void){ return false; }
+ virtual bool UpdateBuckets(void){ return false; }
+ virtual RAS_Deformer* GetReplica(){return NULL;}
virtual void ProcessReplica();
- struct Mesh* GetMesh() { return m_bmesh; };
- virtual class RAS_MeshObject* GetRasMesh() { return (RAS_MeshObject*)m_pMeshObject; };
+ struct Mesh* GetMesh() { return m_bmesh; }
+ virtual class RAS_MeshObject* GetRasMesh() { return (RAS_MeshObject*)m_pMeshObject; }
virtual float (* GetTransVerts(int *tot))[3] { *tot= m_tvtot; return m_transverts; }
- // virtual void InitDeform(double time){};
+ // virtual void InitDeform(double time){}
protected:
class RAS_MeshObject* m_pMeshObject;
diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp
index 08e96f421cc..500968462c3 100644
--- a/source/gameengine/Converter/BL_ModifierDeformer.cpp
+++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp
@@ -141,17 +141,17 @@ bool BL_ModifierDeformer::HasArmatureDeformer(Object *ob)
// return a deformed mesh that supports mapping (with a valid CD_ORIGINDEX layer)
struct DerivedMesh* BL_ModifierDeformer::GetPhysicsMesh()
{
- // we need to compute the deformed mesh taking into account the current
- // shape and skin deformers, we cannot just call mesh_create_derived_physics()
- // because that would use the m_transvers already deformed previously by BL_ModifierDeformer::Update(),
- // so restart from scratch by forcing a full update the shape/skin deformers
- // (will do nothing if there is no such deformer)
+ /* we need to compute the deformed mesh taking into account the current
+ * shape and skin deformers, we cannot just call mesh_create_derived_physics()
+ * because that would use the m_transvers already deformed previously by BL_ModifierDeformer::Update(),
+ * so restart from scratch by forcing a full update the shape/skin deformers
+ * (will do nothing if there is no such deformer) */
BL_ShapeDeformer::ForceUpdate();
BL_ShapeDeformer::Update();
// now apply the modifiers but without those that don't support mapping
Object* blendobj = m_gameobj->GetBlendObject();
/* hack: the modifiers require that the mesh is attached to the object
- It may not be the case here because of replace mesh actuator */
+ * It may not be the case here because of replace mesh actuator */
Mesh *oldmesh = (Mesh*)blendobj->data;
blendobj->data = m_bmesh;
DerivedMesh *dm = mesh_create_derived_physics(m_scene, blendobj, m_transverts, CD_MASK_MESH);
@@ -172,7 +172,7 @@ bool BL_ModifierDeformer::Update(void)
/* execute the modifiers */
Object* blendobj = m_gameobj->GetBlendObject();
/* hack: the modifiers require that the mesh is attached to the object
- It may not be the case here because of replace mesh actuator */
+ * It may not be the case here because of replace mesh actuator */
Mesh *oldmesh = (Mesh*)blendobj->data;
blendobj->data = m_bmesh;
/* execute the modifiers */
diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h
index fc08d3b54d6..cd18bd8c1d6 100644
--- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h
+++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h
@@ -48,7 +48,7 @@ public:
virtual ~BL_ScalarInterpolator() {}
virtual float GetValue(float currentTime) const;
- struct FCurve *GetFCurve() { return m_fcu;};
+ struct FCurve *GetFCurve() { return m_fcu; }
private:
struct FCurve *m_fcu;
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
index bed9e538090..72a953247d5 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -1123,7 +1123,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie)
}
else {
- /* incase the mesh might be refered to later */
+ /* in case the mesh might be refered to later */
{
CTR_Map<STR_HashedString,void*> &mapStringToMeshes = scene->GetLogicManager()->GetMeshMap();
@@ -1214,7 +1214,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie)
// delete the entities of this scene
/* TODO - */
- /*
+#if 0
vector<pair<KX_Scene*,KX_WorldInfo*> >::iterator worldit;
size = m_worldinfos.size();
for (i=0, worldit=m_worldinfos.begin(); i<size; ) {
@@ -1227,7 +1227,8 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie)
i++;
worldit++;
}
- }*/
+ }
+#endif
/* Worlds dont reference original blender data so we need to make a set from them */
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h
index f3c4627693b..258fb1ebdcc 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.h
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h
@@ -143,7 +143,7 @@ public:
struct Scene* GetBlenderSceneForName(const STR_String& name);
-// struct Main* GetMain() { return m_maggie; };
+// struct Main* GetMain() { return m_maggie; }
struct Main* GetMainDynamicPath(const char *path);
vector<struct Main*> &GetMainDynamic();
diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp
index e577a5e5f99..04342717555 100644
--- a/source/gameengine/Converter/KX_ConvertActuators.cpp
+++ b/source/gameengine/Converter/KX_ConvertActuators.cpp
@@ -106,8 +106,8 @@
#include "BL_BlenderDataConversion.h"
/**
-KX_BLENDERTRUNC needed to round 'almost' zero values to zero, else velocities etc. are incorrectly set
-*/
+ * KX_BLENDERTRUNC needed to round 'almost' zero values to zero, else velocities etc. are incorrectly set
+ */
#define KX_BLENDERTRUNC(x) (( x < 0.0001 && x > -0.0001 ) ? 0.0 : x)
@@ -310,30 +310,26 @@ void BL_ConvertActuators(const char* maggiename,
{
bMessageActuator *msgAct = (bMessageActuator *) bact->data;
- /**
- * Get the name of the properties that objects must own that
- * we're sending to, if present
- */
+ /* Get the name of the properties that objects must own that
+ * we're sending to, if present
+ */
STR_String toPropName = (msgAct->toPropName
? (char*) msgAct->toPropName
: "");
- /**
- * Get the Message Subject to send.
- */
+ /* Get the Message Subject to send.
+ */
STR_String subject = (msgAct->subject
? (char*) msgAct->subject
: "");
- /**
- * Get the bodyType
- */
+ /* Get the bodyType
+ */
int bodyType = msgAct->bodyType;
- /**
- * Get the body (text message or property name whose value
- * we'll be sending, might be empty
- */
+ /* Get the body (text message or property name whose value
+ * we'll be sending, might be empty
+ */
STR_String body = (msgAct->body
? (char*) msgAct->body
: "");
@@ -451,13 +447,13 @@ void BL_ConvertActuators(const char* maggiename,
SCA_IObject* destinationObj = NULL;
/*
- here the destinationobject is searched. problem with multiple scenes: other scenes
- have not been converted yet, so the destobj will not be found, so the prop will
- not be copied.
- possible solutions:
- - convert everything when possible and not realtime only when needed.
- - let the object-with-property report itself to the act when converted
- */
+ * here the destinationobject is searched. problem with multiple scenes: other scenes
+ * have not been converted yet, so the destobj will not be found, so the prop will
+ * not be copied.
+ * possible solutions:
+ * - convert everything when possible and not realtime only when needed.
+ * - let the object-with-property report itself to the act when converted
+ */
if (propact->ob)
destinationObj = converter->FindGameObject(propact->ob);
@@ -1060,7 +1056,7 @@ void BL_ConvertActuators(const char* maggiename,
bArmatureActuator* armAct = (bArmatureActuator*) bact->data;
KX_GameObject *tmpgob = converter->FindGameObject(armAct->target);
KX_GameObject *subgob = converter->FindGameObject(armAct->subtarget);
- BL_ArmatureActuator* tmparmact = new BL_ArmatureActuator(gameobj, armAct->type, armAct->posechannel, armAct->constraint, tmpgob, subgob, armAct->weight);
+ BL_ArmatureActuator* tmparmact = new BL_ArmatureActuator(gameobj, armAct->type, armAct->posechannel, armAct->constraint, tmpgob, subgob, armAct->weight, armAct->influence);
baseact = tmparmact;
break;
}
diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp
index a672e9cd9b8..fa9eb5317b9 100644
--- a/source/gameengine/Converter/KX_ConvertSensors.cpp
+++ b/source/gameengine/Converter/KX_ConvertSensors.cpp
@@ -50,7 +50,7 @@
#include "DNA_material_types.h"
#include "DNA_sensor_types.h"
#include "DNA_actuator_types.h" /* for SENS_ALL_KEYS ? this define is
-probably misplaced */
+ * probably misplaced */
/* end of blender include block */
#include "RAS_IPolygonMaterial.h"
@@ -315,9 +315,9 @@ 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 behavior requested, we can make do
- * with a basic sensor. This cuts down memory usage and
- * gives a slight performance gain. */
+ * no focus-related behavior requested, we can make do
+ * with a basic sensor. This cuts down memory usage and
+ * gives a slight performance gain. */
SCA_MouseManager *eventmgr
= (SCA_MouseManager*) logicmgr->FindEventManager(SCA_EventManager::MOUSE_EVENTMGR);
diff --git a/source/gameengine/Expressions/BoolValue.cpp b/source/gameengine/Expressions/BoolValue.cpp
index 113d12b7d59..b3c4dc144df 100644
--- a/source/gameengine/Expressions/BoolValue.cpp
+++ b/source/gameengine/Expressions/BoolValue.cpp
@@ -30,9 +30,9 @@ const STR_String CBoolValue::sFalseString = "FALSE";
CBoolValue::CBoolValue()
/*
-pre: false
-effect: constructs a new CBoolValue
-*/
+ * pre: false
+ * effect: constructs a new CBoolValue
+ */
{
trace("Bool constructor error");
}
diff --git a/source/gameengine/Expressions/BoolValue.h b/source/gameengine/Expressions/BoolValue.h
index 00baeba0857..48238264f1b 100644
--- a/source/gameengine/Expressions/BoolValue.h
+++ b/source/gameengine/Expressions/BoolValue.h
@@ -16,8 +16,8 @@
* \ingroup expressions
*/
-#if !defined _BOOLVALUE_H
-#define _BOOLVALUE_H
+#ifndef __BOOLVALUE_H__
+#define __BOOLVALUE_H__
#include "Value.h"
@@ -64,5 +64,5 @@ public:
#endif
};
-#endif // !defined _BOOLVALUE_H
+#endif // !defined __BOOLVALUE_H__
diff --git a/source/gameengine/Expressions/EmptyValue.h b/source/gameengine/Expressions/EmptyValue.h
index 1da0ee8e928..73946da6705 100644
--- a/source/gameengine/Expressions/EmptyValue.h
+++ b/source/gameengine/Expressions/EmptyValue.h
@@ -16,8 +16,8 @@
* \ingroup expressions
*/
-#if !defined _EMPTYVALUE_H
-#define _EMPTYVALUE_H
+#ifndef __EMPTYVALUE_H__
+#define __EMPTYVALUE_H__
#include "Value.h"
@@ -47,5 +47,5 @@ public:
#endif
};
-#endif // !defined _EMPTYVALUE_H
+#endif // !defined __EMPTYVALUE_H__
diff --git a/source/gameengine/Expressions/ErrorValue.h b/source/gameengine/Expressions/ErrorValue.h
index ec81fc2c82b..484d135f406 100644
--- a/source/gameengine/Expressions/ErrorValue.h
+++ b/source/gameengine/Expressions/ErrorValue.h
@@ -16,8 +16,8 @@
* \ingroup expressions
*/
-#if !defined _ERRORVALUE_H
-#define _ERRORVALUE_H
+#ifndef __ERRORVALUE_H__
+#define __ERRORVALUE_H__
#include "Value.h"
@@ -45,5 +45,5 @@ public:
#endif
};
-#endif // !defined _ERRORVALUE_H
+#endif // !defined __ERRORVALUE_H__
diff --git a/source/gameengine/Expressions/Expression.h b/source/gameengine/Expressions/Expression.h
index b9232477c34..8a4ba8bb7e2 100644
--- a/source/gameengine/Expressions/Expression.h
+++ b/source/gameengine/Expressions/Expression.h
@@ -16,8 +16,8 @@
* \ingroup expressions
*/
-#if !defined _EXPRESSION_H
-#define _EXPRESSION_H
+#ifndef __EXPRESSION_H__
+#define __EXPRESSION_H__
#include "Value.h"
@@ -150,5 +150,5 @@ public:
#endif
};
-#endif // !defined _EXPRESSION_H
+#endif // !defined __EXPRESSION_H__
diff --git a/source/gameengine/Expressions/FloatValue.h b/source/gameengine/Expressions/FloatValue.h
index 8dfb42d6b2e..75b2202eb7e 100644
--- a/source/gameengine/Expressions/FloatValue.h
+++ b/source/gameengine/Expressions/FloatValue.h
@@ -16,8 +16,8 @@
* \ingroup expressions
*/
-#if !defined _FLOATVALUE_H
-#define _FLOATVALUE_H
+#ifndef __FLOATVALUE_H__
+#define __FLOATVALUE_H__
#include "Value.h"
@@ -56,5 +56,5 @@ public:
#endif
};
-#endif // !defined _FLOATVALUE_H
+#endif // !defined __FLOATVALUE_H__
diff --git a/source/gameengine/Expressions/IfExpr.cpp b/source/gameengine/Expressions/IfExpr.cpp
index 9e6d80ab468..baf91e4a5c3 100644
--- a/source/gameengine/Expressions/IfExpr.cpp
+++ b/source/gameengine/Expressions/IfExpr.cpp
@@ -31,11 +31,11 @@ CIfExpr::CIfExpr()
-CIfExpr::CIfExpr(CExpression *guard, CExpression *e1, CExpression *e2)
/*
-pre:
-effect: constructs an CifExpr-object corresponding to IF(guard, e1, e2)
-*/
+ * pre:
+ * effect: constructs an CifExpr-object corresponding to IF(guard, e1, e2)
+ */
+CIfExpr::CIfExpr(CExpression *guard, CExpression *e1, CExpression *e2)
{
m_guard = guard;
m_e1 = e1;
@@ -44,11 +44,11 @@ effect: constructs an CifExpr-object corresponding to IF(guard, e1, e2)
-CIfExpr::~CIfExpr()
/*
-pre:
-effect: dereferences the object
-*/
+ * pre:
+ * effect: dereferences the object
+ */
+CIfExpr::~CIfExpr()
{
if (m_guard)
m_guard->Release();
@@ -62,13 +62,13 @@ effect: dereferences the object
+/**
+ * pre:
+ * ret: a new object containing the value of m_e1 if m_guard is a boolean TRUE
+ * a new object containing the value of m_e2 if m_guard is a boolean FALSE
+ * an new errorvalue if m_guard is not a boolean
+ */
CValue* CIfExpr::Calculate()
-/*
-pre:
-ret: a new object containing the value of m_e1 if m_guard is a boolean TRUE
- a new object containing the value of m_e2 if m_guard is a boolean FALSE
- an new errorvalue if m_guard is not a boolean
-*/
{
CValue *guardval;
guardval = m_guard->Calculate();
diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp
index 9f0def6e866..e13cb8200b1 100644
--- a/source/gameengine/Expressions/InputParser.cpp
+++ b/source/gameengine/Expressions/InputParser.cpp
@@ -579,12 +579,12 @@ CExpression* CParser::ProcessText
}
ch = text[0];
- /*if (ch != '=') {
- expr = new CConstExpr(new CStringValue(text));
- *dependent = deplist;
- return expr;
- } else
- */
+ /* if (ch != '=') {
+ * expr = new CConstExpr(new CStringValue(text));
+ * *dependent = deplist;
+ * return expr;
+ * } else
+ */
// NextCh();
NextSym();
expr = Expr();
diff --git a/source/gameengine/Expressions/IntValue.cpp b/source/gameengine/Expressions/IntValue.cpp
index c03c97311c7..20a4bbc0405 100644
--- a/source/gameengine/Expressions/IntValue.cpp
+++ b/source/gameengine/Expressions/IntValue.cpp
@@ -278,12 +278,11 @@ this object
}
-
+/**
+ * pre:
+ * ret: the cInt stored in the object
+ */
cInt CIntValue::GetInt()
-/*
-pre:
-ret: the cInt stored in the object
-*/
{
return m_int;
}
diff --git a/source/gameengine/Expressions/IntValue.h b/source/gameengine/Expressions/IntValue.h
index e6802b6ad04..733ee8bfa4e 100644
--- a/source/gameengine/Expressions/IntValue.h
+++ b/source/gameengine/Expressions/IntValue.h
@@ -16,8 +16,8 @@
* \ingroup expressions
*/
-#if !defined _INTVALUE_H
-#define _INTVALUE_H
+#ifndef __INTVALUE_H__
+#define __INTVALUE_H__
#include "Value.h"
@@ -71,5 +71,5 @@ public:
#endif
};
-#endif // !defined _INTVALUE_H
+#endif // !defined __INTVALUE_H__
diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h
index 4446b40af16..83f8232ca5e 100644
--- a/source/gameengine/Expressions/ListValue.h
+++ b/source/gameengine/Expressions/ListValue.h
@@ -16,8 +16,8 @@
* \ingroup expressions
*/
-#if !defined _LISTVALUE_H
-#define _LISTVALUE_H
+#ifndef __LISTVALUE_H__
+#define __LISTVALUE_H__
#include "Value.h"
@@ -87,5 +87,5 @@ private:
bool m_bReleaseContents;
};
-#endif // !defined _LISTVALUE_H
+#endif // !defined __LISTVALUE_H__
diff --git a/source/gameengine/Expressions/Operator1Expr.h b/source/gameengine/Expressions/Operator1Expr.h
index c2e005c8196..9815ce16e95 100644
--- a/source/gameengine/Expressions/Operator1Expr.h
+++ b/source/gameengine/Expressions/Operator1Expr.h
@@ -31,7 +31,7 @@ public:
virtual bool MergeExpression(CExpression* otherexpr);
virtual void BroadcastOperators(VALUE_OPERATOR op);
- virtual unsigned char GetExpressionID() { return COPERATOR1EXPRESSIONID;};
+ virtual unsigned char GetExpressionID() { return COPERATOR1EXPRESSIONID; }
CExpression* CheckLink(std::vector<CBrokenLinkInfo*>& brokenlinks);
//virtual bool IsInside(float x,float y,float z,bool bBorderInclude = true);
virtual bool NeedsRecalculated();
diff --git a/source/gameengine/Expressions/Operator2Expr.h b/source/gameengine/Expressions/Operator2Expr.h
index 8064aeec3fc..8b1c5523a2f 100644
--- a/source/gameengine/Expressions/Operator2Expr.h
+++ b/source/gameengine/Expressions/Operator2Expr.h
@@ -16,8 +16,8 @@
* \ingroup expressions
*/
-#if !defined _OPERATOR2EXPR_H
-#define _OPERATOR2EXPR_H
+#ifndef __OPERATOR2EXPR_H__
+#define __OPERATOR2EXPR_H__
#include "Expression.h"
@@ -29,7 +29,7 @@ class COperator2Expr : public CExpression
public:
virtual bool MergeExpression(CExpression* otherexpr);
- virtual unsigned char GetExpressionID() { return COPERATOR2EXPRESSIONID;};
+ virtual unsigned char GetExpressionID() { return COPERATOR2EXPRESSIONID; }
virtual void BroadcastOperators(VALUE_OPERATOR op);
CExpression* CheckLink(std::vector<CBrokenLinkInfo*>& brokenlinks);
//virtual bool IsInside(float x,float y,float z,bool bBorderInclude=true);
@@ -64,5 +64,5 @@ public:
#endif
};
-#endif // !defined _OPERATOR2EXPR_H
+#endif // !defined __OPERATOR2EXPR_H__
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp
index e772aec28e3..27d955edf44 100644
--- a/source/gameengine/Expressions/PyObjectPlus.cpp
+++ b/source/gameengine/Expressions/PyObjectPlus.cpp
@@ -199,7 +199,7 @@ PyObject * PyObjectPlus::py_base_new(PyTypeObject *type, PyObject *args, PyObjec
base->ptr = NULL;
if (ret->ref)
ret->ref->m_proxy= NULL;
- /* 'base' may be free'd after this func finished but not necessarily
+ /* 'base' may be freed after this func finished but not necessarily
* there is no reference to the BGE data now so it will throw an error on access */
Py_DECREF(base);
if (ret->ref) {
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h
index 263d08ead0c..6de0f3fa8d5 100644
--- a/source/gameengine/Expressions/PyObjectPlus.h
+++ b/source/gameengine/Expressions/PyObjectPlus.h
@@ -186,7 +186,7 @@ public: \
#define PY_SET_ATTR_SUCCESS 0
/**
- * These macros are helpfull when embedding Python routines. The second
+ * These macros are helpful when embedding Python routines. The second
* macro is one that also requires a documentation string
*/
#define KX_PYMETHOD(class_name, method_name) \
@@ -609,10 +609,10 @@ public:
static PyObject *GetProxyPlus_Ext(PyObjectPlus *self, PyTypeObject *tp, void *ptr);
/* self=NULL => proxy to generic pointer detached from GE object
- if py_owns is true, the memory pointed by ptr will be deleted automatially with MEM_freeN
- self!=NULL=> proxy attached to GE object, ptr is optional and point to a struct from which attributes can be defined
- if py_owns is true, the object will be deleted automatically, ptr will NOT be deleted
- (assume object destructor takes care of it) */
+ * if py_owns is true, the memory pointed by ptr will be deleted automatically with MEM_freeN
+ * self!=NULL=> proxy attached to GE object, ptr is optional and point to a struct from which attributes can be defined
+ * if py_owns is true, the object will be deleted automatically, ptr will NOT be deleted
+ * (assume object destructor takes care of it) */
static PyObject *NewProxyPlus_Ext(PyObjectPlus *self, PyTypeObject *tp, void *ptr, bool py_owns);
static WarnLink* GetDeprecationWarningLinkFirst(void);
diff --git a/source/gameengine/Expressions/StringValue.cpp b/source/gameengine/Expressions/StringValue.cpp
index 29c72a29b71..2e29a39222b 100644
--- a/source/gameengine/Expressions/StringValue.cpp
+++ b/source/gameengine/Expressions/StringValue.cpp
@@ -24,20 +24,20 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
+/**
+ * pre: false
+ * effect: constructs a new CStringValue
+ */
CStringValue::CStringValue()
-/*
-pre: false
-effect: constructs a new CStringValue
-*/
{
m_strString = "[Illegal String constructor call]";
}
+/**
+ * pre:
+ * effect: constructs a new CStringValue containing text txt
+ */
CStringValue::CStringValue(const char *txt,const char *name,AllocationTYPE alloctype)
-/*
-pre:
-effect: constructs a new CStringValue containing text txt
-*/
{
m_strString = txt;
SetName(name);
@@ -52,23 +52,23 @@ effect: constructs a new CStringValue containing text txt
}
+/**
+ * pre:
+ * ret: a new object containing the result of applying operator op to this
+ * object and val
+ */
CValue* CStringValue::Calc(VALUE_OPERATOR op, CValue *val)
-/*
-pre:
-ret: a new object containing the result of applying operator op to this
-object and val
-*/
{
//return val->CalrcString(op, this);
return val->CalcFinal(VALUE_STRING_TYPE, op, this);
}
+/**
+ * pre: the type of val is dtype
+ * ret: a new object containing the result of applying operator op to val and
+ * this object
+ */
CValue* CStringValue::CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val)
-/*
-pre: the type of val is dtype
-ret: a new object containing the result of applying operator op to val and
-this object
-*/
{
CValue *ret;
diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h
index 3a81ec05d5b..00320ff9ed2 100644
--- a/source/gameengine/Expressions/Value.h
+++ b/source/gameengine/Expressions/Value.h
@@ -152,7 +152,7 @@ struct ValueFlags {
/**
* Base Class for all Actions performed on CValue's. Can be extended for undo/redo system in future.
-*/
+ */
class CAction
{
public:
diff --git a/source/gameengine/Expressions/VectorValue.cpp b/source/gameengine/Expressions/VectorValue.cpp
index 07a2743b19f..65f5d7d3d22 100644
--- a/source/gameengine/Expressions/VectorValue.cpp
+++ b/source/gameengine/Expressions/VectorValue.cpp
@@ -87,12 +87,12 @@ CVectorValue::~CVectorValue()
}
+/**
+ * pre: the type of val is dtype
+ * ret: a new object containing the result of applying operator op to val and
+ * this object
+ */
CValue* CVectorValue::CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val)
-/*
-pre: the type of val is dtype
-ret: a new object containing the result of applying operator op to val and
-this object
-*/
{
CValue *ret = NULL;
@@ -210,10 +210,9 @@ CValue* CVectorValue::GetReplica()
return replica;
};
-/*void CVectorValue::Transform(rcMatrix4x4 mat)
+#if 0
+void CVectorValue::Transform(rcMatrix4x4 mat)
{
m_transformedvec = mat*m_vec;
}
-*/
-
-
+#endif
diff --git a/source/gameengine/Expressions/VectorValue.h b/source/gameengine/Expressions/VectorValue.h
index 6ff47843282..5d0e0c0ddb2 100644
--- a/source/gameengine/Expressions/VectorValue.h
+++ b/source/gameengine/Expressions/VectorValue.h
@@ -16,8 +16,8 @@
* \ingroup expressions
*/
-#if !defined _VECTORVALUE_H
-#define _VECTORVALUE_H
+#ifndef __VECTORVALUE_H__
+#define __VECTORVALUE_H__
#include "Value.h"
@@ -59,7 +59,7 @@ public:
virtual CValue* GetReplica();
virtual const STR_String & GetText();
-/*
+#if 0
void SnapPoint(float num,int snap)
{
if (num > 0) num += ((float)snap / 2);
@@ -78,8 +78,8 @@ public:
SnapPoint(m_vec[KX_Z],snapvec[KX_Z]);
}
-*/
-
+#endif
+
protected:
double m_vec[3];
double m_transformedvec[3];
@@ -92,5 +92,5 @@ public:
#endif
};
-#endif // !defined _VECTORVALUE_H
+#endif // !defined __VECTORVALUE_H__
diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
index f2ee3fc0f9f..a992150fad3 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
+++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
@@ -74,7 +74,7 @@ class SCA_Joystick
/**
* max # of buttons avail
- */
+ */
int m_axismax;
int m_buttonmax;
@@ -114,7 +114,7 @@ class SCA_Joystick
void DestroyJoystickDevice(void);
/**
- * fills the axis mnember values
+ * fills the axis member values
*/
void pFillButtons(void);
diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h
index d0bd49e71af..751c03bc712 100644
--- a/source/gameengine/GameLogic/SCA_LogicManager.h
+++ b/source/gameengine/GameLogic/SCA_LogicManager.h
@@ -127,8 +127,8 @@ public:
// for the scripting... needs a FactoryManager later (if we would have time... ;)
void RegisterMeshName(const STR_String& meshname,void* mesh);
void UnregisterMeshName(const STR_String& meshname,void* mesh);
- CTR_Map<STR_HashedString,void*>& GetMeshMap() { return m_mapStringToMeshes; };
- CTR_Map<STR_HashedString,void*>& GetActionMap() { return m_mapStringToActions; };
+ CTR_Map<STR_HashedString,void*>& GetMeshMap() { return m_mapStringToMeshes; }
+ CTR_Map<STR_HashedString,void*>& GetActionMap() { return m_mapStringToActions; }
void RegisterActionName(const STR_String& actname,void* action);
diff --git a/source/gameengine/GameLogic/SCA_MouseManager.h b/source/gameengine/GameLogic/SCA_MouseManager.h
index 66a838651c2..4b40ab8a197 100644
--- a/source/gameengine/GameLogic/SCA_MouseManager.h
+++ b/source/gameengine/GameLogic/SCA_MouseManager.h
@@ -60,7 +60,7 @@ public:
/**
* Checks whether a mouse button is depressed. Ignores requests on non-
- * mouse related evenst. Can also flag mouse movement.
+ * mouse related events. Can also flag mouse movement.
*/
bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode);
virtual void NextFrame();
diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp
index 8a87a734a1c..11ea7e51858 100644
--- a/source/gameengine/GameLogic/SCA_PythonController.cpp
+++ b/source/gameengine/GameLogic/SCA_PythonController.cpp
@@ -265,7 +265,7 @@ void SCA_PythonController::ErrorPrint(const char *error_msg)
/* Added in 2.48a, the last_traceback can reference Objects for example, increasing
* their user count. Not to mention holding references to wrapped data.
- * This is especially bad when the PyObject for the wrapped data is free'd, after blender
+ * This is especially bad when the PyObject for the wrapped data is freed, after blender
* has already dealocated the pointer */
PySys_SetObject( (char *)"last_traceback", NULL);
PyErr_Clear(); /* just to be sure */
@@ -298,7 +298,7 @@ bool SCA_PythonController::Import()
//printf("py module modified '%s'\n", m_scriptName.Ptr());
m_bModified= false;
- /* incase we re-import */
+ /* in case we re-import */
Py_XDECREF(m_function);
m_function= NULL;
diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.cpp b/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
index 15211247d26..0915326c8eb 100644
--- a/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
@@ -442,17 +442,17 @@ MakeScreenShot(
png_init_io(png_ptr, fp);
- /*
+#if 0
png_set_filter(png_ptr, 0,
- PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE |
- PNG_FILTER_SUB | PNG_FILTER_VALUE_SUB |
- PNG_FILTER_UP | PNG_FILTER_VALUE_UP |
- PNG_FILTER_AVG | PNG_FILTER_VALUE_AVG |
- PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH|
- PNG_ALL_FILTERS);
+ PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE |
+ PNG_FILTER_SUB | PNG_FILTER_VALUE_SUB |
+ PNG_FILTER_UP | PNG_FILTER_VALUE_UP |
+ PNG_FILTER_AVG | PNG_FILTER_VALUE_AVG |
+ PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH|
+ PNG_ALL_FILTERS);
png_set_compression_level(png_ptr, Z_BEST_COMPRESSION);
- */
+#endif
// png image settings
png_set_IHDR(png_ptr,
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Canvas.h b/source/gameengine/GamePlayer/ghost/GPG_Canvas.h
index e96cd50b9f4..d931f605a64 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Canvas.h
+++ b/source/gameengine/GamePlayer/ghost/GPG_Canvas.h
@@ -55,14 +55,14 @@ public:
virtual void SetMousePosition(int x, int y);
virtual void SetMouseState(RAS_MouseState mousestate);
virtual void SwapBuffers();
- virtual int GetMouseX(int x){return x;};
- virtual int GetMouseY(int y){return y;};
+ virtual int GetMouseX(int x) { return x; }
+ virtual int GetMouseY(int y) { return y; }
virtual float GetMouseNormalizedX(int x);
virtual float GetMouseNormalizedY(int y);
virtual void ResizeWindow(int width, int height);
- bool BeginDraw() { return true;};
+ bool BeginDraw() { return true; }
void EndDraw() {};
};
diff --git a/source/gameengine/Ketsji/BL_Action.cpp b/source/gameengine/Ketsji/BL_Action.cpp
index 1d5a3dd461a..c187199c8d0 100644
--- a/source/gameengine/Ketsji/BL_Action.cpp
+++ b/source/gameengine/Ketsji/BL_Action.cpp
@@ -25,6 +25,7 @@
*/
#include <cstdlib>
+#include <stdio.h>
#include "BL_Action.h"
#include "BL_ArmatureObject.h"
diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h
index 2c6316ea32b..7b1779fed10 100644
--- a/source/gameengine/Ketsji/BL_Material.h
+++ b/source/gameengine/Ketsji/BL_Material.h
@@ -24,11 +24,11 @@ struct EnvMap;
// --
/** max units
- this will default to users available units
- to build with more available, just increment this value
- although the more you add the slower the search time will be.
- we will go for eight, which should be enough
-*/
+ * this will default to users available units
+ * to build with more available, just increment this value
+ * although the more you add the slower the search time will be.
+ * we will go for eight, which should be enough
+ */
#define MAXTEX 8 //match in RAS_TexVert & RAS_OpenGLRasterizer
// different mapping modes
diff --git a/source/gameengine/Ketsji/BL_Shader.h b/source/gameengine/Ketsji/BL_Shader.h
index 32872592cc5..3015dd204c8 100644
--- a/source/gameengine/Ketsji/BL_Shader.h
+++ b/source/gameengine/Ketsji/BL_Shader.h
@@ -194,7 +194,7 @@ public:
bool Ok()const;
unsigned int GetProg();
void SetProg(bool enable);
- int GetAttribute(){return mAttr;};
+ int GetAttribute() { return mAttr; }
// --
// Apply methods : sets colected uniforms
diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
index 3febff92e18..9940b400527 100644
--- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
+++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
@@ -235,9 +235,9 @@ void KX_BulletPhysicsController::setRigidBody(bool rigid)
}
/* This function dynamically adds the collision shape of another controller to
- the current controller shape provided it is a compound shape.
- The idea is that dynamic parenting on a compound object will dynamically extend the shape
-*/
+ * the current controller shape provided it is a compound shape.
+ * The idea is that dynamic parenting on a compound object will dynamically extend the shape
+ */
void KX_BulletPhysicsController::AddCompoundChild(KX_IPhysicsController* child)
{
if (child == NULL || !IsCompound())
@@ -308,8 +308,8 @@ void KX_BulletPhysicsController::AddCompoundChild(KX_IPhysicsController* chil
}
/* Reverse function of the above, it will remove a shape from a compound shape
- provided that the former was added to the later using AddCompoundChild()
-*/
+ * provided that the former was added to the later using AddCompoundChild()
+ */
void KX_BulletPhysicsController::RemoveCompoundChild(KX_IPhysicsController* child)
{
if (child == NULL || !IsCompound())
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp
index 14a307794db..7a2d71f56ff 100644
--- a/source/gameengine/Ketsji/KX_Camera.cpp
+++ b/source/gameengine/Ketsji/KX_Camera.cpp
@@ -133,8 +133,8 @@ const MT_Quaternion KX_Camera::GetCameraOrientation() const
/**
-* Sets the projection matrix that is used by the rasterizer.
-*/
+ * Sets the projection matrix that is used by the rasterizer.
+ */
void KX_Camera::SetProjectionMatrix(const MT_Matrix4x4 & mat)
{
m_projection_matrix = mat;
@@ -146,8 +146,8 @@ void KX_Camera::SetProjectionMatrix(const MT_Matrix4x4 & mat)
/**
-* Sets the modelview matrix that is used by the rasterizer.
-*/
+ * Sets the modelview matrix that is used by the rasterizer.
+ */
void KX_Camera::SetModelviewMatrix(const MT_Matrix4x4 & mat)
{
m_modelview_matrix = mat;
@@ -158,8 +158,8 @@ void KX_Camera::SetModelviewMatrix(const MT_Matrix4x4 & mat)
/**
-* Gets the projection matrix that is used by the rasterizer.
-*/
+ * Gets the projection matrix that is used by the rasterizer.
+ */
const MT_Matrix4x4& KX_Camera::GetProjectionMatrix() const
{
return m_projection_matrix;
@@ -168,8 +168,8 @@ const MT_Matrix4x4& KX_Camera::GetProjectionMatrix() const
/**
-* Gets the modelview matrix that is used by the rasterizer.
-*/
+ * Gets the modelview matrix that is used by the rasterizer.
+ */
const MT_Matrix4x4& KX_Camera::GetModelviewMatrix() const
{
return m_modelview_matrix;
@@ -187,9 +187,9 @@ void KX_Camera::InvalidateProjectionMatrix(bool valid)
}
-/*
-* These getters retrieve the clip data and the focal length
-*/
+/**
+ * These getters retrieve the clip data and the focal length
+ */
float KX_Camera::GetLens() const
{
return m_camdata.m_lens;
@@ -200,17 +200,17 @@ float KX_Camera::GetScale() const
return m_camdata.m_scale;
}
-/*
-* Gets the horizontal size of the sensor - for camera matching.
-*/
+/**
+ * Gets the horizontal size of the sensor - for camera matching.
+ */
float KX_Camera::GetSensorWidth() const
{
return m_camdata.m_sensor_x;
}
-/*
-* Gets the vertical size of the sensor - for camera matching.
-*/
+/**
+ * Gets the vertical size of the sensor - for camera matching.
+ */
float KX_Camera::GetSensorHeight() const
{
return m_camdata.m_sensor_y;
diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h
index 38fc170e371..7481b2eb7f0 100644
--- a/source/gameengine/Ketsji/KX_Camera.h
+++ b/source/gameengine/Ketsji/KX_Camera.h
@@ -63,12 +63,13 @@ protected:
// Never used, I think...
// void MoveTo(const MT_Point3& movevec)
// {
- /*MT_Transform camtrans;
+#if 0
+ MT_Transform camtrans;
camtrans.invert(m_trans1);
MT_Matrix3x3 camorient = camtrans.getBasis();
camtrans.translate(camorient.inverse()*movevec);
m_trans1.invert(camtrans);
- */
+#endif
// }
/**
@@ -185,8 +186,8 @@ public:
bool hasValidProjectionMatrix() const;
/** Sets the validity of the projection matrix. Call this if you change camera
- data (eg lens, near plane, far plane) and require the projection matrix to be
- recalculated.
+ * data (eg lens, near plane, far plane) and require the projection matrix to be
+ * recalculated.
*/
void InvalidateProjectionMatrix(bool valid = false);
diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp
index 361fe3326f5..b683fcb8036 100644
--- a/source/gameengine/Ketsji/KX_CameraActuator.cpp
+++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp
@@ -155,8 +155,8 @@ static void Kx_VecUpMat3(float vec[3], float mat[][3], short axis)
float inp;
short cox = 0, coy = 0, coz = 0;
- /* up varieeren heeft geen zin, is eigenlijk helemaal geen up!
- * zie VecUpMat3old
+ /* up range has no meaning, is not really up!
+ * see: VecUpMat3old
*/
if(axis==0) {
@@ -186,7 +186,7 @@ static void Kx_VecUpMat3(float vec[3], float mat[][3], short axis)
mat[coz][2]= vec[2];
if (Kx_Normalize((float *)mat[coz]) == 0.f) {
/* this is a very abnormal situation: the camera has reach the object center exactly
- We will choose a completely arbitrary direction */
+ * We will choose a completely arbitrary direction */
mat[coz][0] = 1.0f;
mat[coz][1] = 0.0f;
mat[coz][2] = 0.0f;
@@ -210,7 +210,7 @@ static void Kx_VecUpMat3(float vec[3], float mat[][3], short axis)
bool KX_CameraActuator::Update(double curtime, bool frame)
{
- /* wondering... is it really neccesary/desirable to suppress negative */
+ /* wondering... is it really necessary/desirable to suppress negative */
/* events here? */
bool bNegativeEvent = IsNegativeEvent();
RemoveAllEvents();
@@ -239,9 +239,9 @@ bool KX_CameraActuator::Update(double curtime, bool frame)
/* CONSTRAINT 6: again: fixed height relative to floor below actor */
/* CONSTRAINT 7: track to floor below actor */
/* CONSTRAINT 8: look a little bit left or right, depending on how the
-
- character is looking (horizontal x)
- */
+ *
+ * character is looking (horizontal x)
+ */
/* ...and then set the camera position. Since we assume the parent of */
/* this actuator is always a camera, just set the parent position and */
diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h
index eb0a4574a8f..c67174d2830 100644
--- a/source/gameengine/Ketsji/KX_CameraActuator.h
+++ b/source/gameengine/Ketsji/KX_CameraActuator.h
@@ -40,7 +40,7 @@
#include "SCA_LogicManager.h"
/**
- * The camera actuator does a Robbie Muller prespective for you. This is a
+ * The camera actuator does a Robbie Muller perspective for you. This is a
* weird set of rules that positions the camera sort of behind the object,
* tracking, while avoiding any objects between the 'ideal' position and the
* actor being tracked.
diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
index da8df24d704..322d6e60071 100644
--- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
@@ -147,8 +147,8 @@ bool KX_ConstraintActuator::RayHit(KX_ClientObjectInfo* client, KX_RayCast* resu
return true;
}
-/* this function is used to pre-filter the object before casting the ray on them.
- This is useful for "X-Ray" option when we want to see "through" unwanted object.
+/* This function is used to pre-filter the object before casting the ray on them.
+ * This is useful for "X-Ray" option when we want to see "through" unwanted object.
*/
bool KX_ConstraintActuator::NeedRayCast(KX_ClientObjectInfo* client)
{
@@ -175,7 +175,7 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame)
/* low-pass filtered time response, if the damp time is unequal to 0. */
/* Having to retrieve location/rotation and setting it afterwards may not */
- /* be efficient enough... Somthing to look at later. */
+ /* be efficient enough... Something to look at later. */
KX_GameObject *obj = (KX_GameObject*) GetParent();
MT_Point3 position = obj->NodeGetWorldPosition();
MT_Point3 newposition;
diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.h b/source/gameengine/Ketsji/KX_ConstraintWrapper.h
index bd27bc5b333..a92ae83e7f0 100644
--- a/source/gameengine/Ketsji/KX_ConstraintWrapper.h
+++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.h
@@ -41,7 +41,7 @@ class KX_ConstraintWrapper : public PyObjectPlus
public:
KX_ConstraintWrapper(PHY_ConstraintType ctype,int constraintId,class PHY_IPhysicsEnvironment* physenv);
virtual ~KX_ConstraintWrapper ();
- int getConstraintId() { return m_constraintId;};
+ int getConstraintId() { return m_constraintId; }
#ifdef WITH_PYTHON
KX_PYMETHOD_NOARGS(KX_ConstraintWrapper,GetConstraintId);
diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
index 610200cc235..28e7f221ce4 100644
--- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
+++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
@@ -464,7 +464,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
if (objprop->m_dyna && !objprop->m_angular_rigidbody)
{
- /*
+#if 0
//setting the inertia could achieve similar results to constraint the up
//but it is prone to instability, so use special 'Angular' constraint
btVector3 inertia = physicscontroller->GetRigidBody()->getInvInertiaDiagLocal();
@@ -473,7 +473,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
physicscontroller->GetRigidBody()->setInvInertiaDiagLocal(inertia);
physicscontroller->GetRigidBody()->updateInertiaTensor();
- */
+#endif
//env->createConstraint(physicscontroller,0,PHY_ANGULAR_CONSTRAINT,0,0,0,0,0,1);
diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp
index 6bd30685696..6e989dd4d7d 100644
--- a/source/gameengine/Ketsji/KX_Dome.cpp
+++ b/source/gameengine/Ketsji/KX_Dome.cpp
@@ -1,26 +1,26 @@
/*
------------------------------------------------------------------------------
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU Lesser 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 Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place - Suite 330, Boston, MA 02111-1307, USA, or go to
-http://www.gnu.org/copyleft/lesser.txt.
-
-Contributor(s): Dalai Felinto
-
-This code is originally inspired on some of the ideas and codes from Paul Bourke.
-Developed as part of a Research and Development project for SAT - La Société des arts technologiques.
------------------------------------------------------------------------------
-*/
+ * -----------------------------------------------------------------------------
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+ * http://www.gnu.org/copyleft/lesser.txt.
+ *
+ * Contributor(s): Dalai Felinto
+ *
+ * This code is originally inspired on some of the ideas and codes from Paul Bourke.
+ * Developed as part of a Research and Development project for SAT - La Société des arts technologiques.
+ * -----------------------------------------------------------------------------
+ */
/** \file gameengine/Ketsji/KX_Dome.cpp
* \ingroup ketsji
@@ -218,20 +218,20 @@ void KX_Dome::CreateGLImages(void)
void KX_Dome::ClearGLImages(void)
{
glDeleteTextures(m_numimages, (GLuint*)&domefacesId);
-/*
+#if 0
for (int i=0;i<m_numimages;i++)
if(glIsTexture(domefacesId[i]))
glDeleteTextures(1, (GLuint*)&domefacesId[i]);
-*/
+#endif
}
void KX_Dome::CalculateImageSize(void)
{
-/*
-- determine the minimum buffer size
-- reduce the buffer for better performace
-- create a power of 2 texture bigger than the buffer
-*/
+ /*
+ * - determine the minimum buffer size
+ * - reduce the buffer for better performace
+ * - create a power of 2 texture bigger than the buffer
+ */
canvaswidth = m_canvas->GetWidth();
canvasheight = m_canvas->GetHeight();
@@ -453,28 +453,28 @@ void KX_Dome::GLDrawWarpQuads(void)
bool KX_Dome::ParseWarpMesh(STR_String text)
{
-/*
-//Notes about the supported data format:
-File example::
- mode
- width height
- n0_x n0_y n0_u n0_v n0_i
- n1_x n1_y n1_u n1_v n1_i
- n2_x n1_y n2_u n2_v n2_i
- n3_x n3_y n3_u n3_v n3_i
- (...)
-First line is the image type the mesh is support to be applied to: 2 = fisheye, 1=radial
-Tthe next line has the mesh dimensions
-Rest of the lines are the nodes of the mesh. Each line has x y u v i
- (x,y) are the normalised screen coordinates
- (u,v) texture coordinates
- i a multiplicative intensity factor
-
-x varies from -screen aspect to screen aspect
-y varies from -1 to 1
-u and v vary from 0 to 1
-i ranges from 0 to 1, if negative don't draw that mesh node
-*/
+ /*
+ * //Notes about the supported data format:
+ * File example::
+ * mode
+ * width height
+ * n0_x n0_y n0_u n0_v n0_i
+ * n1_x n1_y n1_u n1_v n1_i
+ * n2_x n1_y n2_u n2_v n2_i
+ * n3_x n3_y n3_u n3_v n3_i
+ * (...)
+ * First line is the image type the mesh is support to be applied to: 2 = fisheye, 1=radial
+ * Tthe next line has the mesh dimensions
+ * Rest of the lines are the nodes of the mesh. Each line has x y u v i
+ * (x,y) are the normalised screen coordinates
+ * (u,v) texture coordinates
+ * i a multiplicative intensity factor
+ *
+ * x varies from -screen aspect to screen aspect
+ * y varies from -1 to 1
+ * u and v vary from 0 to 1
+ * i ranges from 0 to 1, if negative don't draw that mesh node
+ */
int i;
int nodeX=0, nodeY=0;
@@ -532,16 +532,16 @@ i ranges from 0 to 1, if negative don't draw that mesh node
void KX_Dome::CreateMeshDome180(void)
{
-/*
-1)- Define the faces of half of a cube
- - each face is made out of 2 triangles
-2) Subdivide the faces
- - more resolution == more curved lines
-3) Spherize the cube
- - normalize the verts
-4) Flatten onto xz plane
- - transform it onto an equidistant spherical projection techniques to transform the sphere onto a dome image
-*/
+ /*
+ * 1)- Define the faces of half of a cube
+ * - each face is made out of 2 triangles
+ * 2) Subdivide the faces
+ * - more resolution == more curved lines
+ * 3) Spherize the cube
+ * - normalize the verts
+ * 4) Flatten onto xz plane
+ * - transform it onto an equidistant spherical projection techniques to transform the sphere onto a dome image
+ */
int i,j;
float uv_ratio = (float)(m_buffersize-1) / m_imagesize;
@@ -711,16 +711,16 @@ void KX_Dome::CreateMeshDome180(void)
void KX_Dome::CreateMeshDome250(void)
{
-/*
-1)- Define the faces of a cube without the back face
- - each face is made out of 2 triangles
-2) Subdivide the faces
- - more resolution == more curved lines
-3) Spherize the cube
- - normalize the verts
-4) Flatten onto xz plane
- - transform it onto an equidistant spherical projection techniques to transform the sphere onto a dome image
-*/
+ /*
+ * 1)- Define the faces of a cube without the back face
+ * - each face is made out of 2 triangles
+ * 2) Subdivide the faces
+ * - more resolution == more curved lines
+ * 3) Spherize the cube
+ * - normalize the verts
+ * 4) Flatten onto xz plane
+ * - transform it onto an equidistant spherical projection techniques to transform the sphere onto a dome image
+ */
int i,j;
float uv_height, uv_base;
@@ -730,20 +730,20 @@ void KX_Dome::CreateMeshDome250(void)
float uv_ratio = (float)(m_buffersize-1) / m_imagesize;
m_radangle = m_angle * M_PI/180.0;//calculates the radians angle, used for flattening
-/*
-verts_height is the exactly needed height of the cube faces (not always 1.0).
-When we want some horizontal information (e.g. for horizontal 220deg domes) we don't need to create and tesselate the whole cube.
-Therefore the lateral cube faces could be small, and the tesselate mesh would be completely used.
-(if we always worked with verts_height = 1.0, we would be discarding a lot of the calculated and tesselated geometry).
-
-So I came out with this formula:
-verts_height = tan((rad_ang/2) - (MT_PI/2))*sqrt(2.0);
-
-Here we take half the sphere(rad_ang/2) and subtract a quarter of it (MT_PI/2)
-Therefore we have the length in radians of the dome/sphere over the horizon.
-Once we take the tangent of that angle, you have the verts coordinate corresponding to the verts on the side faces.
-Then we need to multiply it by sqrt(2.0) to get the coordinate of the verts on the diagonal of the original cube.
-*/
+ /*
+ * verts_height is the exactly needed height of the cube faces (not always 1.0).
+ * When we want some horizontal information (e.g. for horizontal 220deg domes) we don't need to create and tesselate the whole cube.
+ * Therefore the lateral cube faces could be small, and the tesselate mesh would be completely used.
+ * (if we always worked with verts_height = 1.0, we would be discarding a lot of the calculated and tesselated geometry).
+ *
+ * So I came out with this formula:
+ * verts_height = tan((rad_ang/2) - (MT_PI/2))*sqrt(2.0);
+ *
+ * Here we take half the sphere(rad_ang/2) and subtract a quarter of it (MT_PI/2)
+ * Therefore we have the length in radians of the dome/sphere over the horizon.
+ * Once we take the tangent of that angle, you have the verts coordinate corresponding to the verts on the side faces.
+ * Then we need to multiply it by sqrt(2.0) to get the coordinate of the verts on the diagonal of the original cube.
+ */
verts_height = tan((rad_ang/2) - (MT_PI/2))*M_SQRT2;
uv_height = uv_ratio * ((verts_height/2) + 0.5);
@@ -995,16 +995,16 @@ Then we need to multiply it by sqrt(2.0) to get the coordinate of the verts on t
void KX_Dome::CreateMeshPanorama(void)
{
-/*
-1)- Define the faces of a cube without the top and bottom faces
- - each face is made out of 2 triangles
-2) Subdivide the faces
- - more resolution == more curved lines
-3) Spherize the cube
- - normalize the verts t
-4) Flatten onto xz plane
- - use spherical projection techniques to transform the sphere onto a flat panorama
-*/
+ /*
+ * 1)- Define the faces of a cube without the top and bottom faces
+ * - each face is made out of 2 triangles
+ * 2) Subdivide the faces
+ * - more resolution == more curved lines
+ * 3) Spherize the cube
+ * - normalize the verts t
+ * 4) Flatten onto xz plane
+ * - use spherical projection techniques to transform the sphere onto a flat panorama
+ */
int i,j;
float uv_ratio = (float)(m_buffersize-1) / m_imagesize;
@@ -1432,10 +1432,10 @@ void KX_Dome::SplitFace(vector <DomeFace>& face, int *nfaces)
void KX_Dome::CalculateFrustum(KX_Camera * cam)
{
- /*
+#if 0
// manually creating a 90deg Field of View Frustum
- the original formula:
+ // the original formula:
top = tan(fov*3.14159/360.0) * near [for fov in degrees]
fov*0.5 = arctan ((top-bottom)*0.5 / near) [for fov in radians]
bottom = -top
@@ -1446,7 +1446,7 @@ void KX_Dome::CalculateFrustum(KX_Camera * cam)
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(90.0,1.0,cam->GetCameraNear(),cam->GetCameraFar());
- */
+#endif
RAS_FrameFrustum m_frustrum; //90 deg. Frustum
@@ -1469,10 +1469,10 @@ void KX_Dome::CalculateFrustum(KX_Camera * cam)
void KX_Dome::CalculateCameraOrientation()
{
/*
-Uses 4 cameras for angles up to 180deg
-Uses 5 cameras for angles up to 250deg
-Uses 6 cameras for angles up to 360deg
-*/
+ * Uses 4 cameras for angles up to 180deg
+ * Uses 5 cameras for angles up to 250deg
+ * Uses 6 cameras for angles up to 360deg
+ */
int i;
float deg45 = MT_PI / 4;
MT_Scalar c = cos(deg45);
diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h
index 0436e910469..d4524d23d7d 100644
--- a/source/gameengine/Ketsji/KX_Dome.h
+++ b/source/gameengine/Ketsji/KX_Dome.h
@@ -26,8 +26,8 @@ Developed as part of a Research and Development project for SAT - La Soci�t�
* \ingroup ketsji
*/
-#if !defined KX_DOME_H
-#define KX_DOME_H
+#ifndef __KX_DOME_H__
+#define __KX_DOME_H__
#include "KX_Scene.h"
#include "KX_Camera.h"
@@ -112,7 +112,7 @@ public:
int nfacestop, nfacesbottom, nfacesleft, nfacesright, nfacesfront, nfacesback;
int nfacesleftback, nfacesrightback;
- int GetNumberRenders(){return m_numfaces;};
+ int GetNumberRenders() { return m_numfaces; }
void RenderDome(void);
void RenderDomeFrame(KX_Scene* scene, KX_Camera* cam, int i);
@@ -196,5 +196,4 @@ public:
#endif
};
-#endif
-
+#endif /* __KX_DOME_H__ */
diff --git a/source/gameengine/Ketsji/KX_FontObject.cpp b/source/gameengine/Ketsji/KX_FontObject.cpp
index 3739ad0d712..5a67b052a2b 100644
--- a/source/gameengine/Ketsji/KX_FontObject.cpp
+++ b/source/gameengine/Ketsji/KX_FontObject.cpp
@@ -92,8 +92,8 @@ KX_FontObject::KX_FontObject( void* sgReplicationInfo,
m_fontid = GetFontId(text->vfont);
/* initialize the color with the object color and store it in the KX_Object class
- This is a workaround waiting for the fix:
- [#25487] BGE: Object Color only works when it has a keyed frame */
+ * This is a workaround waiting for the fix:
+ * [#25487] BGE: Object Color only works when it has a keyed frame */
copy_v4_v4(m_color, (const float*) ob->col);
this->SetObjectColor((const MT_Vector4&) m_color);
}
diff --git a/source/gameengine/Ketsji/KX_FontObject.h b/source/gameengine/Ketsji/KX_FontObject.h
index 2466a32dad4..affa882427f 100644
--- a/source/gameengine/Ketsji/KX_FontObject.h
+++ b/source/gameengine/Ketsji/KX_FontObject.h
@@ -69,13 +69,13 @@ protected:
class RAS_IRenderTools* m_rendertools; //needed for drawing routine
-/*
+#if 0 // WHY COMMENTED? - campbell
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_FontObject"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
-*/
+#endif
#ifdef WITH_PYTHON
static PyObject* pyattr_get_text(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 2740a2921d2..5db9958f269 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -170,7 +170,7 @@ KX_GameObject::~KX_GameObject()
}
#ifdef WITH_PYTHON
if (m_attr_dict) {
- PyDict_Clear(m_attr_dict); /* incase of circular refs or other weird cases */
+ PyDict_Clear(m_attr_dict); /* in case of circular refs or other weird cases */
/* Py_CLEAR: Py_DECREF's and NULL's */
Py_CLEAR(m_attr_dict);
}
@@ -540,8 +540,8 @@ void KX_GameObject::ApplyRotation(const MT_Vector3& drot,bool local)
/**
-GetOpenGL Matrix, returns an OpenGL 'compatible' matrix
-*/
+ * GetOpenGL Matrix, returns an OpenGL 'compatible' matrix
+ */
double* KX_GameObject::GetOpenGLMatrix()
{
// todo: optimize and only update if necessary
@@ -1768,7 +1768,7 @@ static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val)
if (val==NULL) { /* del ob["key"] */
int del= 0;
- /* try remove both just incase */
+ /* try remove both just in case */
if(attr_str)
del |= (self->RemoveProperty(attr_str)==true) ? 1:0;
@@ -2901,7 +2901,7 @@ bool KX_GameObject::RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void
}
/* this function is used to pre-filter the object before casting the ray on them.
- This is useful for "X-Ray" option when we want to see "through" unwanted object.
+ * This is useful for "X-Ray" option when we want to see "through" unwanted object.
*/
bool KX_GameObject::NeedRayCast(KX_ClientObjectInfo* client)
{
diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h
index 843fba15725..69e7a7cf5a6 100644
--- a/source/gameengine/Ketsji/KX_GameObject.h
+++ b/source/gameengine/Ketsji/KX_GameObject.h
@@ -155,7 +155,7 @@ public:
);
/**
- * Compute an OpenGl compatable 4x4 matrix. Has the
+ * Compute an OpenGl compatible 4x4 matrix. Has the
* side effect of storing the result internally. The
* memory for the matrix remains the property of this class.
*/
diff --git a/source/gameengine/Ketsji/KX_IPhysicsController.h b/source/gameengine/Ketsji/KX_IPhysicsController.h
index 5fc9f5c2473..68577f09414 100644
--- a/source/gameengine/Ketsji/KX_IPhysicsController.h
+++ b/source/gameengine/Ketsji/KX_IPhysicsController.h
@@ -41,11 +41,11 @@
struct KX_ClientObjectInfo;
/**
- Physics Controller, a special kind of Scene Graph Transformation Controller.
- It get's callbacks from Physics in case a transformation change took place.
- Each time the scene graph get's updated, the controller get's a chance
- in the 'Update' method to reflect changed.
-*/
+ * Physics Controller, a special kind of Scene Graph Transformation Controller.
+ * It get's callbacks from Physics in case a transformation change took place.
+ * Each time the scene graph get's updated, the controller get's a chance
+ * in the 'Update' method to reflect changed.
+ */
class KX_IPhysicsController : public SG_Controller
diff --git a/source/gameengine/Ketsji/KX_ISceneConverter.h b/source/gameengine/Ketsji/KX_ISceneConverter.h
index dce97ea039f..50390005f2b 100644
--- a/source/gameengine/Ketsji/KX_ISceneConverter.h
+++ b/source/gameengine/Ketsji/KX_ISceneConverter.h
@@ -49,11 +49,11 @@ public:
virtual ~KX_ISceneConverter () {};
/*
- scenename: name of the scene to be converted,
- if the scenename is empty, convert the 'default' scene (whatever this means)
- destinationscene: pass an empty scene, everything goes into this
- dictobj: python dictionary (for pythoncontrollers)
- */
+ * scenename: name of the scene to be converted,
+ * if the scenename is empty, convert the 'default' scene (whatever this means)
+ * destinationscene: pass an empty scene, everything goes into this
+ * dictobj: python dictionary (for pythoncontrollers)
+ */
virtual void ConvertScene(
class KX_Scene* destinationscene,
class RAS_IRenderTools* rendertools,
diff --git a/source/gameengine/Ketsji/KX_IpoActuator.h b/source/gameengine/Ketsji/KX_IpoActuator.h
index a8b7a362bd9..58cdfc28742 100644
--- a/source/gameengine/Ketsji/KX_IpoActuator.h
+++ b/source/gameengine/Ketsji/KX_IpoActuator.h
@@ -40,13 +40,13 @@ class KX_IpoActuator : public SCA_IActuator
Py_Header
private:
/** Computes the IPO start time from the current time
- and the current frame. */
+ * and the current frame. */
void SetStartTime(float curtime);
/** Computes the current frame from the current time
- and the IPO start time. */
+ * and the IPO start time. */
void SetLocalTime(float curtime);
/** Ensures the current frame is between the start and
- end frames. */
+ * end frames. */
bool ClampLocalTime();
protected:
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index b754e82046f..facac230e05 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -393,7 +393,7 @@ void KX_KetsjiEngine::RenderDome()
}
/**
- * Ketsji Init(), Initializes datastructures and converts data from
+ * Ketsji Init(), Initializes data-structures and converts data from
* Blender into Ketsji native (realtime) format also sets up the
* graphics context
*/
@@ -599,9 +599,9 @@ else
KX_Scene* scene = *sceneit;
/* Suspension holds the physics and logic processing for an
- * entire scene. Objects can be suspended individually, and
- * the settings for that preceed the logic and physics
- * update. */
+ * entire scene. Objects can be suspended individually, and
+ * the settings for that preceed the logic and physics
+ * update. */
m_logger->StartLog(tc_logic, m_kxsystem->GetTimeInSeconds(), true);
m_sceneconverter->resetNoneDynamicObjectToIpo();//this is for none dynamic objects with ipo
@@ -1340,8 +1340,8 @@ void KX_KetsjiEngine::RenderFonts(KX_Scene* scene)
}
/*
-To run once per scene
-*/
+ * To run once per scene
+ */
void KX_KetsjiEngine::PostRenderScene(KX_Scene* scene)
{
// We need to first make sure our viewport is correct (enabling multiple viewports can mess this up)
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h
index 7a29e2a2731..b37ebd250a5 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.h
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h
@@ -72,12 +72,12 @@ class KX_KetsjiEngine
{
private:
- class RAS_ICanvas* m_canvas; // 2D Canvas (2D Rendering Device Context)
+ class RAS_ICanvas* m_canvas; // 2D Canvas (2D Rendering Device Context)
class RAS_IRasterizer* m_rasterizer; // 3D Rasterizer (3D Rendering)
- class KX_ISystem* m_kxsystem;
+ class KX_ISystem* m_kxsystem;
class RAS_IRenderTools* m_rendertools;
class KX_ISceneConverter* m_sceneconverter;
- class NG_NetworkDeviceInterface* m_networkdevice;
+ class NG_NetworkDeviceInterface* m_networkdevice;
#ifdef WITH_PYTHON
/* borrowed from sys.modules["__main__"], dont manage ref's */
PyObject* m_pythondictionary;
@@ -222,16 +222,16 @@ public:
void SetRasterizer(RAS_IRasterizer* rasterizer);
#ifdef WITH_PYTHON
void SetPyNamespace(PyObject* pythondictionary);
- PyObject* GetPyNamespace(){return m_pythondictionary;};
+ PyObject* GetPyNamespace() { return m_pythondictionary; }
#endif
void SetSceneConverter(KX_ISceneConverter* sceneconverter);
void SetAnimRecordMode(bool animation_record, int startFrame);
- RAS_IRasterizer* GetRasterizer(){return m_rasterizer;};
- RAS_ICanvas* GetCanvas(){return m_canvas;};
- RAS_IRenderTools* GetRenderTools(){return m_rendertools;};
- SCA_IInputDevice* GetKeyboardDevice(){return m_keyboarddevice;};
- SCA_IInputDevice* GetMouseDevice(){return m_mousedevice;};
+ RAS_IRasterizer* GetRasterizer() { return m_rasterizer; }
+ RAS_ICanvas* GetCanvas() { return m_canvas; }
+ RAS_IRenderTools* GetRenderTools() { return m_rendertools; }
+ SCA_IInputDevice* GetKeyboardDevice() { return m_keyboarddevice; }
+ SCA_IInputDevice* GetMouseDevice() { return m_mousedevice; }
/// Dome functions
void InitDome(short res, short mode, short angle, float resbuf, short tilt, struct Text* text);
@@ -265,7 +265,7 @@ public:
void GetSceneViewport(KX_Scene* scene, KX_Camera* cam, RAS_Rect& area, RAS_Rect& viewport);
void SetDrawType(int drawingtype);
- int GetDrawType(){return m_drawingmode;};
+ int GetDrawType() { return m_drawingmode; }
void SetCameraZoom(float camzoom);
diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
index c8a916e85b6..0d81883104b 100644
--- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
+++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
@@ -142,11 +142,11 @@ bool KX_MouseFocusSensor::RayHit(KX_ClientObjectInfo* client_info, KX_RayCast* r
KX_GameObject* hitKXObj = client_info->m_gameobject;
/* Is this me? In the ray test, there are a lot of extra checks
- * for aliasing artefacts from self-hits. That doesn't happen
- * here, so a simple test suffices. Or does the camera also get
- * self-hits? (No, and the raysensor shouldn't do it either, since
- * self-hits are excluded by setting the correct ignore-object.)
- * Hitspots now become valid. */
+ * for aliasing artefacts from self-hits. That doesn't happen
+ * here, so a simple test suffices. Or does the camera also get
+ * self-hits? (No, and the raysensor shouldn't do it either, since
+ * self-hits are excluded by setting the correct ignore-object.)
+ * Hitspots now become valid. */
KX_GameObject* thisObj = (KX_GameObject*) GetParent();
if ((m_focusmode == 2) || hitKXObj == thisObj)
{
diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h
index c8e9dc6b6b7..db9e3697492 100644
--- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h
+++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h
@@ -61,7 +61,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
KX_KetsjiEngine* kxengine,
SCA_IObject* gameobj);
- virtual ~KX_MouseFocusSensor() { ; };
+ virtual ~KX_MouseFocusSensor() { }
virtual CValue* GetReplica() {
CValue* replica = new KX_MouseFocusSensor(*this);
// this will copy properties and so on...
@@ -120,7 +120,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
private:
/**
* The focus mode. 1 for handling focus, 0 for not handling, 2 for focus on any object
- */
+ */
int m_focusmode;
/**
diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.cpp b/source/gameengine/Ketsji/KX_NavMeshObject.cpp
index e6f8d7175dc..79e9c28a81c 100644
--- a/source/gameengine/Ketsji/KX_NavMeshObject.cpp
+++ b/source/gameengine/Ketsji/KX_NavMeshObject.cpp
@@ -620,7 +620,7 @@ void KX_NavMeshObject::DrawPath(const float *path, int pathLen, const MT_Vector3
}
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
//----------------------------------------------------------------------------
//Python
@@ -718,4 +718,4 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_NavMeshObject, rebuild,
Py_RETURN_NONE;
}
-#endif // DISABLE_PYTHON
+#endif // WITH_PYTHON
diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.h b/source/gameengine/Ketsji/KX_NavMeshObject.h
index b9c1fcc66db..db35a011c16 100644
--- a/source/gameengine/Ketsji/KX_NavMeshObject.h
+++ b/source/gameengine/Ketsji/KX_NavMeshObject.h
@@ -65,7 +65,7 @@ public:
MT_Point3 TransformToLocalCoords(const MT_Point3& wpos);
MT_Point3 TransformToWorldCoords(const MT_Point3& lpos);
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
/* --------------------------------------------------------------------- */
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
@@ -74,7 +74,7 @@ public:
KX_PYMETHOD_DOC(KX_NavMeshObject, raycast);
KX_PYMETHOD_DOC(KX_NavMeshObject, draw);
KX_PYMETHOD_DOC_NOARGS(KX_NavMeshObject, rebuild);
-#endif
+#endif // WITH_PYTHON
};
#endif //__KX_NAVMESHOBJECT_H__
diff --git a/source/gameengine/Ketsji/KX_NearSensor.h b/source/gameengine/Ketsji/KX_NearSensor.h
index ffe077b9738..8655d93d406 100644
--- a/source/gameengine/Ketsji/KX_NearSensor.h
+++ b/source/gameengine/Ketsji/KX_NearSensor.h
@@ -55,7 +55,7 @@ public:
bool bFindMaterial,
const STR_String& touchedpropname,
PHY_IPhysicsController* ctrl);
-/*
+#if 0
public:
KX_NearSensor(class SCA_EventManager* eventmgr,
class KX_GameObject* gameobj,
@@ -64,7 +64,7 @@ public:
bool bFindMaterial,
const STR_String& touchedpropname,
class KX_Scene* scene);
-*/
+#endif
virtual ~KX_NearSensor();
virtual void SynchronizeTransform();
virtual CValue* GetReplica();
@@ -76,7 +76,7 @@ public:
virtual bool NewHandleCollision(void* obj1,void* obj2,
const PHY_CollData * coll_data);
virtual bool BroadPhaseFilterCollision(void*obj1,void*obj2);
- virtual bool BroadPhaseSensorFilterCollision(void*obj1,void*obj2) { return false; };
+ virtual bool BroadPhaseSensorFilterCollision(void* obj1,void* obj2) { return false; }
virtual sensortype GetSensorType() { return ST_NEAR; }
#ifdef WITH_PYTHON
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 7c47fc59ac5..82016e2fff3 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -1736,11 +1736,11 @@ static void backupPySysObjects(void)
PyObject *sys_mods= PySys_GetObject("modules"); /* should never fail */
/* paths */
- Py_XDECREF(gp_OrigPythonSysPath); /* just incase its set */
+ Py_XDECREF(gp_OrigPythonSysPath); /* just in case its set */
gp_OrigPythonSysPath = PyList_GetSlice(sys_path, 0, INT_MAX); /* copy the list */
/* modules */
- Py_XDECREF(gp_OrigPythonSysModules); /* just incase its set */
+ Py_XDECREF(gp_OrigPythonSysModules); /* just in case its set */
gp_OrigPythonSysModules = PyDict_Copy(sys_mods); /* copy the list */
}
@@ -2025,7 +2025,7 @@ PyObject* initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas)
PyObject* item;
/* Use existing module where possible
- * be careful not to init any runtime vars after this */
+ * be careful not to init any runtime vars after this */
m = PyImport_ImportModule( "Rasterizer" );
if(m) {
Py_DECREF(m);
@@ -2093,7 +2093,7 @@ static PyObject* gPyEventToString(PyObject*, PyObject* value)
}
}
- PyErr_Clear(); // incase there was an error clearing
+ PyErr_Clear(); // in case there was an error clearing
Py_DECREF(mod);
if (!ret) PyErr_SetString(PyExc_ValueError, "GameKeys.EventToString(int): expected a valid int keyboard event");
else Py_INCREF(ret);
diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
index e367ef83eb8..6a60fc08244 100644
--- a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
@@ -168,9 +168,9 @@ void initPyTypes(void)
{
/*
- initPyObjectPlusType(BL_ActionActuator::Parents);
- .....
-*/
+ * initPyObjectPlusType(BL_ActionActuator::Parents);
+ * .....
+ */
/* For now just do PyType_Ready */
PyObject *mod= PyModule_New("GameTypes");
diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp
index 430dcdbd153..959127def5c 100644
--- a/source/gameengine/Ketsji/KX_PythonSeq.cpp
+++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp
@@ -356,7 +356,7 @@ PyMethodDef KX_PythonSeq_methods[] = {
};
/*
- * Initialize the interator index
+ * Initialize the iterator index
*/
static PyObject *KX_PythonSeq_getIter(KX_PythonSeq *self)
diff --git a/source/gameengine/Ketsji/KX_RadarSensor.h b/source/gameengine/Ketsji/KX_RadarSensor.h
index f647189ab35..903413ca89b 100644
--- a/source/gameengine/Ketsji/KX_RadarSensor.h
+++ b/source/gameengine/Ketsji/KX_RadarSensor.h
@@ -36,8 +36,8 @@
#include "MT_Point3.h"
/**
-* Radar 'cone' sensor. Very similar to a near-sensor, but instead of a sphere, a cone is used.
-*/
+ * Radar 'cone' sensor. Very similar to a near-sensor, but instead of a sphere, a cone is used.
+ */
class KX_RadarSensor : public KX_NearSensor
{
protected:
diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp
index 0cc0e7318c1..58ca847b617 100644
--- a/source/gameengine/Ketsji/KX_RaySensor.cpp
+++ b/source/gameengine/Ketsji/KX_RaySensor.cpp
@@ -151,7 +151,7 @@ bool KX_RaySensor::RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void
}
/* this function is used to pre-filter the object before casting the ray on them.
- This is useful for "X-Ray" option when we want to see "through" unwanted object.
+ * This is useful for "X-Ray" option when we want to see "through" unwanted object.
*/
bool KX_RaySensor::NeedRayCast(KX_ClientObjectInfo* client)
{
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 56127c7b634..74a0abe526d 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1048,7 +1048,7 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj)
// in case this is a font
m_fonts.remove((KX_FontObject*)newobj);
- /* currently does nothing, keep incase we need to Unregister something */
+ /* currently does nothing, keep in case we need to Unregister something */
#if 0
if (m_sceneConverter)
m_sceneConverter->UnregisterGameObject(newobj);
@@ -1574,8 +1574,8 @@ void KX_Scene::LogicEndFrame()
/**
- * UpdateParents: SceneGraph transformation update.
- */
+ * UpdateParents: SceneGraph transformation update.
+ */
void KX_Scene::UpdateParents(double curtime)
{
// we use the SG dynamic list
diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h
index 1fa981e18f9..7e3378bd13f 100644
--- a/source/gameengine/Ketsji/KX_Scene.h
+++ b/source/gameengine/Ketsji/KX_Scene.h
@@ -160,8 +160,8 @@ protected:
// Used to deregister objects that are deleted
class KX_BlenderSceneConverter* m_sceneConverter;
/**
- * physics engine abstraction
- */
+ * physics engine abstraction
+ */
//e_PhysicsEngine m_physicsEngine; //who needs this ?
class PHY_IPhysicsEnvironment* m_physicsEnvironment;
@@ -176,7 +176,7 @@ protected:
STR_String m_sceneName;
/**
- * stores the worldsettings for a scene
+ * stores the world-settings for a scene
*/
KX_WorldInfo* m_worldinfo;
@@ -558,10 +558,10 @@ public:
bool IsClearingZBuffer();
void EnableZBufferClearing(bool isclearingZbuffer);
// use of DBVT tree for camera culling
- void SetDbvtCulling(bool b) { m_dbvt_culling = b; };
- bool GetDbvtCulling() { return m_dbvt_culling; };
- void SetDbvtOcclusionRes(int i) { m_dbvt_occlusion_res = i; };
- int GetDbvtOcclusionRes() { return m_dbvt_occlusion_res; };
+ void SetDbvtCulling(bool b) { m_dbvt_culling = b; }
+ bool GetDbvtCulling() { return m_dbvt_culling; }
+ void SetDbvtOcclusionRes(int i) { m_dbvt_occlusion_res = i; }
+ int GetDbvtOcclusionRes() { return m_dbvt_occlusion_res; }
void SetSceneConverter(class KX_BlenderSceneConverter* sceneConverter);
@@ -582,12 +582,12 @@ public:
void SetNodeTree(SG_Tree* root);
/**
- * 2D Filters
- */
+ * 2D Filters
+ */
void Update2DFilter(std::vector<STR_String>& propNames, void* gameObj, RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text);
void Render2DFilters(RAS_ICanvas* canvas);
- KX_ObstacleSimulation* GetObstacleSimulation() {return m_obstacleSimulation;};
+ KX_ObstacleSimulation* GetObstacleSimulation() { return m_obstacleSimulation; }
#ifdef WITH_PYTHON
/* --------------------------------------------------------------------- */
@@ -628,8 +628,8 @@ public:
*/
void RunDrawingCallbacks(PyObject* cb_list);
- PyObject* GetPreDrawCB() { return m_draw_call_pre; };
- PyObject* GetPostDrawCB() { return m_draw_call_post; };
+ PyObject* GetPreDrawCB() { return m_draw_call_pre; }
+ PyObject* GetPostDrawCB() { return m_draw_call_post; }
#endif
/**
diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
index f9af9fc3b8e..c4688af687b 100644
--- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
@@ -502,7 +502,7 @@ void KX_SteeringActuator::HandleActorFace(MT_Vector3& velocity)
}
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
/* ------------------------------------------------------------------------- */
/* Python functions */
@@ -620,7 +620,7 @@ PyObject* KX_SteeringActuator::pyattr_get_steeringVec(void *self, const struct K
return PyObjectFrom(steeringVec);
}
-#endif // DISABLE_PYTHON
+#endif // WITH_PYTHON
/* eof */
diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.h b/source/gameengine/Ketsji/KX_SteeringActuator.h
index f0c3e73ddec..cd55f574e8e 100644
--- a/source/gameengine/Ketsji/KX_SteeringActuator.h
+++ b/source/gameengine/Ketsji/KX_SteeringActuator.h
@@ -99,7 +99,7 @@ public:
virtual bool UnlinkObject(SCA_IObject* clientobj);
const MT_Vector3& GetSteeringVec();
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
/* --------------------------------------------------------------------- */
/* Python interface ---------------------------------------------------- */
@@ -113,7 +113,7 @@ public:
static PyObject* pyattr_get_steeringVec(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
-#endif // DISABLE_PYTHON
+#endif // WITH_PYTHON
}; /* end of class KX_SteeringActuator : public SCA_PropertyActuator */
diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h
index df96b75084a..1a22067f9ac 100644
--- a/source/gameengine/Ketsji/KX_TouchSensor.h
+++ b/source/gameengine/Ketsji/KX_TouchSensor.h
@@ -68,7 +68,7 @@ protected:
// Use with m_bTouchPulse to detect changes
int m_bLastCount; /* size of m_colliders last tick */
- uint_ptr m_bColliderHash; /* hash collision objects pointers to trigger incase one object collides and another takes its place */
+ uint_ptr m_bColliderHash; /* hash collision objects pointers to trigger in case one object collides and another takes its place */
uint_ptr m_bLastColliderHash;
SCA_IObject* m_hitObject;
diff --git a/source/gameengine/Network/NG_NetworkMessage.h b/source/gameengine/Network/NG_NetworkMessage.h
index a0c61784e9f..7a55891552f 100644
--- a/source/gameengine/Network/NG_NetworkMessage.h
+++ b/source/gameengine/Network/NG_NetworkMessage.h
@@ -84,17 +84,17 @@ public:
/**
* get the (read-only) To part of this message
*/
- const STR_String& GetDestinationName() { return m_to;};
+ const STR_String& GetDestinationName() { return m_to; }
/**
* get the (read-only) From part of this message
*/
- const STR_String& GetSenderName() { return m_from;};
+ const STR_String& GetSenderName() { return m_from; }
/**
* get the (read-only) Subject part of this message
*/
- const STR_String& GetSubject() { return m_subject;};
+ const STR_String& GetSubject() { return m_subject; }
/**
* get the (read-only) Body part of this message
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
index dba76c8d5fa..552cca801de 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
@@ -132,7 +132,7 @@ protected:
}
//returns 0.f if no fixed timestep is used
- virtual float getFixedTimeStep(){ return 0.f;};
+ virtual float getFixedTimeStep() { return 0.f; }
virtual void setDebugMode(int debugMode);
diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
index 30344ce3a10..903ea14c5d2 100644
--- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
@@ -356,11 +356,11 @@ void RAS_2DFilterManager::UpdateOffsetMatrix(RAS_ICanvas* canvas)
void RAS_2DFilterManager::UpdateCanvasTextureCoord(unsigned int * viewport)
{
/*
- This function update canvascoord[].
- These parameters are used to create texcoord[1]
- That way we can access the texcoord relative to the canvas:
- (0.0,0.0) bottom left, (1.0,1.0) top right, (0.5,0.5) center
- */
+ * This function update canvascoord[].
+ * These parameters are used to create texcoord[1]
+ * That way we can access the texcoord relative to the canvas:
+ * (0.0,0.0) bottom left, (1.0,1.0) top right, (0.5,0.5) center
+ */
canvascoord[0] = (GLfloat) viewport[0] / viewport[2];
canvascoord[0] *= -1;
canvascoord[1] = (GLfloat) (texturewidth - viewport[0]) / viewport[2];
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.h b/source/gameengine/Rasterizer/RAS_BucketManager.h
index 032d9b03299..dade2ad7c11 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.h
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.h
@@ -65,8 +65,8 @@ public:
/* for merging */
void MergeBucketManager(RAS_BucketManager *other, SCA_IScene *scene);
- BucketList & GetSolidBuckets() {return m_SolidBuckets;};
- BucketList & GetAlphaBuckets() {return m_AlphaBuckets;};
+ BucketList & GetSolidBuckets() {return m_SolidBuckets;}
+ BucketList & GetAlphaBuckets() {return m_AlphaBuckets;}
/*void PrintStats(int verbose_level) {
printf("\nMappings...\n");
diff --git a/source/gameengine/Rasterizer/RAS_ICanvas.h b/source/gameengine/Rasterizer/RAS_ICanvas.h
index b7c26928378..337ea247ce3 100644
--- a/source/gameengine/Rasterizer/RAS_ICanvas.h
+++ b/source/gameengine/Rasterizer/RAS_ICanvas.h
@@ -170,7 +170,7 @@ public:
) = 0;
/**
- * Set the visible vieport
+ * Set the visible view-port
*/
virtual
diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
index 3257682649f..527114b300f 100644
--- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
+++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
@@ -130,7 +130,7 @@ public:
bool image,
struct GameSettings* game);
- virtual ~RAS_IPolyMaterial() {};
+ virtual ~RAS_IPolyMaterial() {}
/**
* Returns the caching information for this material,
diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h
index 34ddafbf2cc..592ddbe07d3 100644
--- a/source/gameengine/Rasterizer/RAS_IRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h
@@ -162,7 +162,7 @@ public:
*/
virtual bool SetMaterial(const RAS_IPolyMaterial& mat)=0;
/**
- * Init initialises the renderer.
+ * Init initializes the renderer.
*/
virtual bool Init()=0;
/**
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
index e5ca40c1354..4e4d70fac31 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
@@ -158,11 +158,11 @@ void RAS_ListRasterizer::RemoveListSlot(RAS_ListSlot* list)
RAS_ListSlot* RAS_ListRasterizer::FindOrAdd(RAS_MeshSlot& ms)
{
/*
- Keep a copy of constant lists submitted for rendering,
- this guards against (replicated)new...delete every frame,
- and we can reuse lists!
- :: sorted by mesh slot
- */
+ * Keep a copy of constant lists submitted for rendering,
+ * this guards against (replicated)new...delete every frame,
+ * and we can reuse lists!
+ * :: sorted by mesh slot
+ */
RAS_ListSlot* localSlot = (RAS_ListSlot*)ms.m_DisplayList;
if(!localSlot) {
if (ms.m_pDerivedMesh) {
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
index f5787dad41e..7e9e3d9156c 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
@@ -828,7 +828,7 @@ static int CheckTexfaceDM(void *mcol, int index)
}
*/
-static int CheckTexDM(MTFace *tface, int has_mcol, int matnr)
+static DMDrawOption CheckTexDM(MTFace *tface, int has_mcol, int matnr)
{
// index is the original face index, retrieve the polygon
@@ -836,23 +836,23 @@ static int CheckTexDM(MTFace *tface, int has_mcol, int matnr)
(tface == NULL || tface->tpage == current_image)) {
// must handle color.
if (current_wireframe)
- return 2;
+ return DM_DRAW_OPTION_NO_MCOL;
if (current_ms->m_bObjectColor) {
MT_Vector4& rgba = current_ms->m_RGBAcolor;
glColor4d(rgba[0], rgba[1], rgba[2], rgba[3]);
// don't use mcol
- return 2;
+ return DM_DRAW_OPTION_NO_MCOL;
}
if (!has_mcol) {
// we have to set the color from the material
unsigned char rgba[4];
current_polymat->GetMaterialRGBAColor(rgba);
glColor4ubv((const GLubyte *)rgba);
- return 2;
+ return DM_DRAW_OPTION_NO_MCOL;
}
- return 1;
+ return DM_DRAW_OPTION_NORMAL;
}
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
void RAS_OpenGLRasterizer::IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi)
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
index e10d006994f..3b4a6c4900c 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
@@ -298,8 +298,8 @@ public:
virtual void EnableMotionBlur(float motionblurvalue);
virtual void DisableMotionBlur();
- virtual float GetMotionBlurValue(){return m_motionblurvalue;};
- virtual int GetMotionBlurState(){return m_motionblur;};
+ virtual float GetMotionBlurValue() { return m_motionblurvalue; }
+ virtual int GetMotionBlurState() { return m_motionblur; }
virtual void SetMotionBlurState(int newstate)
{
if(newstate<0)
diff --git a/source/gameengine/Rasterizer/RAS_Polygon.cpp b/source/gameengine/Rasterizer/RAS_Polygon.cpp
index 2f9c7c607ad..ebf34c3f58c 100644
--- a/source/gameengine/Rasterizer/RAS_Polygon.cpp
+++ b/source/gameengine/Rasterizer/RAS_Polygon.cpp
@@ -72,7 +72,7 @@ int RAS_Polygon::GetVertexOffsetAbs(RAS_MeshObject *mesh, int i)
{
/* hack that only works because there can only ever be 2 different
* GetDisplayArray's per mesh. if this uses a different display array to the first
- * then its incices are offset.
+ * then its indices are offset.
* if support for edges is added back this would need to be changed. */
RAS_DisplayArray* darray= mesh->GetPolygon(0)->GetDisplayArray();
diff --git a/source/gameengine/SceneGraph/SG_IObject.h b/source/gameengine/SceneGraph/SG_IObject.h
index df14631d0d9..a1d4207e508 100644
--- a/source/gameengine/SceneGraph/SG_IObject.h
+++ b/source/gameengine/SceneGraph/SG_IObject.h
@@ -105,10 +105,10 @@ typedef bool (*SG_RescheduleUpdateCallback)(
/**
* SG_Callbacks hold 2 call backs to the outside world.
* The first is meant to be called when objects are replicated.
- * And allows the outside world to syncronise external objects
+ * And allows the outside world to synchronize external objects
* with replicated nodes and their children.
- * The second is called when a node is detroyed and again
- * is their for synconisation purposes
+ * The second is called when a node is destroyed and again
+ * is their for synchronization purposes
* These callbacks may both be NULL.
* The efficacy of this approach has not been proved some
* alternatives might be to perform all replication and destruction
@@ -226,9 +226,9 @@ public:
/**
* Get the client object associated with this
* node. This interface allows you to associate
- * arbitray external objects with this node. They are
+ * arbitrary external objects with this node. They are
* passed to the callback functions when they are
- * activated so you can syncronise these external objects
+ * activated so you can synchronize these external objects
* upon replication and destruction
* This may be NULL.
*/
@@ -246,7 +246,7 @@ public:
/**
* Set the client object for this node. This is just a
* pointer to an object allocated that should exist for
- * the duration of the lifetime of this object, or untill
+ * the duration of the lifetime of this object, or until
* this function is called again.
*/
diff --git a/source/gameengine/SceneGraph/SG_Tree.h b/source/gameengine/SceneGraph/SG_Tree.h
index dcca1a1442f..b2cbb227f77 100644
--- a/source/gameengine/SceneGraph/SG_Tree.h
+++ b/source/gameengine/SceneGraph/SG_Tree.h
@@ -126,7 +126,7 @@ public:
* SG_TreeFactory generates an SG_Tree from a list of SG_Nodes.
* It joins pairs of SG_Nodes to minimise the size of the resultant
* bounding box.
- * cf building an optimised Huffman tree.
+ * cf building an optimized Huffman tree.
* \warning O(n^3)!!!
*/
class SG_TreeFactory
diff --git a/source/gameengine/VideoTexture/BlendType.h b/source/gameengine/VideoTexture/BlendType.h
index fad23af922e..0131cc61c44 100644
--- a/source/gameengine/VideoTexture/BlendType.h
+++ b/source/gameengine/VideoTexture/BlendType.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined BLENDTYPE_H
-#define BLENDTYPE_H
+#ifndef __BLENDTYPE_H__
+#define __BLENDTYPE_H__
/// class allows check type of blender python object and access its contained object
diff --git a/source/gameengine/VideoTexture/Common.h b/source/gameengine/VideoTexture/Common.h
index fe9632b02bb..e6e0ffa1ebc 100644
--- a/source/gameengine/VideoTexture/Common.h
+++ b/source/gameengine/VideoTexture/Common.h
@@ -28,31 +28,31 @@ http://www.gnu.org/copyleft/lesser.txt.
#define WINDOWS_LEAN_AND_MEAN
#endif
-#if !defined NULL
+#ifndef NULL
#define NULL 0
#endif
-#if !defined HRESULT
+#ifndef HRESULT
#define HRESULT long
#endif
-#if !defined DWORD
+#ifndef DWORD
#define DWORD unsigned long
#endif
-#if !defined S_OK
+#ifndef S_OK
#define S_OK ((HRESULT)0L)
#endif
-#if !defined BYTE
+#ifndef BYTE
#define BYTE unsigned char
#endif
-#if !defined WIN32
+#ifndef WIN32
#define Sleep(time) sleep(time)
#endif
-#if !defined FAILED
+#ifndef FAILED
#define FAILED(Status) ((HRESULT)(Status)<0)
#endif
diff --git a/source/gameengine/VideoTexture/Exception.h b/source/gameengine/VideoTexture/Exception.h
index af226fab75d..bc08742de8d 100644
--- a/source/gameengine/VideoTexture/Exception.h
+++ b/source/gameengine/VideoTexture/Exception.h
@@ -25,8 +25,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined EXCEPTION_H
-#define EXCEPTION_H
+#ifndef __EXCEPTION_H__
+#define __EXCEPTION_H__
#include <exception>
#include <vector>
diff --git a/source/gameengine/VideoTexture/FilterBase.h b/source/gameengine/VideoTexture/FilterBase.h
index bdb3106d58d..cd25a7ea313 100644
--- a/source/gameengine/VideoTexture/FilterBase.h
+++ b/source/gameengine/VideoTexture/FilterBase.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined FILTERBASE_H
-#define FILTERBASE_H
+#ifndef __FILTERBASE_H__
+#define __FILTERBASE_H__
#include "Common.h"
diff --git a/source/gameengine/VideoTexture/FilterBlueScreen.h b/source/gameengine/VideoTexture/FilterBlueScreen.h
index 381941fdcca..28ab16d966e 100644
--- a/source/gameengine/VideoTexture/FilterBlueScreen.h
+++ b/source/gameengine/VideoTexture/FilterBlueScreen.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined FILTERBLUESCREEN_H
-#define FILTERBLUESCREEN_H
+#ifndef __FILTERBLUESCREEN_H__
+#define __FILTERBLUESCREEN_H__
#include "Common.h"
diff --git a/source/gameengine/VideoTexture/FilterColor.h b/source/gameengine/VideoTexture/FilterColor.h
index aeca4d326b4..9b1976cf40f 100644
--- a/source/gameengine/VideoTexture/FilterColor.h
+++ b/source/gameengine/VideoTexture/FilterColor.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined FILTERCOLOR_H
-#define FILTERCOLOR_H
+#ifndef __FILTERCOLOR_H__
+#define __FILTERCOLOR_H__
#include "Common.h"
diff --git a/source/gameengine/VideoTexture/FilterNormal.h b/source/gameengine/VideoTexture/FilterNormal.h
index 0b4574d4d1f..19664e8b5f2 100644
--- a/source/gameengine/VideoTexture/FilterNormal.h
+++ b/source/gameengine/VideoTexture/FilterNormal.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined FILTERNORMAL_H
-#define FILTERNORMAL_H
+#ifndef __FILTERNORMAL_H__
+#define __FILTERNORMAL_H__
#include "Common.h"
diff --git a/source/gameengine/VideoTexture/FilterSource.h b/source/gameengine/VideoTexture/FilterSource.h
index 5b73fcda947..a4900e8c148 100644
--- a/source/gameengine/VideoTexture/FilterSource.h
+++ b/source/gameengine/VideoTexture/FilterSource.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined FILTERSOURCE_H
-#define FILTERSOURCE_H
+#ifndef __FILTERSOURCE_H__
+#define __FILTERSOURCE_H__
#include "Common.h"
diff --git a/source/gameengine/VideoTexture/ImageBase.h b/source/gameengine/VideoTexture/ImageBase.h
index cb2187f00ef..91c7dce9637 100644
--- a/source/gameengine/VideoTexture/ImageBase.h
+++ b/source/gameengine/VideoTexture/ImageBase.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined IMAGEBASE_H
-#define IMAGEBASE_H
+#ifndef __IMAGEBASE_H__
+#define __IMAGEBASE_H__
#include "Common.h"
diff --git a/source/gameengine/VideoTexture/ImageBuff.cpp b/source/gameengine/VideoTexture/ImageBuff.cpp
index 899a9f9782e..d28babfcc90 100644
--- a/source/gameengine/VideoTexture/ImageBuff.cpp
+++ b/source/gameengine/VideoTexture/ImageBuff.cpp
@@ -324,7 +324,7 @@ static PyObject * plot (PyImage * self, PyObject * args)
if (PyArg_ParseTuple(args, "s*hhhh|h:plot", &buffer, &width, &height, &x, &y, &mode))
{
// correct decoding, verify that buffer size is correct
- // we need a continous memory buffer
+ // we need a continuous memory buffer
if (testPyBuffer(&buffer, width, height, 4))
{
getImageBuff(self)->plot((unsigned char*)buffer.buf, width, height, x, y, mode);
diff --git a/source/gameengine/VideoTexture/ImageBuff.h b/source/gameengine/VideoTexture/ImageBuff.h
index 1fd2d3f9ee6..b3e7386c899 100644
--- a/source/gameengine/VideoTexture/ImageBuff.h
+++ b/source/gameengine/VideoTexture/ImageBuff.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined IMAGEBUFF_H
-#define IMAGEBUFF_H
+#ifndef __IMAGEBUFF_H__
+#define __IMAGEBUFF_H__
#include "Common.h"
diff --git a/source/gameengine/VideoTexture/ImageMix.h b/source/gameengine/VideoTexture/ImageMix.h
index d99f27576c1..2746635c611 100644
--- a/source/gameengine/VideoTexture/ImageMix.h
+++ b/source/gameengine/VideoTexture/ImageMix.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined IMAGEMIX_H
-#define IMAGEMIX_H
+#ifndef __IMAGEMIX_H__
+#define __IMAGEMIX_H__
#include "Common.h"
diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp
index ef371d05f86..3bdf293b15a 100644
--- a/source/gameengine/VideoTexture/ImageRender.cpp
+++ b/source/gameengine/VideoTexture/ImageRender.cpp
@@ -459,7 +459,7 @@ static int ImageMirror_init (PyObject * pySelf, PyObject * args, PyObject * kwds
else
THRWEXCP(SceneInvalid, S_OK);
- if(scenePtr==NULL) /* incase the python proxy reference is invalid */
+ if(scenePtr==NULL) /* in case the python proxy reference is invalid */
THRWEXCP(SceneInvalid, S_OK);
// get observer pointer
@@ -471,7 +471,7 @@ static int ImageMirror_init (PyObject * pySelf, PyObject * args, PyObject * kwds
else
THRWEXCP(ObserverInvalid, S_OK);
- if(observerPtr==NULL) /* incase the python proxy reference is invalid */
+ if(observerPtr==NULL) /* in case the python proxy reference is invalid */
THRWEXCP(ObserverInvalid, S_OK);
// get mirror pointer
@@ -481,7 +481,7 @@ static int ImageMirror_init (PyObject * pySelf, PyObject * args, PyObject * kwds
else
THRWEXCP(MirrorInvalid, S_OK);
- if(mirrorPtr==NULL) /* incase the python proxy reference is invalid */
+ if(mirrorPtr==NULL) /* in case the python proxy reference is invalid */
THRWEXCP(MirrorInvalid, S_OK);
// locate the material in the mirror
diff --git a/source/gameengine/VideoTexture/ImageRender.h b/source/gameengine/VideoTexture/ImageRender.h
index 61f441465c3..0062175e0af 100644
--- a/source/gameengine/VideoTexture/ImageRender.h
+++ b/source/gameengine/VideoTexture/ImageRender.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined IMAGERENDER_H
-#define IMAGERENDER_H
+#ifndef __IMAGERENDER_H__
+#define __IMAGERENDER_H__
#include "Common.h"
diff --git a/source/gameengine/VideoTexture/ImageViewport.cpp b/source/gameengine/VideoTexture/ImageViewport.cpp
index 729b9ab9777..12f1fa0e20c 100644
--- a/source/gameengine/VideoTexture/ImageViewport.cpp
+++ b/source/gameengine/VideoTexture/ImageViewport.cpp
@@ -57,7 +57,7 @@ ImageViewport::ImageViewport (void) : m_alpha(false), m_texInit(false)
// destructor
ImageViewport::~ImageViewport (void)
-{ delete m_viewportImage; }
+{ delete [] m_viewportImage; }
// use whole viewport to capture image
diff --git a/source/gameengine/VideoTexture/ImageViewport.h b/source/gameengine/VideoTexture/ImageViewport.h
index 4195847c9d0..ccc58a41605 100644
--- a/source/gameengine/VideoTexture/ImageViewport.h
+++ b/source/gameengine/VideoTexture/ImageViewport.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined IMAGEVIEWPORT_H
-#define IMAGEVIEWPORT_H
+#ifndef __IMAGEVIEWPORT_H__
+#define __IMAGEVIEWPORT_H__
#include "Common.h"
diff --git a/source/gameengine/VideoTexture/PyTypeList.h b/source/gameengine/VideoTexture/PyTypeList.h
index 3f1523294aa..e0f7480438d 100644
--- a/source/gameengine/VideoTexture/PyTypeList.h
+++ b/source/gameengine/VideoTexture/PyTypeList.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined PYTYPELIST_H
-#define PYTYPELIST_H
+#ifndef __PYTYPELIST_H__
+#define __PYTYPELIST_H__
#include "Common.h"
diff --git a/source/gameengine/VideoTexture/Texture.h b/source/gameengine/VideoTexture/Texture.h
index 32801a2c38e..d6e2ba0174f 100644
--- a/source/gameengine/VideoTexture/Texture.h
+++ b/source/gameengine/VideoTexture/Texture.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined TEXTURE_H
-#define TEXTURE_H
+#ifndef __TEXTURE_H__
+#define __TEXTURE_H__
#include <PyObjectPlus.h>
#include <structmember.h>
diff --git a/source/gameengine/VideoTexture/VideoBase.h b/source/gameengine/VideoTexture/VideoBase.h
index a1eae96be57..7ad3c6a9c77 100644
--- a/source/gameengine/VideoTexture/VideoBase.h
+++ b/source/gameengine/VideoTexture/VideoBase.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined VIDEOBASE_H
-#define VIDEOBASE_H
+#ifndef __VIDEOBASE_H__
+#define __VIDEOBASE_H__
#include <PyObjectPlus.h>
diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
index aa8496431d9..9db85a0029a 100644
--- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp
+++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
@@ -294,7 +294,7 @@ int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AV
/*
* This thread is used to load video frame asynchronously.
* It provides a frame caching service.
- * The main thread is responsible for positionning the frame pointer in the
+ * The main thread is responsible for positioning the frame pointer in the
* file correctly before calling startCache() which starts this thread.
* The cache is organized in two layers: 1) a cache of 20-30 undecoded packets to keep
* memory and CPU low 2) a cache of 5 decoded frames.
diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.h b/source/gameengine/VideoTexture/VideoFFmpeg.h
index 2be86b6c535..1c07bc957f3 100644
--- a/source/gameengine/VideoTexture/VideoFFmpeg.h
+++ b/source/gameengine/VideoTexture/VideoFFmpeg.h
@@ -24,8 +24,8 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#if !defined VIDEOFFMPEG_H
-#define VIDEOFFMPEG_H
+#ifndef __VIDEOFFMPEG_H__
+#define __VIDEOFFMPEG_H__
#ifdef WITH_FFMPEG
extern "C" {
diff --git a/source/tests/bl_load_addons.py b/source/tests/bl_load_addons.py
index 5bd83abbcb6..21a0101d684 100644
--- a/source/tests/bl_load_addons.py
+++ b/source/tests/bl_load_addons.py
@@ -57,7 +57,7 @@ def reload_addons(do_reload=True, do_reverse=True):
imp.reload(sys.modules[mod_name])
if do_reverse:
- # incase order matters when it shouldnt
+ # in case order matters when it shouldnt
modules.reverse()
diff --git a/source/tests/bl_run_operators.py b/source/tests/bl_run_operators.py
index 08e9d5d59e4..53cc37bc02b 100644
--- a/source/tests/bl_run_operators.py
+++ b/source/tests/bl_run_operators.py
@@ -42,6 +42,9 @@ op_blacklist = (
"wm.doc_view",
"wm.path_open",
"help.operator_cheat_sheet",
+ "wm.keyconfig_test", # just annoying - but harmless
+ "wm.memory_statistics", # another annoying one
+ # "mesh.vertex_color_remove", #crashes! fixme
)
@@ -64,7 +67,7 @@ def run_ops(operators, setup_func=None):
for op_id, op in operators:
if op.poll():
print(" operator:", op_id)
- sys.stdout.flush() # incase of crash
+ sys.stdout.flush() # in case of crash
# disable will get blender in a bad state and crash easy!
bpy.ops.wm.read_factory_settings()